5 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
56 $this->lng->loadLanguageModule(
'trac');
57 $this->tabs_gui =& $ilTabs;
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;
66 if(!$this->anonymized && $this->obj_id)
68 include_once
"Services/Object/classes/class.ilObjectLP.php";
70 $this->anonymized = $olp->isAnonymized();
100 if((
int)
$_GET[
'user_id'])
102 return (
int) $_GET[
'user_id'];
110 if(strlen(
$cmd = $this->ctrl->getCmd()))
119 global $rbacsystem,$ilObjDataCache;
125 case self::LP_CONTEXT_PERSONAL_DESKTOP:
127 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
131 $this->tabs_gui->addTarget(
'trac_progress',
132 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
138 $this->tabs_gui->addTarget(
'trac_objects',
139 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
145 case self::LP_CONTEXT_REPOSITORY:
147 include_once
'./Services/Object/classes/class.ilObjectLP.php';
151 $has_read = $rbacsystem->checkAccess(
'read_learning_progress',$this->
getRefId());
155 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
156 $this->tabs_gui->addSubTabTarget(
'trac_progress',
157 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
163 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
167 $this->tabs_gui->addSubTabTarget($sub_tab,
168 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
174 if(!$this->
isAnonymized() && !in_array($this->obj_type, array(
'tst',
'htlm',
'exc',
'sess')) && !($olp instanceof
ilPluginLP))
176 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
177 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
181 $this->tabs_gui->addSubTabTarget(
"trac_summary",
182 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
187 $rbacsystem->checkAccess(
'edit_learning_progress',$this->
getRefId()))
189 $this->tabs_gui->addSubTabTarget(
'trac_settings',
190 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
195 case self::LP_CONTEXT_ADMINISTRATION:
201 $this->tabs_gui->addSubTabTarget(
'trac_objects',
202 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
206 case self::LP_CONTEXT_USER_FOLDER:
207 case self::LP_CONTEXT_ORG_UNIT:
212 die (
'No valid mode given');
223 case self::LP_CONTEXT_PERSONAL_DESKTOP:
225 $this->tpl->show(
true);
231 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
233 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
266 $path_arr = $tree->getPathFull($a_ref_id);
268 foreach($tree->getPathFull($a_ref_id) as $data)
274 $path .= $data[
'title'];
276 $a_tpl->setCurrentBlock(
"path_item");
277 $a_tpl->setVariable(
"PATH_ITEM",
$path);
278 $a_tpl->parseCurrentBlock();
280 $a_tpl->setCurrentBlock(
"path");
281 $a_tpl->parseCurrentBlock();
296 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
298 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
308 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
311 switch((
string)$a_status)
349 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
367 return $lng->txt($a_status);
375 include_once
"./Services/Table/classes/class.ilTableGUI.php";
386 global $ilObjDataCache;
388 $details_id = $item_id ? $item_id : $this->details_id;
390 include_once
'Services/Object/classes/class.ilObjectLP.php';
392 $mode = $olp->getCurrentMode();
394 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
401 $info->addSection($this->lng->txt(
'details'));
426 if(!is_object($a_user))
431 if($a_user->getId() != $ilUser->getId())
433 $info->addSection($this->lng->txt(
"trac_user_data"));
436 $info->addProperty($this->lng->txt(
'last_login'),
438 $info->addProperty($this->lng->txt(
'trac_total_online'),
446 global $ilObjDataCache;
448 $type = $ilObjDataCache->lookupType($item_id);
456 $info->addProperty($this->lng->txt(
'trac_mode'),
457 $olp->getModeText($olp->getCurrentMode()));
463 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
466 if($progress[
'access_time'])
468 $info->addProperty($this->lng->txt(
'last_access'),
473 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
475 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
488 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
492 $info->addProperty($this->lng->txt(
'trac_status'),
493 ilUtil::img($status_path, $status_text).
" ".$status_text);
496 $mode = $olp->getCurrentMode();
503 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
505 $info->addProperty($this->lng->txt(
'trac_percentage'), (int)$perc.
"%");
511 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
514 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
518 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
524 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
527 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
559 function __sort($a_ids,$a_table,$a_field,$a_id_name)
571 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
573 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
575 "ORDER BY ".$a_field;
580 $ids[] =
$row->$a_id_name;
582 return $ids ? $ids : array();
592 return sprintf(
"%d%%",$reached / $max * 100);
597 global $ilObjDataCache;
599 include_once
'Services/Object/classes/class.ilObjectLP.php';
601 foreach($a_items as $item_id)
605 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
606 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
609 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
618 $collection = $olp->getCollectionInstance();
621 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
631 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
632 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
634 $tpl->setVariable(
"IMG_IN_PROGRESS",
636 $tpl->setVariable(
"IMG_COMPLETED",
638 $tpl->setVariable(
"IMG_FAILED",
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"));
649 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
652 $panel->setBody(
$tpl->get());
654 return $panel->getHTML();
661 include_once
'Services/Object/classes/class.ilObjectLP.php';
663 $lp_mode = $olp->getCurrentMode();
665 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
668 $form->setFormAction($ilCtrl->getFormAction($this,
"updateUser"));
671 $form->setDescription($lng->txt(
'trac_mode').
": ".$olp->getModeText($lp_mode));
673 include_once
"Services/User/classes/class.ilUserUtil.php";
676 $form->addItem($user);
678 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
679 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
686 $mark->setMaxLength(32);
687 $form->addItem($mark);
691 $comm->
setValue($marks->getComment());
692 $form->addItem($comm);
697 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
702 $form->addItem($status);
705 $form->addCommandButton(
"updateUser", $lng->txt(
'save'));
709 $form->addCommandButton($a_cancel, $lng->txt(
'cancel'));
725 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
729 $ilCtrl->setParameter($this,
'user_id', $a_user_id);
730 $ilCtrl->setParameter($this,
'details_id', $a_ref_id);
734 return $form->getHTML();
740 if($form->checkInput())
742 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
744 $marks =
new ilLPMarks($obj_id, $user_id);
745 $marks->setMark($form->getInput(
"mark"));
746 $marks->setComment($form->getInput(
"comment"));
751 $status = $form->getItemByPostVar(
"completed");
752 if(is_object($status))
754 if($marks->getCompleted() != $form->getInput(
"completed"))
756 $marks->setCompleted($form->getInput(
"completed"));
766 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
774 global $objDefinition, $ilObjDataCache;
778 $a_type = $ilObjDataCache->lookupType($a_obj_id);
781 if($objDefinition->isPluginTypeName($a_type))
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);