ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilLearningProgressBaseGUI Class Reference
+ Inheritance diagram for ilLearningProgressBaseGUI:
+ Collaboration diagram for ilLearningProgressBaseGUI:

Public Member Functions

 __construct (int $a_mode, int $a_ref_id=0, int $a_usr_id=0)
 
 executeCommand ()
 
 isAnonymized ()
 
 getMode ()
 
 getRefId ()
 
 getObjId ()
 
 getUserId ()
 
 __getDefaultCommand ()
 
 __setSubTabs (int $a_active)
 
 __buildFooter ()
 
 __buildHeader ()
 
 __showObjectDetails (ilInfoScreenGUI $info, int $item_id=0, string $item_type='', bool $add_section=true)
 show details about current object. More...
 
 __appendLPDetails (ilInfoScreenGUI $info, int $item_id, int $user_id)
 
 __getLegendHTML (int $variant=ilLPStatusIcons::ICON_VARIANT_LONG)
 
 __showEditUser (int $a_user_id, int $a_ref_id, ?string $a_cancel=null, int $a_sub_id=0)
 
 __updateUser (int $user_id, int $obj_id)
 

Static Public Member Functions

static _getStatusText (int $a_status, ?ilLanguage $a_lng=null)
 Get status alt text. More...
 
static __readStatus (int $a_obj_id, int $user_id)
 @noinspection PhpInconsistentReturnPointsInspection More...
 
static isObjectOffline (int $a_obj_id, string $a_type='')
 

Data Fields

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
 

Protected Member Functions

 handleCommand ()
 
 initUserIdFromQuery ()
 
 readTypicalLearningTimeInSeconds (int $obj_id, int $sub_id, string $type)
 
 initEditUserForm (int $a_user_id, int $a_obj_id, ?string $a_cancel=null)
 

Protected Attributes

RefineryFactory $refinery
 
HttpServices $http
 
ilGlobalTemplateInterface $tpl
 
ilHelpGUI $help
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilLogger $logger
 
ilTabsGUI $tabs_gui
 
ilToolbarGUI $toolbar
 
ilObjectDataCache $ilObjectDataCache
 
ilObjUser $user
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTree $tree
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
LOMServices $lom_services
 
ilErrorHandling $error
 
bool $anonymized
 
int $usr_id = 0
 
int $ref_id = 0
 
int $obj_id = 0
 
string $obj_type = ''
 
int $mode = 0
 
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
 

Detailed Description

Definition at line 35 of file class.ilLearningProgressBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLearningProgressBaseGUI::__construct ( int  $a_mode,
int  $a_ref_id = 0,
int  $a_usr_id = 0 
)

Reimplemented in ilLPListOfProgressGUI.

Definition at line 82 of file class.ilLearningProgressBaseGUI.php.

86 {
87 global $DIC;
88
89 $this->tpl = $DIC->ui()->mainTemplate();
90 $this->help = $DIC->help();
91 $this->ctrl = $DIC->ctrl();
92 $this->lng = $DIC->language();
93 $this->lng->loadLanguageModule('trac');
94 $this->tabs_gui = $DIC->tabs();
95 $this->toolbar = $DIC->toolbar();
96 $this->ilObjectDataCache = $DIC['ilObjDataCache'];
97 $this->user = $DIC->user();
98 $this->access = $DIC->access();
99 $this->rbacsystem = $DIC->rbac()->system();
100 $this->rbacreview = $DIC->rbac()->review();
101 $this->tree = $DIC->repositoryTree();
102 $this->lom_services = $DIC->learningObjectMetadata();
103 $this->error = $DIC['ilErr'];
104
105 $this->http = $DIC->http();
106 $this->refinery = $DIC->refinery();
107 $this->ui_factory = $DIC->ui()->factory();
108 $this->ui_renderer = $DIC->ui()->renderer();
109
110 $this->mode = $a_mode;
111 $this->ref_id = $a_ref_id;
112 $this->obj_id = $this->ilObjectDataCache->lookupObjId($this->ref_id);
113 $this->obj_type = $this->ilObjectDataCache->lookupType($this->obj_id);
114 $this->usr_id = $a_usr_id;
115
116 $this->anonymized = !ilObjUserTracking::_enabledUserRelatedData();
117 if (!$this->anonymized && $this->obj_id) {
118 $olp = ilObjectLP::getInstance($this->obj_id);
119 $this->anonymized = $olp->isAnonymized();
120 }
121 $this->logger = $DIC->logger()->trac();
122 }
class ilObjectDataCache
static getInstance(int $obj_id)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, ilObjUserTracking\_enabledUserRelatedData(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObjectLP\getInstance(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilObjectDataCache\lookupObjId(), ilObjectDataCache\lookupType(), ILIAS\Repository\refinery(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ __appendLPDetails()

ilLearningProgressBaseGUI::__appendLPDetails ( ilInfoScreenGUI  $info,
int  $item_id,
int  $user_id 
)

Definition at line 432 of file class.ilLearningProgressBaseGUI.php.

436 : void {
437 $type = $this->ilObjectDataCache->lookupType($item_id);
438 // Section learning_progress
439 // $info->addSection($this->lng->txt('trac_learning_progress'));
440 // see ilLPTableBaseGUI::parseTitle();
441 $info->addSection(
442 $this->lng->txt("trac_progress") . ": " . ilObject::_lookupTitle(
443 $item_id
444 )
445 );
446 $olp = ilObjectLP::getInstance($item_id);
447 $info->addProperty(
448 $this->lng->txt('trac_mode'),
449 $olp->getModeText($olp->getCurrentMode())
450 );
451
454
457 );
458 $info->addProperty(
459 $this->lng->txt('trac_status'),
460 $icons->renderIconForStatus(ilLPStatus::_lookupStatus($item_id, $user_id)) .
461 " " .
462 $status_text
463 );
464
465 if ($olp->getCurrentMode() === ilLPObjSettings::LP_MODE_MANUAL) {
466 // status
467 $i_tpl = new ilTemplate(
468 "tpl.lp_edit_manual_info_page.html",
469 true,
470 true,
471 "components/ILIAS/Tracking"
472 );
473 $i_tpl->setVariable(
474 "INFO_EDITED",
475 $this->lng->txt("trac_info_edited")
476 );
477 $i_tpl->setVariable(
478 "SELECT_STATUS",
481 $user_id,
482 $item_id
483 ),
484 'lp_edit',
485 [0 => $this->lng->txt('trac_not_completed'),
486 1 => $this->lng->txt('trac_completed')
487 ],
488 false,
489 true
490 )
491 );
492 $i_tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
493 $info->addProperty($this->lng->txt('trac_status'), $i_tpl->get());
494 }
495
496 // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
497 $mode = $olp->getCurrentMode();
498 if (in_array(
499 $mode,
502 // ilLPObjSettings::LP_MODE_OBJECTIVES,
512 )
513 )) {
514 $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
515 $info->addProperty(
516 $this->lng->txt('trac_percentage'),
517 (int) $perc . "%"
518 );
519 }
520 }
521
522 if (ilObjectLP::supportsMark($type)) {
523 if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) {
524 $info->addProperty($this->lng->txt('trac_mark'), $mark);
525 }
526 }
527
528 if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) {
529 $info->addProperty($this->lng->txt('trac_comment'), $comment);
530 }
531
532 // More infos for lm's
533 if (in_array($type, ["lm", "htlm"])) {
534 $progress = ilLearningProgress::_getProgress($user_id, $item_id);
535 if ($progress['access_time'] ?? false) {
536 $info->addProperty(
537 $this->lng->txt('trac_last_access'),
539 new ilDateTime($progress['access_time'], IL_CAL_UNIX)
540 )
541 );
542 } else {
543 $info->addProperty(
544 $this->lng->txt('trac_last_access'),
545 $this->lng->txt('trac_not_accessed')
546 );
547 }
548
549 $info->addProperty(
550 $this->lng->txt('trac_visits_nr'),
551 (string) ($progress['visits'] ?? "")
552 );
553
554 if ($type == 'lm') {
555 $info->addProperty(
556 $this->lng->txt('trac_spent_time'),
558 $progress['spent_seconds']
559 )
560 );
561 }
562 }
563 }
$comment
Definition: buildRTE.php:72
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
@classDescription Date and time handling
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
static _lookupComment(int $a_usr_id, int $a_obj_id)
static _hasCompleted(int $a_usr_id, int $a_obj_id)
static _lookupMark(int $a_usr_id, int $a_obj_id)
const int LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
const int LP_MODE_CMIX_COMPLETED
const int LP_MODE_CMIX_PASSED_WITH_FAILED
const int LP_MODE_CMIX_COMPL_WITH_FAILED
const int LP_MODE_CMIX_COMPLETED_OR_PASSED
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
static _lookupPercentage(int $a_obj_id, int $a_user_id)
Lookup percentage.
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static _getProgress(int $a_user_id, int $a_obj_id)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static supportsMark(string $obj_type)
static isSupportedObjectType(string $type)
static _lookupTitle(int $obj_id)
special template class to simplify handling of ITX/PEAR
$info
Definition: entry_point.php:21

Referenced by ilLPListOfProgressGUI\details().

+ Here is the caller graph for this function:

◆ __buildFooter()

ilLearningProgressBaseGUI::__buildFooter ( )

Definition at line 335 of file class.ilLearningProgressBaseGUI.php.

335 : void
336 {
337 switch ($this->getMode()) {
339 $this->tpl->printToStdout();
340 }
341 }

References getMode(), and LP_CONTEXT_PERSONAL_DESKTOP.

Referenced by ilLearningProgressGUI\handleCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildHeader()

ilLearningProgressBaseGUI::__buildHeader ( )

Definition at line 343 of file class.ilLearningProgressBaseGUI.php.

343 : void
344 {
345 }

Referenced by ilLearningProgressGUI\handleCommand().

+ Here is the caller graph for this function:

◆ __getDefaultCommand()

ilLearningProgressBaseGUI::__getDefaultCommand ( )

Definition at line 197 of file class.ilLearningProgressBaseGUI.php.

197 : string
198 {
199 if (strlen($cmd = $this->ctrl->getCmd())) {
200 return $cmd;
201 }
202 return 'show';
203 }

References ILIAS\Repository\ctrl().

Referenced by ilLPObjectStatisticsGUI\handleCommand(), ilLPListOfObjectsGUI\handleCommand(), ilLPListOfProgressGUI\handleCommand(), and ilLPListOfSettingsGUI\handleCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getLegendHTML()

ilLearningProgressBaseGUI::__getLegendHTML ( int  $variant = ilLPStatusIcons::ICON_VARIANT_LONG)

Definition at line 586 of file class.ilLearningProgressBaseGUI.php.

586 : string
587 {
588 $icons = ilLPStatusIcons::getInstance($variant);
589
590 $tpl = new ilTemplate(
591 "tpl.lp_legend.html",
592 true,
593 true,
594 "components/ILIAS/Tracking"
595 );
597 "IMG_NOT_ATTEMPTED",
598 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM)
599 );
601 "IMG_IN_PROGRESS",
602 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM)
603 );
605 "IMG_COMPLETED",
606 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_COMPLETED_NUM)
607 );
609 "IMG_FAILED",
610 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_FAILED_NUM)
611 );
613 "TXT_NOT_ATTEMPTED",
614 $this->lng->txt("trac_not_attempted")
615 );
617 "TXT_IN_PROGRESS",
618 $this->lng->txt("trac_in_progress")
619 );
621 "TXT_COMPLETED",
622 $this->lng->txt("trac_completed")
623 );
625 "TXT_FAILED",
626 $this->lng->txt("trac_failed")
627 );
628
629 $panel = $this->ui_factory->panel()->secondary()->legacy(
630 '',
631 $this->ui_factory->legacy()->content($tpl->get())
632 );
633
634 return $this->ui_renderer->render($panel);
635 }
const int LP_STATUS_FAILED_NUM
const int LP_STATUS_COMPLETED_NUM
const int LP_STATUS_IN_PROGRESS_NUM
const int LP_STATUS_NOT_ATTEMPTED_NUM
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References ILIAS\News\Common\Table\$tpl, ILIAS\UICore\GlobalTemplate\get(), ilLPStatusIcons\getInstance(), ILIAS\Repository\lng(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, and ILIAS\UICore\GlobalTemplate\setVariable().

Referenced by ilLPListOfObjectsGUI\__listObjects(), ilLPListOfProgressGUI\__showProgressList(), ilLPListOfObjectsGUI\__showUsersList(), ilLPListOfProgressGUI\details(), ilLPListOfObjectsGUI\showObjectSummary(), ilLPListOfObjectsGUI\showUserObjectMatrix(), and ilLPListOfObjectsGUI\userDetails().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __readStatus()

static ilLearningProgressBaseGUI::__readStatus ( int  $a_obj_id,
int  $user_id 
)
static

@noinspection PhpInconsistentReturnPointsInspection

Definition at line 566 of file class.ilLearningProgressBaseGUI.php.

566 : string
567 {
568 $status = ilLPStatus::_lookupStatus($a_obj_id, $user_id);
569
570 switch ($status) {
573
576
579
580 default:
583 }
584 }
const string LP_STATUS_COMPLETED
const string LP_STATUS_IN_PROGRESS
const string LP_STATUS_NOT_ATTEMPTED
const string LP_STATUS_FAILED

References $user_id, ilLPStatus\_lookupStatus(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by ilObjSCORMLearningModule\exportSelected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSubTabs()

ilLearningProgressBaseGUI::__setSubTabs ( int  $a_active)

Definition at line 205 of file class.ilLearningProgressBaseGUI.php.

205 : void
206 {
207 switch ($this->getMode()) {
209
212 $this->tabs_gui->addTarget(
213 'trac_progress',
214 $this->ctrl->getLinkTargetByClass(
215 'illplistofprogressgui',
216 ''
217 ),
218 "",
219 "",
220 "",
221 $a_active == self::LP_ACTIVE_PROGRESS
222 );
223 }
224 break;
225
227 // #12771 - do not show status if learning progress is deactivated
228 $olp = ilObjectLP::getInstance($this->obj_id);
229 if ($olp->isActive()) {
231 'read_learning_progress',
232 $this->getRefId()
233 );
234
235 if ($this->isAnonymized() || !$has_read) {
236 $this->ctrl->setParameterByClass(
237 'illplistofprogressgui',
238 'user_id',
239 $this->getUserId()
240 );
241 $this->tabs_gui->addSubTabTarget(
242 'trac_progress',
243 $this->ctrl->getLinkTargetByClass(
244 'illplistofprogressgui',
245 ''
246 ),
247 "",
248 "",
249 "",
250 $a_active == self::LP_ACTIVE_PROGRESS
251 );
252 } else {
253 // Check if it is a course
254 $sub_tab = ($this->ilObjectDataCache->lookupType(
256 $this->getRefId()
257 )
258 ) == 'crs') ?
259 'trac_crs_objects' :
260 'trac_objects';
261
262 $this->tabs_gui->addSubTabTarget(
263 $sub_tab,
264 $this->ctrl->getLinkTargetByClass(
265 "illplistofobjectsgui",
266 ''
267 ),
268 "",
269 "",
270 "",
271 $a_active == self::LP_ACTIVE_OBJECTS
272 );
273 }
274
275 if ($has_read) {
276 if (!$this->isAnonymized() &&
277 !($olp instanceof ilPluginLP) &&
278 ilObjectLP::supportsMatrixView($this->obj_type)) {
279 $this->tabs_gui->addSubTabTarget(
280 "trac_matrix",
281 $this->ctrl->getLinkTargetByClass(
282 "illplistofobjectsgui",
283 'showUserObjectMatrix'
284 ),
285 "",
286 "",
287 "",
288 $a_active == self::LP_ACTIVE_MATRIX
289 );
290 }
291
292 $this->tabs_gui->addSubTabTarget(
293 "trac_summary",
294 $this->ctrl->getLinkTargetByClass(
295 "illplistofobjectsgui",
296 'showObjectSummary'
297 ),
298 "",
299 "",
300 "",
301 $a_active == self::LP_ACTIVE_SUMMARY
302 );
303 }
304 }
305 if (!($olp instanceof ilPluginLP) &&
307 'edit_learning_progress',
308 $this->getRefId()
309 )) {
310 $this->tabs_gui->addSubTabTarget(
311 'trac_settings',
312 $this->ctrl->getLinkTargetByClass(
313 'illplistofsettingsgui',
314 ''
315 ),
316 "",
317 "",
318 "",
319 $a_active == self::LP_ACTIVE_SETTINGS
320 );
321 }
322 break;
323
326 // No tabs default class is lpprogressgui
327 break;
328
329 default:
330 die('No valid mode given');
331 break;
332 }
333 }
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
static supportsMatrixView(string $obj_type)

References ilObjUserTracking\_enabledUserRelatedData(), ilObjUserTracking\_hasLearningProgressLearner(), ilLearningProgressAccess\checkPermission(), ILIAS\Repository\ctrl(), ilObjectLP\getInstance(), getMode(), getRefId(), getUserId(), isAnonymized(), ilObjectDataCache\lookupObjId(), ilObjectDataCache\lookupType(), LP_ACTIVE_MATRIX, LP_ACTIVE_OBJECTS, LP_ACTIVE_SETTINGS, LP_ACTIVE_SUMMARY, LP_CONTEXT_ORG_UNIT, LP_CONTEXT_PERSONAL_DESKTOP, LP_CONTEXT_REPOSITORY, LP_CONTEXT_USER_FOLDER, and ilObjectLP\supportsMatrixView().

Referenced by ilLearningProgressGUI\handleCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showEditUser()

ilLearningProgressBaseGUI::__showEditUser ( int  $a_user_id,
int  $a_ref_id,
?string  $a_cancel = null,
int  $a_sub_id = 0 
)

Definition at line 696 of file class.ilLearningProgressBaseGUI.php.

701 : string {
702 if (!$a_sub_id) {
703 $obj_id = ilObject::_lookupObjId($a_ref_id);
704 } else {
705 $this->ctrl->setParameter($this, 'userdetails_id', $a_sub_id);
706 $obj_id = ilObject::_lookupObjId($a_sub_id);
707 }
708 $this->ctrl->setParameter($this, 'user_id', $a_user_id);
709 $this->ctrl->setParameter($this, 'details_id', $a_ref_id);
710 $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
711 return $form->getHTML();
712 }
initEditUserForm(int $a_user_id, int $a_obj_id, ?string $a_cancel=null)
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId().

Referenced by ilLPListOfObjectsGUI\editUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __showObjectDetails()

ilLearningProgressBaseGUI::__showObjectDetails ( ilInfoScreenGUI  $info,
int  $item_id = 0,
string  $item_type = '',
bool  $add_section = true 
)

show details about current object.

Uses an existing info_gui object.

Definition at line 382 of file class.ilLearningProgressBaseGUI.php.

387 : bool {
388 $details_id = $item_id ?: $this->details_id;
389 $details_type = $item_type ?: $this->details_type;
390
391 $olp = ilObjectLP::getInstance($details_id);
392 $mode = $olp->getCurrentMode();
393 if (
395 $this->readTypicalLearningTimeInSeconds($details_id, 0, $details_type)
396 ) {
397 // Section object details
398 if ($add_section) {
399 $info->addSection($this->lng->txt('details'));
400 }
401
403 $info->addProperty(
404 $this->lng->txt('trac_required_visits'),
405 (string) ilLPObjSettings::_lookupVisits($details_id)
406 );
407 }
408
409 if ($seconds = $this->readTypicalLearningTimeInSeconds($details_id, 0, $details_type)) {
410 $info->addProperty(
411 $this->lng->txt('meta_typical_learning_time'),
413 );
414 }
415 return true;
416 }
417 return false;
418 }
static _lookupVisits(int $a_obj_id)
readTypicalLearningTimeInSeconds(int $obj_id, int $sub_id, string $type)

Referenced by ilLPListOfObjectsGUI\details(), ilLPListOfProgressGUI\details(), ilLPListOfObjectsGUI\editUser(), ilLPListOfObjectsGUI\showUserObjectMatrix(), and ilLPListOfObjectsGUI\userDetails().

+ Here is the caller graph for this function:

◆ __updateUser()

ilLearningProgressBaseGUI::__updateUser ( int  $user_id,
int  $obj_id 
)

Definition at line 714 of file class.ilLearningProgressBaseGUI.php.

714 : void
715 {
716 $form = $this->initEditUserForm($user_id, $obj_id);
717 if ($form->checkInput()) {
718 $marks = new ilLPMarks($obj_id, $user_id);
719 $marks->setMark($form->getInput("mark"));
720 $marks->setComment($form->getInput("comment"));
721
722 $do_lp = false;
723
724 // status/completed is optional
725 $status = $form->getItemByPostVar("completed");
726 if (is_object($status)) {
727 if ($marks->getCompleted() != $form->getInput("completed")) {
728 $marks->setCompleted($form->getInput("completed"));
729 $do_lp = true;
730 }
731 }
732
733 $marks->update();
734
735 // #11600
736 if ($do_lp) {
738 }
739 }
740 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

References $user_id, and ilLPStatusWrapper\_updateStatus().

Referenced by ilLPListOfObjectsGUI\updateUser().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getStatusText()

static ilLearningProgressBaseGUI::_getStatusText ( int  $a_status,
?ilLanguage  $a_lng = null 
)
static

Get status alt text.

Todo:
Move this to a factory.

Definition at line 351 of file class.ilLearningProgressBaseGUI.php.

354 : string {
355 global $DIC;
356
357 $lng = $DIC->language();
358 if (!$a_lng) {
359 $a_lng = $lng;
360 }
361 switch ($a_status) {
363 return $a_lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
364
366 return $a_lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
367
369 return $a_lng->txt(ilLPStatus::LP_STATUS_FAILED);
370
371 default:
372 if ($a_status === ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM) {
373 return $a_lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
374 }
375 return $a_lng->txt((string) $a_status);
376 }
377 }

References $lng.

Referenced by ilSCORM2004TrackingItemsTableGUI\exportValue(), ilSCORMTrackingItemsTableGUI\exportValue(), ilTrSummaryTableGUI\fillHeaderCSV(), ilTrSummaryTableGUI\fillHeaderExcel(), ilLPProgressTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), ilLPObjectStatisticsLPTableGUI\getDetailItems(), ilLPObjectStatisticsLPTableGUI\getGraph(), ilLPProgressBlockGUI\getLegacyContent(), ilMyStaffGUI\getUserLpStatusAsHtml(), ilMyStaffGUI\getUserLpStatusAsText(), ilLPObjectStatisticsLPTableGUI\initFilter(), ilSCORM2004TrackingItemsTableGUI\parseValue(), ilSCORMTrackingItemsTableGUI\parseValue(), and ilLPStatusIcons\renderIconForStatus().

+ Here is the caller graph for this function:

◆ executeCommand()

ilLearningProgressBaseGUI::executeCommand ( )
final

Definition at line 124 of file class.ilLearningProgressBaseGUI.php.

124 : void
125 {
126 $has_access = false;
127 if ($this->getMode() === self::LP_CONTEXT_REPOSITORY) {
128 $has_access = ilLearningProgressAccess::checkAccess($this->getRefId());
129 } elseif ($this->getMode() === self::LP_CONTEXT_ADMINISTRATION) {
131 } elseif ($this->getMode() === self::LP_CONTEXT_USER_FOLDER) {
132 $has_access = $this->access->checkAccess('read', '', $this->getRefId());
133 } elseif ($this->getMode() === self::LP_CONTEXT_ORG_UNIT) {
135 } elseif ($this->getMode() === self::LP_CONTEXT_PERSONAL_DESKTOP) {
136 if ($this instanceof ilLPListOfProgressGUI ||
137 (
138 $this instanceof ilLearningProgressGUI && ($this->__getNextClass() === strtolower(ilLPListOfProgressGUI::class))
139 )
140 ) {
142 } else {
144 }
145 }
146 if ($has_access) {
147 $this->handleCommand();
148 } else {
149 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->WARNING);
150 }
151 }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Class ilObjUserTrackingGUI.
static _checkAccessToUserLearningProgress(int $ref_id, int $usr_id)

References ilObjOrgUnitAccess\_checkAccessToUserLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObjUserTracking\_hasLearningProgressOtherUsers(), ILIAS\Repository\access(), ilLearningProgressAccess\checkAccess(), getMode(), getRefId(), getUserId(), handleCommand(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getMode()

◆ getObjId()

◆ getRefId()

◆ getUserId()

ilLearningProgressBaseGUI::getUserId ( )

Definition at line 186 of file class.ilLearningProgressBaseGUI.php.

186 : int
187 {
188 if ($this->usr_id) {
189 return $this->usr_id;
190 }
191 if ($this->initUserIdFromQuery()) {
192 return $this->initUserIdFromQuery();
193 }
194 return 0;
195 }

References $usr_id, and initUserIdFromQuery().

Referenced by __setSubTabs(), executeCommand(), ilLearningProgressGUI\handleCommand(), ilLPListOfProgressGUI\handleCommand(), and ilLPListOfProgressGUI\show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleCommand()

ilLearningProgressBaseGUI::handleCommand ( )
abstractprotected

Reimplemented in ilLearningProgressGUI, ilLPObjectStatisticsGUI, ilLPListOfObjectsGUI, ilLPListOfProgressGUI, and ilLPListOfSettingsGUI.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ initEditUserForm()

ilLearningProgressBaseGUI::initEditUserForm ( int  $a_user_id,
int  $a_obj_id,
?string  $a_cancel = null 
)
protected

Definition at line 637 of file class.ilLearningProgressBaseGUI.php.

642 $olp = ilObjectLP::getInstance($a_obj_id);
643 $lp_mode = $olp->getCurrentMode();
644
645 $form = new ilPropertyFormGUI();
646
647 $form->setFormAction($this->ctrl->getFormAction($this, "updateUser"));
648
649 $form->setTitle(
650 $this->lng->txt("edit") . ": " . ilObject::_lookupTitle($a_obj_id)
651 );
652 $form->setDescription(
653 $this->lng->txt('trac_mode') . ": " . $olp->getModeText($lp_mode)
654 );
655
656 $user = new ilNonEditableValueGUI($this->lng->txt("user"), '', true);
657 $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
658 $form->addItem($user);
659
660 $marks = new ilLPMarks($a_obj_id, $a_user_id);
661
663 $mark = new ilTextInputGUI($this->lng->txt("trac_mark"), "mark");
664 $mark->setValue($marks->getMark());
665 $mark->setMaxLength(32);
666 $form->addItem($mark);
667 }
668
669 $comm = new ilTextInputGUI($this->lng->txt("trac_comment"), "comment");
670 $comm->setValue($marks->getComment());
671 $form->addItem($comm);
672
673 if ($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
675 $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
676
677 $status = new ilCheckboxInputGUI(
678 $this->lng->txt('trac_completed'),
679 "completed"
680 );
681 $status->setChecked(
683 );
684 $form->addItem($status);
685 }
686
687 $form->addCommandButton("updateUser", $this->lng->txt('save'));
688
689 if ($a_cancel) {
690 $form->addCommandButton($a_cancel, $this->lng->txt('cancel'));
691 }
692
693 return $form;
694 }
This class represents a checkbox property in a property form.
const int LP_MODE_MANUAL_BY_TUTOR
This class represents a non editable value in a property form.
static _lookupType(int $id, bool $reference=false)
This class represents a property form user interface.
This class represents a text property in a property form.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:

◆ initUserIdFromQuery()

ilLearningProgressBaseGUI::initUserIdFromQuery ( )
protected

Definition at line 175 of file class.ilLearningProgressBaseGUI.php.

175 : int
176 {
177 if ($this->http->wrapper()->query()->has('user_id')) {
178 return $this->http->wrapper()->query()->retrieve(
179 'user_id',
180 $this->refinery->kindlyTo()->int()
181 );
182 }
183 return 0;
184 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by ilLPListOfObjectsGUI\editUser(), getUserId(), ilLPListOfObjectsGUI\handleCommand(), ilLPListOfObjectsGUI\initUserIdFromRequest(), and ilLPListOfObjectsGUI\userDetails().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAnonymized()

ilLearningProgressBaseGUI::isAnonymized ( )

◆ isObjectOffline()

static ilLearningProgressBaseGUI::isObjectOffline ( int  $a_obj_id,
string  $a_type = '' 
)
static
Parameters
int$a_obj_id
string$a_type
Returns
bool
Todo:
switch to centralized offline status

Definition at line 748 of file class.ilLearningProgressBaseGUI.php.

751 : bool {
752 global $DIC;
753
754 $objDefinition = $DIC['objDefinition'];
755 $ilObjDataCache = $DIC['ilObjDataCache'];
756
757 if (!$a_type) {
758 $a_type = $ilObjDataCache->lookupType($a_obj_id);
759 }
760
761 if ($objDefinition->isPluginTypeName($a_type)) {
762 return false;
763 }
764 $class = "ilObj" . $objDefinition->getClassName($a_type) . "Access";
765 return (bool) $class::_isOffline($a_obj_id);
766 }

Referenced by ilLPProgressTableGUI\getItems(), and ilTrSummaryTableGUI\getItems().

+ Here is the caller graph for this function:

◆ readTypicalLearningTimeInSeconds()

ilLearningProgressBaseGUI::readTypicalLearningTimeInSeconds ( int  $obj_id,
int  $sub_id,
string  $type 
)
protected

Definition at line 420 of file class.ilLearningProgressBaseGUI.php.

420 : int
421 {
422 $paths = $this->lom_services->paths();
423 $data_helper = $this->lom_services->dataHelper();
424
425 $value = $this->lom_services->read($obj_id, $sub_id, $type, $paths->firstTypicalLearningTime())
426 ->firstData($paths->firstTypicalLearningTime())
427 ->value();
428
429 return $data_helper->durationToSeconds($value);
430 }

Field Documentation

◆ $access

ilAccessHandler ilLearningProgressBaseGUI::$access
protected

Definition at line 48 of file class.ilLearningProgressBaseGUI.php.

◆ $anonymized

bool ilLearningProgressBaseGUI::$anonymized
protected

Definition at line 57 of file class.ilLearningProgressBaseGUI.php.

Referenced by isAnonymized().

◆ $ctrl

ilCtrlInterface ilLearningProgressBaseGUI::$ctrl
protected

Definition at line 41 of file class.ilLearningProgressBaseGUI.php.

◆ $error

ilErrorHandling ilLearningProgressBaseGUI::$error
protected

Definition at line 55 of file class.ilLearningProgressBaseGUI.php.

◆ $help

ilHelpGUI ilLearningProgressBaseGUI::$help
protected

Definition at line 40 of file class.ilLearningProgressBaseGUI.php.

◆ $http

HttpServices ilLearningProgressBaseGUI::$http
protected

Definition at line 38 of file class.ilLearningProgressBaseGUI.php.

◆ $ilObjectDataCache

ilObjectDataCache ilLearningProgressBaseGUI::$ilObjectDataCache
protected

Definition at line 46 of file class.ilLearningProgressBaseGUI.php.

◆ $lng

ilLanguage ilLearningProgressBaseGUI::$lng
protected

Definition at line 42 of file class.ilLearningProgressBaseGUI.php.

Referenced by _getStatusText().

◆ $logger

ilLogger ilLearningProgressBaseGUI::$logger
protected

Definition at line 43 of file class.ilLearningProgressBaseGUI.php.

◆ $lom_services

LOMServices ilLearningProgressBaseGUI::$lom_services
protected

Definition at line 54 of file class.ilLearningProgressBaseGUI.php.

◆ $mode

int ilLearningProgressBaseGUI::$mode = 0
protected

◆ $obj_id

int ilLearningProgressBaseGUI::$obj_id = 0
protected

Definition at line 60 of file class.ilLearningProgressBaseGUI.php.

Referenced by ilLPListOfProgressGUI\details(), and getObjId().

◆ $obj_type

string ilLearningProgressBaseGUI::$obj_type = ''
protected

Definition at line 61 of file class.ilLearningProgressBaseGUI.php.

◆ $rbacreview

ilRbacReview ilLearningProgressBaseGUI::$rbacreview
protected

Definition at line 50 of file class.ilLearningProgressBaseGUI.php.

◆ $rbacsystem

ilRbacSystem ilLearningProgressBaseGUI::$rbacsystem
protected

Definition at line 49 of file class.ilLearningProgressBaseGUI.php.

◆ $ref_id

int ilLearningProgressBaseGUI::$ref_id = 0
protected

◆ $refinery

RefineryFactory ilLearningProgressBaseGUI::$refinery
protected

Definition at line 37 of file class.ilLearningProgressBaseGUI.php.

◆ $tabs_gui

ilTabsGUI ilLearningProgressBaseGUI::$tabs_gui
protected

Definition at line 44 of file class.ilLearningProgressBaseGUI.php.

◆ $toolbar

ilToolbarGUI ilLearningProgressBaseGUI::$toolbar
protected

Definition at line 45 of file class.ilLearningProgressBaseGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilLearningProgressBaseGUI::$tpl
protected

◆ $tree

ilTree ilLearningProgressBaseGUI::$tree
protected

Definition at line 51 of file class.ilLearningProgressBaseGUI.php.

◆ $ui_factory

UIFactory ilLearningProgressBaseGUI::$ui_factory
protected

Definition at line 52 of file class.ilLearningProgressBaseGUI.php.

◆ $ui_renderer

UIRenderer ilLearningProgressBaseGUI::$ui_renderer
protected

Definition at line 53 of file class.ilLearningProgressBaseGUI.php.

◆ $user

ilObjUser ilLearningProgressBaseGUI::$user
protected

◆ $usr_id

int ilLearningProgressBaseGUI::$usr_id = 0
protected

Definition at line 58 of file class.ilLearningProgressBaseGUI.php.

Referenced by getUserId().

◆ LP_ACTIVE_MATRIX

const ilLearningProgressBaseGUI::LP_ACTIVE_MATRIX = 11
protected

Definition at line 80 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJECTS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJECTS = 2
protected

Definition at line 71 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJSTATACCESS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATACCESS = 7
protected

Definition at line 76 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_OBJSTATADMIN

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATADMIN = 10
protected

Definition at line 79 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_OBJSTATDAILY

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATDAILY = 9
protected

Definition at line 78 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_OBJSTATTYPES

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATTYPES = 8
protected

Definition at line 77 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_PROGRESS

const ilLearningProgressBaseGUI::LP_ACTIVE_PROGRESS = 3
protected

Definition at line 72 of file class.ilLearningProgressBaseGUI.php.

◆ LP_ACTIVE_SETTINGS

const ilLearningProgressBaseGUI::LP_ACTIVE_SETTINGS = 1
protected

Definition at line 70 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_SUMMARY

const ilLearningProgressBaseGUI::LP_ACTIVE_SUMMARY = 6
protected

Definition at line 75 of file class.ilLearningProgressBaseGUI.php.

Referenced by __setSubTabs().

◆ LP_ACTIVE_USERS

const ilLearningProgressBaseGUI::LP_ACTIVE_USERS = 5
protected

Definition at line 74 of file class.ilLearningProgressBaseGUI.php.

◆ LP_CONTEXT_ADMINISTRATION

const ilLearningProgressBaseGUI::LP_CONTEXT_ADMINISTRATION = 2

◆ LP_CONTEXT_ORG_UNIT

◆ LP_CONTEXT_PERSONAL_DESKTOP

const ilLearningProgressBaseGUI::LP_CONTEXT_PERSONAL_DESKTOP = 1

◆ LP_CONTEXT_REPOSITORY

◆ LP_CONTEXT_USER_FOLDER

const ilLearningProgressBaseGUI::LP_CONTEXT_USER_FOLDER = 4

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