5include_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'];
 
  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
 
  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", 
''),
 
  208                            $this->tabs_gui->addSubTabTarget(
 
  210                                $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui", 
'showUserObjectMatrix'),
 
  218                        $this->tabs_gui->addSubTabTarget(
 
  220                            $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui", 
'showObjectSummary'),
 
  228                include_once 
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
 
  231                    $this->tabs_gui->addSubTabTarget(
 
  233                        $this->ctrl->getLinkTargetByClass(
'illplistofsettingsgui', 
''),
 
  248                $this->tabs_gui->addSubTabTarget(
 
  250                    $this->ctrl->getLinkTargetByClass(
"illplistofobjectsgui", 
''),
 
  264                die(
'No valid mode given');
 
  276                $this->tpl->show(
true);
 
  282        if ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
 
  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)
 
  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);
 
  769            $mark->setValue($marks->getMark());
 
  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);
 
An exception for terminatinating execution or to throw for unit testing.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)
static _lookupVisits($a_obj_id)
const LP_MODE_TEST_PASSED
const LP_MODE_MANUAL_BY_TUTOR
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_NOT_PARTICIPATED
static _lookupStatus($a_obj_id, $a_user_id, $a_create=true)
Lookup status.
const LP_STATUS_COMPLETED
const LP_STATUS_NOT_REGISTERED
const LP_STATUS_PARTICIPATED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_REGISTERED
const LP_STATUS_FAILED_NUM
static _lookupPercentage($a_obj_id, $a_user_id)
Lookup percentage.
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
const LP_CONTEXT_ADMINISTRATION
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
__updateUser($user_id, $obj_id)
__readItemStatusInfo($a_items)
const LP_CONTEXT_ORG_UNIT
__showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
const LP_ACTIVE_OBJSTATACCESS
__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,...
__construct($a_mode, $a_ref_id=0, $a_usr_id=0)
const LP_ACTIVE_OBJSTATADMIN
const LP_CONTEXT_REPOSITORY
const LP_CONTEXT_PERSONAL_DESKTOP
__getPercent($max, $reached)
__appendUserInfo(&$info, $a_user)
static _showImageByStatus(&$tpl, $a_status, $tpl_prefix="")
const LP_CONTEXT_USER_FOLDER
__showObjectDetails(&$info, $item_id=0, $add_section=true)
show details about current object.
static __readStatus($a_obj_id, $user_id)
__appendLPDetails(&$info, $item_id, $user_id)
initEditUserForm($a_user_id, $a_obj_id, $a_cancel=null)
static _getImagePathForStatus($a_status)
Get image path for status.
static isObjectOffline($a_obj_id, $a_type=null)
__insertPath(&$a_tpl, $a_ref_id)
insert path
__showEditUser($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
const LP_ACTIVE_OBJSTATTYPES
const LP_ACTIVE_OBJSTATDAILY
static _getProgress($a_user_id, $a_obj_id)
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
This class represents a non editable value in a property form.
static _hasLearningProgressOtherUsers()
static _hasLearningProgressLearner()
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
static getInstance($a_obj_id)
static supportsMatrixView($a_obj_type)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
const PANEL_STYLE_SECONDARY
static getInstance()
Get instance.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
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:
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static infoPanel($a_keep=true)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res