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',
''),
139 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
144 $this->tabs_gui->addTarget(
'trac_objects',
145 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
146 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
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',
''),
165 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
170 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
174 $this->tabs_gui->addSubTabTarget($sub_tab,
175 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
176 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
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'),
193 "",
"",
"", $a_active == self::LP_ACTIVE_MATRIX);
196 $this->tabs_gui->addSubTabTarget(
"trac_summary",
197 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
198 "",
"",
"", $a_active == self::LP_ACTIVE_SUMMARY);
201 $this->tabs_gui->addSubTabTarget(
'trac_settings',
202 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
203 "",
"",
"",$a_active == self::LP_ACTIVE_SETTINGS);
207 case self::LP_CONTEXT_ADMINISTRATION:
213 $this->tabs_gui->addSubTabTarget(
'trac_objects',
214 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
215 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
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)
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);
const LP_STATUS_COMPLETED_NUM
static _lookupStatus($a_obj_id, $a_user_id)
Lookup status.
__readStatus($a_obj_id, $user_id)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
_getProgress($a_user_id, $a_obj_id)
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
const LP_MODE_MANUAL_BY_TUTOR
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_no_raise=false, $a_force_raise=false)
Update status.
static _hasLearningProgressLearner()
const LP_STATUS_PARTICIPATED
_lookupMark($a_usr_id, $a_obj_id)
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
_getImagePathForStatus($a_status)
Get image path for status.
static _hasLearningProgressOtherUsers()
const LP_ACTIVE_LM_STATISTICS
__appendLPDetails(&$info, $item_id, $user_id)
const LP_ACTIVE_OBJSTATADMIN
const LP_CONTEXT_USER_FOLDER
__showButton($a_link, $a_text, $a_target='')
const LP_CONTEXT_ADMINISTRATION
const DB_FETCHMODE_OBJECT
_getStatusText($a_status)
Get status alt text.
const LP_STATUS_IN_PROGRESS
__showObjectDetails(&$info, $item_id=0)
show details about current object.
activateStatistics($a_act=true)
__getPercent($max, $reached)
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
const LP_STATUS_NOT_PARTICIPATED
const LP_ACTIVE_OBJSTATDAILY
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static isObjectOffline($a_obj_id, $a_type=null)
special template class to simplify handling of ITX/PEAR
static _showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
static formatDate(ilDateTime $date)
Format a date public.
static infoPanel($a_keep=true)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
const LP_CONTEXT_PERSONAL_DESKTOP
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const LP_CONTEXT_ORG_UNIT
__readItemStatusInfo($a_items)
__appendUserInfo(&$info, $a_user)
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_REGISTERED
__insertPath(&$a_tpl, $a_ref_id)
insert path
_lookupComment($a_usr_id, $a_obj_id)
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
__showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
const LP_ACTIVE_OBJSTATTYPES
const LP_CONTEXT_REPOSITORY
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
__sort($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
const LP_ACTIVE_OBJSTATACCESS
__updateUser($user_id, $obj_id)
ilLearningProgressBaseGUI($a_mode, $a_ref_id=0, $a_usr_id=0)
const LP_STATUS_COMPLETED
static getInstance($a_obj_id)
const LP_STATUS_NOT_REGISTERED
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
const LP_STATUS_FAILED_NUM