ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLPListOfProgressGUI Class Reference
+ Inheritance diagram for ilLPListOfProgressGUI:
+ Collaboration diagram for ilLPListOfProgressGUI:

Public Member Functions

 __construct (int $a_mode, int $a_ref_id, int $a_user_id=0)
 
 executeCommand ()
 execute command More...
 
 show ()
 
 details ()
 
 __showProgressList ()
 
 __initUser (int $a_usr_id=0)
 
 __initDetails (int $a_details_id)
 
- Public Member Functions inherited from ilLearningProgressBaseGUI
 __construct (int $a_mode, int $a_ref_id=0, int $a_usr_id=0)
 
 isAnonymized ()
 
 getMode ()
 
 getRefId ()
 
 getObjId ()
 
 getUserId ()
 
 __getDefaultCommand ()
 
 __setSubTabs (int $a_active)
 
 __buildFooter ()
 
 __buildHeader ()
 
 __showObjectDetails (ilInfoScreenGUI $info, int $item_id=0, bool $add_section=true)
 show details about current object. More...
 
 __appendLPDetails (ilInfoScreenGUI $info, int $item_id, int $user_id)
 
 __getLegendHTML (int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
 
 __showEditUser (int $a_user_id, int $a_ref_id, ?string $a_cancel=null, int $a_sub_id=0)
 
 __updateUser (int $user_id, int $obj_id)
 

Protected Member Functions

 initDetailsIdFromQuery ()
 
 saveProgress ()
 
- Protected Member Functions inherited from ilLearningProgressBaseGUI
 initUserIdFromQuery ()
 
 initEditUserForm (int $a_user_id, int $a_obj_id, ?string $a_cancel=null)
 

Protected Attributes

ilObjUser $tracked_user = null
 
int $details_id = 0
 
int $details_obj_id = 0
 
string $details_type = ''
 
int $details_mode = 0
 
- Protected Attributes inherited from ilLearningProgressBaseGUI
RefineryFactory $refinery
 
HttpServices $http
 
ilGlobalTemplateInterface $tpl
 
ilHelpGUI $help
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilLogger $logger
 
ilTabsGUI $tabs_gui
 
ilToolbarGUI $toolbar
 
ilObjectDataCache $ilObjectDataCache
 
ilObjUser $user
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTree $tree
 
bool $anonymized
 
int $usr_id = 0
 
int $ref_id = 0
 
int $obj_id = 0
 
string $obj_type = ''
 
int $mode = 0
 
const LP_ACTIVE_SETTINGS = 1
 
const LP_ACTIVE_OBJECTS = 2
 
const LP_ACTIVE_PROGRESS = 3
 
const LP_ACTIVE_USERS = 5
 
const LP_ACTIVE_SUMMARY = 6
 
const LP_ACTIVE_OBJSTATACCESS = 7
 
const LP_ACTIVE_OBJSTATTYPES = 8
 
const LP_ACTIVE_OBJSTATDAILY = 9
 
const LP_ACTIVE_OBJSTATADMIN = 10
 
const LP_ACTIVE_MATRIX = 11
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLearningProgressBaseGUI
static _getStatusText (int $a_status, ?ilLanguage $a_lng=null)
 Get status alt text. More...
 
static __readStatus (int $a_obj_id, int $user_id)
 PhpInconsistentReturnPointsInspection More...
 
static isObjectOffline (int $a_obj_id, string $a_type='')
 
- Data Fields inherited from ilLearningProgressBaseGUI
const LP_CONTEXT_PERSONAL_DESKTOP = 1
 
const LP_CONTEXT_ADMINISTRATION = 2
 
const LP_CONTEXT_REPOSITORY = 3
 
const LP_CONTEXT_USER_FOLDER = 4
 
const LP_CONTEXT_ORG_UNIT = 5
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLPListOfProgressGUI::__construct ( int  $a_mode,
int  $a_ref_id,
int  $a_user_id = 0 
)

Definition at line 35 of file class.ilLPListOfProgressGUI.php.

References ILIAS\GlobalScreen\Provider\__construct(), __initDetails(), __initUser(), ILIAS\Repository\ctrl(), and initDetailsIdFromQuery().

36  {
37  parent::__construct($a_mode, $a_ref_id, $a_user_id);
38  $this->__initUser($a_user_id);
39 
40  // Set item id for details
41  $this->__initDetails($this->initDetailsIdFromQuery());
42  $this->ctrl->saveParameter($this, 'details_id');
43  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ __initDetails()

ilLPListOfProgressGUI::__initDetails ( int  $a_details_id)

Definition at line 284 of file class.ilLPListOfProgressGUI.php.

References ilObject\_getAllReferences(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getRefId(), ilObjectDataCache\lookupObjId(), and ilObjectDataCache\lookupType().

Referenced by __construct(), and show().

284  : void
285  {
286  if (!$a_details_id) {
287  $a_details_id = $this->getRefId();
288  }
289  if ($a_details_id) {
290  $ref_ids = ilObject::_getAllReferences($a_details_id);
291 
292  $this->details_id = $a_details_id;
293  $this->details_obj_id = $this->ilObjectDataCache->lookupObjId(
294  $this->details_id
295  );
296  $this->details_type = $this->ilObjectDataCache->lookupType(
297  $this->details_obj_id
298  );
299 
300  $olp = ilObjectLP::getInstance($this->details_obj_id);
301  $this->details_mode = $olp->getCurrentMode();
302  }
303  }
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initUser()

ilLPListOfProgressGUI::__initUser ( int  $a_usr_id = 0)
Todo:
check the access checks.

Definition at line 238 of file class.ilLPListOfProgressGUI.php.

References ilLearningProgressBaseGUI\$user, ilObjOrgUnitAccess\_checkAccessToUserLearningProgress(), ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), and SYSTEM_ROLE_ID.

Referenced by __construct(), and show().

238  : bool
239  {
240  if ($this->http->wrapper()->post()->has('user_id')) {
241  $a_usr_id = $this->http->wrapper()->post()->retrieve(
242  'user_id',
243  $this->refinery->kindlyTo()->int()
244  );
245  $this->ctrl->setParameter($this, 'user_id', $a_usr_id);
246  }
247  if ($a_usr_id) {
249  if (!$user instanceof ilObjUser) {
250  throw new ilObjectNotFoundException(
251  'Invalid user id given: ' . $a_usr_id
252  );
253  }
254  $this->tracked_user = $user;
255  } else {
256  $this->tracked_user = $this->user;
257  }
258 
259  // #8762: see ilObjUserGUI->getTabs()
260  if ($this->mode == self::LP_CONTEXT_USER_FOLDER &&
261  $this->rbacsystem->checkAccess('read', $this->ref_id)) {
262  return false;
263  }
264 
265  if ($this->mode == self::LP_CONTEXT_ORG_UNIT &&
267  $this->ref_id,
268  $a_usr_id
269  )) {
270  return false;
271  }
272 
273  // Check access
274  if (!$this->rbacreview->isAssigned(
275  $this->user->getId(),
277  )) {
278  $this->tracked_user = $this->user;
279  return false;
280  }
281  return true;
282  }
const SYSTEM_ROLE_ID
Definition: constants.php:29
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
static _checkAccessToUserLearningProgress(int $ref_id, int $usr_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showProgressList()

ilLPListOfProgressGUI::__showProgressList ( )

Definition at line 206 of file class.ilLPListOfProgressGUI.php.

References ilLearningProgressBaseGUI\__getLegendHTML(), ILIAS\Repository\ctrl(), and ilLearningProgressBaseGUI\getMode().

Referenced by show().

206  : void
207  {
208  $this->tpl->addBlockFile(
209  'ADM_CONTENT',
210  'adm_content',
211  'tpl.lp_list_progress.html',
212  'Services/Tracking'
213  );
214 
215  // User info
216  $info = new ilInfoScreenGUI($this);
217  $info->setFormAction($this->ctrl->getFormAction($this));
218  $lp_table = new ilLPProgressTableGUI(
219  $this,
220  "",
221  $this->tracked_user,
222  null,
223  false,
224  null,
225  false,
226  null,
227  null,
228  $this->getMode()
229  );
230  $this->tpl->setVariable("LP_OBJECTS", $lp_table->getHTML());
231 
232  $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
233  }
Class ilInfoScreenGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__getLegendHTML(int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ details()

ilLPListOfProgressGUI::details ( )

Definition at line 112 of file class.ilLPListOfProgressGUI.php.

References ilLearningProgressBaseGUI\$obj_id, ilLearningProgressBaseGUI\__appendLPDetails(), ilLearningProgressBaseGUI\__getLegendHTML(), ilLearningProgressBaseGUI\__showObjectDetails(), ilObject\_lookupObjectId(), ILIAS\Repository\access(), ilLearningProgressAccess\checkPermission(), ILIAS\Repository\ctrl(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getMode(), ilLearningProgressBaseGUI\getRefId(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().

Referenced by show().

112  : void
113  {
114  // Show back button to crs if called from crs. Otherwise if called from personal desktop or administration
115  // show back to list
116  $crs_id = 0;
117  if ($this->http->wrapper()->query()->has('crs_id')) {
118  $crs_id = $this->http->wrapper()->query()->retrieve(
119  'crs_id',
120  $this->refinery->kindlyTo()->int()
121  );
122  }
123  if ($crs_id) {
124  $this->ctrl->setParameter($this, 'details_id', $crs_id);
125  $this->toolbar->addButton(
126  $this->lng->txt('trac_view_crs'),
127  $this->ctrl->getLinkTarget($this, 'details')
128  );
129  } elseif ($this->getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP or
130  $this->getMode() == self::LP_CONTEXT_ADMINISTRATION or
131  $this->getMode() == self::LP_CONTEXT_USER_FOLDER) {
132  $this->toolbar->addButton(
133  $this->lng->txt('trac_view_list'),
134  $this->ctrl->getLinkTarget($this, 'show')
135  );
136  }
137 
138  $this->tpl->addBlockFile(
139  'ADM_CONTENT',
140  'adm_content',
141  'tpl.lp_progress_container.html',
142  'Services/Tracking'
143  );
144 
145  $info = new ilInfoScreenGUI($this);
146  $info->setContextRefId($this->details_id);
147  $info->setContextObjId($this->details_obj_id);
148  $info->setContentObjType((string) $this->obj_type);
149  $info->enableLearningProgress(true);
150  $info->setFormAction($this->ctrl->getFormAction($this));
151  $this->__appendLPDetails(
152  $info,
153  $this->details_obj_id,
154  $this->tracked_user->getId()
155  );
156  $this->__showObjectDetails($info, $this->details_obj_id, false);
157 
158  // Finally set template variable
159  $this->tpl->setVariable("LM_INFO", $info->getHTML());
160 
161  $olp = ilObjectLP::getInstance($this->details_obj_id);
162  $collection = $olp->getCollectionInstance();
163  $obj_ids = array();
164  if ($collection) {
165  foreach ($collection->getItems() as $item_id) {
166  if ($collection instanceof ilLPCollectionOfRepositoryObjects) {
168  if ($this->access->checkAccessOfUser(
169  $this->tracked_user->getId(),
170  'visible',
171  '',
172  $item_id
173  )) {
174  $obj_ids[$obj_id] = array($item_id);
175  }
176  } else {
177  $obj_ids[] = $item_id;
178  }
179  }
180  }
181 
182  // #15247
183  if (count($obj_ids) > 0) {
184  // seems obsolete
186  'read_learning_progress',
187  $this->getRefId()
188  );
189  $lp_table = new ilLPProgressTableGUI(
190  $this,
191  "details",
192  $this->tracked_user,
193  $obj_ids,
194  true,
195  $this->details_mode,
196  $personal_only,
197  $this->details_obj_id,
198  $this->details_id
199  );
200  $this->tpl->setVariable("LP_OBJECTS", $lp_table->getHTML());
201  }
202 
203  $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
204  }
Class ilInfoScreenGUI.
__showObjectDetails(ilInfoScreenGUI $info, int $item_id=0, bool $add_section=true)
show details about current object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
static _lookupObjectId(int $ref_id)
__appendLPDetails(ilInfoScreenGUI $info, int $item_id, int $user_id)
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
__getLegendHTML(int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLPListOfProgressGUI::executeCommand ( )

execute command

Definition at line 59 of file class.ilLPListOfProgressGUI.php.

References ilLearningProgressBaseGUI\__getDefaultCommand(), ILIAS\Repository\ctrl(), and ilLearningProgressBaseGUI\getUserId().

59  : void
60  {
61  $this->ctrl->setReturn($this, "show");
62  $this->ctrl->setParameter($this, 'user_id', $this->getUserId());
63  switch ($this->ctrl->getNextClass()) {
64  case 'illpprogresstablegui':
65  $table_gui = new ilLPProgressTableGUI(
66  $this,
67  "",
68  $this->tracked_user
69  );
70  $this->ctrl->setReturn($this, 'show');
71  $this->ctrl->forwardCommand($table_gui);
72  break;
73 
74  default:
75  $cmd = $this->__getDefaultCommand();
76  $this->$cmd();
77  }
78  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ initDetailsIdFromQuery()

ilLPListOfProgressGUI::initDetailsIdFromQuery ( )
protected

Definition at line 45 of file class.ilLPListOfProgressGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by __construct().

45  : int
46  {
47  if ($this->http->wrapper()->query()->has('details_id')) {
48  return $this->http->wrapper()->query()->retrieve(
49  'details_id',
50  $this->refinery->kindlyTo()->int()
51  );
52  }
53  return 0;
54  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveProgress()

ilLPListOfProgressGUI::saveProgress ( )
protected

Definition at line 102 of file class.ilLPListOfProgressGUI.php.

References ILIAS\Repository\ctrl().

102  : void
103  {
104  $info = new ilInfoScreenGUI($this);
105  $info->setContextRefId($this->ref_id);
106  $info->setContextObjId($this->details_obj_id);
107  $info->setContentObjType((string) $this->obj_type);
108  $info->saveProgress(false);
109  $this->ctrl->redirect($this);
110  }
Class ilInfoScreenGUI.
+ Here is the call graph for this function:

◆ show()

ilLPListOfProgressGUI::show ( )

Definition at line 80 of file class.ilLPListOfProgressGUI.php.

References __initDetails(), __initUser(), __showProgressList(), details(), ilLearningProgressBaseGUI\getMode(), ilLearningProgressBaseGUI\getRefId(), and ilLearningProgressBaseGUI\getUserId().

80  : void
81  {
82  switch ($this->getMode()) {
83  // Show only detail of current repository item if called from repository
84  case self::LP_CONTEXT_REPOSITORY:
85  $this->__initDetails($this->getRefId());
86  $this->details();
87  return;
88 
89  case self::LP_CONTEXT_USER_FOLDER:
90  case self::LP_CONTEXT_ORG_UNIT:
91  // if called from user folder obj_id is id of current user
92  $this->__initUser($this->getUserId());
93  break;
94  }
95  // not called from repository
96  $this->__showProgressList();
97  }
+ Here is the call graph for this function:

Field Documentation

◆ $details_id

int ilLPListOfProgressGUI::$details_id = 0
protected

Definition at line 30 of file class.ilLPListOfProgressGUI.php.

◆ $details_mode

int ilLPListOfProgressGUI::$details_mode = 0
protected

Definition at line 33 of file class.ilLPListOfProgressGUI.php.

◆ $details_obj_id

int ilLPListOfProgressGUI::$details_obj_id = 0
protected

Definition at line 31 of file class.ilLPListOfProgressGUI.php.

◆ $details_type

string ilLPListOfProgressGUI::$details_type = ''
protected

Definition at line 32 of file class.ilLPListOfProgressGUI.php.

◆ $tracked_user

ilObjUser ilLPListOfProgressGUI::$tracked_user = null
protected

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


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