4 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
26 $ilBench->start(
'LearningProgress',
'0000_Start');
28 $this->ctrl->setReturn($this,
"");
33 case 'illplistofprogressgui':
34 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
41 $this->ctrl->forwardCommand($lop_gui);
44 case 'illplistofobjectsgui':
45 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
51 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
52 if (stristr($this->ctrl->getCmd(),
"matrix")) {
54 } elseif (stristr($this->ctrl->getCmd(),
"summary")) {
61 $this->ctrl->forwardCommand($loo_gui);
64 case 'illplistofsettingsgui':
65 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
71 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
76 $this->ctrl->forwardCommand($los_gui);
79 case 'illpobjectstatisticsgui':
80 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
81 if (stristr($this->ctrl->getCmd(),
"access")) {
83 } elseif (stristr($this->ctrl->getCmd(),
"types")) {
85 } elseif (stristr($this->ctrl->getCmd(),
"daily")) {
92 $this->ctrl->forwardCommand($ost_gui);
96 $cmd = $this->ctrl->getCmd();
101 $this->tpl->show(
true);
109 $ilBench->stop(
'LearningProgress',
'0000_Start');
119 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
120 $this->ctrl->setCmdClass(strtolower($a_class));
134 if (strlen($next_class = $this->ctrl->getNextClass())) {
135 if ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
136 $_SESSION[
'il_lp_history'] = $next_class;
141 case self::LP_CONTEXT_ADMINISTRATION:
142 return 'illplistofobjectsgui';
144 case self::LP_CONTEXT_REPOSITORY:
145 $cmd = $this->ctrl->getCmd();
146 if (in_array($cmd,
array(
"editManual",
"updatemanual",
"showtlt"))) {
151 include_once
'./Services/Object/classes/class.ilObjectLP.php';
153 if (!$olp->isActive()) {
154 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
157 return 'illplistofsettingsgui';
163 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
164 if (!$this->anonymized &&
166 return 'illplistofobjectsgui';
170 return 'illplistofsettingsgui';
172 return 'illplistofprogressgui';
174 case self::LP_CONTEXT_PERSONAL_DESKTOP:
176 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
180 if ($has_edit || $has_personal) {
184 $tgt =
'illplistofprogressgui';
185 } elseif ($has_edit) {
186 $tgt =
'illplistofobjectsgui';
191 case 'illplistofobjectsgui':
197 case 'illplistofprogressgui':
198 if (!$has_personal) {
215 case self::LP_CONTEXT_USER_FOLDER:
216 case self::LP_CONTEXT_ORG_UNIT:
218 return 'illplistofprogressgui';
236 $tpl->setContent(
$form->getHTML());
245 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
247 $form->setFormAction($ilCtrl->getFormAction($this,
"updatemanual"));
248 $form->setTitle($lng->txt(
"learning_progress"));
249 $form->setDescription($lng->txt(
"trac_collection_manual_learner_info"));
251 $coll_items =
array();
253 include_once
'./Services/Object/classes/class.ilObjectLP.php';
255 $collection = $olp->getCollectionInstance();
257 $coll_items = $collection->getItems();
258 $possible_items = $collection->getPossibleItems($this->
getRefId());
262 $subitem_title = $lng->txt(
"objs_st");
263 $subitem_info = $lng->txt(
"trac_collection_manual_learner_lm_info");
268 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
270 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
273 $grp->setInfo($subitem_info);
274 $form->addItem($grp);
278 $completed =
array();
279 foreach (array_keys($possible_items) as $item_id) {
280 if (!in_array($item_id, $coll_items)) {
287 if (isset($lp_data[$item_id])) {
289 $info = $lng->txt(
"trac_collection_manual_learner_changed_ts") .
": " .
292 if ($lp_data[$item_id][0]) {
294 $completed[] = $item_id;
302 $opt =
new ilCheckboxOption($icon .
" " . $possible_items[$item_id][
"title"], $item_id);
304 $opt->setInfo(
$info);
306 $grp->addOption($opt);
310 $grp->setValue($completed);
313 $form->addCommandButton(
"updatemanual", $lng->txt(
"save"));
322 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
324 include_once
'./Services/Object/classes/class.ilObjectLP.php';
328 if (
$form->checkInput()) {
329 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
331 $class::_setObjectStatus($this->
getObjId(), $this->usr_id,
$form->getInput(
"sids"));
336 $ilCtrl->redirect($this,
"editManual");
345 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
347 $form->setFormAction($ilCtrl->getFormAction($this,
"showtlt"));
348 $form->setTitle($lng->txt(
"learning_progress"));
349 $form->setDescription($lng->txt(
"trac_collection_tlt_learner_info"));
351 $coll_items =
array();
353 include_once
'./Services/Object/classes/class.ilObjectLP.php';
355 $collection = $olp->getCollectionInstance();
357 $coll_items = $collection->getItems();
358 $possible_items = $collection->getPossibleItems($this->
getRefId());
361 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
365 foreach ($coll_items as $item_id) {
367 if (!array_key_exists($item_id, $possible_items)) {
375 if (isset(
$info[
"completed"][$item_id]) &&
376 in_array($ilUser->getId(),
$info[
"completed"][$item_id])) {
378 } elseif (isset(
$info[
"in_progress"][$item_id]) &&
379 in_array($ilUser->getId(),
$info[
"in_progress"][$item_id])) {
388 if (isset(
$info[
"tlt_users"][$item_id][$ilUser->getId()])) {
389 $spent =
$info[
"tlt_users"][$item_id][$ilUser->getId()];
391 $needed =
$info[
"tlt"][$item_id];
393 $field->setInfo(sprintf(
394 $lng->txt(
"trac_collection_tlt_learner_subitem"),
397 min(100, round(abs($spent)/$needed*100))
401 $form->addItem($field);
404 $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 _getImagePathForStatus($a_status)
Get image path for status.
static _hasLearningProgressLearner()
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
executeCommand()
execute command
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const LP_STATUS_IN_PROGRESS_NUM
Class ilLPListOfSettingsGUI.
const LP_MODE_COLLECTION_MANUAL
static _hasLearningProgressOtherUsers()
const LP_MODE_COLLECTION_TLT
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
static _getClassById($a_obj_id, $a_mode=null)
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
editManual()
Show progress screen for "edit manual" type $tpl.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
if(isset($_POST['submit'])) $form
initCollectionManualForm()
static _lookupObjId($a_id)
Create styles array
The data for the language used.
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.
static redirect($a_script)
static getInstance($a_obj_id)
Class ilObjUserTrackingGUI.