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',
''),
133 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
138 $this->tabs_gui->addTarget(
'trac_objects',
139 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
140 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
145 case self::LP_CONTEXT_REPOSITORY:
147 include_once
'./Services/Object/classes/class.ilObjectLP.php';
151 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
156 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id',$this->
getUserId());
157 $this->tabs_gui->addSubTabTarget(
'trac_progress',
158 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
159 "",
"",
"",$a_active == self::LP_ACTIVE_PROGRESS);
164 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
168 $this->tabs_gui->addSubTabTarget($sub_tab,
169 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
170 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
179 $this->tabs_gui->addSubTabTarget(
"trac_matrix",
180 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
181 "",
"",
"", $a_active == self::LP_ACTIVE_MATRIX);
184 $this->tabs_gui->addSubTabTarget(
"trac_summary",
185 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
186 "",
"",
"", $a_active == self::LP_ACTIVE_SUMMARY);
189 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
193 $this->tabs_gui->addSubTabTarget(
'trac_settings',
194 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
195 "",
"",
"",$a_active == self::LP_ACTIVE_SETTINGS);
199 case self::LP_CONTEXT_ADMINISTRATION:
205 $this->tabs_gui->addSubTabTarget(
'trac_objects',
206 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
207 "",
"",
"",$a_active == self::LP_ACTIVE_OBJECTS);
210 case self::LP_CONTEXT_USER_FOLDER:
211 case self::LP_CONTEXT_ORG_UNIT:
216 die (
'No valid mode given');
227 case self::LP_CONTEXT_PERSONAL_DESKTOP:
229 $this->tpl->show(
true);
235 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
237 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
270 $path_arr = $tree->getPathFull($a_ref_id);
272 foreach($tree->getPathFull($a_ref_id) as
$data)
280 $a_tpl->setCurrentBlock(
"path_item");
281 $a_tpl->setVariable(
"PATH_ITEM",
$path);
282 $a_tpl->parseCurrentBlock();
284 $a_tpl->setCurrentBlock(
"path");
285 $a_tpl->parseCurrentBlock();
300 $tpl->setVariable($tpl_prefix.
"STATUS_IMG",
302 $tpl->setVariable($tpl_prefix.
"STATUS_ALT",$lng->txt($a_status));
312 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
315 switch((
string)$a_status)
358 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
376 return $a_lng->txt($a_status);
384 include_once
"./Services/Table/classes/class.ilTableGUI.php";
395 global $ilObjDataCache;
397 $details_id = $item_id ? $item_id : $this->details_id;
399 include_once
'Services/Object/classes/class.ilObjectLP.php';
401 $mode = $olp->getCurrentMode();
403 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
410 $info->addSection($this->lng->txt(
'details'));
435 if(!is_object($a_user))
440 if($a_user->getId() != $ilUser->getId())
442 $info->addSection($this->lng->txt(
"trac_user_data"));
445 $info->addProperty($this->lng->txt(
'last_login'),
447 $info->addProperty($this->lng->txt(
'trac_total_online'),
455 global $ilObjDataCache;
457 $type = $ilObjDataCache->lookupType($item_id);
465 $info->addProperty($this->lng->txt(
'trac_mode'),
466 $olp->getModeText($olp->getCurrentMode()));
472 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
475 if($progress[
'access_time'])
477 $info->addProperty($this->lng->txt(
'last_access'),
482 $info->addProperty($this->lng->txt(
'last_access'),$this->lng->txt(
'trac_not_accessed'));
484 $info->addProperty($this->lng->txt(
'trac_visits'),(int) $progress[
'visits']);
500 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
504 $info->addProperty($this->lng->txt(
'trac_status'),
505 ilUtil::img($status_path, $status_text).
" ".$status_text);
508 $mode = $olp->getCurrentMode();
515 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
517 $info->addProperty($this->lng->txt(
'trac_percentage'), (int)$perc.
"%");
523 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
529 $info->addProperty($this->lng->txt(
'trac_mark'),$mark);
535 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
541 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
544 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
576 function __sort($a_ids,$a_table,$a_field,$a_id_name)
588 $where =
"WHERE ".$ilDB->in($a_id_name, $a_ids,
false,
'integer').
" ";
590 $query =
"SELECT ".$a_id_name.
" FROM ".$a_table.
" ".
592 "ORDER BY ".$a_field;
597 $ids[] =
$row->$a_id_name;
599 return $ids ? $ids : array();
609 return sprintf(
"%d%%",$reached / $max * 100);
614 global $ilObjDataCache;
616 include_once
'Services/Object/classes/class.ilObjectLP.php';
618 foreach($a_items as $item_id)
622 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
623 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
626 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
635 $collection = $olp->getCollectionInstance();
638 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
648 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
649 $tpl->setVariable(
"IMG_NOT_ATTEMPTED",
651 $tpl->setVariable(
"IMG_IN_PROGRESS",
653 $tpl->setVariable(
"IMG_COMPLETED",
655 $tpl->setVariable(
"IMG_FAILED",
657 $tpl->setVariable(
"TXT_NOT_ATTEMPTED",
658 $lng->txt(
"trac_not_attempted"));
659 $tpl->setVariable(
"TXT_IN_PROGRESS",
660 $lng->txt(
"trac_in_progress"));
661 $tpl->setVariable(
"TXT_COMPLETED",
662 $lng->txt(
"trac_completed"));
663 $tpl->setVariable(
"TXT_FAILED",
664 $lng->txt(
"trac_failed"));
666 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
669 $panel->setBody($tpl->get());
671 return $panel->getHTML();
678 include_once
'Services/Object/classes/class.ilObjectLP.php';
680 $lp_mode = $olp->getCurrentMode();
682 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
685 $form->setFormAction($ilCtrl->getFormAction($this,
"updateUser"));
688 $form->setDescription($lng->txt(
'trac_mode').
": ".$olp->getModeText($lp_mode));
690 include_once
"Services/User/classes/class.ilUserUtil.php";
693 $form->addItem($user);
695 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
696 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
702 $mark->setMaxLength(32);
703 $form->addItem($mark);
707 $comm->
setValue($marks->getComment());
708 $form->addItem($comm);
713 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
718 $form->addItem($status);
721 $form->addCommandButton(
"updateUser", $lng->txt(
'save'));
725 $form->addCommandButton($a_cancel, $lng->txt(
'cancel'));
741 $ilCtrl->setParameter($this,
'userdetails_id',$a_sub_id);
745 $ilCtrl->setParameter($this,
'user_id', $a_user_id);
746 $ilCtrl->setParameter($this,
'details_id', $a_ref_id);
750 return $form->getHTML();
756 if($form->checkInput())
758 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
760 $marks =
new ilLPMarks($obj_id, $user_id);
761 $marks->setMark($form->getInput(
"mark"));
762 $marks->setComment($form->getInput(
"comment"));
767 $status = $form->getItemByPostVar(
"completed");
768 if(is_object($status))
770 if($marks->getCompleted() != $form->getInput(
"completed"))
772 $marks->setCompleted($form->getInput(
"completed"));
782 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
790 global $objDefinition, $ilObjDataCache;
794 $a_type = $ilObjDataCache->lookupType($a_obj_id);
797 if($objDefinition->isPluginTypeName($a_type))
802 $class =
"ilObj".$objDefinition->getClassName($a_type).
"Access";
803 include_once $objDefinition->getLocation($a_type).
"/class.".$class.
".php";
804 return call_user_func(array($class,
'_isOffline'), $a_obj_id);
const LP_STATUS_COMPLETED_NUM
__readStatus($a_obj_id, $user_id)
_getProgress($a_user_id, $a_obj_id)
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
setValue($a_value)
Set Value.
_getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
const LP_MODE_MANUAL_BY_TUTOR
static _hasLearningProgressLearner()
const LP_STATUS_PARTICIPATED
_lookupMark($a_usr_id, $a_obj_id)
const LP_STATUS_NOT_ATTEMPTED
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.
const LP_STATUS_IN_PROGRESS_NUM
_getImagePathForStatus($a_status)
Get image path for status.
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
const DB_FETCHMODE_OBJECT
__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
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)
_getStatusText($a_status, $a_lng=null)
Get status alt text.
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)
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
const LP_CONTEXT_PERSONAL_DESKTOP
const LP_CONTEXT_ORG_UNIT
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
const LP_STATUS_REGISTERED
static getInstance()
Get instance.
static supportsSpentSeconds($a_obj_type)
__insertPath(&$a_tpl, $a_ref_id)
insert path
_lookupComment($a_usr_id, $a_obj_id)
__showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
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
__updateUser($user_id, $obj_id)
ilLearningProgressBaseGUI($a_mode, $a_ref_id=0, $a_usr_id=0)
setValue($a_value)
Set Value.
const LP_STATUS_COMPLETED
static getInstance($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