4 include_once
'./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
26 $ilHelp = $DIC[
'ilHelp'];
27 $ilAccess = $DIC[
'ilAccess'];
29 $this->ctrl->setReturn($this,
"");
34 case 'illplistofprogressgui':
35 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfProgressGUI.php';
42 $this->ctrl->forwardCommand($lop_gui);
45 case 'illplistofobjectsgui':
46 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
52 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfObjectsGUI.php';
53 if (stristr($this->ctrl->getCmd(),
"matrix")) {
55 } elseif (stristr($this->ctrl->getCmd(),
"summary")) {
62 $this->ctrl->forwardCommand($loo_gui);
65 case 'illplistofsettingsgui':
66 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
72 include_once
'Services/Tracking/classes/repository_statistics/class.ilLPListOfSettingsGUI.php';
77 $this->ctrl->forwardCommand($los_gui);
80 case 'illpobjectstatisticsgui':
81 include_once
'Services/Tracking/classes/object_statistics/class.ilLPObjectStatisticsGUI.php';
82 if (stristr($this->ctrl->getCmd(),
"access")) {
84 } elseif (stristr($this->ctrl->getCmd(),
"types")) {
86 } elseif (stristr($this->ctrl->getCmd(),
"daily")) {
93 $this->ctrl->forwardCommand($ost_gui);
97 $cmd = $this->ctrl->getCmd();
102 $this->tpl->show(
true);
118 if ($this->ctrl->getCmdClass() == strtolower(get_class($this))) {
119 $this->ctrl->setCmdClass(strtolower($a_class));
128 $ilAccess = $DIC[
'ilAccess'];
136 if (strlen($next_class = $this->ctrl->getNextClass())) {
137 if ($this->
getMode() == self::LP_CONTEXT_PERSONAL_DESKTOP) {
138 $_SESSION[
'il_lp_history'] = $next_class;
143 case self::LP_CONTEXT_ADMINISTRATION:
144 return 'illplistofobjectsgui';
146 case self::LP_CONTEXT_REPOSITORY:
147 $cmd = $this->ctrl->getCmd();
148 if (in_array($cmd, array(
"editManual",
"updatemanual",
"showtlt"))) {
153 include_once
'./Services/Object/classes/class.ilObjectLP.php';
155 if (!$olp->isActive()) {
156 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
159 return 'illplistofsettingsgui';
165 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
166 if (!$this->anonymized &&
168 return 'illplistofobjectsgui';
172 return 'illplistofsettingsgui';
174 return 'illplistofprogressgui';
176 case self::LP_CONTEXT_PERSONAL_DESKTOP:
178 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
182 if ($has_edit || $has_personal) {
186 $tgt =
'illplistofprogressgui';
187 } elseif ($has_edit) {
188 $tgt =
'illplistofobjectsgui';
193 case 'illplistofobjectsgui':
199 case 'illplistofprogressgui':
200 if (!$has_personal) {
217 case self::LP_CONTEXT_USER_FOLDER:
218 case self::LP_CONTEXT_ORG_UNIT:
220 return 'illplistofprogressgui';
252 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
254 $form->setFormAction(
$ilCtrl->getFormAction($this,
"updatemanual"));
255 $form->setTitle(
$lng->txt(
"learning_progress"));
256 $form->setDescription(
$lng->txt(
"trac_collection_manual_learner_info"));
258 $coll_items = array();
260 include_once
'./Services/Object/classes/class.ilObjectLP.php';
262 $collection = $olp->getCollectionInstance();
264 $coll_items = $collection->getItems();
265 $possible_items = $collection->getPossibleItems($this->
getRefId());
269 $subitem_title =
$lng->txt(
"objs_st");
270 $subitem_info =
$lng->txt(
"trac_collection_manual_learner_lm_info");
275 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
277 $lp_data = $class::_getObjectStatus($this->
getObjId(), $this->usr_id);
280 $grp->setInfo($subitem_info);
281 $form->addItem($grp);
285 $completed = array();
286 foreach (array_keys($possible_items) as $item_id) {
287 if (!in_array($item_id, $coll_items)) {
294 if (isset($lp_data[$item_id])) {
296 $info =
$lng->txt(
"trac_collection_manual_learner_changed_ts") .
": " .
299 if ($lp_data[$item_id][0]) {
301 $completed[] = $item_id;
309 $opt =
new ilCheckboxOption($icon .
" " . $possible_items[$item_id][
"title"], $item_id);
311 $opt->setInfo(
$info);
313 $grp->addOption($opt);
317 $grp->setValue($completed);
320 $form->addCommandButton(
"updatemanual",
$lng->txt(
"save"));
332 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
334 include_once
'./Services/Object/classes/class.ilObjectLP.php';
338 if (
$form->checkInput()) {
339 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
341 $class::_setObjectStatus($this->
getObjId(), $this->usr_id,
$form->getInput(
"sids"));
343 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
346 $ilCtrl->redirect($this,
"editManual");
360 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
362 $form->setFormAction(
$ilCtrl->getFormAction($this,
"showtlt"));
363 $form->setTitle(
$lng->txt(
"learning_progress"));
364 $form->setDescription(
$lng->txt(
"trac_collection_tlt_learner_info"));
366 $coll_items = array();
368 include_once
'./Services/Object/classes/class.ilObjectLP.php';
370 $collection = $olp->getCollectionInstance();
372 $coll_items = $collection->getItems();
373 $possible_items = $collection->getPossibleItems($this->
getRefId());
376 include_once
"Services/Tracking/classes/class.ilLPStatusFactory.php";
380 foreach ($coll_items as $item_id) {
382 if (!array_key_exists($item_id, $possible_items)) {
390 if (isset(
$info[
"completed"][$item_id]) &&
391 in_array(
$ilUser->getId(),
$info[
"completed"][$item_id])) {
393 } elseif (isset(
$info[
"in_progress"][$item_id]) &&
394 in_array(
$ilUser->getId(),
$info[
"in_progress"][$item_id])) {
403 if (isset(
$info[
"tlt_users"][$item_id][
$ilUser->getId()])) {
404 $spent =
$info[
"tlt_users"][$item_id][
$ilUser->getId()];
406 $needed =
$info[
"tlt"][$item_id];
408 $field->setInfo(sprintf(
409 $lng->txt(
"trac_collection_tlt_learner_subitem"),
412 min(100, round(abs($spent) / $needed * 100))
416 $form->addItem($field);
const LP_STATUS_COMPLETED_NUM
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
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 formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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)
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static _lookupType($a_id, $a_reference=false)
lookup object type
const LP_STATUS_NOT_ATTEMPTED_NUM
static redirect($a_script)
static getInstance($a_obj_id)
Class ilObjUserTrackingGUI.