ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLearningProgressGUI Class Reference

Class ilObjUserTrackingGUI. More...

+ Inheritance diagram for ilLearningProgressGUI:
+ Collaboration diagram for ilLearningProgressGUI:

Public Member Functions

 ilLearningProgressGUI ($a_mode, $a_ref_id=0, $a_user_id=0)
executeCommand ()
 execute command
 __setCmdClass ($a_class)
 __getNextClass ()
- Public Member Functions inherited from ilLearningProgressBaseGUI
 ilLearningProgressBaseGUI ($a_mode, $a_ref_id=0, $a_usr_id=0)
 isAnonymized ()
 getMode ()
 getRefId ()
 getObjId ()
 getUserId ()
 __getDefaultCommand ()
 __setSubTabs ($a_active)
 __buildFooter ()
 __buildHeader ()
 __insertPath (&$a_tpl, $a_ref_id)
 insert path
 __showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
 _getImagePathForStatus ($a_status)
 Get image path for status.
 _getStatusText ($a_status)
 Get status alt text.
__initTableGUI ()
 __showObjectDetails (&$info, $item_id=0, $add_section=true)
 show details about current object.
 __appendUserInfo (&$info, $a_user)
 __appendLPDetails (&$info, $item_id, $user_id)
 __readStatus ($a_obj_id, $user_id)
 __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.
 __getPercent ($max, $reached)
 __readItemStatusInfo ($a_items)
 __getLegendHTML ()
 __showEditUser ($a_user_id, $a_ref_id, $a_cancel, $a_sub_id=false)
 __updateUser ($user_id, $obj_id)

Protected Member Functions

 editManual ()
 initCollectionManualForm ()
 updateManual ()
 showtlt ()
- Protected Member Functions inherited from ilLearningProgressBaseGUI
 initEditUserForm ($a_user_id, $a_obj_id, $a_cancel=null)

Additional Inherited Members

- Static Public Member Functions inherited from ilLearningProgressBaseGUI
static _showImageByStatus (&$tpl, $a_status, $tpl_prefix="")
static isObjectOffline ($a_obj_id, $a_type=null)
- Data Fields inherited from ilLearningProgressBaseGUI
 $tpl = null
 $ctrl = null
 $lng = null
 $ref_id = 0
 $mode = 0
const LP_CONTEXT_PERSONAL_DESKTOP = 1
const LP_CONTEXT_ADMINISTRATION = 2
const LP_CONTEXT_REPOSITORY = 3
const LP_CONTEXT_USER_FOLDER = 4
const LP_CONTEXT_ORG_UNIT = 5
const LP_ACTIVE_SETTINGS = 1
const LP_ACTIVE_OBJECTS = 2
const LP_ACTIVE_PROGRESS = 3
const LP_ACTIVE_USERS = 5
const LP_ACTIVE_SUMMARY = 6
const LP_ACTIVE_OBJSTATACCESS = 7
const LP_ACTIVE_OBJSTATTYPES = 8
const LP_ACTIVE_OBJSTATDAILY = 9
const LP_ACTIVE_OBJSTATADMIN = 10
const LP_ACTIVE_MATRIX = 11
- Protected Attributes inherited from ilLearningProgressBaseGUI
 $anonymized

Detailed Description

Member Function Documentation

ilLearningProgressGUI::__getNextClass ( )

Definition at line 142 of file class.ilLearningProgressGUI.php.

References $_SESSION, $cmd, $ilUser, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ilObject\_lookupObjId(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getMode(), ilLearningProgressBaseGUI\getRefId(), ilLearningProgressBaseGUI\LP_CONTEXT_PERSONAL_DESKTOP, and ilUtil\redirect().

Referenced by executeCommand().

{
global $ilAccess, $ilUser;
// #9857
{
return;
}
if(strlen($next_class = $this->ctrl->getNextClass()))
{
{
$_SESSION['il_lp_history'] = $next_class;
}
return $next_class;
}
switch($this->getMode())
{
case self::LP_CONTEXT_ADMINISTRATION:
return 'illplistofobjectsgui';
case self::LP_CONTEXT_REPOSITORY:
$cmd = $this->ctrl->getCmd();
if(in_array($cmd, array("editmanual", "updatemanual", "showtlt")))
{
return "";
}
// #12771
include_once './Services/Object/classes/class.ilObjectLP.php';
if(!$olp->isActive())
{
if(!($olp instanceof ilPluginLP) &&
$ilAccess->checkAccess('edit_learning_progress','',$this->getRefId()))
{
return 'illplistofsettingsgui';
}
else
{
return '';
}
}
if(!$this->anonymized &&
$ilAccess->checkAccess('read_learning_progress','',$this->getRefId()))
{
return 'illplistofobjectsgui';
}
if($ilAccess->checkAccess('edit_learning_progress','',$this->getRefId()))
{
return 'illplistofsettingsgui';
}
return 'illplistofprogressgui';
case self::LP_CONTEXT_PERSONAL_DESKTOP:
include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
if($has_edit || $has_personal)
{
// default (#10928)
$tgt = null;
if($has_personal)
{
$tgt = 'illplistofprogressgui';
}
else if($has_edit)
{
$tgt = 'illplistofobjectsgui';
}
// validate session
switch($_SESSION['il_lp_history'])
{
case 'illplistofobjectsgui':
if(!$has_edit)
{
$_SESSION['il_lp_history'] = null;
}
break;
case 'illplistofprogressgui':
if(!$has_personal)
{
$_SESSION['il_lp_history'] = null;
}
break;
}
if($_SESSION['il_lp_history'])
{
return $_SESSION['il_lp_history'];
}
else if($tgt)
{
return $tgt;
}
}
// should not happen
ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
case self::LP_CONTEXT_USER_FOLDER:
case self::LP_CONTEXT_ORG_UNIT:
{
return 'illplistofprogressgui';
}
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLearningProgressGUI::__setCmdClass (   $a_class)

Definition at line 130 of file class.ilLearningProgressGUI.php.

Referenced by executeCommand().

{
// If cmd class == 'illearningprogressgui' the cmd class is set to the the new forwarded class
// otherwise e.g illplistofprogressgui tries to forward (back) to illearningprogressgui.
if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
{
$this->ctrl->setCmdClass(strtolower($a_class));
}
return true;
}

+ Here is the caller graph for this function:

ilLearningProgressGUI::editManual ( )
protected

Definition at line 259 of file class.ilLearningProgressGUI.php.

References ilLearningProgressBaseGUI\$tpl, ilObject\_lookupObjId(), ilLearningProgressAccess\checkAccess(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getRefId(), initCollectionManualForm(), and ilLPObjSettings\LP_MODE_COLLECTION_MANUAL.

{
global $tpl;
include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
{
include_once './Services/Object/classes/class.ilObjectLP.php';
if($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL)
{
$form = $this->initCollectionManualForm();
$tpl->setContent($form->getHTML());
}
}
}

+ Here is the call graph for this function:

& ilLearningProgressGUI::executeCommand ( )

execute command

Definition at line 27 of file class.ilLearningProgressGUI.php.

References $cmd, $ilBench, ilLearningProgressBaseGUI\__buildFooter(), ilLearningProgressBaseGUI\__buildHeader(), __getNextClass(), __setCmdClass(), ilLearningProgressBaseGUI\__setSubTabs(), ilLearningProgressBaseGUI\getMode(), ilLearningProgressBaseGUI\getRefId(), and ilLearningProgressBaseGUI\getUserId().

{
global $ilBench, $ilHelp, $ilAccess;
$ilBench->start('LearningProgress','0000_Start');
$this->ctrl->setReturn($this, "");
// E.g personal desktop mode needs locator header icon ...
$this->__buildHeader();
switch($this->__getNextClass())
{
case 'illplistofprogressgui':
include_once 'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
$ilHelp->setScreenIdComponent("lp");
$this->__setSubTabs(self::LP_ACTIVE_PROGRESS);
$this->__setCmdClass('illplistofprogressgui');
$lop_gui = new ilLPListOfProgressGUI($this->getMode(),$this->getRefId(),$this->getUserId());
$this->ctrl->forwardCommand($lop_gui);
break;
case 'illplistofobjectsgui':
if($this->getRefId() &&
!$ilAccess->checkAccess('read_learning_progress', '', $this->getRefId()))
{
return;
}
include_once 'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
if(stristr($this->ctrl->getCmd(), "matrix"))
{
$this->__setSubTabs(self::LP_ACTIVE_MATRIX);
}
else if(stristr($this->ctrl->getCmd(), "summary"))
{
$this->__setSubTabs(self::LP_ACTIVE_SUMMARY);
}
else
{
$this->__setSubTabs(self::LP_ACTIVE_OBJECTS);
}
$loo_gui = new ilLPListOfObjectsGUI($this->getMode(),$this->getRefId());
$this->__setCmdClass('illplistofobjectsgui');
$this->ctrl->forwardCommand($loo_gui);
break;
case 'illplistofsettingsgui':
if($this->getRefId() &&
!$ilAccess->checkAccess('edit_learning_progress', '', $this->getRefId()))
{
return;
}
include_once 'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
$this->__setSubTabs(self::LP_ACTIVE_SETTINGS);
$los_gui = new ilLPListOfSettingsGUI($this->getMode(),$this->getRefId());
$this->__setCmdClass('illplistofsettingsgui');
$this->ctrl->forwardCommand($los_gui);
break;
case 'illpobjectstatisticsgui':
include_once 'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
if(stristr($this->ctrl->getCmd(), "access"))
{
$this->__setSubTabs(self::LP_ACTIVE_OBJSTATACCESS);
}
else if(stristr($this->ctrl->getCmd(), "types"))
{
$this->__setSubTabs(self::LP_ACTIVE_OBJSTATTYPES);
}
else if(stristr($this->ctrl->getCmd(), "daily"))
{
$this->__setSubTabs(self::LP_ACTIVE_OBJSTATDAILY);
}
else
{
$this->__setSubTabs(self::LP_ACTIVE_OBJSTATADMIN);
}
$this->__setCmdClass('illpobjectstatisticsgui');
$ost_gui = new ilLPObjectStatisticsGUI($this->getMode(),$this->getRefId());
$this->ctrl->forwardCommand($ost_gui);
break;
default:
$cmd = $this->ctrl->getCmd();
$this->$cmd();
$this->tpl->show(true);
break;
}
// E.G personal desktop mode needs $tpl->show();
$this->__buildFooter();
$ilBench->stop('LearningProgress','0000_Start');
return true;
}

+ Here is the call graph for this function:

ilLearningProgressGUI::ilLearningProgressGUI (   $a_mode,
  $a_ref_id = 0,
  $a_user_id = 0 
)

Definition at line 19 of file class.ilLearningProgressGUI.php.

References ilLearningProgressBaseGUI\ilLearningProgressBaseGUI().

{
parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id,$a_user_id);
}

+ Here is the call graph for this function:

ilLearningProgressGUI::initCollectionManualForm ( )
protected

Definition at line 276 of file class.ilLearningProgressGUI.php.

References $changed, $ilCtrl, ilLearningProgressBaseGUI\$lng, $path, ilLPStatusFactory\_getClassById(), ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilObject\_lookupType(), ilDatePresentation\formatDate(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getObjId(), ilLearningProgressBaseGUI\getRefId(), IL_CAL_UNIX, ilUtil\img(), ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPStatus\LP_STATUS_COMPLETED_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by editManual(), and updateManual().

{
global $lng, $ilCtrl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "updatemanual"));
$form->setTitle($lng->txt("learning_progress"));
$form->setDescription($lng->txt("trac_collection_manual_learner_info"));
$coll_items = array();
include_once './Services/Object/classes/class.ilObjectLP.php';
$collection = $olp->getCollectionInstance();
if($collection)
{
$coll_items = $collection->getItems();
$possible_items = $collection->getPossibleItems($this->getRefId()); // for titles
switch(ilObject::_lookupType($this->getObjId()))
{
case "lm":
$subitem_title = $lng->txt("objs_st");
$subitem_info = $lng->txt("trac_collection_manual_learner_lm_info");
break;
}
}
include_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
$lp_data = $class::_getObjectStatus($this->getObjId(), $this->usr_id);
$grp = new ilCheckboxGroupInputGUI($subitem_title, "sids");
$grp->setInfo($subitem_info);
$form->addItem($grp);
// #14994 - using possible items for proper sorting
$completed = array();
foreach(array_keys($possible_items) as $item_id)
{
if(!in_array($item_id, $coll_items))
{
continue;
}
$info = null;
if(isset($lp_data[$item_id]))
{
$changed = new ilDateTime($lp_data[$item_id][1], IL_CAL_UNIX);
$info = $lng->txt("trac_collection_manual_learner_changed_ts").": ".
if($lp_data[$item_id][0])
{
$completed[] = $item_id;
}
}
$icon = ilUtil::img($path, $text);
$opt = new ilCheckboxOption($icon." ".$possible_items[$item_id]["title"], $item_id);
if($info)
{
$opt->setInfo($info);
}
$grp->addOption($opt);
}
if($completed)
{
$grp->setValue($completed);
}
$form->addCommandButton("updatemanual", $lng->txt("save"));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLearningProgressGUI::showtlt ( )
protected

Definition at line 387 of file class.ilLearningProgressGUI.php.

References $ilCtrl, $ilUser, ilLearningProgressBaseGUI\$lng, $path, ilLearningProgressBaseGUI\$tpl, ilLPStatusFactory\_getClassById(), ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilFormat\_secondsToString(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getObjId(), ilLearningProgressBaseGUI\getRefId(), ilUtil\img(), ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

{
global $lng, $ilCtrl, $tpl, $ilUser;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this, "showtlt"));
$form->setTitle($lng->txt("learning_progress"));
$form->setDescription($lng->txt("trac_collection_tlt_learner_info"));
$coll_items = array();
include_once './Services/Object/classes/class.ilObjectLP.php';
$collection = $olp->getCollectionInstance();
if($collection)
{
$coll_items = $collection->getItems();
$possible_items = $collection->getPossibleItems($this->getRefId()); // for titles
}
include_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
$info = $class::_getStatusInfo($this->getObjId(), true);
foreach($coll_items as $item_id)
{
// #16599 - deleted items should not be displayed
if(!array_key_exists($item_id, $possible_items))
{
continue;
}
$field = new ilCustomInputGUI($possible_items[$item_id]["title"]);
// lp status
if(isset($info["completed"][$item_id]) &&
in_array($ilUser->getId(), $info["completed"][$item_id]))
{
}
else if(isset($info["in_progress"][$item_id]) &&
in_array($ilUser->getId(), $info["in_progress"][$item_id]))
{
}
$field->setHtml(ilUtil::img($path, $text));
// stats
$spent = 0;
if(isset($info["tlt_users"][$item_id][$ilUser->getId()]))
{
$spent = $info["tlt_users"][$item_id][$ilUser->getId()];
}
$needed = $info["tlt"][$item_id];
if($needed)
{
$field->setInfo(sprintf($lng->txt("trac_collection_tlt_learner_subitem"),
min(100, round(abs($spent)/$needed*100))));
}
$form->addItem($field);
}
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilLearningProgressGUI::updateManual ( )
protected

Definition at line 361 of file class.ilLearningProgressGUI.php.

References $ilCtrl, ilLearningProgressBaseGUI\$lng, ilLPStatusFactory\_getClassById(), ilObject\_lookupObjId(), ilLearningProgressAccess\checkAccess(), ilObjectLP\getInstance(), ilLearningProgressBaseGUI\getObjId(), ilLearningProgressBaseGUI\getRefId(), initCollectionManualForm(), ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
{
include_once './Services/Object/classes/class.ilObjectLP.php';
if($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL)
{
$form = $this->initCollectionManualForm();
if($form->checkInput())
{
include_once "Services/Tracking/classes/class.ilLPStatusFactory.php";
$class::_setObjectStatus($this->getObjId(), $this->usr_id, $form->getInput("sids"));
ilUtil::sendSuccess($lng->txt("settings_saved"), true);
}
$ilCtrl->redirect($this, "editmanual");
}
}
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: