ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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
 
Profile $profile
 
object $parent_gui
 
ilObject $parent_obj
 
ilParticipants $participants
 
ilWaitingList $waiting_list
 
ilTree $tree
 
 $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 29 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 58 of file class.ilAttendanceList.php.

63 {
64 global $DIC;
65
66 $this->logger = $DIC->logger()->mmbr();
67 $this->lng = $DIC->language();
68 $this->ctrl = $DIC->ctrl();
69 $this->tpl = $DIC->ui()->mainTemplate();
70 $this->profile = $DIC['user']->getProfile();
71 $this->tree = $DIC->repositoryTree();
72 $this->parent_gui = $a_parent_gui;
73 $this->parent_obj = $a_parent_obj;
74 $this->participants = $a_participants_object;
75 $this->waiting_list = $a_waiting_list;
76
77 // always available
78 $this->presets['name'] = array($DIC->language()->txt('name'), true);
79 $this->presets['login'] = array($DIC->language()->txt('login'), true);
80
81 // add exportable fields
83
84 $DIC->language()->loadLanguageModule('crs');
85
86 // roles
87 $roles = $this->participants->getRoles();
88
89 foreach ($roles as $role_id) {
91 switch (substr($title, 0, 8)) {
92 case 'il_crs_a':
93 case 'il_grp_a':
94 case 'il_lso_a':
95 $this->addRole($role_id, $DIC->language()->txt('event_tbl_admin'), 'admin');
96 break;
97
98 case 'il_crs_t':
99 $this->addRole($role_id, $DIC->language()->txt('event_tbl_tutor'), 'tutor');
100 break;
101
102 case 'il_crs_m':
103 case 'il_grp_m':
104 case 'il_sess_':
105 case 'il_lso_m':
106 $this->addRole($role_id, $DIC->language()->txt('event_tbl_member'), 'member');
107 break;
108
109 // local
110 default:
111 $this->has_local_role = true;
112 $this->addRole($role_id, $title, 'local');
113 break;
114 }
115 }
116 }
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: shib_login.php:26

References $DIC, $roles, $title, ilObject\_lookupTitle(), addRole(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\profile(), 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 176 of file class.ilAttendanceList.php.

176 : void
177 {
178 $this->pre_blanks[] = $a_caption;
179 }

◆ addPreset()

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

Add user field.

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

168 : void
169 {
170 $this->presets[$a_id] = array($a_caption, $a_selected);
171 }

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 193 of file class.ilAttendanceList.php.

193 : void
194 {
195 $this->role_data[$a_id] = array($a_caption, $a_type);
196 }

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 206 of file class.ilAttendanceList.php.

206 : void
207 {
208 $this->user_filters[$a_id] = array($a_caption, $a_checked);
209 }

◆ getFullscreenHTML()

ilAttendanceList::getFullscreenHTML ( )

render list in fullscreen mode

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

559 : void
560 {
561 $this->tpl->setContent($this->getHTML());
562 $this->tpl->addOnLoadCode("il.Util.print();");
563 }
getHTML()
render attendance list

References getHTML().

+ Here is the call graph for this function:

◆ getHTML()

ilAttendanceList::getHTML ( )

render attendance list

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

568 : string
569 {
570 $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'components/ILIAS/Membership');
573
574 $tpl->setVariable('TXT_TITLE', $this->title);
575 if ($this->description) {
576 $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
577 } else {
578 $tpl->setVariable('TXT_DESCRIPTION', $time);
579 }
580
581 $tpl->setCurrentBlock('head_item');
582 foreach ($this->presets as $item) {
583 if ($item[1]) {
584 $tpl->setVariable('TXT_HEAD', $item[0]);
586 }
587 }
588
589 if ($this->blank_columns) {
590 foreach ($this->blank_columns as $blank) {
591 $tpl->setVariable('TXT_HEAD', $blank);
593 }
594 }
595
596 // handle members
597
598 $valid_user_ids = $filters = array();
599
600 if ($this->roles) {
601 if ($this->has_local_role) {
602 $members = array();
603 foreach ($this->participants->getMembers() as $member_id) {
604 foreach ($this->participants->getAssignedRoles($member_id) as $role_id) {
605 $members[$role_id][] = $member_id;
606 }
607 }
608 } else {
609 $members = $this->participants->getMembers();
610 }
611
612 foreach ($this->roles as $role_id) {
613 switch ($this->role_data[$role_id][1]) {
614 case "admin":
615 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getAdmins());
616 break;
617
618 case "tutor":
619 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getTutors());
620 break;
621
622 // member/local
623 default:
624 if (!$this->has_local_role) {
625 $valid_user_ids = array_merge($valid_user_ids, $members);
626 } else {
627 $valid_user_ids = array_merge($valid_user_ids, (array) ($members[$role_id] ?? []));
628 }
629 break;
630 }
631 }
632 }
633
634 if ($this->include_subscribers) {
635 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getSubscribers());
636 }
637
638 if ($this->include_waiting_list) {
639 $valid_user_ids = array_merge($valid_user_ids, $this->waiting_list->getUserIds());
640 }
641
642 if ($this->user_filters) {
643 foreach ($this->user_filters as $sub_id => $sub_item) {
644 $filters[$sub_id] = (bool) ($sub_item[2] ?? false);
645 }
646 }
647 $valid_user_ids = ilUtil::_sortIds(array_unique($valid_user_ids), 'usr_data', 'lastname', 'usr_id');
648 foreach ($valid_user_ids as $user_id) {
649 if ($this->callback) {
650 $user_data = call_user_func_array($this->callback, [(int) $user_id, $filters]);
651 if (!$user_data) {
652 continue;
653 }
654
655 $tpl->setCurrentBlock("row_preset");
656 foreach ($this->presets as $id => $item) {
657 if ($item[1]) {
658 switch ($id) {
659 case 'org_units':
660 $value = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $user_id);
661 break;
662
663 case "name":
664 if (!($user_data[$id] ?? null)) {
665 $name = ilObjUser::_lookupName((int) $user_id);
666 $value = $name["lastname"] . ", " . $name["firstname"];
667 break;
668 }
669 // no break
670 case "login":
671 if (!($user_data[$id] ?? false)) {
672 $value = ilObjUser::_lookupLogin((int) $user_id);
673 break;
674 }
675
676 // no break
677 default:
678 $value = (string) ($user_data[$id] ?? '');
679 break;
680 }
681 $tpl->setVariable("TXT_PRESET", $value);
683 }
684 }
685 }
686
687 if ($this->blank_columns) {
688 for ($loop = 0, $loopMax = count($this->blank_columns); $loop < $loopMax; $loop++) {
689 $tpl->touchBlock('row_blank');
690 }
691 }
692
693 $tpl->touchBlock("member_row");
694 }
695 return $tpl->get();
696 }
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, ?ilObjUser $user=null,)
@classDescription Date and time handling
static _lookupName(int $a_user_id)
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,...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References $id, $tpl, $user_id, ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilUtil\_sortIds(), ilDatePresentation\formatDate(), ILIAS\UICore\GlobalTemplate\get(), IL_CAL_UNIX, ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ilDatePresentation\setUseRelativeDates(), ILIAS\UICore\GlobalTemplate\setVariable(), and ILIAS\UICore\GlobalTemplate\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 214 of file class.ilAttendanceList.php.

214 : void
215 {
216 $subscriber_ids = $this->participants->getSubscribers();
217 $user_ids = $subscriber_ids;
218 if ($this->waiting_list) {
219 $user_ids = array_merge($user_ids, $this->waiting_list->getUserIds());
220 }
221
222 // Finally read user profile data
223 $profile_data = ilObjUser::_readUsersProfileData($user_ids);
224 foreach ($profile_data as $user_id => $fields) {
225 foreach ((array) $fields as $field => $value) {
226 $a_res[$user_id][$field] = $value;
227 }
228 }
229
230 $parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'crs') ? 'crs' : '';
231 $parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'grp') ? 'grp' : $parent_obj_type;
232 $user_defined_fields = $parent_obj_type === ''
233 ? $this->profile->getAllUserDefinedFields()
234 : $this->profile->getVisibleUserDefinedFields(Context::buildFromObjectType($parent_obj_type));
235
236 foreach ($user_defined_fields as $field) {
237 $profile_data = $this->profile->getDataForMultiple($user_ids);
238 foreach ($profile_data as $user_id => $field) {
239 $a_res[$user_id]['udf_' . $field->getIdentifier()] = $profile_data->getAdditionalFieldByIdentifier(
240 $field->getIdentifier()
241 );
242 }
243 }
244
245 if (count($user_ids)) {
246 // object specific user data
247 $cdfs = ilCourseUserData::_getValuesByObjId($this->parent_obj->getId());
248 foreach (array_unique($user_ids) as $user_id) {
249 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
250 $a_res[$user_id]['login'] = $tmp_obj->getLogin();
251 $a_res[$user_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
252
253 if (in_array($user_id, $subscriber_ids)) {
254 $a_res[$user_id]['status'] = $this->lng->txt('crs_subscriber');
255 } else {
256 $a_res[$user_id]['status'] = $this->lng->txt('crs_waiting_list');
257 }
258
259 foreach ((array) ($cdfs[$user_id] ?? []) as $field_id => $value) {
260 $a_res[$user_id]['cdf_' . $field_id] = (string) $value;
261 }
262 }
263 }
264 }
265 }
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

References $user_id, ilCourseUserData\_getValuesByObjId(), ilObjUser\_readUsersProfileData(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), and ILIAS\Repository\profile().

+ Here is the call graph for this function:

◆ initForm()

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

Init form.

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

302 {
303 $this->lng->loadLanguageModule('crs');
304
305 $form = new ilPropertyFormGUI();
306 $form->setFormAction($this->ctrl->getFormAction($this->parent_gui, $a_cmd));
307 $form->setPreventDoubleSubmission(false);
308 $form->setTitle($this->lng->txt('sess_gen_attendance_list'));
309
310 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
311 $title->setValue($this->title);
312 $form->addItem($title);
313
314 $desc = new ilTextInputGUI($this->lng->txt('description'), 'desc');
315 $desc->setValue($this->description);
316 $form->addItem($desc);
317
318 if (count($this->presets)) {
319 $preset = new ilCheckboxGroupInputGUI($this->lng->txt('user_detail'), 'preset');
320 $preset_value = array();
321 foreach ($this->presets as $id => $item) {
322 $preset->addOption(new ilCheckboxOption($item[0], $id));
323 if ($item[1]) {
324 $preset_value[] = $id;
325 }
326 }
327 $preset->setValue($preset_value);
328 $form->addItem($preset);
329 }
330
331 $blank = new ilTextInputGUI($this->lng->txt('event_blank_columns'), 'blank');
332 $blank->setMulti(true);
333 $form->addItem($blank);
334
335 if ($this->pre_blanks) {
336 $blank->setValue($this->pre_blanks);
337 }
338
339 $checked = array();
340
341 $chk_grp = new ilCheckboxGroupInputGUI($this->lng->txt('event_user_selection'), 'selection_of_users');
342
343 // participants by roles
344 foreach ($this->role_data as $role_id => $role_data) {
345 $title = ilObject::_lookupTitle($role_id);
346
347 $role_name = $role_id;
348 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_adm') === 0) {
349 $role_name = 'adm';
350 }
351 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_mem') === 0) {
352 $role_name = 'mem';
353 }
354 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_tut') === 0) {
355 $role_name = 'tut';
356 }
357
358 $chk = new ilCheckboxOption(
359 sprintf($this->lng->txt('event_user_selection_include_role'), $role_data[0]),
360 'role_' . $role_name
361 );
362 $checked[] = 'role_' . $role_name;
363 $chk_grp->addOption($chk);
364 }
365
366 if ($this->waiting_list) {
367 $chk = new ilCheckboxOption($this->lng->txt('event_user_selection_include_requests'), 'subscr');
368 $chk_grp->addOption($chk);
369
370 $chk = new ilCheckboxOption($this->lng->txt('event_user_selection_include_waiting_list'), 'wlist');
371 $chk_grp->addOption($chk);
372 }
373
374 if ($this->user_filters) {
375 foreach ($this->user_filters as $sub_id => $sub_item) {
376 $chk = new ilCheckboxOption(
377 sprintf($this->lng->txt('event_user_selection_include_filter'), $sub_item[0]),
378 'members_' . $sub_id
379 );
380 if ($sub_item[1]) {
381 $checked[] = 'members_' . $sub_id;
382 }
383 $chk_grp->addOption($chk);
384 }
385 }
386 $chk_grp->setValue($checked);
387 $form->addItem($chk_grp);
388
389 $form->addCommandButton($a_cmd, $this->lng->txt('sess_print_attendance_list'));
390
391 if ($this->id && $a_cmd) {
392 $settings = new ilUserFormSettings($this->id);
393 if (!$settings->hasStoredEntry()) {
394 $settings = new ilUserFormSettings($this->parent_obj->getType() . 's_pview', -1);
395 }
396
397 $settings->deleteValue('desc'); // #11340
398 $settings->exportToForm($form);
399 }
400 return $form;
401 }
$settings
Definition: index.php:44
This class represents a property in a property form.
This class represents an option in a checkbox group.
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...

References $id, $role_data, $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 406 of file class.ilAttendanceList.php.

406 : void
407 {
408 $form = $this->initForm();
409 if ($form->checkInput()) {
410 foreach (array_keys($this->presets) as $id) {
411 $this->presets[$id][1] = false;
412 }
413 foreach ((array) $form->getInput('preset') as $value) {
414 if (isset($this->presets[$value])) {
415 $this->presets[$value][1] = true;
416 } else {
417 $this->addPreset($value, $value, true);
418 }
419 }
420
421 $this->setTitle($form->getInput('title'), $form->getInput('desc'));
422 $this->setBlankColumns($form->getInput('blank'));
423
424 $selection_of_users = (array) $form->getInput('selection_of_users'); // #18238
425
426 $roles = array();
427 foreach (array_keys($this->role_data) as $role_id) {
428 $title = ilObject::_lookupTitle($role_id);
429 $role_name = $role_id;
430 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_adm') === 0) {
431 $role_name = 'adm';
432 }
433 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_mem') === 0) {
434 $role_name = 'mem';
435 }
436 if (strpos($title, 'il_' . $this->parent_obj->getType() . '_tut') === 0) {
437 $role_name = 'tut';
438 }
439
440 if (in_array('role_' . $role_name, $selection_of_users)) {
441 $roles[] = $role_id;
442 }
443 }
444 $this->setRoleSelection($roles);
445
446 // not in sessions
447 if ($this->waiting_list) {
448 $this->include_subscribers = in_array('subscr', $selection_of_users);
449 $this->include_waiting_list = in_array('wlist', $selection_of_users);
450 }
451
452 if ($this->user_filters) {
453 foreach (array_keys($this->user_filters) as $msub_id) {
454 $this->user_filters[$msub_id][2] = in_array("members_" . $msub_id, $selection_of_users);
455 }
456 }
457
458 if ($this->id) {
459 #$form->setValuesByPost();
460
461 #$settings = new ilUserFormSettings($this->id);
462 #$settings->deleteValue('desc'); // #11340
463 #$settings->importFromForm($form);
464 #$settings->store();
465 }
466 }
467 }
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 472 of file class.ilAttendanceList.php.

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

References $id, $role_data, $roles, $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 121 of file class.ilAttendanceList.php.

121 : bool
122 {
123 $field_info = ilExportFieldsInfo::_getInstanceByType($this->parent_obj->getType());
124 $field_info->sortExportFields();
125
126 foreach ($field_info->getExportableFields() as $field) {
127 switch ($field) {
128 case 'username':
129 case 'firstname':
130 case 'lastname':
131 continue 2;
132 }
133
134 // Check if default enabled
135 $this->presets[$field] = array(
136 $GLOBALS['DIC']['lng']->txt($field),
137 false
138 );
139 }
140
141 $parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'crs') ? 'crs' : '';
142 $parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'grp') ? 'grp' : $parent_obj_type;
143 $user_defined_fields = $parent_obj_type === ''
144 ? $this->profile->getAllUserDefinedFields()
145 : $this->profile->getVisibleUserDefinedFields(Context::buildFromObjectType($parent_obj_type));
146
147 // add udf fields
148 foreach ($user_defined_fields as $field) {
149 $this->presets['udf_' . $field->getIdentifier()] = array(
150 $field->getLabel($this->lng),
151 false
152 );
153 }
154
155 // add cdf fields
156 foreach (ilCourseDefinedFieldDefinition::_getFields($this->parent_obj->getId()) as $field_obj) {
157 $this->presets['cdf_' . $field_obj->getId()] = array(
158 $field_obj->getName(),
159 false
160 );
161 }
162 return true;
163 }
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.
$GLOBALS["DIC"]
Definition: wac.php:66

References $GLOBALS, ilCourseDefinedFieldDefinition\_getFields(), ilExportFieldsInfo\_getInstanceByType(), and ILIAS\Repository\profile().

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 270 of file class.ilAttendanceList.php.

270 : void
271 {
272 if (!implode("", $a_values)) {
273 $a_values = array();
274 } else {
275 foreach ($a_values as $idx => $value) {
276 $a_values[$idx] = trim($value);
277 if ($a_values[$idx] == "") {
278 unset($a_values[$idx]);
279 }
280 }
281 }
282 $this->blank_columns = $a_values;
283 }

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 288 of file class.ilAttendanceList.php.

288 : void
289 {
290 $this->callback = $a_callback;
291 }

◆ setId()

ilAttendanceList::setId ( string  $a_value)

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

293 : void
294 {
295 $this->id = $a_value;
296 }

◆ setRoleSelection()

ilAttendanceList::setRoleSelection ( array  $a_role_ids)
protected

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

198 : void
199 {
200 $this->roles = $a_role_ids;
201 }

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 184 of file class.ilAttendanceList.php.

184 : void
185 {
186 $this->title = $a_title;
187 $this->description = (string) $a_description;
188 }

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 49 of file class.ilAttendanceList.php.

◆ $callback

ilAttendanceList::$callback
protected

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

◆ $ctrl

ilCtrlInterface ilAttendanceList::$ctrl
protected

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

◆ $description

string ilAttendanceList::$description = ''
protected

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

◆ $has_local_role

bool ilAttendanceList::$has_local_role = false
protected

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

◆ $id

string ilAttendanceList::$id = ''
protected

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

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

◆ $include_subscribers

bool ilAttendanceList::$include_subscribers = false
protected

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

◆ $include_waiting_list

bool ilAttendanceList::$include_waiting_list = false
protected

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

◆ $lng

ilLanguage ilAttendanceList::$lng
protected

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

◆ $logger

ilLogger ilAttendanceList::$logger
protected

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

◆ $parent_gui

object ilAttendanceList::$parent_gui
protected

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

◆ $parent_obj

ilObject ilAttendanceList::$parent_obj
protected

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

◆ $participants

ilParticipants ilAttendanceList::$participants
protected

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

◆ $pre_blanks

array ilAttendanceList::$pre_blanks = []
protected

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

◆ $presets

array ilAttendanceList::$presets = []
protected

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

◆ $profile

Profile ilAttendanceList::$profile
protected

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

◆ $role_data

array ilAttendanceList::$role_data = []
protected

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

Referenced by initForm(), and initFromSettings().

◆ $roles

array ilAttendanceList::$roles = []
protected

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

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

◆ $title

string ilAttendanceList::$title = ''
protected

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

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

◆ $tpl

ilGlobalTemplateInterface ilAttendanceList::$tpl
protected

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

Referenced by getHTML().

◆ $tree

ilTree ilAttendanceList::$tree
protected

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

◆ $user_filters

array ilAttendanceList::$user_filters = []
protected

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

◆ $waiting_list

ilWaitingList ilAttendanceList::$waiting_list
protected

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


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