5 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
60 public function __construct($a_mode, $a_ref_id = 0, $a_usr_id = 0)
67 $ilObjDataCache = $DIC[
'ilObjDataCache'];
68 $ilTabs = $DIC[
'ilTabs'];
73 $this->lng->loadLanguageModule(
'trac');
74 $this->tabs_gui = $ilTabs;
76 $this->mode = $a_mode;
77 $this->ref_id = $a_ref_id;
78 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
79 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
80 $this->usr_id = $a_usr_id;
83 if (!$this->anonymized && $this->obj_id) {
84 include_once
"Services/Object/classes/class.ilObjectLP.php";
86 $this->anonymized = $olp->isAnonymized();
89 $this->logger =
$GLOBALS[
'DIC']->logger()->trac();
109 return $this->obj_id;
115 return $this->usr_id;
117 if ((
int)
$_GET[
'user_id']) {
118 return (
int) $_GET[
'user_id'];
126 if (strlen($cmd = $this->ctrl->getCmd())) {
136 $rbacsystem = $DIC[
'rbacsystem'];
137 $ilObjDataCache = $DIC[
'ilObjDataCache'];
142 case self::LP_CONTEXT_PERSONAL_DESKTOP:
144 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
147 $this->tabs_gui->addSubTabTarget(
149 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
153 $a_active == self::LP_ACTIVE_PROGRESS
158 $this->tabs_gui->addSubTabTarget(
160 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
164 $a_active == self::LP_ACTIVE_OBJECTS
170 case self::LP_CONTEXT_REPOSITORY:
172 include_once
'./Services/Object/classes/class.ilObjectLP.php';
174 if ($olp->isActive()) {
175 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
179 $this->ctrl->setParameterByClass(
'illplistofprogressgui',
'user_id', $this->
getUserId());
180 $this->tabs_gui->addSubTabTarget(
182 $this->ctrl->getLinkTargetByClass(
'illplistofprogressgui',
''),
186 $a_active == self::LP_ACTIVE_PROGRESS
190 $sub_tab = ($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->getRefId())) ==
'crs') ?
194 $this->tabs_gui->addSubTabTarget(
196 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
200 $a_active == self::LP_ACTIVE_OBJECTS
208 $this->tabs_gui->addSubTabTarget(
210 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showUserObjectMatrix'),
214 $a_active == self::LP_ACTIVE_MATRIX
218 $this->tabs_gui->addSubTabTarget(
220 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
'showObjectSummary'),
224 $a_active == self::LP_ACTIVE_SUMMARY
228 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
231 $this->tabs_gui->addSubTabTarget(
233 $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui',
''),
237 $a_active == self::LP_ACTIVE_SETTINGS
242 case self::LP_CONTEXT_ADMINISTRATION:
248 $this->tabs_gui->addSubTabTarget(
250 $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui",
''),
254 $a_active == self::LP_ACTIVE_OBJECTS
258 case self::LP_CONTEXT_USER_FOLDER:
259 case self::LP_CONTEXT_ORG_UNIT:
264 die(
'No valid mode given');
274 case self::LP_CONTEXT_PERSONAL_DESKTOP:
276 $this->tpl->show(
true);
282 if ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
315 $tree = $DIC[
'tree'];
317 $path_arr =
$tree->getPathFull($a_ref_id);
319 foreach (
$tree->getPathFull($a_ref_id) as
$data) {
325 $a_tpl->setCurrentBlock(
"path_item");
326 $a_tpl->setVariable(
"PATH_ITEM",
$path);
327 $a_tpl->parseCurrentBlock();
329 $a_tpl->setCurrentBlock(
"path");
330 $a_tpl->parseCurrentBlock();
348 $tpl_prefix .
"STATUS_IMG",
351 $tpl->setVariable($tpl_prefix .
"STATUS_ALT",
$lng->txt($a_status));
361 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
364 switch ((
string) $a_status) {
407 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
423 return $a_lng->txt($a_status);
431 include_once
"./Services/Table/classes/class.ilTableGUI.php";
444 $ilObjDataCache = $DIC[
'ilObjDataCache'];
446 $details_id = $item_id ? $item_id : $this->details_id;
448 include_once
'Services/Object/classes/class.ilObjectLP.php';
450 $mode = $olp->getCurrentMode();
452 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
457 $info->addSection($this->lng->txt(
'details'));
482 if (!is_object($a_user)) {
486 if ($a_user->getId() !=
$ilUser->getId()) {
487 $info->addSection($this->lng->txt(
"trac_user_data"));
491 $this->lng->txt(
'last_login'),
495 $this->lng->txt(
'trac_total_online'),
506 $ilObjDataCache = $DIC[
'ilObjDataCache'];
508 $type = $ilObjDataCache->lookupType($item_id);
517 $this->lng->txt(
'trac_mode'),
518 $olp->getModeText($olp->getCurrentMode())
524 include_once
'Services/Tracking/classes/class.ilLearningProgress.php';
527 if ($progress[
'access_time']) {
529 $this->lng->txt(
'last_access'),
533 $info->addProperty($this->lng->txt(
'last_access'), $this->lng->txt(
'trac_not_accessed'));
535 $info->addProperty($this->lng->txt(
'trac_visits'), (int) $progress[
'visits']);
555 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
560 $this->lng->txt(
'trac_status'),
561 ilUtil::img($status_path, $status_text) .
" " . $status_text
565 $mode = $olp->getCurrentMode();
571 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
573 $info->addProperty($this->lng->txt(
'trac_percentage'), (int) $perc .
"%");
579 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
583 $info->addProperty($this->lng->txt(
'trac_mark'), $mark);
588 $info->addProperty($this->lng->txt(
'trac_comment'),
$comment);
594 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
597 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
628 public function __sort($a_ids, $a_table, $a_field, $a_id_name)
632 $ilDB = $DIC[
'ilDB'];
641 $where =
"WHERE " .
$ilDB->in($a_id_name, $a_ids,
false,
'integer') .
" ";
643 $query =
"SELECT " . $a_id_name .
" FROM " . $a_table .
" " .
645 "ORDER BY " . $a_field;
649 $ids[] =
$row->$a_id_name;
651 return $ids ? $ids : array();
660 return sprintf(
"%d%%", $reached / $max * 100);
667 $ilObjDataCache = $DIC[
'ilObjDataCache'];
669 include_once
'Services/Object/classes/class.ilObjectLP.php';
671 foreach ($a_items as $item_id) {
674 $this->obj_data[$item_id][
'type'] = $ilObjDataCache->lookupType($item_id);
675 $this->obj_data[$item_id][
'mode'] = $olp->getCurrentMode();
677 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
684 $collection = $olp->getCollectionInstance();
686 $this->obj_data[$item_id][
'scos'] = count($collection->getItems());
698 $tpl =
new ilTemplate(
"tpl.lp_legend.html",
true,
true,
"Services/Tracking");
717 $lng->txt(
"trac_not_attempted")
721 $lng->txt(
"trac_in_progress")
725 $lng->txt(
"trac_completed")
729 $lng->txt(
"trac_failed")
732 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
735 $panel->setBody(
$tpl->get());
737 return $panel->getHTML();
747 include_once
'Services/Object/classes/class.ilObjectLP.php';
749 $lp_mode = $olp->getCurrentMode();
751 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
754 $form->setFormAction(
$ilCtrl->getFormAction($this,
"updateUser"));
757 $form->setDescription(
$lng->txt(
'trac_mode') .
": " . $olp->getModeText($lp_mode));
759 include_once
"Services/User/classes/class.ilUserUtil.php";
764 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
765 $marks =
new ilLPMarks($a_obj_id, $a_user_id);
770 $mark->setMaxLength(32);
771 $form->addItem($mark);
775 $comm->
setValue($marks->getComment());
776 $form->addItem($comm);
780 include_once(
"./Services/Tracking/classes/class.ilLPStatus.php");
785 $form->addItem($status);
788 $form->addCommandButton(
"updateUser",
$lng->txt(
'save'));
791 $form->addCommandButton($a_cancel,
$lng->txt(
'cancel'));
797 public function __showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id =
false)
806 $ilCtrl->setParameter($this,
'userdetails_id', $a_sub_id);
810 $ilCtrl->setParameter($this,
'user_id', $a_user_id);
811 $ilCtrl->setParameter($this,
'details_id', $a_ref_id);
815 return $form->getHTML();
821 if (
$form->checkInput()) {
822 include_once
'Services/Tracking/classes/class.ilLPMarks.php';
824 $marks =
new ilLPMarks($obj_id, $user_id);
825 $marks->setMark(
$form->getInput(
"mark"));
826 $marks->setComment(
$form->getInput(
"comment"));
831 $status =
$form->getItemByPostVar(
"completed");
832 if (is_object($status)) {
833 if ($marks->getCompleted() !=
$form->getInput(
"completed")) {
834 $marks->setCompleted(
$form->getInput(
"completed"));
843 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
853 $objDefinition = $DIC[
'objDefinition'];
854 $ilObjDataCache = $DIC[
'ilObjDataCache'];
857 $a_type = $ilObjDataCache->lookupType($a_obj_id);
860 if ($objDefinition->isPluginTypeName(
$a_type)) {
864 $class =
"ilObj" . $objDefinition->getClassName(
$a_type) .
"Access";
865 include_once $objDefinition->getLocation(
$a_type) .
"/class." . $class .
".php";
866 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)
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.
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
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
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)
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
const LP_STATUS_FAILED_NUM