ILIAS  release_8 Revision v8.24
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)
 
 isAnonymized ()
 
 getMode ()
 
 getRefId ()
 
 getObjId ()
 
 getUserId ()
 
 __getDefaultCommand ()
 
 __setSubTabs (int $a_active)
 
 __buildFooter ()
 
 __buildHeader ()
 
 __showObjectDetails (ilInfoScreenGUI $info, int $item_id=0, 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

 initUserIdFromQuery ()
 
 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
 
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 32 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 75 of file class.ilLearningProgressBaseGUI.php.

79 {
80 global $DIC;
81
82 $this->tpl = $DIC->ui()->mainTemplate();
83 $this->help = $DIC->help();
84 $this->ctrl = $DIC->ctrl();
85 $this->lng = $DIC->language();
86 $this->lng->loadLanguageModule('trac');
87 $this->tabs_gui = $DIC->tabs();
88 $this->toolbar = $DIC->toolbar();
89 $this->ilObjectDataCache = $DIC['ilObjDataCache'];
90 $this->user = $DIC->user();
91 $this->access = $DIC->access();
92 $this->rbacsystem = $DIC->rbac()->system();
93 $this->rbacreview = $DIC->rbac()->review();
94 $this->tree = $DIC->repositoryTree();
95
96 $this->http = $DIC->http();
97 $this->refinery = $DIC->refinery();
98
99 $this->mode = $a_mode;
100 $this->ref_id = $a_ref_id;
101 $this->obj_id = $this->ilObjectDataCache->lookupObjId($this->ref_id);
102 $this->obj_type = $this->ilObjectDataCache->lookupType($this->obj_id);
103 $this->usr_id = $a_usr_id;
104
105 $this->anonymized = !ilObjUserTracking::_enabledUserRelatedData();
106 if (!$this->anonymized && $this->obj_id) {
107 $olp = ilObjectLP::getInstance($this->obj_id);
108 $this->anonymized = $olp->isAnonymized();
109 }
110 $this->logger = $DIC->logger()->trac();
111 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $obj_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

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 409 of file class.ilLearningProgressBaseGUI.php.

413 : void {
414 $type = $this->ilObjectDataCache->lookupType($item_id);
415 // Section learning_progress
416 // $info->addSection($this->lng->txt('trac_learning_progress'));
417 // see ilLPTableBaseGUI::parseTitle();
418 $info->addSection(
419 $this->lng->txt("trac_progress") . ": " . ilObject::_lookupTitle(
420 $item_id
421 )
422 );
423 $olp = ilObjectLP::getInstance($item_id);
424 $info->addProperty(
425 $this->lng->txt('trac_mode'),
426 $olp->getModeText($olp->getCurrentMode())
427 );
428
431
433 ilLPStatus::_lookupStatus($item_id, $user_id)
434 );
435 $info->addProperty(
436 $this->lng->txt('trac_status'),
437 $icons->renderIconForStatus(ilLPStatus::_lookupStatus($item_id, $user_id)) .
438 " " .
439 $status_text
440 );
441
442 if ($olp->getCurrentMode() === ilLPObjSettings::LP_MODE_MANUAL) {
443 // status
444 $i_tpl = new ilTemplate(
445 "tpl.lp_edit_manual_info_page.html",
446 true,
447 true,
448 "Services/Tracking"
449 );
450 $i_tpl->setVariable(
451 "INFO_EDITED",
452 $this->lng->txt("trac_info_edited")
453 );
454 $i_tpl->setVariable(
455 "SELECT_STATUS",
458 $user_id,
459 $item_id
460 ),
461 'lp_edit',
462 [0 => $this->lng->txt('trac_not_completed'),
463 1 => $this->lng->txt('trac_completed')
464 ],
465 false,
466 true
467 )
468 );
469 $i_tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
470 $info->addProperty($this->lng->txt('trac_status'), $i_tpl->get());
471 }
472
473 // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
474 $mode = $olp->getCurrentMode();
475 if (in_array(
476 $mode,
479 // ilLPObjSettings::LP_MODE_OBJECTIVES,
489 )
490 )) {
491 $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
492 $info->addProperty(
493 $this->lng->txt('trac_percentage'),
494 (int) $perc . "%"
495 );
496 }
497 }
498
500 if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) {
501 $info->addProperty($this->lng->txt('trac_mark'), $mark);
502 }
503 }
504
505 if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) {
506 $info->addProperty($this->lng->txt('trac_comment'), $comment);
507 }
508
509 // More infos for lm's
510 if (in_array($type, ["lm", "htlm"])) {
511 $progress = ilLearningProgress::_getProgress($user_id, $item_id);
512 if ($progress['access_time'] ?? false) {
513 $info->addProperty(
514 $this->lng->txt('trac_last_access'),
516 new ilDateTime($progress['access_time'], IL_CAL_UNIX)
517 )
518 );
519 } else {
520 $info->addProperty(
521 $this->lng->txt('trac_last_access'),
522 $this->lng->txt('trac_not_accessed')
523 );
524 }
525
526 $info->addProperty(
527 $this->lng->txt('trac_visits'),
528 (string) ($progress['visits'] ?? "")
529 );
530
531 if ($type == 'lm') {
532 $info->addProperty(
533 $this->lng->txt('trac_spent_time'),
535 $progress['spent_seconds']
536 )
537 );
538 }
539 }
540 }
$comment
Definition: buildRTE.php:72
const IL_CAL_UNIX
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
addSection(string $a_title)
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 LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
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
$type

Referenced by ilLPListOfProgressGUI\details().

+ Here is the caller graph for this function:

◆ __buildFooter()

ilLearningProgressBaseGUI::__buildFooter ( )

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

326 : void
327 {
328 switch ($this->getMode()) {
330 $this->tpl->printToStdout();
331 }
332 }

References getMode(), and LP_CONTEXT_PERSONAL_DESKTOP.

Referenced by ilLearningProgressGUI\executeCommand().

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

◆ __buildHeader()

ilLearningProgressBaseGUI::__buildHeader ( )

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

334 : void
335 {
336 }

Referenced by ilLearningProgressGUI\executeCommand().

+ Here is the caller graph for this function:

◆ __getDefaultCommand()

ilLearningProgressBaseGUI::__getDefaultCommand ( )

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

155 : string
156 {
157 if (strlen($cmd = $this->ctrl->getCmd())) {
158 return $cmd;
159 }
160 return 'show';
161 }

References ILIAS\Repository\ctrl().

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

+ 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 563 of file class.ilLearningProgressBaseGUI.php.

563 : string
564 {
565 $icons = ilLPStatusIcons::getInstance($variant);
566
567 $tpl = new ilTemplate(
568 "tpl.lp_legend.html",
569 true,
570 true,
571 "Services/Tracking"
572 );
574 "IMG_NOT_ATTEMPTED",
575 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM)
576 );
578 "IMG_IN_PROGRESS",
579 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM)
580 );
582 "IMG_COMPLETED",
583 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_COMPLETED_NUM)
584 );
586 "IMG_FAILED",
587 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_FAILED_NUM)
588 );
590 "TXT_NOT_ATTEMPTED",
591 $this->lng->txt("trac_not_attempted")
592 );
594 "TXT_IN_PROGRESS",
595 $this->lng->txt("trac_in_progress")
596 );
598 "TXT_COMPLETED",
599 $this->lng->txt("trac_completed")
600 );
602 "TXT_FAILED",
603 $this->lng->txt("trac_failed")
604 );
605
608 $panel->setBody($tpl->get());
609
610 return $panel->getHTML();
611 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const PANEL_STYLE_SECONDARY
static getInstance()
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
Definition: imgupload.php:198
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 $panel, $tpl, ilGlobalTemplateInterface\get(), ilPanelGUI\getInstance(), 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, ilPanelGUI\PANEL_STYLE_SECONDARY, and ilGlobalTemplateInterface\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 543 of file class.ilLearningProgressBaseGUI.php.

543 : string
544 {
545 $status = ilLPStatus::_lookupStatus($a_obj_id, $user_id);
546
547 switch ($status) {
550
553
556
557 default:
560 }
561 }
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS

References 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 163 of file class.ilLearningProgressBaseGUI.php.

163 : void
164 {
165 switch ($this->getMode()) {
167
170 $this->tabs_gui->addTarget(
171 'trac_progress',
172 $this->ctrl->getLinkTargetByClass(
173 'illplistofprogressgui',
174 ''
175 ),
176 "",
177 "",
178 "",
179 $a_active == self::LP_ACTIVE_PROGRESS
180 );
181 }
182
184 $this->tabs_gui->addTarget(
185 'trac_objects',
186 $this->ctrl->getLinkTargetByClass(
187 "illplistofobjectsgui",
188 ''
189 ),
190 "",
191 "",
192 "",
193 $a_active == self::LP_ACTIVE_OBJECTS
194 );
195 }
196 break;
197
199 // #12771 - do not show status if learning progress is deactivated
200 $olp = ilObjectLP::getInstance($this->obj_id);
201 if ($olp->isActive()) {
203 'read_learning_progress',
204 $this->getRefId()
205 );
206
207 if ($this->isAnonymized() || !$has_read) {
208 $this->ctrl->setParameterByClass(
209 'illplistofprogressgui',
210 'user_id',
211 $this->getUserId()
212 );
213 $this->tabs_gui->addSubTabTarget(
214 'trac_progress',
215 $this->ctrl->getLinkTargetByClass(
216 'illplistofprogressgui',
217 ''
218 ),
219 "",
220 "",
221 "",
222 $a_active == self::LP_ACTIVE_PROGRESS
223 );
224 } else {
225 // Check if it is a course
226 $sub_tab = ($this->ilObjectDataCache->lookupType(
228 $this->getRefId()
229 )
230 ) == 'crs') ?
231 'trac_crs_objects' :
232 'trac_objects';
233
234 $this->tabs_gui->addSubTabTarget(
235 $sub_tab,
236 $this->ctrl->getLinkTargetByClass(
237 "illplistofobjectsgui",
238 ''
239 ),
240 "",
241 "",
242 "",
243 $a_active == self::LP_ACTIVE_OBJECTS
244 );
245 }
246
247 if ($has_read) {
248 if (!$this->isAnonymized() &&
249 !($olp instanceof ilPluginLP) &&
250 ilObjectLP::supportsMatrixView($this->obj_type)) {
251 $this->tabs_gui->addSubTabTarget(
252 "trac_matrix",
253 $this->ctrl->getLinkTargetByClass(
254 "illplistofobjectsgui",
255 'showUserObjectMatrix'
256 ),
257 "",
258 "",
259 "",
260 $a_active == self::LP_ACTIVE_MATRIX
261 );
262 }
263
264 $this->tabs_gui->addSubTabTarget(
265 "trac_summary",
266 $this->ctrl->getLinkTargetByClass(
267 "illplistofobjectsgui",
268 'showObjectSummary'
269 ),
270 "",
271 "",
272 "",
273 $a_active == self::LP_ACTIVE_SUMMARY
274 );
275 }
276 }
277 if (!($olp instanceof ilPluginLP) &&
279 'edit_learning_progress',
280 $this->getRefId()
281 )) {
282 $this->tabs_gui->addSubTabTarget(
283 'trac_settings',
284 $this->ctrl->getLinkTargetByClass(
285 'illplistofsettingsgui',
286 ''
287 ),
288 "",
289 "",
290 "",
291 $a_active == self::LP_ACTIVE_SETTINGS
292 );
293 }
294 break;
295
297 /*
298 $this->tabs_gui->addSubTabTarget('trac_progress',
299 $this->ctrl->getLinkTargetByClass('illplistofprogressgui',''),
300 "","","",$a_active == self::LP_ACTIVE_PROGRESS);
301 */
302 $this->tabs_gui->addSubTabTarget(
303 'trac_objects',
304 $this->ctrl->getLinkTargetByClass(
305 "illplistofobjectsgui",
306 ''
307 ),
308 "",
309 "",
310 "",
311 $a_active == self::LP_ACTIVE_OBJECTS
312 );
313 break;
314
317 // No tabs default class is lpprogressgui
318 break;
319
320 default:
321 die('No valid mode given');
322 break;
323 }
324 }
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(), ilObjUserTracking\_hasLearningProgressOtherUsers(), 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_ADMINISTRATION, LP_CONTEXT_ORG_UNIT, LP_CONTEXT_PERSONAL_DESKTOP, LP_CONTEXT_REPOSITORY, LP_CONTEXT_USER_FOLDER, and ilObjectLP\supportsMatrixView().

Referenced by ilLearningProgressGUI\executeCommand().

+ 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 672 of file class.ilLearningProgressBaseGUI.php.

677 : string {
678 if (!$a_sub_id) {
679 $obj_id = ilObject::_lookupObjId($a_ref_id);
680 } else {
681 $this->ctrl->setParameter($this, 'userdetails_id', $a_sub_id);
682 $obj_id = ilObject::_lookupObjId($a_sub_id);
683 }
684 $this->ctrl->setParameter($this, 'user_id', $a_user_id);
685 $this->ctrl->setParameter($this, 'details_id', $a_ref_id);
686 $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
687 return $form->getHTML();
688 }
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,
bool  $add_section = true 
)

show details about current object.

Uses an existing info_gui object.

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

377 : bool {
378 $details_id = $item_id ?: $this->details_id;
379
380 $olp = ilObjectLP::getInstance($details_id);
381 $mode = $olp->getCurrentMode();
384 // Section object details
385 if ($add_section) {
386 $info->addSection($this->lng->txt('details'));
387 }
388
390 $info->addProperty(
391 $this->lng->txt('trac_required_visits'),
392 (string) ilLPObjSettings::_lookupVisits($details_id)
393 );
394 }
395
397 $details_id
398 )) {
399 $info->addProperty(
400 $this->lng->txt('meta_typical_learning_time'),
402 );
403 }
404 return true;
405 }
406 return false;
407 }
static _lookupVisits(int $a_obj_id)
static _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id=0)

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 690 of file class.ilLearningProgressBaseGUI.php.

690 : void
691 {
692 $form = $this->initEditUserForm($user_id, $obj_id);
693 if ($form->checkInput()) {
694 $marks = new ilLPMarks($obj_id, $user_id);
695 $marks->setMark($form->getInput("mark"));
696 $marks->setComment($form->getInput("comment"));
697
698 $do_lp = false;
699
700 // status/completed is optional
701 $status = $form->getItemByPostVar("completed");
702 if (is_object($status)) {
703 if ($marks->getCompleted() != $form->getInput("completed")) {
704 $marks->setCompleted($form->getInput("completed"));
705 $do_lp = true;
706 }
707 }
708
709 $marks->update();
710
711 // #11600
712 if ($do_lp) {
714 }
715 }
716 }
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)

References 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 342 of file class.ilLearningProgressBaseGUI.php.

345 : string {
346 global $DIC;
347
348 $lng = $DIC->language();
349 if (!$a_lng) {
350 $a_lng = $lng;
351 }
352 switch ($a_status) {
354 return $a_lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
355
357 return $a_lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
358
360 return $a_lng->txt(ilLPStatus::LP_STATUS_FAILED);
361
362 default:
363 if ($a_status === ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM) {
364 return $a_lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
365 }
366 return $a_lng->txt((string) $a_status);
367 }
368 }

References $lng.

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

+ Here is the caller graph for this function:

◆ getMode()

◆ getObjId()

◆ getRefId()

◆ getUserId()

ilLearningProgressBaseGUI::getUserId ( )

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

144 : int
145 {
146 if ($this->usr_id) {
147 return $this->usr_id;
148 }
149 if ($this->initUserIdFromQuery()) {
150 return $this->initUserIdFromQuery();
151 }
152 return 0;
153 }

References $usr_id, and initUserIdFromQuery().

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

+ Here is the call graph for this function:
+ 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 613 of file class.ilLearningProgressBaseGUI.php.

618 $olp = ilObjectLP::getInstance($a_obj_id);
619 $lp_mode = $olp->getCurrentMode();
620
621 $form = new ilPropertyFormGUI();
622
623 $form->setFormAction($this->ctrl->getFormAction($this, "updateUser"));
624
625 $form->setTitle(
626 $this->lng->txt("edit") . ": " . ilObject::_lookupTitle($a_obj_id)
627 );
628 $form->setDescription(
629 $this->lng->txt('trac_mode') . ": " . $olp->getModeText($lp_mode)
630 );
631
632 $user = new ilNonEditableValueGUI($this->lng->txt("user"), '', true);
633 $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
634 $form->addItem($user);
635
636 $marks = new ilLPMarks($a_obj_id, $a_user_id);
637
639 $mark = new ilTextInputGUI($this->lng->txt("trac_mark"), "mark");
640 $mark->setValue($marks->getMark());
641 $mark->setMaxLength(32);
642 $form->addItem($mark);
643 }
644
645 $comm = new ilTextInputGUI($this->lng->txt("trac_comment"), "comment");
646 $comm->setValue($marks->getComment());
647 $form->addItem($comm);
648
649 if ($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
651 $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
652
653 $status = new ilCheckboxInputGUI(
654 $this->lng->txt('trac_completed'),
655 "completed"
656 );
657 $status->setChecked(
659 );
660 $form->addItem($status);
661 }
662
663 $form->addCommandButton("updateUser", $this->lng->txt('save'));
664
665 if ($a_cancel) {
666 $form->addCommandButton($a_cancel, $this->lng->txt('cancel'));
667 }
668
669 return $form;
670 }
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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="ilpublicuserprofilegui")
Default behaviour is:

◆ initUserIdFromQuery()

ilLearningProgressBaseGUI::initUserIdFromQuery ( )
protected

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

133 : int
134 {
135 if ($this->http->wrapper()->query()->has('user_id')) {
136 return $this->http->wrapper()->query()->retrieve(
137 'user_id',
138 $this->refinery->kindlyTo()->int()
139 );
140 }
141 return 0;
142 }

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

Referenced by ilLPListOfObjectsGUI\editUser(), ilLPListOfObjectsGUI\executeCommand(), getUserId(), 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 724 of file class.ilLearningProgressBaseGUI.php.

727 : bool {
728 global $DIC;
729
730 $objDefinition = $DIC['objDefinition'];
731 $ilObjDataCache = $DIC['ilObjDataCache'];
732
733 if (!$a_type) {
734 $a_type = $ilObjDataCache->lookupType($a_obj_id);
735 }
736
737 if ($objDefinition->isPluginTypeName($a_type)) {
738 return false;
739 }
740 $class = "ilObj" . $objDefinition->getClassName($a_type) . "Access";
741 return (bool) $class::_isOffline($a_obj_id);
742 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilLearningProgressBaseGUI::$access
protected

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

◆ $anonymized

bool ilLearningProgressBaseGUI::$anonymized
protected

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

Referenced by isAnonymized().

◆ $ctrl

ilCtrlInterface ilLearningProgressBaseGUI::$ctrl
protected

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

◆ $help

ilHelpGUI ilLearningProgressBaseGUI::$help
protected

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

◆ $http

HttpServices ilLearningProgressBaseGUI::$http
protected

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

◆ $ilObjectDataCache

ilObjectDataCache ilLearningProgressBaseGUI::$ilObjectDataCache
protected

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

◆ $lng

ilLanguage ilLearningProgressBaseGUI::$lng
protected

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

Referenced by _getStatusText().

◆ $logger

ilLogger ilLearningProgressBaseGUI::$logger
protected

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

◆ $mode

int ilLearningProgressBaseGUI::$mode = 0
protected

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

Referenced by getMode().

◆ $obj_id

int ilLearningProgressBaseGUI::$obj_id = 0
protected

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

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

◆ $obj_type

string ilLearningProgressBaseGUI::$obj_type = ''
protected

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

◆ $rbacreview

ilRbacReview ilLearningProgressBaseGUI::$rbacreview
protected

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

◆ $rbacsystem

ilRbacSystem ilLearningProgressBaseGUI::$rbacsystem
protected

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

◆ $ref_id

int ilLearningProgressBaseGUI::$ref_id = 0
protected

◆ $refinery

RefineryFactory ilLearningProgressBaseGUI::$refinery
protected

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

◆ $tabs_gui

ilTabsGUI ilLearningProgressBaseGUI::$tabs_gui
protected

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

◆ $toolbar

ilToolbarGUI ilLearningProgressBaseGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLearningProgressBaseGUI::$tpl
protected

◆ $tree

ilTree ilLearningProgressBaseGUI::$tree
protected

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

◆ $user

ilObjUser ilLearningProgressBaseGUI::$user
protected

◆ $usr_id

int ilLearningProgressBaseGUI::$usr_id = 0
protected

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

Referenced by getUserId().

◆ LP_ACTIVE_MATRIX

const ilLearningProgressBaseGUI::LP_ACTIVE_MATRIX = 11
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJECTS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJECTS = 2
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJSTATACCESS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATACCESS = 7
protected

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

◆ LP_ACTIVE_OBJSTATADMIN

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATADMIN = 10
protected

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

◆ LP_ACTIVE_OBJSTATDAILY

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATDAILY = 9
protected

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

◆ LP_ACTIVE_OBJSTATTYPES

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATTYPES = 8
protected

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

◆ LP_ACTIVE_PROGRESS

const ilLearningProgressBaseGUI::LP_ACTIVE_PROGRESS = 3
protected

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

◆ LP_ACTIVE_SETTINGS

const ilLearningProgressBaseGUI::LP_ACTIVE_SETTINGS = 1
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_SUMMARY

const ilLearningProgressBaseGUI::LP_ACTIVE_SUMMARY = 6
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_USERS

const ilLearningProgressBaseGUI::LP_ACTIVE_USERS = 5
protected

Definition at line 67 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: