ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilStudyProgrammeDashboardViewGUI Class Reference
+ Inheritance diagram for ilStudyProgrammeDashboardViewGUI:
+ Collaboration diagram for ilStudyProgrammeDashboardViewGUI:

Public Member Functions

 initViewSettings ()
 
 emptyHandling ()
 
 initData ()
 
 getBlockType ()
 
- Public Member Functions inherited from ilDashboardBlockGUI
 __construct ()
 
 initViewSettings ()
 
 initData ()
 
 emptyHandling ()
 
 addCustomCommandsToActionMenu (ilObjectListGUI $itemListGui, int $ref_id)
 
 getNoItemFoundContent ()
 
 getViewSettings ()
 
 init ()
 
 getHTML ()
 
 setData (array $a_data)
 
 getData ()
 
 addCommandActions ()
 
 getRemoveModal ()
 
 executeCommand ()
 
 manually ()
 
 getViewControlsForPanel ()
 
 viewDashboardObject ()
 
 changePDItemSortingObject ()
 
 changePDItemPresentationObject ()
 
 getItemGroups ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 removeMultipleEnabled ()
 
 confirmedRemove (array $ids)
 
 byType (string $a_type)
 
- Public Member Functions inherited from ilBlockGUI
 __construct ()
 
 getBlockType ()
 
 setData (array $a_data)
 
 getData ()
 
 setPresentation (int $type)
 
 getPresentation ()
 
 setBlockId (string $a_block_id="0")
 
 getBlockId ()
 
 setGuiObject (object $a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setOffset (int $a_offset)
 
 getOffset ()
 
 checkOffset (int $offset)
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setEnableEdit (bool $a_enableedit)
 
 getEnableEdit ()
 
 setRepositoryMode (bool $a_repositorymode)
 
 getRepositoryMode ()
 
 setSubtitle (string $a_subtitle)
 
 getSubtitle ()
 
 setRefId (int $a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 
 setAdminCommands (bool $a_admincommands)
 
 getAdminCommands ()
 
 setEnableNumInfo (bool $a_enablenuminfo)
 
 getEnableNumInfo ()
 
 setProperties (array $a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty (string $a_property)
 
 setProperty (string $a_property, string $a_value)
 
 setRowTemplate (string $a_rowtemplatename, string $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 
 getRowTemplateDir ()
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="", ?RoundTrip $modal=null)
 
 getBlockCommands ()
 
 getHTML ()
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getViewControlsForPanel ()
 
 sortObject ()
 
 addSortOption (string $option, string $label, bool $active)
 
 setSortTarget (string $target)
 
 addPresentation (string $label, string $target, bool $active)
 
 getNoItemFoundContent ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Protected Member Functions

 isReadable (ilObjStudyProgramme $prg)
 
 getVisibleOnPDMode ()
 
 maybeGetCertificateLink (int $usr_id, int $prg_obj_id, int $prg_ref_id)
 
- Protected Member Functions inherited from ilDashboardBlockGUI
 getCardForData (BlockDTO $data)
 
 getListItemGroups ()
 Get items. More...
 
 getListItemForDataDTO (BlockDTO $data)
 
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 initAndShow ()
 
 isRootNode (int $refId)
 
 getRepositoryTitle ()
 
 getManageFields ()
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 specialCharsAsEntities (string $string)
 
 initCommands ()
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getActionsForPanel ()
 
 send (string $output)
 Send. More...
 

Protected Attributes

string $visible_on_pd_mode = null
 
- Protected Attributes inherited from ilDashboardBlockGUI
string $content
 
readonly ilRbacSystem $rbacsystem
 
string $parent
 
readonly ilFavouritesManager $favourites_manager
 
int $requested_item_ref_id
 
mixed $object_cache
 
readonly ilTree $tree
 
readonly mixed $obj_definition
 
readonly ilSetting $settings
 
readonly ilLogger $logging
 
readonly Services $http
 
readonly Factory $refinery
 
ilPDSelectedItemsBlockViewSettings $view_settings
 
array $data
 
- Protected Attributes inherited from ilBlockGUI
ILIAS UI Renderer $renderer
 
Factory $factory
 
object $gui_object
 
ILIAS Container Block StandardGUIRequest $request
 
ILIAS Container Block BlockManager $block_manager
 
bool $repositorymode = false
 
ILIAS DI UIServices $ui
 
array $data = array()
 
bool $enablenuminfo = true
 
array $footer_links = array()
 
string $block_id = "0"
 
bool $allow_moving = true
 
array $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
array $block_commands = array()
 
int $max_count = 0
 
bool $close_command = false
 
bool $image = false
 
array $property = []
 
string $nav_value = ""
 
string $css_row = ""
 
string $title = ""
 
bool $admincommands = false
 
array $dropdown
 
ilTemplate $tpl
 
ilGlobalTemplateInterface $main_tpl
 
ilObjUser $user
 
ilCtrl $ctrl
 
ilAccessHandler $access
 
ilLanguage $lng
 
ilObjectDefinition $obj_def
 
int $presentation
 
int $requested_ref_id
 

Additional Inherited Members

- Static Public Member Functions inherited from ilBlockGUI
static getScreenMode ()
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 
const PRES_MAIN_TILE = 4
 

Detailed Description

Definition at line 25 of file class.ilStudyProgrammeDashboardViewGUI.php.

Member Function Documentation

◆ emptyHandling()

ilStudyProgrammeDashboardViewGUI::emptyHandling ( )

Reimplemented from ilDashboardBlockGUI.

Definition at line 39 of file class.ilStudyProgrammeDashboardViewGUI.php.

39 : string
40 {
41 return '';
42 }

◆ getBlockType()

ilStudyProgrammeDashboardViewGUI::getBlockType ( )

Reimplemented from ilBlockGUI.

Definition at line 115 of file class.ilStudyProgrammeDashboardViewGUI.php.

115 : string
116 {
117 return 'dash_sp';
118 }

◆ getVisibleOnPDMode()

ilStudyProgrammeDashboardViewGUI::getVisibleOnPDMode ( )
protected

Definition at line 103 of file class.ilStudyProgrammeDashboardViewGUI.php.

References $visible_on_pd_mode, ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD, ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_READ, and ILIAS\Repository\settings().

Referenced by isReadable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initData()

ilStudyProgrammeDashboardViewGUI::initData ( )

Reimplemented from ilDashboardBlockGUI.

Definition at line 44 of file class.ilStudyProgrammeDashboardViewGUI.php.

44 : void
45 {
46 $user_table = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserTable'];
47 $user_table->disablePermissionCheck(true);
48 $rows = $user_table->fetchSingleUserRootAssignments($this->user->getId());
49
50 $items = [];
51 foreach ($rows as $row) {
52 $prg = ilObjStudyProgramme::getInstanceByObjId($row->getNodeId());
53 if (!$this->isReadable($prg) || !$prg->isActive()) {
54 continue;
55 }
56
57 $properties = [
58 $this->lng->txt('prg_dash_label_minimum') => $row->getPointsRequired(),
59 $this->lng->txt('prg_dash_label_gain') => $row->getPointsCurrent(),
60 $this->lng->txt('prg_dash_label_status') => $row->getStatus(),
61 ];
62
63 if ($row->getStatusRaw() === ilPRGProgress::STATUS_ACCREDITED ||
64 $row->getStatusRaw() === ilPRGProgress::STATUS_COMPLETED
65 ) {
66 $properties[$this->lng->txt('prg_dash_label_valid')] = $row->getExpiryDate() ?: $row->getValidity();
67
68 if ($cert_link = $this->maybeGetCertificateLink($this->user->getId(), $prg->getId(), $prg->getRefId())) {
69 $repo_assignment = ilStudyProgrammeDIC::dic()['repo.assignment'];
70 $longest_lasting = $repo_assignment->getLongestValidAssignment($prg->getId(), $this->user->getId());
71 if ($longest_lasting === null
72 || $row->getAssignmentId() === $longest_lasting->getId()) {
73 $properties[$this->lng->txt('certificate')] = $cert_link;
74 }
75 }
76 } else {
77 $properties[$this->lng->txt('prg_dash_label_finish_until')] = $row->getDeadline();
78 }
79
80 $items[] = new BlockDTO(
81 $prg->getType(),
82 $prg->getRefId(),
83 $prg->getId(),
84 $prg->getTitle(),
85 $prg->getDescription(),
86 null,
87 null,
88 $properties
89 );
90 }
91
92 $this->setData(['' => $items]);
93 }
static getInstanceByObjId(int $obj_id)
maybeGetCertificateLink(int $usr_id, int $prg_obj_id, int $prg_ref_id)

References ilStudyProgrammeDIC\dic(), ilObjStudyProgramme\getInstanceByObjId(), isReadable(), ILIAS\Repository\lng(), maybeGetCertificateLink(), ilDashboardBlockGUI\setData(), ilPRGProgress\STATUS_ACCREDITED, ilPRGProgress\STATUS_COMPLETED, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ initViewSettings()

ilStudyProgrammeDashboardViewGUI::initViewSettings ( )

Reimplemented from ilDashboardBlockGUI.

Definition at line 29 of file class.ilStudyProgrammeDashboardViewGUI.php.

29 : void
30 {
31 $this->view_settings = new ilPDSelectedItemsBlockViewSettings(
32 $this->user,
34 );
35
36 $this->ctrl->setParameter($this, 'view', $this->view_settings->getView());
37 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\user(), and ilPDSelectedItemsBlockConstants\VIEW_MY_STUDYPROGRAMME.

+ Here is the call graph for this function:

◆ isReadable()

ilStudyProgrammeDashboardViewGUI::isReadable ( ilObjStudyProgramme  $prg)
protected

Definition at line 95 of file class.ilStudyProgrammeDashboardViewGUI.php.

95 : bool
96 {
98 return true;
99 }
100 return $this->access->checkAccess('read', "", $prg->getRefId(), "prg", $prg->getId());
101 }

References ILIAS\Repository\access(), ilObject\getId(), ilObject\getRefId(), getVisibleOnPDMode(), and ilObjStudyProgrammeAdmin\SETTING_VISIBLE_ON_PD_ALLWAYS.

Referenced by initData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maybeGetCertificateLink()

ilStudyProgrammeDashboardViewGUI::maybeGetCertificateLink ( int  $usr_id,
int  $prg_obj_id,
int  $prg_ref_id 
)
protected

Definition at line 120 of file class.ilStudyProgrammeDashboardViewGUI.php.

120 : ?string
121 {
122 $cert_validator = new ilCertificateDownloadValidator();
123 if ($cert_validator->isCertificateDownloadable($usr_id, $prg_obj_id)) {
124 $this->ctrl->setParameterByClass('ilObjStudyProgrammeGUI', 'ref_id', $prg_ref_id);
125 $target = $this->ctrl->getLinkTargetByClass("ilObjStudyProgrammeGUI", "deliverCertificate");
126 $this->ctrl->setParameterByClass('ilObjStudyProgrammeGUI', 'ref_id', null);
127 $this->lng->loadLanguageModule('certificate');
128 return $this->renderer->render($this->factory->link()->standard($this->lng->txt('download_certificate'), $target));
129 }
130 return null;
131 }
renderer()
factory()
Validates if an active certificate is stored in the database and can be downloaded by the user.

References ILIAS\Repository\ctrl(), factory(), ILIAS\Repository\lng(), and renderer().

Referenced by initData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $visible_on_pd_mode

string ilStudyProgrammeDashboardViewGUI::$visible_on_pd_mode = null
protected

Definition at line 27 of file class.ilStudyProgrammeDashboardViewGUI.php.

Referenced by getVisibleOnPDMode().


The documentation for this class was generated from the following file: