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');
33 $this->ctrl->setReturn($this,
"");
39 case 'illplistofprogressgui':
40 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
42 $ilHelp->setScreenIdComponent(
"lp");
47 $this->ctrl->forwardCommand($lop_gui);
50 case 'illplistofobjectsgui':
51 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
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':
77 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
84 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
89 $this->ctrl->forwardCommand($los_gui);
92 case 'illpobjectstatisticsgui':
93 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
94 if(stristr($this->ctrl->getCmd(),
"access"))
98 else if(stristr($this->ctrl->getCmd(),
"types"))
102 else if(stristr($this->ctrl->getCmd(),
"daily"))
112 $this->ctrl->forwardCommand($ost_gui);
116 $cmd = $this->ctrl->getCmd();
118 $this->tpl->show(
true);
126 $ilBench->stop(
'LearningProgress',
'0000_Start');
136 if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
138 $this->ctrl->setCmdClass(strtolower($a_class));
153 if(strlen($next_class = $this->ctrl->getNextClass()))
155 if($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP)
157 $_SESSION[
'il_lp_history'] = $next_class;
163 case self::LP_CONTEXT_ADMINISTRATION:
164 return 'illplistofobjectsgui';
166 case self::LP_CONTEXT_REPOSITORY:
167 $cmd = $this->ctrl->getCmd();
168 if(in_array(
$cmd, array(
"editmanual",
"updatemanual",
"showtlt")))
174 include_once
'./Services/Object/classes/class.ilObjectLP.php';
176 if(!$olp->isActive())
178 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
182 return 'illplistofsettingsgui';
190 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
191 if(!$this->anonymized &&
194 return 'illplistofobjectsgui';
199 return 'illplistofsettingsgui';
201 return 'illplistofprogressgui';
203 case self::LP_CONTEXT_PERSONAL_DESKTOP:
205 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
209 if($has_edit || $has_personal)
215 $tgt =
'illplistofprogressgui';
219 $tgt =
'illplistofobjectsgui';
225 case 'illplistofobjectsgui':
232 case 'illplistofprogressgui':
253 case self::LP_CONTEXT_USER_FOLDER:
254 case self::LP_CONTEXT_ORG_UNIT:
257 return 'illplistofprogressgui';
267 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
270 include_once
'./Services/Object/classes/class.ilObjectLP.php';
275 $tpl->setContent($form->getHTML());
284 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
286 $form->setFormAction($ilCtrl->getFormAction($this,
"updatemanual"));
287 $form->setTitle($lng->txt(
"learning_progress"));
288 $form->setDescription($lng->txt(
"trac_collection_manual_learner_info"));
290 $coll_items = array();
292 include_once
'./Services/Object/classes/class.ilObjectLP.php';
294 $collection = $olp->getCollectionInstance();
297 $coll_items = $collection->getItems();
298 $possible_items = $collection->getPossibleItems($this->
getRefId());
303 $subitem_title = $lng->txt(
"objs_st");
304 $subitem_info = $lng->txt(
"trac_collection_manual_learner_lm_info");
309 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
311 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
314 $grp->setInfo($subitem_info);
315 $form->addItem($grp);
319 $completed = array();
320 foreach(array_keys($possible_items) as $item_id)
322 if(!in_array($item_id, $coll_items))
330 if(isset($lp_data[$item_id]))
333 $info = $lng->txt(
"trac_collection_manual_learner_changed_ts").
": ".
336 if($lp_data[$item_id][0])
339 $completed[] = $item_id;
347 $opt =
new ilCheckboxOption($icon.
" ".$possible_items[$item_id][
"title"], $item_id);
350 $opt->setInfo(
$info);
352 $grp->addOption($opt);
357 $grp->setValue($completed);
360 $form->addCommandButton(
"updatemanual", $lng->txt(
"save"));
369 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
372 include_once
'./Services/Object/classes/class.ilObjectLP.php';
377 if($form->checkInput())
379 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
381 $class::_setObjectStatus($this->
getObjId(), $this->usr_id, $form->getInput(
"sids"));
386 $ilCtrl->redirect($this,
"editmanual");
395 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
397 $form->setFormAction($ilCtrl->getFormAction($this,
"showtlt"));
398 $form->setTitle($lng->txt(
"learning_progress"));
399 $form->setDescription($lng->txt(
"trac_collection_tlt_learner_info"));
401 $coll_items = array();
403 include_once
'./Services/Object/classes/class.ilObjectLP.php';
405 $collection = $olp->getCollectionInstance();
408 $coll_items = $collection->getItems();
409 $possible_items = $collection->getPossibleItems($this->
getRefId());
412 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
416 foreach($coll_items as $item_id)
419 if(!array_key_exists($item_id, $possible_items))
428 if(isset(
$info[
"completed"][$item_id]) &&
429 in_array($ilUser->getId(),
$info[
"completed"][$item_id]))
433 else if(isset(
$info[
"in_progress"][$item_id]) &&
434 in_array($ilUser->getId(),
$info[
"in_progress"][$item_id]))
444 if(isset(
$info[
"tlt_users"][$item_id][$ilUser->getId()]))
446 $spent =
$info[
"tlt_users"][$item_id][$ilUser->getId()];
448 $needed =
$info[
"tlt"][$item_id];
451 $field->setInfo(sprintf($lng->txt(
"trac_collection_tlt_learner_subitem"),
454 min(100, round(abs($spent)/$needed*100))));
457 $form->addItem($field);
460 $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
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
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)
_getStatusText($a_status, $a_lng=null)
Get status alt text.
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)