35 define(
"LP_MODE_PERSONAL_DESKTOP",1);
36 define(
"LP_MODE_ADMINISTRATION",2);
37 define(
"LP_MODE_REPOSITORY",3);
38 define(
"LP_MODE_USER_FOLDER",4);
40 define(
"LP_ACTIVE_SETTINGS",1);
41 define(
"LP_ACTIVE_OBJECTS",2);
42 define(
"LP_ACTIVE_PROGRESS",3);
43 define(
"LP_ACTIVE_LM_STATISTICS",4);
44 define(
"LP_ACTIVE_USERS",5);
45 define(
"LP_ACTIVE_SUMMARY",6);
47 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
73 $this->lng->loadLanguageModule(
'trac');
74 $this->tabs_gui =& $ilTabs;
76 $this->mode = $a_mode;
77 $this->ref_id = $a_ref_id;
78 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
79 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
80 $this->usr_id = $a_usr_id;
87 return $this->active_pdf;
92 include_once
'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
94 $this->active_pdf = $rpc_server->getHost() ?
true :
false;
99 return $this->anonymized;
104 switch($this->obj_type)
107 include_once
'./Modules/Test/classes/class.ilObjTest.php';
130 return $this->obj_id;
139 if((
int)
$_GET[
'user_id'])
141 return (
int) $_GET[
'user_id'];
148 $this->statistics_activated = $a_act;
154 if(strlen(
$cmd = $this->ctrl->getCmd()))
163 global $rbacsystem,$ilObjDataCache,
$lng;
171 $this->tabs_gui->addSubTabTarget(
'trac_progress',
172 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
174 $this->tabs_gui->addSubTabTarget(
'trac_objects',
175 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
182 if($rbacsystem->checkAccess(
'edit_learning_progress',$this->getRefId()))
186 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
187 $this->tabs_gui->addSubTabTarget(
'trac_progress',
188 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
194 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
198 $this->tabs_gui->addSubTabTarget($sub_tab,
199 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
204 if ($this->statistics_activated)
206 $this->tabs_gui->addSubTabTarget(
'trac_lm_statistics',
207 $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''),
211 if(!$this->
isAnonymized() && !in_array($this->obj_type, array(
'tst',
'lm',
'htlm',
'exc')))
213 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
214 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
215 "",
"",
"", $a_active == LP_ACTIVE_MATRIX);
218 $this->tabs_gui->addSubTabTarget(
"trac_summary",
219 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
222 $this->tabs_gui->addSubTabTarget(
'trac_settings',
223 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
230 $this->tabs_gui->addSubTabTarget(
'trac_progress',
231 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
233 $this->tabs_gui->addSubTabTarget(
'trac_objects',
234 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
244 die (
'No valid mode given');
257 $this->tpl->show(
true);
265 $this->tpl->setCurrentBlock(
"header_image");
267 $this->tpl->parseCurrentBlock();
268 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
"personal_desktop"));
301 $path_arr = $tree->getPathFull($a_ref_id);
303 foreach($tree->getPathFull($a_ref_id) as
$data)
311 $a_tpl->setCurrentBlock(
"path_item");
312 $a_tpl->setVariable(
"PATH_ITEM",
$path);
313 $a_tpl->parseCurrentBlock();
315 $a_tpl->setCurrentBlock(
"path");
316 $a_tpl->parseCurrentBlock();
331 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
333 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
343 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
346 switch((
string)$a_status)
384 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
402 return $lng->txt($a_status);
410 include_once
"./Services/Table/classes/class.ilTableGUI.php";
421 global $ilObjDataCache;
423 $details_id = $item_id ? $item_id : $this->details_id;
425 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
431 $info->addSection($this->lng->txt(
'details'));
464 if(!is_object($a_user))
469 if($a_user->getId() != $ilUser->getId())
471 $info->addSection($this->lng->txt(
"trac_user_data"));
474 $info->addProperty($this->lng->txt(
'last_login'),
476 $info->addProperty($this->lng->txt(
'trac_total_online'),
484 global $ilObjDataCache;
486 $type = $ilObjDataCache->lookupType($item_id);
489 $info->addSection($this->lng->txt(
'trac_learning_progress'));
495 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
498 if($progress[
'access_time'])
500 $info->addProperty($this->lng->txt(
'last_access'),
505 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
507 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
512 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
520 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
525 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
528 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
532 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
538 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
561 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
564 $this->tpl->setCurrentBlock(
"btn_cell");
565 $this->tpl->setVariable(
"BTN_LINK",$a_link);
566 $this->tpl->setVariable(
"BTN_TXT",$a_text);
569 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
572 $this->tpl->parseCurrentBlock();
588 function __sort($a_ids,$a_table,$a_field,$a_id_name)
600 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
602 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
604 "ORDER BY ".$a_field;
609 $ids[] =
$row->$a_id_name;
611 return $ids ? $ids : array();
621 return sprintf(
"%d%%",$reached / $max * 100);
626 global $ilObjDataCache;
628 foreach($a_items as $item_id)
631 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
632 if($this->obj_data[$item_id][
'mode'] ==
LP_MODE_TLT)
634 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
639 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
644 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
654 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
655 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
657 $tpl->setVariable(
"IMG_IN_PROGRESS",
659 $tpl->setVariable(
"IMG_COMPLETED",
661 $tpl->setVariable(
"IMG_FAILED",
663 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
664 $lng->txt(
"trac_not_attempted"));
665 $tpl->setVariable(
"TXT_IN_PROGRESS",
666 $lng->txt(
"trac_in_progress"));
667 $tpl->setVariable(
"TXT_COMPLETED",
668 $lng->txt(
"trac_completed"));
669 $tpl->setVariable(
"TXT_FAILED",
670 $lng->txt(
"trac_failed"));
678 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
682 $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
686 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
687 $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
690 $marks =
new ilLPMarks($obj_id, $a_user_id);
692 $tpl =
new ilTemplate(
'tpl.lp_edit_user.html',
true,
true,
'Services/Tracking');
694 $tpl->setVariable(
"OBJ_TITLE", $lng->txt(
"edit").
": ".$ilObjDataCache->lookupTitle($obj_id));
697 $ilCtrl->setParameter($this,
'user_id',$a_user_id);
698 $ilCtrl->setParameter($this,
'details_id',$a_ref_id);
699 $tpl->setVariable(
"FORMACTION",$ilCtrl->getFormAction($this));
702 $tpl->setVariable(
"ALT_IMG",$ilObjDataCache->lookupTitle($a_user_id));
703 $tpl->setVariable(
"TXT_LP",$lng->txt(
'trac_learning_progress_tbl_header'));
707 $type = $ilObjDataCache->lookupType($obj_id);
710 $tpl->setVariable(
"TXT_MARK",$lng->txt(
'trac_mark'));
714 $tpl->setVariable(
"TXT_COMMENT",$lng->txt(
'trac_comment'));
721 $tpl->setVariable(
"mode_manual");
722 $tpl->setVariable(
"TXT_COMPLETED",$lng->txt(
'trac_completed'));
728 $tpl->setVariable(
"TXT_CANCEL",$lng->txt(
'cancel'));
729 $tpl->setVariable(
"TXT_SAVE",$lng->txt(
'save'));
730 $tpl->setVariable(
"CMD_CANCEL", $a_cancel);
737 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
739 $marks =
new ilLPMarks($obj_id, $user_id);
742 $marks->setCompleted((
bool)
$_POST[
'completed']);
745 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");