ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilLearningProgressBaseGUI Class Reference
+ Inheritance diagram for ilLearningProgressBaseGUI:
+ Collaboration diagram for ilLearningProgressBaseGUI:

Public Member Functions

 ilLearningProgressBaseGUI ($a_mode, $a_ref_id=0, $a_usr_id=0)
 
 isAnonymized ()
 
 getMode ()
 
 getRefId ()
 
 getObjId ()
 
 getUserId ()
 
 __getDefaultCommand ()
 
 __setSubTabs ($a_active)
 
 __buildFooter ()
 
 __buildHeader ()
 
 __insertPath (&$a_tpl, $a_ref_id)
 insert path More...
 
 __showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
 
 _getImagePathForStatus ($a_status)
 Get image path for status. More...
 
 _getStatusText ($a_status)
 Get status alt text. More...
 
__initTableGUI ()
 
 __showObjectDetails (&$info, $item_id=0, $add_section=true)
 show details about current object. More...
 
 __appendUserInfo (&$info, $a_user)
 
 __appendLPDetails (&$info, $item_id, $user_id)
 
 __readStatus ($a_obj_id, $user_id)
 
 __sort ($a_ids, $a_table, $a_field, $a_id_name)
 Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname. More...
 
 __getPercent ($max, $reached)
 
 __readItemStatusInfo ($a_items)
 
 __getLegendHTML ()
 
 __showEditUser ($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
 
 __updateUser ($user_id, $obj_id)
 

Static Public Member Functions

static _showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
 
static isObjectOffline ($a_obj_id, $a_type=null)
 

Data Fields

 $tpl = null
 
 $ctrl = null
 
 $lng = null
 
 $ref_id = 0
 
 $mode = 0
 
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
 
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
 

Protected Member Functions

 initEditUserForm ($a_user_id, $a_obj_id, $a_cancel=null)
 

Protected Attributes

 $anonymized
 

Detailed Description

Definition at line 21 of file class.ilLearningProgressBaseGUI.php.

Member Function Documentation

◆ __appendLPDetails()

ilLearningProgressBaseGUI::__appendLPDetails ( $info,
  $item_id,
  $user_id 
)

Definition at line 444 of file class.ilLearningProgressBaseGUI.php.

445 {
446 global $ilObjDataCache;
447
448 $type = $ilObjDataCache->lookupType($item_id);
449
450 // Section learning_progress
451 // $info->addSection($this->lng->txt('trac_learning_progress'));
452 // see ilLPTableBaseGUI::parseTitle();
453 $info->addSection($this->lng->txt("trac_progress").": ".ilObject::_lookupTitle($item_id));
454
455 $olp = ilObjectLP::getInstance($item_id);
456 $info->addProperty($this->lng->txt('trac_mode'),
457 $olp->getModeText($olp->getCurrentMode()));
458
459 switch($type)
460 {
461 case 'lm':
462 case 'htlm':
463 include_once 'Services/Tracking/classes/class.ilLearningProgress.php';
464 $progress = ilLearningProgress::_getProgress($user_id,$item_id);
465
466 if($progress['access_time'])
467 {
468 $info->addProperty($this->lng->txt('last_access'),
469 ilDatePresentation::formatDate(new ilDateTime($progress['access_time'],IL_CAL_DATETIME)));
470 }
471 else
472 {
473 $info->addProperty($this->lng->txt('last_access'),$this->lng->txt('trac_not_accessed'));
474 }
475 $info->addProperty($this->lng->txt('trac_visits'),(int) $progress['visits']);
476 if($type == 'lm')
477 {
478 $info->addProperty($this->lng->txt('trac_spent_time'),ilFormat::_secondsToString($progress['spent_seconds']));
479 }
480 // fallthrough
481
482 case 'exc':
483 case 'tst':
484 case 'crs':
485 case 'sahs':
486 case 'grp':
487 // display status as image
488 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
489 $status = $this->__readStatus($item_id,$user_id);
491 $status_text = ilLearningProgressBaseGUI::_getStatusText($status);
492 $info->addProperty($this->lng->txt('trac_status'),
493 ilUtil::img($status_path, $status_text)." ".$status_text);
494
495 // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
496 $mode = $olp->getCurrentMode();
497 if(in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
499 // ilLPObjSettings::LP_MODE_OBJECTIVES,
502 {
503 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
504 $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
505 $info->addProperty($this->lng->txt('trac_percentage'), (int)$perc."%");
506 }
507 break;
508
509 }
510
511 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
512 if(strlen($mark = ilLPMarks::_lookupMark($user_id,$item_id)))
513 {
514 $info->addProperty($this->lng->txt('trac_mark'),$mark);
515 }
516 if(strlen($comment = ilLPMarks::_lookupComment($user_id,$item_id)))
517 {
518 $info->addProperty($this->lng->txt('trac_comment'),$comment);
519 }
520 }
$comment
Definition: buildRTE.php:83
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
_lookupComment($a_usr_id, $a_obj_id)
_lookupMark($a_usr_id, $a_obj_id)
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
_getImagePathForStatus($a_status)
Get image path for status.
_getStatusText($a_status)
Get status alt text.
_getProgress($a_user_id, $a_obj_id)
static getInstance($a_obj_id)
static _lookupTitle($a_id)
lookup object title
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.

References $comment, $mode, __readStatus(), _getImagePathForStatus(), ilLearningProgress\_getProgress(), _getStatusText(), ilLPMarks\_lookupComment(), ilLPMarks\_lookupMark(), ilLPStatus\_lookupPercentage(), ilObject\_lookupTitle(), ilFormat\_secondsToString(), ilDatePresentation\formatDate(), ilObjectLP\getInstance(), IL_CAL_DATETIME, ilUtil\img(), ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_TEST_PASSED, ilLPObjSettings\LP_MODE_TLT, and ilLPObjSettings\LP_MODE_VISITS.

+ Here is the call graph for this function:

◆ __appendUserInfo()

ilLearningProgressBaseGUI::__appendUserInfo ( $info,
  $a_user 
)

Definition at line 419 of file class.ilLearningProgressBaseGUI.php.

420 {
421 global $ilUser;
422
423 // #13525 - irrelevant personal data is not to be presented
424 return;
425
426 if(!is_object($a_user))
427 {
428 $a_user = ilObjectFactory::getInstanceByObjId($a_user);
429 }
430
431 if($a_user->getId() != $ilUser->getId())
432 {
433 $info->addSection($this->lng->txt("trac_user_data"));
434 // $info->addProperty($this->lng->txt('username'),$a_user->getLogin());
435 // $info->addProperty($this->lng->txt('name'),$a_user->getFullname());
436 $info->addProperty($this->lng->txt('last_login'),
437 ilDatePresentation::formatDate(new ilDateTime($a_user->getLastLogin(),IL_CAL_DATETIME)));
438 $info->addProperty($this->lng->txt('trac_total_online'),
439 ilFormat::_secondsToString(ilOnlineTracking::getOnlineTime($a_user->getId())));
440 return true;
441 }
442 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $ilUser
Definition: imgupload.php:15

References $ilUser, ilFormat\_secondsToString(), ilDatePresentation\formatDate(), ilObjectFactory\getInstanceByObjId(), and IL_CAL_DATETIME.

Referenced by ilLPListOfProgressGUI\__showProgressList(), ilLPListOfObjectsGUI\editUser(), and ilLPListOfObjectsGUI\userDetails().

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

◆ __buildFooter()

ilLearningProgressBaseGUI::__buildFooter ( )

Definition at line 219 of file class.ilLearningProgressBaseGUI.php.

220 {
221 switch($this->getMode())
222 {
224
225 $this->tpl->show(true);
226 }
227 }

References getMode(), and LP_CONTEXT_PERSONAL_DESKTOP.

Referenced by ilLearningProgressGUI\executeCommand().

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

◆ __buildHeader()

ilLearningProgressBaseGUI::__buildHeader ( )

Definition at line 229 of file class.ilLearningProgressBaseGUI.php.

230 {
231 if($this->getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
232 {
233 $this->tpl->setTitle($this->lng->txt("learning_progress"));
234
235 // set locator
236/*
237 $this->tpl->setVariable("TXT_LOCATOR", $this->lng->txt("locator"));
238 $this->tpl->touchBlock("locator_separator");
239 $this->tpl->touchBlock("locator_item");
240 //$this->tpl->setCurrentBlock("locator_item");
241 //$this->tpl->setVariable("ITEM", $this->lng->txt("personal_desktop"));
242 //$this->tpl->setVariable("LINK_ITEM",
243 // $this->ctrl->getLinkTargetByClass("ilpersonaldesktopgui"));
244 //$this->tpl->parseCurrentBlock();
245
246 $this->tpl->setCurrentBlock("locator_item");
247 $this->tpl->setVariable("ITEM", $this->lng->txt("learning_progress"));
248 $this->tpl->setVariable("LINK_ITEM",
249 $this->ctrl->getLinkTargetByClass('illearningprogressgui'));
250 $this->tpl->parseCurrentBlock();
251*/
252
253 // display infopanel if something happened
255 }
256
257 }
static infoPanel($a_keep=true)

References getMode(), and ilUtil\infoPanel().

Referenced by ilLearningProgressGUI\executeCommand().

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

◆ __getDefaultCommand()

ilLearningProgressBaseGUI::__getDefaultCommand ( )

Definition at line 108 of file class.ilLearningProgressBaseGUI.php.

109 {
110 if(strlen($cmd = $this->ctrl->getCmd()))
111 {
112 return $cmd;
113 }
114 return 'show';
115 }
$cmd
Definition: sahs_server.php:35

References $cmd.

Referenced by ilLPObjectStatisticsGUI\executeCommand(), ilLPListOfObjectsGUI\executeCommand(), ilLPListOfProgressGUI\executeCommand(), and ilLPListOfSettingsGUI\executeCommand().

+ Here is the caller graph for this function:

◆ __getLegendHTML()

ilLearningProgressBaseGUI::__getLegendHTML ( )

Definition at line 627 of file class.ilLearningProgressBaseGUI.php.

628 {
629 global $lng;
630
631 $tpl = new ilTemplate("tpl.lp_legend.html", true, true, "Services/Tracking");
632 $tpl->setVariable("IMG_NOT_ATTEMPTED",
633 ilUtil::getImagePath("scorm/not_attempted.svg"));
634 $tpl->setVariable("IMG_IN_PROGRESS",
635 ilUtil::getImagePath("scorm/incomplete.svg"));
636 $tpl->setVariable("IMG_COMPLETED",
637 ilUtil::getImagePath("scorm/completed.svg"));
638 $tpl->setVariable("IMG_FAILED",
639 ilUtil::getImagePath("scorm/failed.svg"));
640 $tpl->setVariable("TXT_NOT_ATTEMPTED",
641 $lng->txt("trac_not_attempted"));
642 $tpl->setVariable("TXT_IN_PROGRESS",
643 $lng->txt("trac_in_progress"));
644 $tpl->setVariable("TXT_COMPLETED",
645 $lng->txt("trac_completed"));
646 $tpl->setVariable("TXT_FAILED",
647 $lng->txt("trac_failed"));
648
649 include_once "Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
650 $panel = ilPanelGUI::getInstance();
651 $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY);
652 $panel->setBody($tpl->get());
653
654 return $panel->getHTML();
655 }
const PANEL_STYLE_SECONDARY
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $lng, $tpl, ilUtil\getImagePath(), ilPanelGUI\getInstance(), and ilPanelGUI\PANEL_STYLE_SECONDARY.

Referenced by ilLPListOfObjectsGUI\__listObjects(), ilLPListOfProgressGUI\__showProgressList(), ilLPListOfObjectsGUI\__showUsersList(), ilLPListOfObjectsGUI\showUserObjectMatrix(), and ilLPListOfObjectsGUI\userDetails().

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

◆ __getPercent()

ilLearningProgressBaseGUI::__getPercent (   $max,
  $reached 
)

Definition at line 585 of file class.ilLearningProgressBaseGUI.php.

586 {
587 if(!$max)
588 {
589 return "0%";
590 }
591
592 return sprintf("%d%%",$reached / $max * 100);
593 }

◆ __initTableGUI()

& ilLearningProgressBaseGUI::__initTableGUI ( )

Definition at line 373 of file class.ilLearningProgressBaseGUI.php.

374 {
375 include_once "./Services/Table/classes/class.ilTableGUI.php";
376
377 return new ilTableGUI(0,false);
378 }
Class ilTableGUI.

◆ __insertPath()

ilLearningProgressBaseGUI::__insertPath ( $a_tpl,
  $a_ref_id 
)

insert path

Definition at line 262 of file class.ilLearningProgressBaseGUI.php.

263 {
264 global $tree;
265
266 $path_arr = $tree->getPathFull($a_ref_id);
267 $counter = 0;
268 foreach($tree->getPathFull($a_ref_id) as $data)
269 {
270 if($counter++)
271 {
272 $path .= " -> ";
273 }
274 $path .= $data['title'];
275 }
276 $a_tpl->setCurrentBlock("path_item");
277 $a_tpl->setVariable("PATH_ITEM",$path);
278 $a_tpl->parseCurrentBlock();
279
280 $a_tpl->setCurrentBlock("path");
281 $a_tpl->parseCurrentBlock();
282
283 return $path;
284 }
$path
Definition: index.php:22

References $data, and $path.

◆ __readItemStatusInfo()

ilLearningProgressBaseGUI::__readItemStatusInfo (   $a_items)

Definition at line 595 of file class.ilLearningProgressBaseGUI.php.

596 {
597 global $ilObjDataCache;
598
599 include_once 'Services/Object/classes/class.ilObjectLP.php';
600
601 foreach($a_items as $item_id)
602 {
603 $olp = ilObjectLP::getInstance($item_id);
604
605 $this->obj_data[$item_id]['type'] = $ilObjDataCache->lookupType($item_id);
606 $this->obj_data[$item_id]['mode'] = $olp->getCurrentMode();
607 if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_TLT)
608 {
609 include_once './Services/MetaData/classes/class.ilMDEducational.php';
610 $this->obj_data[$item_id]['tlt'] = ilMDEducational::_getTypicalLearningTimeSeconds($item_id);
611 }
612 if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_VISITS)
613 {
614 $this->obj_data[$item_id]['visits'] = ilLPObjSettings::_lookupVisits($item_id);
615 }
616 if($this->obj_data[$item_id]['mode'] == ilLPObjSettings::LP_MODE_SCORM)
617 {
618 $collection = $olp->getCollectionInstance();
619 if($collection)
620 {
621 $this->obj_data[$item_id]['scos'] = count($collection->getItems());
622 }
623 }
624 }
625 }
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)

References ilMDEducational\_getTypicalLearningTimeSeconds(), ilLPObjSettings\_lookupVisits(), ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_TLT, and ilLPObjSettings\LP_MODE_VISITS.

+ Here is the call graph for this function:

◆ __readStatus()

ilLearningProgressBaseGUI::__readStatus (   $a_obj_id,
  $user_id 
)

Definition at line 522 of file class.ilLearningProgressBaseGUI.php.

523 {
524 include_once 'Services/Tracking/classes/class.ilLPStatus.php';
525 $status = ilLPStatus::_lookupStatus($a_obj_id, $user_id);
526
527 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
528 switch($status)
529 {
532
535
538
541
542 default:
543 return $status;
544 }
545 }
const LP_STATUS_COMPLETED_NUM
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS

References ilLPStatus\_lookupStatus(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by __appendLPDetails(), and ilObjSCORMLearningModule\exportSelected().

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

◆ __setSubTabs()

ilLearningProgressBaseGUI::__setSubTabs (   $a_active)

Definition at line 117 of file class.ilLearningProgressBaseGUI.php.

118 {
119 global $rbacsystem,$ilObjDataCache;
120
121
122
123 switch($this->getMode())
124 {
126
127 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
130 {
131 $this->tabs_gui->addTarget('trac_progress',
132 $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
133 "","","",$a_active == self::LP_ACTIVE_PROGRESS);
134 }
135
137 {
138 $this->tabs_gui->addTarget('trac_objects',
139 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
140 "","","",$a_active == self::LP_ACTIVE_OBJECTS);
141 }
142 break;
143
144
146 // #12771 - do not show status if learning progress is deactivated
147 include_once './Services/Object/classes/class.ilObjectLP.php';
148 $olp = ilObjectLP::getInstance($this->obj_id);
149 if($olp->isActive())
150 {
151 $has_read = $rbacsystem->checkAccess('read_learning_progress',$this->getRefId());
152
153 if($this->isAnonymized() || !$has_read)
154 {
155 $this->ctrl->setParameterByClass('illplistofprogressgui','user_id',$this->getUserId());
156 $this->tabs_gui->addSubTabTarget('trac_progress',
157 $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
158 "","","",$a_active == self::LP_ACTIVE_PROGRESS);
159 }
160 else
161 {
162 // Check if it is a course
163 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) == 'crs') ?
164 'trac_crs_objects' :
165 'trac_objects';
166
167 $this->tabs_gui->addSubTabTarget($sub_tab,
168 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
169 "","","",$a_active == self::LP_ACTIVE_OBJECTS);
170 }
171
172 if($has_read)
173 {
174 if(!$this->isAnonymized() && !in_array($this->obj_type, array('tst', 'htlm', 'exc', 'sess')) && !($olp instanceof ilPluginLP))
175 {
176 $this->tabs_gui->addSubTabTarget("trac_matrix",
177 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showUserObjectMatrix'),
178 "", "", "", $a_active == self::LP_ACTIVE_MATRIX);
179 }
180
181 $this->tabs_gui->addSubTabTarget("trac_summary",
182 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui", 'showObjectSummary'),
183 "", "", "", $a_active == self::LP_ACTIVE_SUMMARY);
184 }
185 }
186 if(!($olp instanceof ilPluginLP) &&
187 $rbacsystem->checkAccess('edit_learning_progress',$this->getRefId()))
188 {
189 $this->tabs_gui->addSubTabTarget('trac_settings',
190 $this->ctrl->getLinkTargetByClass('illplistofsettingsgui',''),
191 "","","",$a_active == self::LP_ACTIVE_SETTINGS);
192 }
193 break;
194
196 /*
197 $this->tabs_gui->addSubTabTarget('trac_progress',
198 $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
199 "","","",$a_active == self::LP_ACTIVE_PROGRESS);
200 */
201 $this->tabs_gui->addSubTabTarget('trac_objects',
202 $this->ctrl->getLinkTargetByClass("illplistofobjectsgui",''),
203 "","","",$a_active == self::LP_ACTIVE_OBJECTS);
204 break;
205
208 // No tabs default class is lpprogressgui
209 break;
210
211 default:
212 die ('No valid mode given');
213 break;
214 }
215
216 return true;
217 }
static _enabledUserRelatedData()
check wether user related tracking is enabled or not

References ilObjUserTracking\_enabledUserRelatedData(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ilObjectLP\getInstance(), getMode(), getRefId(), getUserId(), isAnonymized(), LP_ACTIVE_MATRIX, LP_ACTIVE_OBJECTS, LP_ACTIVE_SETTINGS, LP_ACTIVE_SUMMARY, LP_CONTEXT_ADMINISTRATION, LP_CONTEXT_ORG_UNIT, LP_CONTEXT_PERSONAL_DESKTOP, LP_CONTEXT_REPOSITORY, and LP_CONTEXT_USER_FOLDER.

Referenced by ilLearningProgressGUI\executeCommand().

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

◆ __showEditUser()

ilLearningProgressBaseGUI::__showEditUser (   $a_user_id,
  $a_ref_id,
  $a_cancel,
  $a_sub_id = false 
)

Definition at line 715 of file class.ilLearningProgressBaseGUI.php.

716 {
717 global $ilCtrl;
718
719 if(!$a_sub_id)
720 {
721 $obj_id = ilObject::_lookupObjId($a_ref_id);
722 }
723 else
724 {
725 $ilCtrl->setParameter($this,'userdetails_id',$a_sub_id);
726 $obj_id = ilObject::_lookupObjId($a_sub_id);
727 }
728
729 $ilCtrl->setParameter($this, 'user_id', $a_user_id);
730 $ilCtrl->setParameter($this, 'details_id', $a_ref_id);
731
732 $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
733
734 return $form->getHTML();
735 }
initEditUserForm($a_user_id, $a_obj_id, $a_cancel=null)
static _lookupObjId($a_id)
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ilObject\_lookupObjId(), and initEditUserForm().

Referenced by ilLPListOfObjectsGUI\editUser().

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

◆ __showImageByStatus()

ilLearningProgressBaseGUI::__showImageByStatus ( $tpl,
  $a_status,
  $tpl_prefix = "" 
)

Definition at line 286 of file class.ilLearningProgressBaseGUI.php.

287 {
288 return ilLearningProgressBaseGUI::_showImageByStatus($tpl,$a_status,$tpl_prefix);
289 }
static _showImageByStatus(&$tpl, $a_status, $tpl_prefix="")

References $tpl, and _showImageByStatus().

+ Here is the call graph for this function:

◆ __showObjectDetails()

ilLearningProgressBaseGUI::__showObjectDetails ( $info,
  $item_id = 0,
  $add_section = true 
)

show details about current object.

Uses an existing info_gui object.

Definition at line 384 of file class.ilLearningProgressBaseGUI.php.

385 {
386 global $ilObjDataCache;
387
388 $details_id = $item_id ? $item_id : $this->details_id;
389
390 include_once 'Services/Object/classes/class.ilObjectLP.php';
391 $olp = ilObjectLP::getInstance($details_id);
392 $mode = $olp->getCurrentMode();
393
394 include_once './Services/MetaData/classes/class.ilMDEducational.php';
397 {
398 // Section object details
399 if($add_section)
400 {
401 $info->addSection($this->lng->txt('details'));
402 }
403
405 {
406 $info->addProperty($this->lng->txt('trac_required_visits'), ilLPObjSettings::_lookupVisits($details_id));
407 }
408
409 if($seconds = ilMDEducational::_getTypicalLearningTimeSeconds($details_id))
410 {
411 $info->addProperty($this->lng->txt('meta_typical_learning_time'), ilFormat::_secondsToString($seconds));
412 }
413
414 return true;
415 }
416 return false;
417 }

References $mode, ilMDEducational\_getTypicalLearningTimeSeconds(), ilLPObjSettings\_lookupVisits(), ilFormat\_secondsToString(), ilObjectLP\getInstance(), and ilLPObjSettings\LP_MODE_VISITS.

Referenced by ilLPListOfObjectsGUI\details(), ilLPListOfObjectsGUI\editUser(), ilLPListOfObjectsGUI\showUserObjectMatrix(), and ilLPListOfObjectsGUI\userDetails().

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

◆ __sort()

ilLearningProgressBaseGUI::__sort (   $a_ids,
  $a_table,
  $a_field,
  $a_id_name 
)

Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.

Parameters
arrayArray of ids
stringtable name
stringtable field
stringid name
Returns
array sorted ids

@access protected

Definition at line 559 of file class.ilLearningProgressBaseGUI.php.

560 {
561 global $ilDB;
562
563 if(!$a_ids)
564 {
565 return array();
566 }
567
568 // comment by mjansen: Requesting database in gui classes?
569
570 // use database to sort user array
571 $where = "WHERE ".$ilDB->in($a_id_name, $a_ids, false, 'integer')." ";
572
573 $query = "SELECT ".$a_id_name." FROM ".$a_table." ".
574 $where.
575 "ORDER BY ".$a_field;
576
577 $res = $ilDB->query($query);
578 while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
579 {
580 $ids[] = $row->$a_id_name;
581 }
582 return $ids ? $ids : array();
583 }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

◆ __updateUser()

ilLearningProgressBaseGUI::__updateUser (   $user_id,
  $obj_id 
)

Definition at line 737 of file class.ilLearningProgressBaseGUI.php.

738 {
739 $form = $this->initEditUserForm($user_id, $obj_id);
740 if($form->checkInput())
741 {
742 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
743
744 $marks = new ilLPMarks($obj_id, $user_id);
745 $marks->setMark($form->getInput("mark"));
746 $marks->setComment($form->getInput("comment"));
747
748 $do_lp = false;
749
750 // status/completed is optional
751 $status = $form->getItemByPostVar("completed");
752 if(is_object($status))
753 {
754 if($marks->getCompleted() != $form->getInput("completed"))
755 {
756 $marks->setCompleted($form->getInput("completed"));
757 $do_lp = true;
758 }
759 }
760
761 $marks->update();
762
763 // #11600
764 if($do_lp)
765 {
766 include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
767 ilLPStatusWrapper::_updateStatus($obj_id, $user_id);
768 }
769 }
770 }
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.

References ilLPStatusWrapper\_updateStatus(), and initEditUserForm().

Referenced by ilLPListOfObjectsGUI\updateUser().

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

◆ _getImagePathForStatus()

ilLearningProgressBaseGUI::_getImagePathForStatus (   $a_status)

Get image path for status.

Definition at line 306 of file class.ilLearningProgressBaseGUI.php.

307 {
308 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
309
310 // constants are either number or string, so make comparison string-based
311 switch((string)$a_status)
312 {
316 return ilUtil::getImagePath('scorm/incomplete.svg');
317 break;
318
322 return ilUtil::getImagePath('scorm/complete.svg');
323 break;
324
328 return ilUtil::getImagePath('scorm/not_attempted.svg');
329 break;
330
333 return ilUtil::getImagePath('scorm/failed.svg');
334 break;
335
336 default:
337 return ilUtil::getImagePath('scorm/not_attempted.svg');
338 break;
339 }
340 }
const LP_STATUS_NOT_PARTICIPATED
const LP_STATUS_NOT_REGISTERED
const LP_STATUS_PARTICIPATED
const LP_STATUS_REGISTERED

References ilUtil\getImagePath(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ilLPStatus\LP_STATUS_NOT_PARTICIPATED, ilLPStatus\LP_STATUS_NOT_REGISTERED, ilLPStatus\LP_STATUS_PARTICIPATED, and ilLPStatus\LP_STATUS_REGISTERED.

Referenced by __appendLPDetails(), ilLPObjectStatisticsLPTableGUI\__construct(), _showImageByStatus(), ilLMExplorerGUI\checkLPIcon(), ilLPProgressTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilLPObjectStatisticsLPTableGUI\getDetailItems(), ilTrSummaryTableGUI\getItems(), ilDataCollectionRecordListTableGUI\getStatus(), ilLearningProgressGUI\initCollectionManualForm(), ilSCORM2004TrackingItemsTableGUI\parseValue(), ilSCORMTrackingItemsTableGUI\parseValue(), ilLPTableBaseGUI\parseValue(), ilLPStatus\preloadListGUIData(), ilPortfolioPageGUI\renderMyCourses(), and ilLearningProgressGUI\showtlt().

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

◆ _getStatusText()

ilLearningProgressBaseGUI::_getStatusText (   $a_status)

Get status alt text.

Definition at line 345 of file class.ilLearningProgressBaseGUI.php.

346 {
347 global $lng;
348
349 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
350//echo "#".$a_status."#";
351 switch($a_status)
352 {
355
358
361
362 default:
364 {
366 }
367 return $lng->txt($a_status);
368 }
369 }

References $lng, ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by __appendLPDetails(), ilLPObjectStatisticsLPTableGUI\__construct(), ilTrSummaryTableGUI\fillHeaderCSV(), ilTrSummaryTableGUI\fillHeaderExcel(), ilLPProgressTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilSCORM2004TrackingItemsTableGUI\fillRowCSV(), ilSCORMTrackingItemsTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilSCORM2004TrackingItemsTableGUI\fillRowExcel(), ilSCORMTrackingItemsTableGUI\fillRowExcel(), ilLPProgressTableGUI\fillRowExcel(), ilTrMatrixTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), ilLPObjectStatisticsLPTableGUI\getDetailItems(), ilLPObjectStatisticsLPTableGUI\getGraph(), ilTrSummaryTableGUI\getItems(), ilLearningProgressGUI\initCollectionManualForm(), ilLPObjectStatisticsLPTableGUI\initFilter(), ilSCORM2004TrackingItemsTableGUI\parseValue(), ilSCORMTrackingItemsTableGUI\parseValue(), ilLPTableBaseGUI\parseValue(), ilLPStatus\preloadListGUIData(), ilPortfolioPageGUI\renderMyCourses(), and ilLearningProgressGUI\showtlt().

+ Here is the caller graph for this function:

◆ _showImageByStatus()

static ilLearningProgressBaseGUI::_showImageByStatus ( $tpl,
  $a_status,
  $tpl_prefix = "" 
)
static

Definition at line 292 of file class.ilLearningProgressBaseGUI.php.

293 {
294 global $lng;
295
296 $tpl->setVariable($tpl_prefix."STATUS_IMG",
298 $tpl->setVariable($tpl_prefix."STATUS_ALT",$lng->txt($a_status));
299
300 return true;
301 }

References $lng, $tpl, and _getImagePathForStatus().

Referenced by __showImageByStatus().

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

◆ getMode()

◆ getObjId()

◆ getRefId()

◆ getUserId()

ilLearningProgressBaseGUI::getUserId ( )

Definition at line 94 of file class.ilLearningProgressBaseGUI.php.

95 {
96 if($this->usr_id)
97 {
98 return $this->usr_id;
99 }
100 if((int) $_GET['user_id'])
101 {
102 return (int) $_GET['user_id'];
103 }
104 return 0;
105 }
$_GET["client_id"]

References $_GET.

Referenced by __setSubTabs(), ilLearningProgressGUI\executeCommand(), ilLPListOfProgressGUI\executeCommand(), and ilLPListOfProgressGUI\show().

+ Here is the caller graph for this function:

◆ ilLearningProgressBaseGUI()

ilLearningProgressBaseGUI::ilLearningProgressBaseGUI (   $a_mode,
  $a_ref_id = 0,
  $a_usr_id = 0 
)

Definition at line 49 of file class.ilLearningProgressBaseGUI.php.

50 {
51 global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilTabs;
52
53 $this->tpl =& $tpl;
54 $this->ctrl =& $ilCtrl;
55 $this->lng =& $lng;
56 $this->lng->loadLanguageModule('trac');
57 $this->tabs_gui =& $ilTabs;
58
59 $this->mode = $a_mode;
60 $this->ref_id = $a_ref_id;
61 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
62 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
63 $this->usr_id = $a_usr_id;
64
65 $this->anonymized = (bool)!ilObjUserTracking::_enabledUserRelatedData();
66 if(!$this->anonymized && $this->obj_id)
67 {
68 include_once "Services/Object/classes/class.ilObjectLP.php";
69 $olp = ilObjectLP::getInstance($this->obj_id);
70 $this->anonymized = $olp->isAnonymized();
71 }
72 }

References $ilCtrl, $lng, $tpl, ilObjUserTracking\_enabledUserRelatedData(), and ilObjectLP\getInstance().

+ Here is the call graph for this function:

◆ initEditUserForm()

ilLearningProgressBaseGUI::initEditUserForm (   $a_user_id,
  $a_obj_id,
  $a_cancel = null 
)
protected

Definition at line 657 of file class.ilLearningProgressBaseGUI.php.

658 {
659 global $lng, $ilCtrl;
660
661 include_once 'Services/Object/classes/class.ilObjectLP.php';
662 $olp = ilObjectLP::getInstance($a_obj_id);
663 $lp_mode = $olp->getCurrentMode();
664
665 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
666 $form = new ilPropertyFormGUI();
667
668 $form->setFormAction($ilCtrl->getFormAction($this, "updateUser"));
669
670 $form->setTitle($lng->txt("edit").": ".ilObject::_lookupTitle($a_obj_id));
671 $form->setDescription($lng->txt('trac_mode').": ".$olp->getModeText($lp_mode));
672
673 include_once "Services/User/classes/class.ilUserUtil.php";
674 $user = new ilNonEditableValueGUI($lng->txt("user"), null, true);
675 $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
676 $form->addItem($user);
677
678 include_once 'Services/Tracking/classes/class.ilLPMarks.php';
679 $marks = new ilLPMarks($a_obj_id, $a_user_id);
680
681 $type = ilObject::_lookupType($a_obj_id);
682 if($type != 'lm')
683 {
684 $mark = new ilTextInputGUI($lng->txt("trac_mark"), "mark");
685 $mark->setValue($marks->getMark());
686 $mark->setMaxLength(32);
687 $form->addItem($mark);
688 }
689
690 $comm = new ilTextInputGUI($lng->txt("trac_comment"), "comment");
691 $comm->setValue($marks->getComment());
692 $form->addItem($comm);
693
694 if($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
696 {
697 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
698 $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
699
700 $status = new ilCheckboxInputGUI($lng->txt('trac_completed'), "completed");
701 $status->setChecked(($completed == ilLPStatus::LP_STATUS_COMPLETED_NUM));
702 $form->addItem($status);
703 }
704
705 $form->addCommandButton("updateUser", $lng->txt('save'));
706
707 if($a_cancel)
708 {
709 $form->addCommandButton($a_cancel, $lng->txt('cancel'));
710 }
711
712 return $form;
713 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a property form user interface.
This class represents a text property in a property form.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true)
Default behaviour is:

References $ilCtrl, $lng, ilLPStatus\_lookupStatus(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilObjectLP\getInstance(), ilUserUtil\getNamePresentation(), ilLPObjSettings\LP_MODE_MANUAL, ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, and ilLPStatus\LP_STATUS_COMPLETED_NUM.

Referenced by __showEditUser(), and __updateUser().

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

◆ isAnonymized()

ilLearningProgressBaseGUI::isAnonymized ( )

◆ isObjectOffline()

static ilLearningProgressBaseGUI::isObjectOffline (   $a_obj_id,
  $a_type = null 
)
static

Definition at line 772 of file class.ilLearningProgressBaseGUI.php.

773 {
774 global $objDefinition, $ilObjDataCache;
775
776 if(!$a_type)
777 {
778 $a_type = $ilObjDataCache->lookupType($a_obj_id);
779 }
780
781 if($objDefinition->isPluginTypeName($a_type))
782 {
783 return false;
784 }
785
786 $class = "ilObj".$objDefinition->getClassName($a_type)."Access";
787 include_once $objDefinition->getLocation($a_type)."/class.".$class.".php";
788 return call_user_func(array($class,'_isOffline'), $a_obj_id);
789
790 // PHP 5.3 only ?
791 //return $class::_isOffline($obj_id);
792 }

Referenced by ilTrSummaryTableGUI\getItems(), and ilLPProgressTableGUI\getItems().

+ Here is the caller graph for this function:

Field Documentation

◆ $anonymized

ilLearningProgressBaseGUI::$anonymized
protected

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

Referenced by isAnonymized().

◆ $ctrl

ilLearningProgressBaseGUI::$ctrl = null

Definition at line 24 of file class.ilLearningProgressBaseGUI.php.

◆ $lng

◆ $mode

ilLearningProgressBaseGUI::$mode = 0

◆ $ref_id

ilLearningProgressBaseGUI::$ref_id = 0

Definition at line 26 of file class.ilLearningProgressBaseGUI.php.

Referenced by getRefId().

◆ $tpl

◆ LP_ACTIVE_MATRIX

const ilLearningProgressBaseGUI::LP_ACTIVE_MATRIX = 11

Definition at line 47 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJECTS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJECTS = 2

Definition at line 38 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJSTATACCESS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATACCESS = 7

Definition at line 43 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_OBJSTATADMIN

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATADMIN = 10

Definition at line 46 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_OBJSTATDAILY

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATDAILY = 9

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

◆ LP_ACTIVE_OBJSTATTYPES

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATTYPES = 8

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

◆ LP_ACTIVE_PROGRESS

const ilLearningProgressBaseGUI::LP_ACTIVE_PROGRESS = 3

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

◆ LP_ACTIVE_SETTINGS

const ilLearningProgressBaseGUI::LP_ACTIVE_SETTINGS = 1

Definition at line 37 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_SUMMARY

const ilLearningProgressBaseGUI::LP_ACTIVE_SUMMARY = 6

Definition at line 42 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_USERS

const ilLearningProgressBaseGUI::LP_ACTIVE_USERS = 5

Definition at line 41 of file class.ilLearningProgressBaseGUI.php.

◆ LP_CONTEXT_ADMINISTRATION

const ilLearningProgressBaseGUI::LP_CONTEXT_ADMINISTRATION = 2

◆ LP_CONTEXT_ORG_UNIT

◆ LP_CONTEXT_PERSONAL_DESKTOP

const ilLearningProgressBaseGUI::LP_CONTEXT_PERSONAL_DESKTOP = 1

◆ LP_CONTEXT_REPOSITORY

◆ LP_CONTEXT_USER_FOLDER

const ilLearningProgressBaseGUI::LP_CONTEXT_USER_FOLDER = 4

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