ILIAS  release_8 Revision v8.24
ilAttendanceList Class Reference

Base class for attendance lists. More...

+ Collaboration diagram for ilAttendanceList:

Public Member Functions

 __construct (object $a_parent_gui, ilObject $a_parent_obj, ?ilParticipants $a_participants_object=null, ?ilWaitingList $a_waiting_list=null)
 
 addPreset (string $a_id, string $a_caption, bool $a_selected=false)
 Add user field. More...
 
 addBlank (string $a_caption)
 Add blank column preset. More...
 
 setTitle (string $a_title, ?string $a_description=null)
 Set titles. More...
 
 addUserFilter (string $a_id, string $a_caption, bool $a_checked=false)
 Add user filter. More...
 
 getNonMemberUserData (array &$a_res)
 Get user data for subscribers and waiting list. More...
 
 setBlankColumns (array $a_values)
 Add blank columns. More...
 
 setCallback (callable $a_callback)
 Set participant detail callback. More...
 
 setId (string $a_value)
 
 initForm (string $a_cmd="")
 Init form. More...
 
 initFromForm ()
 Set list attributes from post values. More...
 
 initFromSettings ()
 Directly set list attributes from default settings for print view. More...
 
 getFullscreenHTML ()
 render list in fullscreen mode More...
 
 getHTML ()
 render attendance list More...
 

Protected Member Functions

 readOrderedExportableFields ()
 read object export fields More...
 
 addRole (int $a_id, string $a_caption, string $a_type)
 Add role. More...
 
 setRoleSelection (array $a_role_ids)
 

Protected Attributes

ilLogger $logger
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilGlobalTemplateInterface $tpl
 
object $parent_gui
 
ilObject $parent_obj
 
ilParticipants $participants
 
ilWaitingList $waiting_list
 
 $callback
 
array $presets = []
 
array $role_data = []
 
array $roles = []
 
bool $has_local_role = false
 
array $blank_columns = []
 
string $title = ''
 
string $description = ''
 
array $pre_blanks = []
 
string $id = ''
 
bool $include_waiting_list = false
 
bool $include_subscribers = false
 
array $user_filters = []
 

Detailed Description

Base class for attendance lists.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 26 of file class.ilAttendanceList.php.

Constructor & Destructor Documentation

◆ __construct()

ilAttendanceList::__construct ( object  $a_parent_gui,
ilObject  $a_parent_obj,
?ilParticipants  $a_participants_object = null,
?ilWaitingList  $a_waiting_list = null 
)

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

58 {
59 global $DIC;
60
61 $this->logger = $DIC->logger()->mmbr();
62 $this->lng = $DIC->language();
63 $this->ctrl = $DIC->ctrl();
64 $this->tpl = $DIC->ui()->mainTemplate();
65
66 $this->parent_gui = $a_parent_gui;
67 $this->parent_obj = $a_parent_obj;
68 $this->participants = $a_participants_object;
69 $this->waiting_list = $a_waiting_list;
70
71 // always available
72 $this->presets['name'] = array($DIC->language()->txt('name'), true);
73 $this->presets['login'] = array($DIC->language()->txt('login'), true);
74
75 // add exportable fields
77
78 $DIC->language()->loadLanguageModule('crs');
79
80 // roles
81 $roles = $this->participants->getRoles();
82
83 foreach ($roles as $role_id) {
85 switch (substr($title, 0, 8)) {
86 case 'il_crs_a':
87 case 'il_grp_a':
88 case 'il_lso_a':
89 $this->addRole($role_id, $DIC->language()->txt('event_tbl_admin'), 'admin');
90 break;
91
92 case 'il_crs_t':
93 $this->addRole($role_id, $DIC->language()->txt('event_tbl_tutor'), 'tutor');
94 break;
95
96 case 'il_crs_m':
97 case 'il_grp_m':
98 case 'il_sess_':
99 case 'il_lso_m':
100 $this->addRole($role_id, $DIC->language()->txt('event_tbl_member'), 'member');
101 break;
102
103 // local
104 default:
105 $this->has_local_role = true;
106 $this->addRole($role_id, $title, 'local');
107 break;
108 }
109 }
110 }
addRole(int $a_id, string $a_caption, string $a_type)
Add role.
readOrderedExportableFields()
read object export fields
static _lookupTitle(int $obj_id)
global $DIC
Definition: feed.php:28

References $DIC, $roles, $title, ilObject\_lookupTitle(), addRole(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and readOrderedExportableFields().

+ Here is the call graph for this function:

Member Function Documentation

◆ addBlank()

ilAttendanceList::addBlank ( string  $a_caption)

Add blank column preset.

Definition at line 165 of file class.ilAttendanceList.php.

165 : void
166 {
167 $this->pre_blanks[] = $a_caption;
168 }

◆ addPreset()

ilAttendanceList::addPreset ( string  $a_id,
string  $a_caption,
bool  $a_selected = false 
)

Add user field.

Definition at line 157 of file class.ilAttendanceList.php.

157 : void
158 {
159 $this->presets[$a_id] = array($a_caption, $a_selected);
160 }

Referenced by initFromForm(), and initFromSettings().

+ Here is the caller graph for this function:

◆ addRole()

ilAttendanceList::addRole ( int  $a_id,
string  $a_caption,
string  $a_type 
)
protected

Add role.

Definition at line 182 of file class.ilAttendanceList.php.

182 : void
183 {
184 $this->role_data[$a_id] = array($a_caption, $a_type);
185 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ addUserFilter()

ilAttendanceList::addUserFilter ( string  $a_id,
string  $a_caption,
bool  $a_checked = false 
)

Add user filter.

Definition at line 195 of file class.ilAttendanceList.php.

195 : void
196 {
197 $this->user_filters[$a_id] = array($a_caption, $a_checked);
198 }

◆ getFullscreenHTML()

ilAttendanceList::getFullscreenHTML ( )

render list in fullscreen mode

Definition at line 542 of file class.ilAttendanceList.php.

542 : void
543 {
544 $this->tpl->setContent($this->getHTML());
545 $this->tpl->addOnLoadCode("il.Util.print();");
546 }
getHTML()
render attendance list

References getHTML().

+ Here is the call graph for this function:

◆ getHTML()

ilAttendanceList::getHTML ( )

render attendance list

Definition at line 551 of file class.ilAttendanceList.php.

551 : string
552 {
553 $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'Services/Membership');
556
557 $tpl->setVariable('TXT_TITLE', $this->title);
558 if ($this->description) {
559 $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
560 } else {
561 $tpl->setVariable('TXT_DESCRIPTION', $time);
562 }
563
564 $tpl->setCurrentBlock('head_item');
565 foreach ($this->presets as $item) {
566 if ($item[1]) {
567 $tpl->setVariable('TXT_HEAD', $item[0]);
569 }
570 }
571
572 if ($this->blank_columns) {
573 foreach ($this->blank_columns as $blank) {
574 $tpl->setVariable('TXT_HEAD', $blank);
576 }
577 }
578
579 // handle members
580
581 $valid_user_ids = $filters = array();
582
583 if ($this->roles) {
584 if ($this->has_local_role) {
585 $members = array();
586 foreach ($this->participants->getMembers() as $member_id) {
587 foreach ($this->participants->getAssignedRoles($member_id) as $role_id) {
588 $members[$role_id][] = $member_id;
589 }
590 }
591 } else {
592 $members = $this->participants->getMembers();
593 }
594
595 foreach ($this->roles as $role_id) {
596 switch ($this->role_data[$role_id][1]) {
597 case "admin":
598 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getAdmins());
599 break;
600
601 case "tutor":
602 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getTutors());
603 break;
604
605 // member/local
606 default:
607 if (!$this->has_local_role) {
608 $valid_user_ids = array_merge($valid_user_ids, $members);
609 } else {
610 $valid_user_ids = array_merge($valid_user_ids, (array) $members[$role_id]);
611 }
612 break;
613 }
614 }
615 }
616
617 if ($this->include_subscribers) {
618 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getSubscribers());
619 }
620
621 if ($this->include_waiting_list) {
622 $valid_user_ids = array_merge($valid_user_ids, $this->waiting_list->getUserIds());
623 }
624
625 if ($this->user_filters) {
626 foreach ($this->user_filters as $sub_id => $sub_item) {
627 $filters[$sub_id] = (bool) ($sub_item[2] ?? false);
628 }
629 }
630 $valid_user_ids = ilUtil::_sortIds(array_unique($valid_user_ids), 'usr_data', 'lastname', 'usr_id');
631 foreach ($valid_user_ids as $user_id) {
632 if ($this->callback) {
633 $user_data = call_user_func_array($this->callback, [(int) $user_id, $filters]);
634 if (!$user_data) {
635 continue;
636 }
637
638 $tpl->setCurrentBlock("row_preset");
639 foreach ($this->presets as $id => $item) {
640 if ($item[1]) {
641 switch ($id) {
642 case 'org_units':
643 $value = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $user_id);
644 break;
645
646 case "name":
647 if (!($user_data[$id] ?? null)) {
648 $name = ilObjUser::_lookupName((int) $user_id);
649 $value = $name["lastname"] . ", " . $name["firstname"];
650 break;
651 }
652 // no break
653 case "login":
654 if (!($user_data[$id] ?? false)) {
655 $value = ilObjUser::_lookupLogin((int) $user_id);
656 break;
657 }
658
659 // no break
660 default:
661 $value = (string) ($user_data[$id] ?? '');
662 break;
663 }
664 $tpl->setVariable("TXT_PRESET", $value);
666 }
667 }
668 }
669
670 if ($this->blank_columns) {
671 for ($loop = 0, $loopMax = count($this->blank_columns); $loop < $loopMax; $loop++) {
672 $tpl->touchBlock('row_blank');
673 }
674 }
675
676 $tpl->touchBlock("member_row");
677 }
678 return $tpl->get();
679 }
const IL_CAL_UNIX
ilGlobalTemplateInterface $tpl
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static _lookupName(int $a_user_id)
lookup user name
static _lookupLogin(int $a_user_id)
special template class to simplify handling of ITX/PEAR
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
touchBlock(string $block)
overwrites ITX::touchBlock.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
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.
if($format !==null) $name
Definition: metadata.php:247

References $id, $name, $tpl, ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\_sortIds(), ilDatePresentation\formatDate(), ilGlobalTemplateInterface\get(), IL_CAL_UNIX, ilGlobalTemplateInterface\parseCurrentBlock(), ilGlobalTemplateInterface\setCurrentBlock(), ilDatePresentation\setUseRelativeDates(), ilGlobalTemplateInterface\setVariable(), and ilGlobalTemplateInterface\touchBlock().

Referenced by getFullscreenHTML().

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

◆ getNonMemberUserData()

ilAttendanceList::getNonMemberUserData ( array &  $a_res)

Get user data for subscribers and waiting list.

Definition at line 203 of file class.ilAttendanceList.php.

203 : void
204 {
205 $subscriber_ids = $this->participants->getSubscribers();
206 $user_ids = $subscriber_ids;
207 if ($this->waiting_list) {
208 $user_ids = array_merge($user_ids, $this->waiting_list->getUserIds());
209 }
210
211 // Finally read user profile data
212 $profile_data = ilObjUser::_readUsersProfileData($user_ids);
213 foreach ($profile_data as $user_id => $fields) {
214 foreach ((array) $fields as $field => $value) {
215 $a_res[$user_id][$field] = $value;
216 }
217 }
218
220
221 foreach ($udf->getExportableFields($this->parent_obj->getId()) as $field_id => $udf_data) {
222 foreach ($profile_data as $user_id => $field) {
223 $udf_data = new ilUserDefinedData($user_id);
224 $a_res[$user_id]['udf_' . $field_id] = $udf_data->get('f_' . $field_id);
225 }
226 }
227
228 if (count($user_ids)) {
229 // object specific user data
230 $cdfs = ilCourseUserData::_getValuesByObjId($this->parent_obj->getId());
231 foreach (array_unique($user_ids) as $user_id) {
232 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
233 $a_res[$user_id]['login'] = $tmp_obj->getLogin();
234 $a_res[$user_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
235
236 if (in_array($user_id, $subscriber_ids)) {
237 $a_res[$user_id]['status'] = $this->lng->txt('crs_subscriber');
238 } else {
239 $a_res[$user_id]['status'] = $this->lng->txt('crs_waiting_list');
240 }
241
242 foreach ((array) ($cdfs[$user_id] ?? []) as $field_id => $value) {
243 $a_res[$user_id]['cdf_' . $field_id] = (string) $value;
244 }
245 }
246 }
247 }
248 }
static _getValuesByObjId(int $a_obj_id)
static _readUsersProfileData(array $a_user_ids)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilUserDefinedFields\_getInstance(), ilCourseUserData\_getValuesByObjId(), ilObjUser\_readUsersProfileData(), ilObjectFactory\getInstanceByObjId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initForm()

ilAttendanceList::initForm ( string  $a_cmd = "")

Init form.

Definition at line 284 of file class.ilAttendanceList.php.

285 {
286 $this->lng->loadLanguageModule('crs');
287
288 $form = new ilPropertyFormGUI();
289 $form->setFormAction($this->ctrl->getFormAction($this->parent_gui, $a_cmd));
290 $form->setPreventDoubleSubmission(false);
291 $form->setTitle($this->lng->txt('sess_gen_attendance_list'));
292
293 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
294 $title->setValue($this->title);
295 $form->addItem($title);
296
297 $desc = new ilTextInputGUI($this->lng->txt('description'), 'desc');
298 $desc->setValue($this->description);
299 $form->addItem($desc);
300
301 if (count($this->presets)) {
302 $preset = new ilCheckboxGroupInputGUI($this->lng->txt('user_detail'), 'preset');
303 $preset_value = array();
304 foreach ($this->presets as $id => $item) {
305 $preset->addOption(new ilCheckboxOption($item[0], $id));
306 if ($item[1]) {
307 $preset_value[] = $id;
308 }
309 }
310 $preset->setValue($preset_value);
311 $form->addItem($preset);
312 }
313
314 $blank = new ilTextInputGUI($this->lng->txt('event_blank_columns'), 'blank');
315 $blank->setMulti(true);
316 $form->addItem($blank);
317
318 if ($this->pre_blanks) {
319 $blank->setValue($this->pre_blanks);
320 }
321
322 $checked = array();
323
324 $chk_grp = new ilCheckboxGroupInputGUI($this->lng->txt('event_user_selection'), 'selection_of_users');
325
326 // participants by roles
327 foreach ($this->role_data as $role_id => $role_data) {
328 $title = ilObject::_lookupTitle($role_id);
329
330 $role_name = $role_id;
331 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_adm') === 0) {
332 $role_name = 'adm';
333 }
334 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_mem') === 0) {
335 $role_name = 'mem';
336 }
337 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_tut') === 0) {
338 $role_name = 'tut';
339 }
340
341 $chk = new ilCheckboxOption(
342 sprintf($this->lng->txt('event_user_selection_include_role'), $role_data[0]),
343 'role_' . $role_name
344 );
345 $checked[] = 'role_' . $role_name;
346 $chk_grp->addOption($chk);
347 }
348
349 if ($this->waiting_list) {
350 $chk = new ilCheckboxOption($this->lng->txt('event_user_selection_include_requests'), 'subscr');
351 $chk_grp->addOption($chk);
352
353 $chk = new ilCheckboxOption($this->lng->txt('event_user_selection_include_waiting_list'), 'wlist');
354 $chk_grp->addOption($chk);
355 }
356
357 if ($this->user_filters) {
358 foreach ($this->user_filters as $sub_id => $sub_item) {
359 $chk = new ilCheckboxOption(
360 sprintf($this->lng->txt('event_user_selection_include_filter'), $sub_item[0]),
361 'members_' . $sub_id
362 );
363 if ($sub_item[1]) {
364 $checked[] = 'members_' . $sub_id;
365 }
366 $chk_grp->addOption($chk);
367 }
368 }
369 $chk_grp->setValue($checked);
370 $form->addItem($chk_grp);
371
372 $form->addCommandButton($a_cmd, $this->lng->txt('sess_print_attendance_list'));
373
374 if ($this->id && $a_cmd) {
375 $settings = new ilUserFormSettings($this->id);
376 if (!$settings->hasStoredEntry()) {
377 $settings = new ilUserFormSettings($this->parent_obj->getType() . 's_pview', -1);
378 }
379
380 $settings->deleteValue('desc'); // #11340
381 $settings->exportToForm($form);
382 }
383 return $form;
384 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200

References $id, $role_data, ILIAS\LTI\ToolProvider\$settings, $title, ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by initFromForm().

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

◆ initFromForm()

ilAttendanceList::initFromForm ( )

Set list attributes from post values.

Definition at line 389 of file class.ilAttendanceList.php.

389 : void
390 {
391 $form = $this->initForm();
392 if ($form->checkInput()) {
393 foreach (array_keys($this->presets) as $id) {
394 $this->presets[$id][1] = false;
395 }
396 foreach ((array) $form->getInput('preset') as $value) {
397 if (isset($this->presets[$value])) {
398 $this->presets[$value][1] = true;
399 } else {
400 $this->addPreset($value, $value, true);
401 }
402 }
403
404 $this->setTitle($form->getInput('title'), $form->getInput('desc'));
405 $this->setBlankColumns($form->getInput('blank'));
406
407 $selection_of_users = (array) $form->getInput('selection_of_users'); // #18238
408
409 $roles = array();
410 foreach (array_keys($this->role_data) as $role_id) {
411 $title = ilObject::_lookupTitle($role_id);
412 $role_name = $role_id;
413 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_adm') === 0) {
414 $role_name = 'adm';
415 }
416 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_mem') === 0) {
417 $role_name = 'mem';
418 }
419 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_tut') === 0) {
420 $role_name = 'tut';
421 }
422
423 if (in_array('role_' . $role_name, $selection_of_users)) {
424 $roles[] = $role_id;
425 }
426 }
427 $this->setRoleSelection($roles);
428
429 // not in sessions
430 if ($this->waiting_list) {
431 $this->include_subscribers = in_array('subscr', $selection_of_users);
432 $this->include_waiting_list = in_array('wlist', $selection_of_users);
433 }
434
435 if ($this->user_filters) {
436 foreach (array_keys($this->user_filters) as $msub_id) {
437 $this->user_filters[$msub_id][2] = in_array("members_" . $msub_id, $selection_of_users);
438 }
439 }
440
441 if ($this->id) {
442 #$form->setValuesByPost();
443
444 #$settings = new ilUserFormSettings($this->id);
445 #$settings->deleteValue('desc'); // #11340
446 #$settings->importFromForm($form);
447 #$settings->store();
448 }
449 }
450 }
setTitle(string $a_title, ?string $a_description=null)
Set titles.
addPreset(string $a_id, string $a_caption, bool $a_selected=false)
Add user field.
initForm(string $a_cmd="")
Init form.
setBlankColumns(array $a_values)
Add blank columns.
setRoleSelection(array $a_role_ids)

References $id, $roles, $title, ilObject\_lookupTitle(), addPreset(), initForm(), setBlankColumns(), setRoleSelection(), and setTitle().

+ Here is the call graph for this function:

◆ initFromSettings()

ilAttendanceList::initFromSettings ( )

Directly set list attributes from default settings for print view.

Definition at line 455 of file class.ilAttendanceList.php.

455 : void
456 {
458 $this->parent_obj->getType() . 's_pview_' . $this->parent_obj->getId(),
459 -1
460 );
461 if (!$settings->hasStoredEntry()) {
462 // init from global defaults
463 $settings = new ilUserFormSettings($this->parent_obj->getType() . 's_pview', -1);
464 }
465 $settings->deleteValue('desc'); // #11340
466
467 // title and description
468 $this->setTitle(
469 (string) ($settings->getValue('title') ?? $this->title),
470 (string) ($settings->getValue('desc') ?? $this->description)
471 );
472
473 // preset
474 if ($preset_value = $settings->getValue('preset')) {
475 foreach (array_keys($this->presets) as $id) {
476 $this->presets[$id][1] = false;
477 }
478 foreach ((array) $preset_value as $value) {
479 if (isset($this->presets[$value])) {
480 $this->presets[$value][1] = true;
481 } else {
482 $this->addPreset($value, $value, true);
483 }
484 }
485 }
486
487 // blank
488 $this->setBlankColumns(
489 (array) ($settings->getValue('blank') ?? $this->pre_blanks)
490 );
491
492 // selection of users
493 $selection_of_users = $settings->getValue('selection_of_users');
494
495 // participants by roles
496 $roles = [];
497 foreach ($this->role_data as $role_id => $role_data) {
498 $title = ilObject::_lookupTitle($role_id);
499
500 $role_name = $role_id;
501 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_adm') === 0) {
502 $role_name = 'adm';
503 }
504 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_mem') === 0) {
505 $role_name = 'mem';
506 }
507 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_tut') === 0) {
508 $role_name = 'tut';
509 }
510
511 if (
512 isset($selection_of_users) &&
513 !in_array('role_' . $role_name, $selection_of_users)
514 ) {
515 continue;
516 }
517 $roles[] = $role_id;
518 }
519 $this->setRoleSelection($roles);
520
521 // waiting list and subscribers (not in sessions)
522 if ($this->waiting_list && isset($selection_of_users)) {
523 $this->include_subscribers = in_array('subscr', $selection_of_users);
524 $this->include_waiting_list = in_array('wlist', $selection_of_users);
525 }
526
527 // user filters
528 foreach (array_keys($this->user_filters) as $msub_id) {
529 if (isset($selection_of_users)) {
530 $this->user_filters[$msub_id][2] = in_array("members_" . $msub_id, $selection_of_users);
531 continue;
532 }
533 if ($this->user_filters[$msub_id][1]) {
534 $this->user_filters[$msub_id][2] = true;
535 }
536 }
537 }

References $id, $role_data, $roles, ILIAS\LTI\ToolProvider\$settings, $title, ilObject\_lookupTitle(), addPreset(), setBlankColumns(), setRoleSelection(), and setTitle().

+ Here is the call graph for this function:

◆ readOrderedExportableFields()

ilAttendanceList::readOrderedExportableFields ( )
protected

read object export fields

Definition at line 115 of file class.ilAttendanceList.php.

115 : bool
116 {
117 $field_info = ilExportFieldsInfo::_getInstanceByType($this->parent_obj->getType());
118 $field_info->sortExportFields();
119
120 foreach ($field_info->getExportableFields() as $field) {
121 switch ($field) {
122 case 'username':
123 case 'firstname':
124 case 'lastname':
125 continue 2;
126 }
127
128 // Check if default enabled
129 $this->presets[$field] = array(
130 $GLOBALS['DIC']['lng']->txt($field),
131 false
132 );
133 }
134
135 // add udf fields
137 foreach ($udf->getExportableFields($this->parent_obj->getId()) as $field_id => $udf_data) {
138 $this->presets['udf_' . $field_id] = array(
139 $udf_data['field_name'],
140 false
141 );
142 }
143
144 // add cdf fields
145 foreach (ilCourseDefinedFieldDefinition::_getFields($this->parent_obj->getId()) as $field_obj) {
146 $this->presets['cdf_' . $field_obj->getId()] = array(
147 $field_obj->getName(),
148 false
149 );
150 }
151 return true;
152 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
static _getInstanceByType(string $a_type)
Get Singleton Instance.

References $GLOBALS, ilCourseDefinedFieldDefinition\_getFields(), ilUserDefinedFields\_getInstance(), and ilExportFieldsInfo\_getInstanceByType().

Referenced by __construct().

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

◆ setBlankColumns()

ilAttendanceList::setBlankColumns ( array  $a_values)

Add blank columns.

Definition at line 253 of file class.ilAttendanceList.php.

253 : void
254 {
255 if (!implode("", $a_values)) {
256 $a_values = array();
257 } else {
258 foreach ($a_values as $idx => $value) {
259 $a_values[$idx] = trim($value);
260 if ($a_values[$idx] == "") {
261 unset($a_values[$idx]);
262 }
263 }
264 }
265 $this->blank_columns = $a_values;
266 }

Referenced by initFromForm(), and initFromSettings().

+ Here is the caller graph for this function:

◆ setCallback()

ilAttendanceList::setCallback ( callable  $a_callback)

Set participant detail callback.

Definition at line 271 of file class.ilAttendanceList.php.

271 : void
272 {
273 $this->callback = $a_callback;
274 }

◆ setId()

ilAttendanceList::setId ( string  $a_value)

Definition at line 276 of file class.ilAttendanceList.php.

276 : void
277 {
278 $this->id = $a_value;
279 }

◆ setRoleSelection()

ilAttendanceList::setRoleSelection ( array  $a_role_ids)
protected

Definition at line 187 of file class.ilAttendanceList.php.

187 : void
188 {
189 $this->roles = $a_role_ids;
190 }

Referenced by initFromForm(), and initFromSettings().

+ Here is the caller graph for this function:

◆ setTitle()

ilAttendanceList::setTitle ( string  $a_title,
?string  $a_description = null 
)

Set titles.

Definition at line 173 of file class.ilAttendanceList.php.

173 : void
174 {
175 $this->title = $a_title;
176 $this->description = (string) $a_description;
177 }

Referenced by initFromForm(), and initFromSettings().

+ Here is the caller graph for this function:

Field Documentation

◆ $blank_columns

array ilAttendanceList::$blank_columns = []
protected

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

◆ $callback

ilAttendanceList::$callback
protected

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

◆ $ctrl

ilCtrlInterface ilAttendanceList::$ctrl
protected

Definition at line 30 of file class.ilAttendanceList.php.

◆ $description

string ilAttendanceList::$description = ''
protected

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

◆ $has_local_role

bool ilAttendanceList::$has_local_role = false
protected

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

◆ $id

string ilAttendanceList::$id = ''
protected

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

Referenced by getHTML(), initForm(), initFromForm(), and initFromSettings().

◆ $include_subscribers

bool ilAttendanceList::$include_subscribers = false
protected

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

◆ $include_waiting_list

bool ilAttendanceList::$include_waiting_list = false
protected

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

◆ $lng

ilLanguage ilAttendanceList::$lng
protected

Definition at line 29 of file class.ilAttendanceList.php.

◆ $logger

ilLogger ilAttendanceList::$logger
protected

Definition at line 28 of file class.ilAttendanceList.php.

◆ $parent_gui

object ilAttendanceList::$parent_gui
protected

Definition at line 32 of file class.ilAttendanceList.php.

◆ $parent_obj

ilObject ilAttendanceList::$parent_obj
protected

Definition at line 33 of file class.ilAttendanceList.php.

◆ $participants

ilParticipants ilAttendanceList::$participants
protected

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

◆ $pre_blanks

array ilAttendanceList::$pre_blanks = []
protected

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

◆ $presets

array ilAttendanceList::$presets = []
protected

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

◆ $role_data

array ilAttendanceList::$role_data = []
protected

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

Referenced by initForm(), and initFromSettings().

◆ $roles

array ilAttendanceList::$roles = []
protected

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

Referenced by __construct(), initFromForm(), and initFromSettings().

◆ $title

string ilAttendanceList::$title = ''
protected

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

Referenced by __construct(), initForm(), initFromForm(), and initFromSettings().

◆ $tpl

ilGlobalTemplateInterface ilAttendanceList::$tpl
protected

Definition at line 31 of file class.ilAttendanceList.php.

Referenced by getHTML().

◆ $user_filters

array ilAttendanceList::$user_filters = []
protected

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

◆ $waiting_list

ilWaitingList ilAttendanceList::$waiting_list
protected

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


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