ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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, string $item_type='', 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 ()
 
 readTypicalLearningTimeInSeconds (int $obj_id, int $sub_id, string $type)
 
 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
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
LOMServices $lom_services
 
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 283 of file class.ilLPListOfProgressGUI.php.

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

Referenced by __construct(), and show().

283  : void
284  {
285  if (!$a_details_id) {
286  $a_details_id = $this->getRefId();
287  }
288  if ($a_details_id) {
289  $ref_ids = ilObject::_getAllReferences($a_details_id);
290 
291  $this->details_id = $a_details_id;
292  $this->details_obj_id = $this->ilObjectDataCache->lookupObjId(
293  $this->details_id
294  );
295  $this->details_type = $this->ilObjectDataCache->lookupType(
296  $this->details_obj_id
297  );
298 
299  $olp = ilObjectLP::getInstance($this->details_obj_id);
300  $this->details_mode = $olp->getCurrentMode();
301  }
302  }
static _getAllReferences(int $id)
get all reference ids for object ID
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 237 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().

237  : bool
238  {
239  if ($this->http->wrapper()->post()->has('user_id')) {
240  $a_usr_id = $this->http->wrapper()->post()->retrieve(
241  'user_id',
242  $this->refinery->kindlyTo()->int()
243  );
244  $this->ctrl->setParameter($this, 'user_id', $a_usr_id);
245  }
246  if ($a_usr_id) {
248  if (!$user instanceof ilObjUser) {
249  throw new ilObjectNotFoundException(
250  'Invalid user id given: ' . $a_usr_id
251  );
252  }
253  $this->tracked_user = $user;
254  } else {
255  $this->tracked_user = $this->user;
256  }
257 
258  // #8762: see ilObjUserGUI->getTabs()
259  if ($this->mode == self::LP_CONTEXT_USER_FOLDER &&
260  $this->rbacsystem->checkAccess('read', $this->ref_id)) {
261  return false;
262  }
263 
264  if ($this->mode == self::LP_CONTEXT_ORG_UNIT &&
266  $this->ref_id,
267  $a_usr_id
268  )) {
269  return false;
270  }
271 
272  // Check access
273  if (!$this->rbacreview->isAssigned(
274  $this->user->getId(),
276  )) {
277  $this->tracked_user = $this->user;
278  return false;
279  }
280  return true;
281  }
const SYSTEM_ROLE_ID
Definition: constants.php:29
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 205 of file class.ilLPListOfProgressGUI.php.

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

Referenced by show().

205  : void
206  {
207  $this->tpl->addBlockFile(
208  'ADM_CONTENT',
209  'adm_content',
210  'tpl.lp_list_progress.html',
211  'components/ILIAS/Tracking'
212  );
213 
214  // User info
215  $info = new ilInfoScreenGUI($this);
216  $info->setFormAction($this->ctrl->getFormAction($this));
217  $lp_table = new ilLPProgressTableGUI(
218  $this,
219  "",
220  $this->tracked_user,
221  null,
222  false,
223  null,
224  false,
225  null,
226  null,
227  $this->getMode()
228  );
229  $this->tpl->setVariable("LP_OBJECTS", $lp_table->getHTML());
230 
231  $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
232  }
TableGUI class for learning progress.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__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_USER_FOLDER) {
131  $this->toolbar->addButton(
132  $this->lng->txt('trac_view_list'),
133  $this->ctrl->getLinkTarget($this, 'show')
134  );
135  }
136 
137  $this->tpl->addBlockFile(
138  'ADM_CONTENT',
139  'adm_content',
140  'tpl.lp_progress_container.html',
141  'components/ILIAS/Tracking'
142  );
143 
144  $info = new ilInfoScreenGUI($this);
145  $info->setContextRefId($this->details_id);
146  $info->setContextObjId($this->details_obj_id);
147  $info->setContentObjType((string) $this->obj_type);
148  $info->enableLearningProgress(true);
149  $info->setFormAction($this->ctrl->getFormAction($this));
150  $this->__appendLPDetails(
151  $info,
152  $this->details_obj_id,
153  $this->tracked_user->getId()
154  );
155  $this->__showObjectDetails($info, $this->details_obj_id, $this->details_type, false);
156 
157  // Finally set template variable
158  $this->tpl->setVariable("LM_INFO", $info->getHTML());
159 
160  $olp = ilObjectLP::getInstance($this->details_obj_id);
161  $collection = $olp->getCollectionInstance();
162  $obj_ids = array();
163  if ($collection) {
164  foreach ($collection->getItems() as $item_id) {
165  if ($collection instanceof ilLPCollectionOfRepositoryObjects) {
167  if ($this->access->checkAccessOfUser(
168  $this->tracked_user->getId(),
169  'visible',
170  '',
171  $item_id
172  )) {
173  $obj_ids[$obj_id] = array($item_id);
174  }
175  } else {
176  $obj_ids[] = $item_id;
177  }
178  }
179  }
180 
181  // #15247
182  if (count($obj_ids) > 0) {
183  // seems obsolete
185  'read_learning_progress',
186  $this->getRefId()
187  );
188  $lp_table = new ilLPProgressTableGUI(
189  $this,
190  "details",
191  $this->tracked_user,
192  $obj_ids,
193  true,
194  $this->details_mode,
195  $personal_only,
196  $this->details_obj_id,
197  $this->details_id
198  );
199  $this->tpl->setVariable("LP_OBJECTS", $lp_table->getHTML());
200  }
201 
202  $this->tpl->setVariable("LEGEND", $this->__getLegendHTML());
203  }
__showObjectDetails(ilInfoScreenGUI $info, int $item_id=0, string $item_type='', bool $add_section=true)
show details about current object.
TableGUI class for learning progress.
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  }
TableGUI class for learning progress.
+ 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  }
+ 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: