5 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
63 $this->lng->loadLanguageModule(
'trac');
64 $this->tabs_gui = $ilTabs;
66 $this->mode = $a_mode;
67 $this->ref_id = $a_ref_id;
68 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
69 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
70 $this->usr_id = $a_usr_id;
73 if(!$this->anonymized && $this->obj_id)
75 include_once
"Services/Object/classes/class.ilObjectLP.php";
77 $this->anonymized = $olp->isAnonymized();
80 $this->logger =
$GLOBALS[
'DIC']->logger()->trac();
100 return $this->obj_id;
107 return $this->usr_id;
109 if((
int)
$_GET[
'user_id'])
111 return (
int) $_GET[
'user_id'];
119 if(strlen(
$cmd = $this->ctrl->getCmd()))
128 global $rbacsystem,$ilObjDataCache;
134 case self::LP_CONTEXT_PERSONAL_DESKTOP:
136 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
140 $this->tabs_gui->addTarget(
'trac_progress',
141 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
142 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
147 $this->tabs_gui->addTarget(
'trac_objects',
148 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
149 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
154 case self::LP_CONTEXT_REPOSITORY:
156 include_once
'./Services/Object/classes/class.ilObjectLP.php';
160 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
165 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
166 $this->tabs_gui->addSubTabTarget(
'trac_progress',
167 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
168 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
173 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
177 $this->tabs_gui->addSubTabTarget($sub_tab,
178 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
179 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
188 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
189 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
190 "",
"",
"", $a_active == self::LP_ACTIVE_MATRIX);
193 $this->tabs_gui->addSubTabTarget(
"trac_summary",
194 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
195 "",
"",
"", $a_active == self::LP_ACTIVE_SUMMARY);
198 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
202 $this->tabs_gui->addSubTabTarget(
'trac_settings',
203 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
204 "",
"",
"",$a_active == self::LP_ACTIVE_SETTINGS);
208 case self::LP_CONTEXT_ADMINISTRATION:
214 $this->tabs_gui->addSubTabTarget(
'trac_objects',
215 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
216 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
219 case self::LP_CONTEXT_USER_FOLDER:
220 case self::LP_CONTEXT_ORG_UNIT:
225 die (
'No valid mode given');
236 case self::LP_CONTEXT_PERSONAL_DESKTOP:
238 $this->tpl->show(
true);
244 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
246 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
279 $path_arr = $tree->getPathFull($a_ref_id);
281 foreach($tree->getPathFull($a_ref_id) as
$data)
289 $a_tpl->setCurrentBlock(
"path_item");
290 $a_tpl->setVariable(
"PATH_ITEM",
$path);
291 $a_tpl->parseCurrentBlock();
293 $a_tpl->setCurrentBlock(
"path");
294 $a_tpl->parseCurrentBlock();
309 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
311 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
321 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
324 switch((
string)$a_status)
367 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
385 return $a_lng->txt($a_status);
393 include_once
"./Services/Table/classes/class.ilTableGUI.php";
404 global $ilObjDataCache;
406 $details_id = $item_id ? $item_id : $this->details_id;
408 include_once
'Services/Object/classes/class.ilObjectLP.php';
410 $mode = $olp->getCurrentMode();
412 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
419 $info->addSection($this->lng->txt(
'details'));
444 if(!is_object($a_user))
449 if($a_user->getId() != $ilUser->getId())
451 $info->addSection($this->lng->txt(
"trac_user_data"));
454 $info->addProperty($this->lng->txt(
'last_login'),
456 $info->addProperty($this->lng->txt(
'trac_total_online'),
464 global $ilObjDataCache;
466 $type = $ilObjDataCache->lookupType($item_id);
474 $info->addProperty($this->lng->txt(
'trac_mode'),
475 $olp->getModeText($olp->getCurrentMode()));
481 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
484 if($progress[
'access_time'])
486 $info->addProperty($this->lng->txt(
'last_access'),
491 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
493 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
511 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
515 $info->addProperty($this->lng->txt(
'trac_status'),
516 ilUtil::img($status_path, $status_text).
" ".$status_text);
519 $mode = $olp->getCurrentMode();
526 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
528 $info->addProperty($this->lng->txt(
'trac_percentage'), (int)$perc.
"%");
534 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
540 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
546 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
552 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
555 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
587 function __sort($a_ids,$a_table,$a_field,$a_id_name)
599 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
601 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
603 "ORDER BY ".$a_field;
608 $ids[] =
$row->$a_id_name;
610 return $ids ? $ids :
array();
620 return sprintf(
"%d%%",$reached / $max * 100);
625 global $ilObjDataCache;
627 include_once
'Services/Object/classes/class.ilObjectLP.php';
629 foreach($a_items as $item_id)
633 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
634 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
637 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
646 $collection = $olp->getCollectionInstance();
649 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
659 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
660 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
662 $tpl->setVariable(
"IMG_IN_PROGRESS",
664 $tpl->setVariable(
"IMG_COMPLETED",
666 $tpl->setVariable(
"IMG_FAILED",
668 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
669 $lng->txt(
"trac_not_attempted"));
670 $tpl->setVariable(
"TXT_IN_PROGRESS",
671 $lng->txt(
"trac_in_progress"));
672 $tpl->setVariable(
"TXT_COMPLETED",
673 $lng->txt(
"trac_completed"));
674 $tpl->setVariable(
"TXT_FAILED",
675 $lng->txt(
"trac_failed"));
677 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
680 $panel->setBody($tpl->get());
682 return $panel->getHTML();
689 include_once
'Services/Object/classes/class.ilObjectLP.php';
691 $lp_mode = $olp->getCurrentMode();
693 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
696 $form->setFormAction($ilCtrl->getFormAction($this,
"updateUser"));
699 $form->setDescription($lng->txt(
'trac_mode').
": ".$olp->getModeText($lp_mode));
701 include_once
"Services/User/classes/class.ilUserUtil.php";
704 $form->addItem($user);
706 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
707 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
713 $mark->setMaxLength(32);
714 $form->addItem($mark);
718 $comm->
setValue($marks->getComment());
719 $form->addItem($comm);
724 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
729 $form->addItem($status);
732 $form->addCommandButton(
"updateUser", $lng->txt(
'save'));
736 $form->addCommandButton($a_cancel, $lng->txt(
'cancel'));
752 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
756 $ilCtrl->setParameter($this,
'user_id', $a_user_id);
757 $ilCtrl->setParameter($this,
'details_id', $a_ref_id);
761 return $form->getHTML();
767 if($form->checkInput())
769 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
771 $marks =
new ilLPMarks($obj_id, $user_id);
772 $marks->setMark($form->getInput(
"mark"));
773 $marks->setComment($form->getInput(
"comment"));
778 $status = $form->getItemByPostVar(
"completed");
779 if(is_object($status))
781 if($marks->getCompleted() != $form->getInput(
"completed"))
783 $marks->setCompleted($form->getInput(
"completed"));
793 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
801 global $objDefinition, $ilObjDataCache;
805 $a_type = $ilObjDataCache->lookupType($a_obj_id);
808 if($objDefinition->isPluginTypeName(
$a_type))
813 $class =
"ilObj".$objDefinition->getClassName(
$a_type).
"Access";
814 include_once $objDefinition->getLocation(
$a_type).
"/class.".$class.
".php";
815 return call_user_func(
array($class,
'_isOffline'), $a_obj_id);
const LP_STATUS_COMPLETED_NUM
__construct($a_mode, $a_ref_id=0, $a_usr_id=0)
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
setValue($a_value)
Set Value.
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
const LP_MODE_MANUAL_BY_TUTOR
static _getImagePathForStatus($a_status)
Get image path for status.
static _hasLearningProgressLearner()
const LP_STATUS_PARTICIPATED
const LP_STATUS_NOT_ATTEMPTED
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const LP_STATUS_IN_PROGRESS_NUM
static _hasLearningProgressOtherUsers()
static _lookupTitle($a_id)
lookup object title
__appendLPDetails(&$info, $item_id, $user_id)
const LP_ACTIVE_OBJSTATADMIN
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
const LP_CONTEXT_USER_FOLDER
const LP_CONTEXT_ADMINISTRATION
__showObjectDetails(&$info, $item_id=0, $add_section=true)
show details about current object.
const LP_STATUS_IN_PROGRESS
__getPercent($max, $reached)
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
initEditUserForm($a_user_id, $a_obj_id, $a_cancel=null)
const LP_STATUS_NOT_PARTICIPATED
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
const LP_ACTIVE_OBJSTATDAILY
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
const LP_MODE_TEST_PASSED
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)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
static infoPanel($a_keep=true)
static supportsMatrixView($a_obj_type)
const LP_CONTEXT_PERSONAL_DESKTOP
const LP_CONTEXT_ORG_UNIT
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
__readItemStatusInfo($a_items)
__appendUserInfo(&$info, $a_user)
static supportsMark($a_obj_type)
const LP_STATUS_NOT_ATTEMPTED_NUM
static __readStatus($a_obj_id, $user_id)
const LP_STATUS_REGISTERED
static getInstance()
Get instance.
static supportsSpentSeconds($a_obj_type)
__insertPath(&$a_tpl, $a_ref_id)
insert path
__showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
static _lookupVisits($a_obj_id)
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
This class represents a non editable value in a property form.
const LP_ACTIVE_OBJSTATTYPES
const LP_CONTEXT_REPOSITORY
__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 PANEL_STYLE_SECONDARY
const LP_ACTIVE_OBJSTATACCESS
static _lookupMark($a_usr_id, $a_obj_id)
__updateUser($user_id, $obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
setValue($a_value)
Set Value.
const LP_STATUS_COMPLETED
static getInstance($a_obj_id)
static _getProgress($a_user_id, $a_obj_id)
const LP_STATUS_NOT_REGISTERED
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_FAILED_NUM