ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilStudyProgrammeDashboardViewGUI Class Reference
+ Inheritance diagram for ilStudyProgrammeDashboardViewGUI:
+ Collaboration diagram for ilStudyProgrammeDashboardViewGUI:

Public Member Functions

 initViewSettings ()
 
 emptyHandling ()
 
 initData ()
 
 getBlockType ()
 
 removeMultipleEnabled ()
 
 getRemoveMultipleActionText ()
 
- 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 ()
 
 viewDashboardObject ()
 
 changePDItemSortingObject ()
 
 changePDItemPresentationObject ()
 
 getItemGroups ()
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 removeMultipleEnabled ()
 
 getRemoveMultipleActionText ()
 
 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 ()
 

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 ()
 
 getListItemForDataDTO (BlockDTO $data)
 
 isRepositoryObject ()
 
 getLegacyContent ()
 
 preloadData (array $data)
 
 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
ilFavouritesManager $favourites_manager
 
int $requested_item_ref_id
 
ilSetting $settings
 
ilLogger $logging
 
Services $http
 
ilPDSelectedItemsBlockViewSettings $viewSettings
 
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 ( )

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

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

◆ getBlockType()

ilStudyProgrammeDashboardViewGUI::getBlockType ( )

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

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

◆ getRemoveMultipleActionText()

ilStudyProgrammeDashboardViewGUI::getRemoveMultipleActionText ( )

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

125  : string
126  {
127  return '';
128  }

◆ 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().

103  : string
104  {
105  if (is_null($this->visible_on_pd_mode)) {
106  $this->visible_on_pd_mode =
107  $this->settings->get(
110  );
111  }
113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initData()

ilStudyProgrammeDashboardViewGUI::initData ( )

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

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

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getInstanceByObjId(int $obj_id)
maybeGetCertificateLink(int $usr_id, int $prg_obj_id, int $prg_ref_id)
+ Here is the call graph for this function:

◆ initViewSettings()

ilStudyProgrammeDashboardViewGUI::initViewSettings ( )

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

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

29  : void
30  {
31  $this->viewSettings = new ilPDSelectedItemsBlockViewSettings(
32  $this->user,
34  );
35 
36  $this->ctrl->setParameter($this, 'view', $this->viewSettings->getCurrentView());
37  }
+ Here is the call graph for this function:

◆ isReadable()

ilStudyProgrammeDashboardViewGUI::isReadable ( ilObjStudyProgramme  $prg)
protected

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

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

Referenced by initData().

95  : bool
96  {
98  return true;
99  }
100  return $this->access->checkAccess('read', "", $prg->getRefId(), "prg", $prg->getId());
101  }
+ 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 130 of file class.ilStudyProgrammeDashboardViewGUI.php.

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

Referenced by initData().

130  : ?string
131  {
132  $cert_validator = new ilCertificateDownloadValidator();
133  if ($cert_validator->isCertificateDownloadable($usr_id, $prg_obj_id)) {
134  $this->ctrl->setParameterByClass('ilObjStudyProgrammeGUI', 'ref_id', $prg_ref_id);
135  $target = $this->ctrl->getLinkTargetByClass("ilObjStudyProgrammeGUI", "deliverCertificate");
136  $this->ctrl->setParameterByClass('ilObjStudyProgrammeGUI', 'ref_id', null);
137  $this->lng->loadLanguageModule('certificate');
138  return $this->renderer->render($this->factory->link()->standard($this->lng->txt('download_certificate'), $target));
139  }
140  return null;
141  }
factory()
renderer()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Validates if an active certificate is stored in the database and can be downloaded by the user...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeMultipleEnabled()

ilStudyProgrammeDashboardViewGUI::removeMultipleEnabled ( )

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

120  : bool
121  {
122  return false;
123  }

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: