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);
45 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
71 $this->lng->loadLanguageModule(
'trac');
72 $this->tabs_gui =& $ilTabs;
74 $this->mode = $a_mode;
75 $this->ref_id = $a_ref_id;
76 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
77 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
78 $this->usr_id = $a_usr_id;
85 return $this->active_pdf;
90 include_once
'Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
92 $this->active_pdf = $rpc_server->getHost() ?
true :
false;
97 return $this->anonymized;
102 switch($this->obj_type)
105 include_once
'./Modules/Test/classes/class.ilObjTest.php';
128 return $this->obj_id;
135 return $this->usr_id;
137 if((
int)
$_GET[
'user_id'])
139 return (
int) $_GET[
'user_id'];
146 $this->statistics_activated = $a_act;
152 if(strlen(
$cmd = $this->ctrl->getCmd()))
161 global $rbacsystem,$ilObjDataCache;
169 $this->tabs_gui->addSubTabTarget(
'trac_progress',
170 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
172 $this->tabs_gui->addSubTabTarget(
'trac_objects',
173 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
180 if($rbacsystem->checkAccess(
'edit_learning_progress',$this->getRefId()))
184 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
185 $this->tabs_gui->addSubTabTarget(
'trac_progress',
186 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
192 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
196 $this->tabs_gui->addSubTabTarget($sub_tab,
197 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
201 if ($this->statistics_activated)
203 $this->tabs_gui->addSubTabTarget(
'trac_lm_statistics',
204 $this->ctrl->getLinkTargetByClass(
'illmstatisticsgui',
''),
208 $this->tabs_gui->addSubTabTarget(
'trac_settings',
209 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
217 $this->tabs_gui->addSubTabTarget(
'trac_progress',
218 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
220 $this->tabs_gui->addSubTabTarget(
'trac_objects',
221 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
231 die (
'No valid mode given');
244 $this->tpl->show(
true);
252 $this->tpl->setCurrentBlock(
"header_image");
254 $this->tpl->parseCurrentBlock();
255 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
"personal_desktop"));
290 $path_arr = $tree->getPathFull($a_ref_id);
292 foreach($tree->getPathFull($a_ref_id) as
$data)
298 $path .=
$data[
'title'];
300 $a_tpl->setCurrentBlock(
"path_item");
301 $a_tpl->setVariable(
"PATH_ITEM",$path);
302 $a_tpl->parseCurrentBlock();
304 $a_tpl->setCurrentBlock(
"path");
305 $a_tpl->parseCurrentBlock();
317 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$this->lng->txt($a_status));
323 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$this->lng->txt($a_status));
330 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$this->lng->txt($a_status));
335 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$this->lng->txt($a_status));
345 include_once
"./Services/Table/classes/class.ilTableGUI.php";
356 global $ilObjDataCache;
358 $details_id = $item_id ? $item_id : $this->details_id;
362 $info->addSection($this->lng->txt(
'details'));
363 $info->addProperty($this->lng->txt(
'title'),$ilObjDataCache->lookupTitle($details_id));
364 if(strlen($desc = $ilObjDataCache->lookupDescription($details_id)))
366 $info->addProperty($this->lng->txt(
'description'),$desc);
375 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
384 global $ilObjDataCache;
386 $type = $ilObjDataCache->lookupType($item_id);
389 $info->addSection($this->lng->txt(
'trac_learning_progress'));
395 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
398 if($progress[
'access_time'])
400 $info->addProperty($this->lng->txt(
'last_access'),
405 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
407 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
412 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
420 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
425 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
428 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
432 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
438 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
461 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
464 $this->tpl->setCurrentBlock(
"btn_cell");
465 $this->tpl->setVariable(
"BTN_LINK",$a_link);
466 $this->tpl->setVariable(
"BTN_TXT",$a_text);
469 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
472 $this->tpl->parseCurrentBlock();
488 function __sort($a_ids,$a_table,$a_field,$a_id_name)
498 $where =
"WHERE ".$a_id_name.
" IN ('";
499 $where .= implode(
"','",$a_ids);
502 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
504 "ORDER BY ".$a_field;
506 $res = $ilDB->query($query);
509 $ids[] = $row->$a_id_name;
511 return $ids ? $ids : array();
521 return sprintf(
"%.2f%%",$reached / $max * 100);
526 global $ilObjDataCache;
528 foreach($a_items as $item_id)
531 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
532 if($this->obj_data[$item_id][
'mode'] ==
LP_MODE_TLT)
534 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
539 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
544 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
554 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
555 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
557 $tpl->setVariable(
"IMG_IN_PROGRESS",
559 $tpl->setVariable(
"IMG_COMPLETED",
561 $tpl->setVariable(
"IMG_FAILED",
563 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
564 $lng->txt(
"trac_not_attempted"));
565 $tpl->setVariable(
"TXT_IN_PROGRESS",
566 $lng->txt(
"trac_in_progress"));
567 $tpl->setVariable(
"TXT_COMPLETED",
568 $lng->txt(
"trac_completed"));
569 $tpl->setVariable(
"TXT_FAILED",
570 $lng->txt(
"trac_failed"));