5 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
56 public function __construct($a_mode, $a_ref_id = 0, $a_usr_id = 0)
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) {
74 include_once
"Services/Object/classes/class.ilObjectLP.php";
76 $this->anonymized = $olp->isAnonymized();
79 $this->logger =
$GLOBALS[
'DIC']->logger()->trac();
105 return $this->usr_id;
107 if ((
int)
$_GET[
'user_id']) {
108 return (
int) $_GET[
'user_id'];
116 if (strlen($cmd = $this->ctrl->getCmd())) {
124 global $rbacsystem,$ilObjDataCache;
129 case self::LP_CONTEXT_PERSONAL_DESKTOP:
131 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
134 $this->tabs_gui->addTarget(
136 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
140 $a_active == self::LP_ACTIVE_PROGRESS
145 $this->tabs_gui->addTarget(
147 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
151 $a_active == self::LP_ACTIVE_OBJECTS
157 case self::LP_CONTEXT_REPOSITORY:
159 include_once
'./Services/Object/classes/class.ilObjectLP.php';
161 if ($olp->isActive()) {
162 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
166 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id', $this->
getUserId());
167 $this->tabs_gui->addSubTabTarget(
169 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
173 $a_active == self::LP_ACTIVE_PROGRESS
177 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
181 $this->tabs_gui->addSubTabTarget(
183 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
187 $a_active == self::LP_ACTIVE_OBJECTS
195 $this->tabs_gui->addSubTabTarget(
197 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
201 $a_active == self::LP_ACTIVE_MATRIX
205 $this->tabs_gui->addSubTabTarget(
207 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
211 $a_active == self::LP_ACTIVE_SUMMARY
215 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
218 $this->tabs_gui->addSubTabTarget(
220 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
224 $a_active == self::LP_ACTIVE_SETTINGS
229 case self::LP_CONTEXT_ADMINISTRATION:
235 $this->tabs_gui->addSubTabTarget(
237 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
241 $a_active == self::LP_ACTIVE_OBJECTS
245 case self::LP_CONTEXT_USER_FOLDER:
246 case self::LP_CONTEXT_ORG_UNIT:
251 die(
'No valid mode given');
261 case self::LP_CONTEXT_PERSONAL_DESKTOP:
263 $this->tpl->show(
true);
269 if ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
270 $this->tpl->setTitle($this->lng->txt(
"learning_progress"));
302 $path_arr = $tree->getPathFull($a_ref_id);
304 foreach ($tree->getPathFull($a_ref_id) as
$data) {
310 $a_tpl->setCurrentBlock(
"path_item");
311 $a_tpl->setVariable(
"PATH_ITEM",
$path);
312 $a_tpl->parseCurrentBlock();
314 $a_tpl->setCurrentBlock(
"path");
315 $a_tpl->parseCurrentBlock();
331 $tpl_prefix .
"STATUS_IMG",
334 $tpl->setVariable($tpl_prefix .
"STATUS_ALT", $lng->txt($a_status));
344 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
347 switch ((
string) $a_status) {
388 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
404 return $a_lng->txt($a_status);
412 include_once
"./Services/Table/classes/class.ilTableGUI.php";
423 global $ilObjDataCache;
425 $details_id = $item_id ? $item_id : $this->details_id;
427 include_once
'Services/Object/classes/class.ilObjectLP.php';
429 $mode = $olp->getCurrentMode();
431 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
436 $info->addSection($this->lng->txt(
'details'));
459 if (!is_object($a_user)) {
463 if ($a_user->getId() != $ilUser->getId()) {
464 $info->addSection($this->lng->txt(
"trac_user_data"));
468 $this->lng->txt(
'last_login'),
472 $this->lng->txt(
'trac_total_online'),
481 global $ilObjDataCache;
483 $type = $ilObjDataCache->lookupType($item_id);
492 $this->lng->txt(
'trac_mode'),
493 $olp->getModeText($olp->getCurrentMode())
499 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
502 if ($progress[
'access_time']) {
504 $this->lng->txt(
'last_access'),
508 $info->addProperty($this->lng->txt(
'last_access'), $this->lng->txt(
'trac_not_accessed'));
510 $info->addProperty($this->lng->txt(
'trac_visits'), (int) $progress[
'visits']);
528 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
533 $this->lng->txt(
'trac_status'),
534 ilUtil::img($status_path, $status_text) .
" " . $status_text
538 $mode = $olp->getCurrentMode();
544 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
546 $info->addProperty($this->lng->txt(
'trac_percentage'), (int) $perc .
"%");
552 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
556 $info->addProperty($this->lng->txt(
'trac_mark'), $mark);
561 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
567 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
570 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
601 public function __sort($a_ids, $a_table, $a_field, $a_id_name)
612 $where =
"WHERE " . $ilDB->in($a_id_name, $a_ids,
false,
'integer') .
" ";
614 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
616 "ORDER BY " . $a_field;
620 $ids[] =
$row->$a_id_name;
622 return $ids ? $ids :
array();
631 return sprintf(
"%d%%", $reached / $max * 100);
636 global $ilObjDataCache;
638 include_once
'Services/Object/classes/class.ilObjectLP.php';
640 foreach ($a_items as $item_id) {
643 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
644 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
646 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
653 $collection = $olp->getCollectionInstance();
655 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
665 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
684 $lng->txt(
"trac_not_attempted")
688 $lng->txt(
"trac_in_progress")
692 $lng->txt(
"trac_completed")
696 $lng->txt(
"trac_failed")
699 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
702 $panel->setBody(
$tpl->get());
704 return $panel->getHTML();
711 include_once
'Services/Object/classes/class.ilObjectLP.php';
713 $lp_mode = $olp->getCurrentMode();
715 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
718 $form->setFormAction($ilCtrl->getFormAction($this,
"updateUser"));
721 $form->setDescription($lng->txt(
'trac_mode') .
": " . $olp->getModeText($lp_mode));
723 include_once
"Services/User/classes/class.ilUserUtil.php";
726 $form->addItem($user);
728 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
729 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
734 $mark->setMaxLength(32);
735 $form->addItem($mark);
739 $comm->
setValue($marks->getComment());
740 $form->addItem($comm);
744 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
749 $form->addItem($status);
752 $form->addCommandButton(
"updateUser", $lng->txt(
'save'));
755 $form->addCommandButton($a_cancel, $lng->txt(
'cancel'));
761 public function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id =
false)
768 $ilCtrl->setParameter($this,
'userdetails_id', $a_sub_id);
772 $ilCtrl->setParameter($this,
'user_id', $a_user_id);
773 $ilCtrl->setParameter($this,
'details_id', $a_ref_id);
777 return $form->getHTML();
783 if (
$form->checkInput()) {
784 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
786 $marks =
new ilLPMarks($obj_id, $user_id);
787 $marks->setMark(
$form->getInput(
"mark"));
788 $marks->setComment(
$form->getInput(
"comment"));
793 $status =
$form->getItemByPostVar(
"completed");
794 if (is_object($status)) {
795 if ($marks->getCompleted() !=
$form->getInput(
"completed")) {
796 $marks->setCompleted(
$form->getInput(
"completed"));
805 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
813 global $objDefinition, $ilObjDataCache;
816 $a_type = $ilObjDataCache->lookupType($a_obj_id);
819 if ($objDefinition->isPluginTypeName(
$a_type)) {
823 $class =
"ilObj" . $objDefinition->getClassName(
$a_type) .
"Access";
824 include_once $objDefinition->getLocation(
$a_type) .
"/class." . $class .
".php";
825 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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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
const LP_ACTIVE_OBJSTATDAILY
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
foreach($_POST as $key=> $value) $res
if(isset($_POST['submit'])) $form
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 infoPanel($a_keep=true)
static supportsMatrixView($a_obj_type)
const LP_CONTEXT_PERSONAL_DESKTOP
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
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