4 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
21 parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id,$a_user_id);
31 $ilBench->start(
'LearningProgress',
'0000_Start');
34 $this->ctrl->setReturn($this,
"");
40 case 'illplistofprogressgui':
41 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
43 $ilHelp->setScreenIdComponent(
"lp");
48 $this->ctrl->forwardCommand($lop_gui);
51 case 'illplistofobjectsgui':
53 !$ilAccess->checkAccess(
'read_learning_progress',
'', $this->getRefId()))
58 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
59 if(stristr($this->ctrl->getCmd(),
"matrix"))
63 else if(stristr($this->ctrl->getCmd(),
"summary"))
73 $this->ctrl->forwardCommand($loo_gui);
76 case 'illplistofsettingsgui':
78 !$ilAccess->checkAccess(
'edit_learning_progress',
'', $this->getRefId()))
83 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
88 $this->ctrl->forwardCommand($los_gui);
91 case 'illpobjectstatisticsgui':
92 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
93 if(stristr($this->ctrl->getCmd(),
"access"))
97 else if(stristr($this->ctrl->getCmd(),
"types"))
101 else if(stristr($this->ctrl->getCmd(),
"daily"))
111 $this->ctrl->forwardCommand($ost_gui);
115 $cmd = $this->ctrl->getCmd();
117 $this->tpl->show(
true);
125 $ilBench->stop(
'LearningProgress',
'0000_Start');
135 if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
137 $this->ctrl->setCmdClass(strtolower($a_class));
152 if(strlen($next_class = $this->ctrl->getNextClass()))
154 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
156 $_SESSION[
'il_lp_history'] = $next_class;
162 case self::LP_CONTEXT_ADMINISTRATION:
163 return 'illplistofobjectsgui';
165 case self::LP_CONTEXT_REPOSITORY:
166 $cmd = $this->ctrl->getCmd();
167 if(in_array(
$cmd, array(
"editmanual",
"updatemanual",
"showtlt")))
173 include_once
'./Services/Object/classes/class.ilObjectLP.php';
175 if(!$olp->isActive())
178 $ilAccess->checkAccess(
'edit_learning_progress',
'',$this->
getRefId()))
180 return 'illplistofsettingsgui';
188 if(!$this->anonymized &&
189 $ilAccess->checkAccess(
'read_learning_progress',
'',$this->getRefId()))
191 return 'illplistofobjectsgui';
193 if($ilAccess->checkAccess(
'edit_learning_progress',
'',$this->getRefId()))
195 return 'illplistofsettingsgui';
197 return 'illplistofprogressgui';
199 case self::LP_CONTEXT_PERSONAL_DESKTOP:
201 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
205 if($has_edit || $has_personal)
211 $tgt =
'illplistofprogressgui';
215 $tgt =
'illplistofobjectsgui';
221 case 'illplistofobjectsgui':
228 case 'illplistofprogressgui':
249 case self::LP_CONTEXT_USER_FOLDER:
250 case self::LP_CONTEXT_ORG_UNIT:
253 return 'illplistofprogressgui';
263 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
266 include_once
'./Services/Object/classes/class.ilObjectLP.php';
271 $tpl->setContent($form->getHTML());
280 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
282 $form->setFormAction($ilCtrl->getFormAction($this,
"updatemanual"));
283 $form->setTitle($lng->txt(
"learning_progress"));
284 $form->setDescription($lng->txt(
"trac_collection_manual_learner_info"));
286 $coll_items = array();
288 include_once
'./Services/Object/classes/class.ilObjectLP.php';
290 $collection = $olp->getCollectionInstance();
293 $coll_items = $collection->getItems();
294 $possible_items = $collection->getPossibleItems($this->
getRefId());
299 $subitem_title = $lng->txt(
"objs_st");
300 $subitem_info = $lng->txt(
"trac_collection_manual_learner_lm_info");
305 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
307 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
310 $grp->setInfo($subitem_info);
311 $form->addItem($grp);
315 $completed = array();
316 foreach(array_keys($possible_items) as $item_id)
318 if(!in_array($item_id, $coll_items))
326 if(isset($lp_data[$item_id]))
329 $info = $lng->txt(
"trac_collection_manual_learner_changed_ts").
": ".
332 if($lp_data[$item_id][0])
335 $completed[] = $item_id;
343 $opt =
new ilCheckboxOption($icon.
" ".$possible_items[$item_id][
"title"], $item_id);
346 $opt->setInfo($info);
348 $grp->addOption($opt);
353 $grp->setValue($completed);
356 $form->addCommandButton(
"updatemanual", $lng->txt(
"save"));
365 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
368 include_once
'./Services/Object/classes/class.ilObjectLP.php';
373 if($form->checkInput())
375 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
377 $class::_setObjectStatus($this->
getObjId(), $this->usr_id, $form->getInput(
"sids"));
382 $ilCtrl->redirect($this,
"editmanual");
391 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
393 $form->setFormAction($ilCtrl->getFormAction($this,
"showtlt"));
394 $form->setTitle($lng->txt(
"learning_progress"));
395 $form->setDescription($lng->txt(
"trac_collection_tlt_learner_info"));
397 $coll_items = array();
399 include_once
'./Services/Object/classes/class.ilObjectLP.php';
401 $collection = $olp->getCollectionInstance();
404 $coll_items = $collection->getItems();
405 $possible_items = $collection->getPossibleItems($this->
getRefId());
408 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
410 $info = $class::_getStatusInfo($this->
getObjId(),
true);
412 foreach($coll_items as $item_id)
415 if(!array_key_exists($item_id, $possible_items))
424 if(isset($info[
"completed"][$item_id]) &&
425 in_array($ilUser->getId(), $info[
"completed"][$item_id]))
429 else if(isset($info[
"in_progress"][$item_id]) &&
430 in_array($ilUser->getId(), $info[
"in_progress"][$item_id]))
440 if(isset($info[
"tlt_users"][$item_id][$ilUser->getId()]))
442 $spent = $info[
"tlt_users"][$item_id][$ilUser->getId()];
444 $needed = $info[
"tlt"][$item_id];
447 $field->setInfo(sprintf($lng->txt(
"trac_collection_tlt_learner_subitem"),
450 min(100, round(abs($spent)/$needed*100))));
453 $form->addItem($field);
456 $tpl->setContent($form->getHTML());
const LP_STATUS_COMPLETED_NUM
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a checkbox group.
static _hasLearningProgressLearner()
const LP_STATUS_IN_PROGRESS_NUM
Class ilLPListOfSettingsGUI.
const LP_MODE_COLLECTION_MANUAL
_getImagePathForStatus($a_status)
Get image path for status.
static _hasLearningProgressOtherUsers()
const LP_MODE_COLLECTION_TLT
_getStatusText($a_status)
Get status alt text.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _enabledLearningProgress()
check wether learing progress is enabled or not
initCollectionManualForm()
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
static _lookupType($a_id, $a_reference=false)
lookup object type
const LP_STATUS_NOT_ATTEMPTED_NUM
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
ilLearningProgressGUI($a_mode, $a_ref_id=0, $a_user_id=0)
static redirect($a_script)
http redirect to other script
static getInstance($a_obj_id)
Class ilObjUserTrackingGUI.
& executeCommand()
execute command
_getClassById($a_obj_id, $a_mode=NULL)