5 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
57 $this->lng->loadLanguageModule(
'trac');
58 $this->tabs_gui =& $ilTabs;
60 $this->mode = $a_mode;
61 $this->ref_id = $a_ref_id;
62 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
63 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
64 $this->usr_id = $a_usr_id;
67 if(!$this->anonymized && $this->obj_id)
69 include_once
"Services/Object/classes/class.ilObjectLP.php";
71 $this->anonymized = $olp->isAnonymized();
101 if((
int)
$_GET[
'user_id'])
103 return (
int) $_GET[
'user_id'];
110 $this->statistics_activated = $a_act;
116 if(strlen(
$cmd = $this->ctrl->getCmd()))
125 global $rbacsystem,$ilObjDataCache;
131 case self::LP_CONTEXT_PERSONAL_DESKTOP:
133 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
137 $this->tabs_gui->addTarget(
'trac_progress',
138 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
144 $this->tabs_gui->addTarget(
'trac_objects',
145 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
151 case self::LP_CONTEXT_REPOSITORY:
153 if($rbacsystem->checkAccess(
'edit_learning_progress',$this->getRefId()))
156 include_once
'./Services/Object/classes/class.ilObjectLP.php';
162 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
163 $this->tabs_gui->addSubTabTarget(
'trac_progress',
164 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
170 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
174 $this->tabs_gui->addSubTabTarget($sub_tab,
175 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
189 if(!$this->
isAnonymized() && !in_array($this->obj_type, array(
'tst',
'htlm',
'exc')))
191 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
192 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
196 $this->tabs_gui->addSubTabTarget(
"trac_summary",
197 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
201 $this->tabs_gui->addSubTabTarget(
'trac_settings',
202 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
207 case self::LP_CONTEXT_ADMINISTRATION:
213 $this->tabs_gui->addSubTabTarget(
'trac_objects',
214 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
218 case self::LP_CONTEXT_USER_FOLDER:
219 case self::LP_CONTEXT_ORG_UNIT:
224 die (
'No valid mode given');
235 case self::LP_CONTEXT_PERSONAL_DESKTOP:
237 $this->tpl->show(
true);
243 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
249 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
282 $path_arr = $tree->getPathFull($a_ref_id);
284 foreach($tree->getPathFull($a_ref_id) as $data)
290 $path .= $data[
'title'];
292 $a_tpl->setCurrentBlock(
"path_item");
293 $a_tpl->setVariable(
"PATH_ITEM",
$path);
294 $a_tpl->parseCurrentBlock();
296 $a_tpl->setCurrentBlock(
"path");
297 $a_tpl->parseCurrentBlock();
312 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
314 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
324 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
327 switch((
string)$a_status)
365 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
383 return $lng->txt($a_status);
391 include_once
"./Services/Table/classes/class.ilTableGUI.php";
402 global $ilObjDataCache;
404 $details_id = $item_id ? $item_id : $this->details_id;
406 include_once
'Services/Object/classes/class.ilObjectLP.php';
408 $mode = $olp->getCurrentMode();
410 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
415 $info->addSection($this->lng->txt(
'details'));
439 if(!is_object($a_user))
444 if($a_user->getId() != $ilUser->getId())
446 $info->addSection($this->lng->txt(
"trac_user_data"));
449 $info->addProperty($this->lng->txt(
'last_login'),
451 $info->addProperty($this->lng->txt(
'trac_total_online'),
459 global $ilObjDataCache;
461 $type = $ilObjDataCache->lookupType($item_id);
464 $info->addSection($this->lng->txt(
'trac_learning_progress'));
470 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
473 if($progress[
'access_time'])
475 $info->addProperty($this->lng->txt(
'last_access'),
480 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
482 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
489 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
493 $info->addProperty($this->lng->txt(
'trac_status'),
494 ilUtil::img($status_path, $status_text).
" ".$status_text);
503 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
507 $info->addProperty($this->lng->txt(
'trac_status'),
508 ilUtil::img($status_path, $status_text).
" ".$status_text);
513 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
516 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
520 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
526 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
529 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
552 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
555 $this->tpl->setCurrentBlock(
"btn_cell");
556 $this->tpl->setVariable(
"BTN_LINK",$a_link);
557 $this->tpl->setVariable(
"BTN_TXT",$a_text);
560 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
563 $this->tpl->parseCurrentBlock();
579 function __sort($a_ids,$a_table,$a_field,$a_id_name)
591 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
593 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
595 "ORDER BY ".$a_field;
600 $ids[] =
$row->$a_id_name;
602 return $ids ? $ids : array();
612 return sprintf(
"%d%%",$reached / $max * 100);
617 global $ilObjDataCache;
619 include_once
'Services/Object/classes/class.ilObjectLP.php';
621 foreach($a_items as $item_id)
625 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
626 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
629 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
638 $collection = $olp->getCollectionInstance();
641 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
651 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
652 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
654 $tpl->setVariable(
"IMG_IN_PROGRESS",
656 $tpl->setVariable(
"IMG_COMPLETED",
658 $tpl->setVariable(
"IMG_FAILED",
660 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
661 $lng->txt(
"trac_not_attempted"));
662 $tpl->setVariable(
"TXT_IN_PROGRESS",
663 $lng->txt(
"trac_in_progress"));
664 $tpl->setVariable(
"TXT_COMPLETED",
665 $lng->txt(
"trac_completed"));
666 $tpl->setVariable(
"TXT_FAILED",
667 $lng->txt(
"trac_failed"));
675 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
679 $obj_id = $ilObjDataCache->lookupObjId($a_ref_id);
683 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
684 $obj_id = $ilObjDataCache->lookupObjId($a_sub_id);
687 $marks =
new ilLPMarks($obj_id, $a_user_id);
689 $tpl =
new ilTemplate(
'tpl.lp_edit_user.html',
true,
true,
'Services/Tracking');
691 $tpl->setVariable(
"OBJ_TITLE", $lng->txt(
"edit").
": ".$ilObjDataCache->lookupTitle($obj_id));
693 include_once
'Services/Object/classes/class.ilObjectLP.php';
695 $lp_mode = $olp->getCurrentMode();
697 $tpl->setVariable(
"OBJ_SUBTITLE", $this->lng->txt(
'trac_mode').
": ".$olp->getModeText($lp_mode));
699 $ilCtrl->setParameter($this,
'user_id',$a_user_id);
700 $ilCtrl->setParameter($this,
'details_id',$a_ref_id);
701 $tpl->setVariable(
"FORMACTION",$ilCtrl->getFormAction($this));
704 $tpl->setVariable(
"ALT_IMG",$ilObjDataCache->lookupTitle($a_user_id));
705 $tpl->setVariable(
"TXT_LP",$lng->txt(
'trac_learning_progress_tbl_header'));
709 $type = $ilObjDataCache->lookupType($obj_id);
712 $tpl->setVariable(
"TXT_MARK",$lng->txt(
'trac_mark'));
716 $tpl->setVariable(
"TXT_COMMENT",$lng->txt(
'trac_comment'));
720 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
723 $tpl->setVariable(
"mode_manual");
724 $tpl->setVariable(
"TXT_COMPLETED",$lng->txt(
'trac_completed'));
730 $tpl->setVariable(
"TXT_CANCEL",$lng->txt(
'cancel'));
731 $tpl->setVariable(
"TXT_SAVE",$lng->txt(
'save'));
732 $tpl->setVariable(
"CMD_CANCEL", $a_cancel);
741 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
743 $marks =
new ilLPMarks($obj_id, $user_id);
748 if($marks->getCompleted() != (bool)
$_POST[
'completed'])
750 $marks->setCompleted((
bool)
$_POST[
'completed']);
759 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
766 global $objDefinition, $ilObjDataCache;
770 $a_type = $ilObjDataCache->lookupType($a_obj_id);
773 if($objDefinition->isPluginTypeName($a_type))
778 $class =
"ilObj".$objDefinition->getClassName($a_type).
"Access";
779 include_once $objDefinition->getLocation($a_type).
"/class.".$class.
".php";
780 return call_user_func(array($class,
'_isOffline'), $a_obj_id);