ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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
 
 $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 57 of file class.ilAttendanceList.php.

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

171 : void
172 {
173 $this->pre_blanks[] = $a_caption;
174 }

◆ addPreset()

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

Add user field.

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

163 : void
164 {
165 $this->presets[$a_id] = array($a_caption, $a_selected);
166 }

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

188 : void
189 {
190 $this->role_data[$a_id] = array($a_caption, $a_type);
191 }

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

201 : void
202 {
203 $this->user_filters[$a_id] = array($a_caption, $a_checked);
204 }

◆ getFullscreenHTML()

ilAttendanceList::getFullscreenHTML ( )

render list in fullscreen mode

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

550 : void
551 {
552 $this->tpl->setContent($this->getHTML());
553 $this->tpl->addOnLoadCode("il.Util.print();");
554 }
getHTML()
render attendance list

References getHTML().

+ Here is the call graph for this function:

◆ getHTML()

ilAttendanceList::getHTML ( )

render attendance list

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

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

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

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

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

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

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

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

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

261 : void
262 {
263 if (!implode("", $a_values)) {
264 $a_values = array();
265 } else {
266 foreach ($a_values as $idx => $value) {
267 $a_values[$idx] = trim($value);
268 if ($a_values[$idx] == "") {
269 unset($a_values[$idx]);
270 }
271 }
272 }
273 $this->blank_columns = $a_values;
274 }

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

279 : void
280 {
281 $this->callback = $a_callback;
282 }

◆ setId()

ilAttendanceList::setId ( string  $a_value)

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

284 : void
285 {
286 $this->id = $a_value;
287 }

◆ setRoleSelection()

ilAttendanceList::setRoleSelection ( array  $a_role_ids)
protected

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

193 : void
194 {
195 $this->roles = $a_role_ids;
196 }

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

179 : void
180 {
181 $this->title = $a_title;
182 $this->description = (string) $a_description;
183 }

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

◆ $callback

ilAttendanceList::$callback
protected

Definition at line 43 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 50 of file class.ilAttendanceList.php.

◆ $has_local_role

bool ilAttendanceList::$has_local_role = false
protected

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

◆ $id

string ilAttendanceList::$id = ''
protected

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

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

◆ $include_subscribers

bool ilAttendanceList::$include_subscribers = false
protected

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

◆ $include_waiting_list

bool ilAttendanceList::$include_waiting_list = false
protected

Definition at line 53 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 51 of file class.ilAttendanceList.php.

◆ $presets

array ilAttendanceList::$presets = []
protected

Definition at line 44 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 45 of file class.ilAttendanceList.php.

Referenced by initForm(), and initFromSettings().

◆ $roles

array ilAttendanceList::$roles = []
protected

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

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

◆ $title

string ilAttendanceList::$title = ''
protected

Definition at line 49 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().

◆ $user_filters

array ilAttendanceList::$user_filters = []
protected

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