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;
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"));
288 $path_arr = $tree->getPathFull($a_ref_id);
290 foreach($tree->getPathFull($a_ref_id) as
$data)
296 $path .=
$data[
'title'];
298 $a_tpl->setCurrentBlock(
"path_item");
299 $a_tpl->setVariable(
"PATH_ITEM",$path);
300 $a_tpl->parseCurrentBlock();
302 $a_tpl->setCurrentBlock(
"path");
303 $a_tpl->parseCurrentBlock();
323 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
329 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
336 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
341 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
351 include_once
"./Services/Table/classes/class.ilTableGUI.php";
362 global $ilObjDataCache;
364 $details_id = $item_id ? $item_id : $this->details_id;
368 $info->addSection($this->lng->txt(
'details'));
369 $info->addProperty($this->lng->txt(
'title'),$ilObjDataCache->lookupTitle($details_id));
370 if(strlen(
$desc = $ilObjDataCache->lookupDescription($details_id)))
372 $info->addProperty($this->lng->txt(
'description'),
$desc);
381 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
390 global $ilObjDataCache;
392 $type = $ilObjDataCache->lookupType($item_id);
395 $info->addSection($this->lng->txt(
'trac_learning_progress'));
401 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
404 if($progress[
'access_time'])
406 $info->addProperty($this->lng->txt(
'last_access'),
411 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
413 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
418 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
426 $info->addProperty($this->lng->txt(
'trac_status'),$this->lng->txt($this->
__readStatus($item_id,$user_id)));
431 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
434 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
438 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
444 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
467 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
470 $this->tpl->setCurrentBlock(
"btn_cell");
471 $this->tpl->setVariable(
"BTN_LINK",$a_link);
472 $this->tpl->setVariable(
"BTN_TXT",$a_text);
475 $this->tpl->setVariable(
"BTN_TARGET",$a_target);
478 $this->tpl->parseCurrentBlock();
494 function __sort($a_ids,$a_table,$a_field,$a_id_name)
506 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
508 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
510 "ORDER BY ".$a_field;
515 $ids[] =
$row->$a_id_name;
517 return $ids ? $ids : array();
527 return sprintf(
"%d%%",$reached / $max * 100);
532 global $ilObjDataCache;
534 foreach($a_items as $item_id)
537 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
538 if($this->obj_data[$item_id][
'mode'] ==
LP_MODE_TLT)
540 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
545 include_once
'./Services/Tracking/classes/class.ilLPObjSettings.php';
550 include_once
'./Services/Tracking/classes/class.ilLPCollectionCache.php';
560 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
561 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
563 $tpl->setVariable(
"IMG_IN_PROGRESS",
565 $tpl->setVariable(
"IMG_COMPLETED",
567 $tpl->setVariable(
"IMG_FAILED",
569 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
570 $lng->txt(
"trac_not_attempted"));
571 $tpl->setVariable(
"TXT_IN_PROGRESS",
572 $lng->txt(
"trac_in_progress"));
573 $tpl->setVariable(
"TXT_COMPLETED",
574 $lng->txt(
"trac_completed"));
575 $tpl->setVariable(
"TXT_FAILED",
576 $lng->txt(
"trac_failed"));