ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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, 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

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

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

403 : void {
404 $type = $this->ilObjectDataCache->lookupType($item_id);
405 // Section learning_progress
406 // $info->addSection($this->lng->txt('trac_learning_progress'));
407 // see ilLPTableBaseGUI::parseTitle();
408 $info->addSection(
409 $this->lng->txt("trac_progress") . ": " . ilObject::_lookupTitle(
410 $item_id
411 )
412 );
413 $olp = ilObjectLP::getInstance($item_id);
414 $info->addProperty(
415 $this->lng->txt('trac_mode'),
416 $olp->getModeText($olp->getCurrentMode())
417 );
418
421
424 );
425 $info->addProperty(
426 $this->lng->txt('trac_status'),
427 $icons->renderIconForStatus(ilLPStatus::_lookupStatus($item_id, $user_id)) .
428 " " .
429 $status_text
430 );
431
432 if ($olp->getCurrentMode() === ilLPObjSettings::LP_MODE_MANUAL) {
433 // status
434 $i_tpl = new ilTemplate(
435 "tpl.lp_edit_manual_info_page.html",
436 true,
437 true,
438 "components/ILIAS/Tracking"
439 );
440 $i_tpl->setVariable(
441 "INFO_EDITED",
442 $this->lng->txt("trac_info_edited")
443 );
444 $i_tpl->setVariable(
445 "SELECT_STATUS",
448 $user_id,
449 $item_id
450 ),
451 'lp_edit',
452 [0 => $this->lng->txt('trac_not_completed'),
453 1 => $this->lng->txt('trac_completed')
454 ],
455 false,
456 true
457 )
458 );
459 $i_tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
460 $info->addProperty($this->lng->txt('trac_status'), $i_tpl->get());
461 }
462
463 // #15334 - see ilLPTableBaseGUI::isPercentageAvailable()
464 $mode = $olp->getCurrentMode();
465 if (in_array(
466 $mode,
469 // ilLPObjSettings::LP_MODE_OBJECTIVES,
479 )
480 )) {
481 $perc = ilLPStatus::_lookupPercentage($item_id, $user_id);
482 $info->addProperty(
483 $this->lng->txt('trac_percentage'),
484 (int) $perc . "%"
485 );
486 }
487 }
488
489 if (ilObjectLP::supportsMark($type)) {
490 if (strlen($mark = ilLPMarks::_lookupMark($user_id, $item_id))) {
491 $info->addProperty($this->lng->txt('trac_mark'), $mark);
492 }
493 }
494
495 if (strlen($comment = ilLPMarks::_lookupComment($user_id, $item_id))) {
496 $info->addProperty($this->lng->txt('trac_comment'), $comment);
497 }
498
499 // More infos for lm's
500 if (in_array($type, ["lm", "htlm"])) {
501 $progress = ilLearningProgress::_getProgress($user_id, $item_id);
502 if ($progress['access_time'] ?? false) {
503 $info->addProperty(
504 $this->lng->txt('trac_last_access'),
506 new ilDateTime($progress['access_time'], IL_CAL_UNIX)
507 )
508 );
509 } else {
510 $info->addProperty(
511 $this->lng->txt('trac_last_access'),
512 $this->lng->txt('trac_not_accessed')
513 );
514 }
515
516 $info->addProperty(
517 $this->lng->txt('trac_visits'),
518 (string) ($progress['visits'] ?? "")
519 );
520
521 if ($type == 'lm') {
522 $info->addProperty(
523 $this->lng->txt('trac_spent_time'),
525 $progress['spent_seconds']
526 )
527 );
528 }
529 }
530 }
$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 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
$info
Definition: entry_point.php:21

Referenced by ilLPListOfProgressGUI\details().

+ Here is the caller graph for this function:

◆ __buildFooter()

ilLearningProgressBaseGUI::__buildFooter ( )

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

302 : void
303 {
304 switch ($this->getMode()) {
306 $this->tpl->printToStdout();
307 }
308 }

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

310 : void
311 {
312 }

Referenced by ilLearningProgressGUI\executeCommand().

+ Here is the caller graph for this function:

◆ __getDefaultCommand()

ilLearningProgressBaseGUI::__getDefaultCommand ( )

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

164 : string
165 {
166 if (strlen($cmd = $this->ctrl->getCmd())) {
167 return $cmd;
168 }
169 return 'show';
170 }

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

553 : string
554 {
555 $icons = ilLPStatusIcons::getInstance($variant);
556
557 $tpl = new ilTemplate(
558 "tpl.lp_legend.html",
559 true,
560 true,
561 "components/ILIAS/Tracking"
562 );
564 "IMG_NOT_ATTEMPTED",
565 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM)
566 );
568 "IMG_IN_PROGRESS",
569 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_IN_PROGRESS_NUM)
570 );
572 "IMG_COMPLETED",
573 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_COMPLETED_NUM)
574 );
576 "IMG_FAILED",
577 $icons->renderIconForStatus(ilLPStatus::LP_STATUS_FAILED_NUM)
578 );
580 "TXT_NOT_ATTEMPTED",
581 $this->lng->txt("trac_not_attempted")
582 );
584 "TXT_IN_PROGRESS",
585 $this->lng->txt("trac_in_progress")
586 );
588 "TXT_COMPLETED",
589 $this->lng->txt("trac_completed")
590 );
592 "TXT_FAILED",
593 $this->lng->txt("trac_failed")
594 );
595
596 $panel = $this->ui_factory->panel()->secondary()->legacy(
597 '',
598 $this->ui_factory->legacy()->content($tpl->get())
599 );
600
601 return $this->ui_renderer->render($panel);
602 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_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\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

◆ __setSubTabs()

ilLearningProgressBaseGUI::__setSubTabs ( int  $a_active)

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

172 : void
173 {
174 switch ($this->getMode()) {
176
179 $this->tabs_gui->addTarget(
180 'trac_progress',
181 $this->ctrl->getLinkTargetByClass(
182 'illplistofprogressgui',
183 ''
184 ),
185 "",
186 "",
187 "",
188 $a_active == self::LP_ACTIVE_PROGRESS
189 );
190 }
191 break;
192
194 // #12771 - do not show status if learning progress is deactivated
195 $olp = ilObjectLP::getInstance($this->obj_id);
196 if ($olp->isActive()) {
198 'read_learning_progress',
199 $this->getRefId()
200 );
201
202 if ($this->isAnonymized() || !$has_read) {
203 $this->ctrl->setParameterByClass(
204 'illplistofprogressgui',
205 'user_id',
206 $this->getUserId()
207 );
208 $this->tabs_gui->addSubTabTarget(
209 'trac_progress',
210 $this->ctrl->getLinkTargetByClass(
211 'illplistofprogressgui',
212 ''
213 ),
214 "",
215 "",
216 "",
217 $a_active == self::LP_ACTIVE_PROGRESS
218 );
219 } else {
220 // Check if it is a course
221 $sub_tab = ($this->ilObjectDataCache->lookupType(
223 $this->getRefId()
224 )
225 ) == 'crs') ?
226 'trac_crs_objects' :
227 'trac_objects';
228
229 $this->tabs_gui->addSubTabTarget(
230 $sub_tab,
231 $this->ctrl->getLinkTargetByClass(
232 "illplistofobjectsgui",
233 ''
234 ),
235 "",
236 "",
237 "",
238 $a_active == self::LP_ACTIVE_OBJECTS
239 );
240 }
241
242 if ($has_read) {
243 if (!$this->isAnonymized() &&
244 !($olp instanceof ilPluginLP) &&
245 ilObjectLP::supportsMatrixView($this->obj_type)) {
246 $this->tabs_gui->addSubTabTarget(
247 "trac_matrix",
248 $this->ctrl->getLinkTargetByClass(
249 "illplistofobjectsgui",
250 'showUserObjectMatrix'
251 ),
252 "",
253 "",
254 "",
255 $a_active == self::LP_ACTIVE_MATRIX
256 );
257 }
258
259 $this->tabs_gui->addSubTabTarget(
260 "trac_summary",
261 $this->ctrl->getLinkTargetByClass(
262 "illplistofobjectsgui",
263 'showObjectSummary'
264 ),
265 "",
266 "",
267 "",
268 $a_active == self::LP_ACTIVE_SUMMARY
269 );
270 }
271 }
272 if (!($olp instanceof ilPluginLP) &&
274 'edit_learning_progress',
275 $this->getRefId()
276 )) {
277 $this->tabs_gui->addSubTabTarget(
278 'trac_settings',
279 $this->ctrl->getLinkTargetByClass(
280 'illplistofsettingsgui',
281 ''
282 ),
283 "",
284 "",
285 "",
286 $a_active == self::LP_ACTIVE_SETTINGS
287 );
288 }
289 break;
290
293 // No tabs default class is lpprogressgui
294 break;
295
296 default:
297 die('No valid mode given');
298 break;
299 }
300 }
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\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 663 of file class.ilLearningProgressBaseGUI.php.

668 : string {
669 if (!$a_sub_id) {
670 $obj_id = ilObject::_lookupObjId($a_ref_id);
671 } else {
672 $this->ctrl->setParameter($this, 'userdetails_id', $a_sub_id);
673 $obj_id = ilObject::_lookupObjId($a_sub_id);
674 }
675 $this->ctrl->setParameter($this, 'user_id', $a_user_id);
676 $this->ctrl->setParameter($this, 'details_id', $a_ref_id);
677 $form = $this->initEditUserForm($a_user_id, $obj_id, $a_cancel);
678 return $form->getHTML();
679 }
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 349 of file class.ilLearningProgressBaseGUI.php.

354 : bool {
355 $details_id = $item_id ?: $this->details_id;
356 $details_type = $item_type ?: $this->details_type;
357
358 $olp = ilObjectLP::getInstance($details_id);
359 $mode = $olp->getCurrentMode();
360 if (
362 $this->readTypicalLearningTimeInSeconds($details_id, 0, $details_type)
363 ) {
364 // Section object details
365 if ($add_section) {
366 $info->addSection($this->lng->txt('details'));
367 }
368
370 $info->addProperty(
371 $this->lng->txt('trac_required_visits'),
372 (string) ilLPObjSettings::_lookupVisits($details_id)
373 );
374 }
375
376 if ($seconds = $this->readTypicalLearningTimeInSeconds($details_id, 0, $details_type)) {
377 $info->addProperty(
378 $this->lng->txt('meta_typical_learning_time'),
380 );
381 }
382 return true;
383 }
384 return false;
385 }
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 681 of file class.ilLearningProgressBaseGUI.php.

681 : void
682 {
683 $form = $this->initEditUserForm($user_id, $obj_id);
684 if ($form->checkInput()) {
685 $marks = new ilLPMarks($obj_id, $user_id);
686 $marks->setMark($form->getInput("mark"));
687 $marks->setComment($form->getInput("comment"));
688
689 $do_lp = false;
690
691 // status/completed is optional
692 $status = $form->getItemByPostVar("completed");
693 if (is_object($status)) {
694 if ($marks->getCompleted() != $form->getInput("completed")) {
695 $marks->setCompleted($form->getInput("completed"));
696 $do_lp = true;
697 }
698 }
699
700 $marks->update();
701
702 // #11600
703 if ($do_lp) {
705 }
706 }
707 }
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 318 of file class.ilLearningProgressBaseGUI.php.

321 : string {
322 global $DIC;
323
324 $lng = $DIC->language();
325 if (!$a_lng) {
326 $a_lng = $lng;
327 }
328 switch ($a_status) {
330 return $a_lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
331
333 return $a_lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
334
336 return $a_lng->txt(ilLPStatus::LP_STATUS_FAILED);
337
338 default:
339 if ($a_status === ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM) {
340 return $a_lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
341 }
342 return $a_lng->txt((string) $a_status);
343 }
344 }

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(), ilLPProgressBlockGUI\getLegacyContent(), ilMyStaffGUI\getUserLpStatusAsHtml(), ilMyStaffGUI\getUserLpStatusAsText(), ilLPObjectStatisticsLPTableGUI\initFilter(), ilSCORM2004TrackingItemsTableGUI\parseValue(), ilSCORMTrackingItemsTableGUI\parseValue(), and ilLPStatusIcons\renderIconForStatus().

+ Here is the caller graph for this function:

◆ getMode()

ilLearningProgressBaseGUI::getMode ( )

◆ getObjId()

◆ getRefId()

◆ getUserId()

ilLearningProgressBaseGUI::getUserId ( )

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

153 : int
154 {
155 if ($this->usr_id) {
156 return $this->usr_id;
157 }
158 if ($this->initUserIdFromQuery()) {
159 return $this->initUserIdFromQuery();
160 }
161 return 0;
162 }

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

609 $olp = ilObjectLP::getInstance($a_obj_id);
610 $lp_mode = $olp->getCurrentMode();
611
612 $form = new ilPropertyFormGUI();
613
614 $form->setFormAction($this->ctrl->getFormAction($this, "updateUser"));
615
616 $form->setTitle(
617 $this->lng->txt("edit") . ": " . ilObject::_lookupTitle($a_obj_id)
618 );
619 $form->setDescription(
620 $this->lng->txt('trac_mode') . ": " . $olp->getModeText($lp_mode)
621 );
622
623 $user = new ilNonEditableValueGUI($this->lng->txt("user"), '', true);
624 $user->setValue(ilUserUtil::getNamePresentation($a_user_id, true));
625 $form->addItem($user);
626
627 $marks = new ilLPMarks($a_obj_id, $a_user_id);
628
630 $mark = new ilTextInputGUI($this->lng->txt("trac_mark"), "mark");
631 $mark->setValue($marks->getMark());
632 $mark->setMaxLength(32);
633 $form->addItem($mark);
634 }
635
636 $comm = new ilTextInputGUI($this->lng->txt("trac_comment"), "comment");
637 $comm->setValue($marks->getComment());
638 $form->addItem($comm);
639
640 if ($lp_mode == ilLPObjSettings::LP_MODE_MANUAL ||
642 $completed = ilLPStatus::_lookupStatus($a_obj_id, $a_user_id);
643
644 $status = new ilCheckboxInputGUI(
645 $this->lng->txt('trac_completed'),
646 "completed"
647 );
648 $status->setChecked(
650 );
651 $form->addItem($status);
652 }
653
654 $form->addCommandButton("updateUser", $this->lng->txt('save'));
655
656 if ($a_cancel) {
657 $form->addCommandButton($a_cancel, $this->lng->txt('cancel'));
658 }
659
660 return $form;
661 }
This class represents a checkbox property in a property form.
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 142 of file class.ilLearningProgressBaseGUI.php.

142 : int
143 {
144 if ($this->http->wrapper()->query()->has('user_id')) {
145 return $this->http->wrapper()->query()->retrieve(
146 'user_id',
147 $this->refinery->kindlyTo()->int()
148 );
149 }
150 return 0;
151 }

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

718 : bool {
719 global $DIC;
720
721 $objDefinition = $DIC['objDefinition'];
722 $ilObjDataCache = $DIC['ilObjDataCache'];
723
724 if (!$a_type) {
725 $a_type = $ilObjDataCache->lookupType($a_obj_id);
726 }
727
728 if ($objDefinition->isPluginTypeName($a_type)) {
729 return false;
730 }
731 $class = "ilObj" . $objDefinition->getClassName($a_type) . "Access";
732 return (bool) $class::_isOffline($a_obj_id);
733 }

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

387 : int
388 {
389 $paths = $this->lom_services->paths();
390 $data_helper = $this->lom_services->dataHelper();
391
392 $value = $this->lom_services->read($obj_id, $sub_id, $type, $paths->firstTypicalLearningTime())
393 ->firstData($paths->firstTypicalLearningTime())
394 ->value();
395
396 return $data_helper->durationToSeconds($value);
397 }

Field Documentation

◆ $access

ilAccessHandler ilLearningProgressBaseGUI::$access
protected

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

◆ $anonymized

bool ilLearningProgressBaseGUI::$anonymized
protected

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

Referenced by isAnonymized().

◆ $ctrl

ilCtrlInterface ilLearningProgressBaseGUI::$ctrl
protected

Definition at line 41 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 59 of file class.ilLearningProgressBaseGUI.php.

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

◆ $obj_type

string ilLearningProgressBaseGUI::$obj_type = ''
protected

Definition at line 60 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 57 of file class.ilLearningProgressBaseGUI.php.

Referenced by getUserId().

◆ LP_ACTIVE_MATRIX

const ilLearningProgressBaseGUI::LP_ACTIVE_MATRIX = 11
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJECTS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJECTS = 2
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_OBJSTATACCESS

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATACCESS = 7
protected

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

◆ LP_ACTIVE_OBJSTATADMIN

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATADMIN = 10
protected

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

◆ LP_ACTIVE_OBJSTATDAILY

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATDAILY = 9
protected

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

◆ LP_ACTIVE_OBJSTATTYPES

const ilLearningProgressBaseGUI::LP_ACTIVE_OBJSTATTYPES = 8
protected

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

◆ LP_ACTIVE_PROGRESS

const ilLearningProgressBaseGUI::LP_ACTIVE_PROGRESS = 3
protected

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

◆ LP_ACTIVE_SETTINGS

const ilLearningProgressBaseGUI::LP_ACTIVE_SETTINGS = 1
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_SUMMARY

const ilLearningProgressBaseGUI::LP_ACTIVE_SUMMARY = 6
protected

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

Referenced by __setSubTabs().

◆ LP_ACTIVE_USERS

const ilLearningProgressBaseGUI::LP_ACTIVE_USERS = 5
protected

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