ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 555 of file class.ilAttendanceList.php.

555 : void
556 {
557 $this->tpl->setContent($this->getHTML());
558 $this->tpl->addOnLoadCode("il.Util.print();");
559 }
getHTML()
render attendance list

References getHTML().

+ Here is the call graph for this function:

◆ getHTML()

ilAttendanceList::getHTML ( )

render attendance list

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

564 : string
565 {
566 $tpl = new ilTemplate('tpl.attendance_list_print.html', true, true, 'components/ILIAS/Membership');
569
570 $tpl->setVariable('TXT_TITLE', $this->title);
571 if ($this->description) {
572 $tpl->setVariable('TXT_DESCRIPTION', $this->description . " (" . $time . ")");
573 } else {
574 $tpl->setVariable('TXT_DESCRIPTION', $time);
575 }
576
577 $tpl->setCurrentBlock('head_item');
578 foreach ($this->presets as $item) {
579 if ($item[1]) {
580 $tpl->setVariable('TXT_HEAD', $item[0]);
582 }
583 }
584
585 if ($this->blank_columns) {
586 foreach ($this->blank_columns as $blank) {
587 $tpl->setVariable('TXT_HEAD', $blank);
589 }
590 }
591
592 // handle members
593
594 $valid_user_ids = $filters = array();
595
596 if ($this->roles) {
597 if ($this->has_local_role) {
598 $members = array();
599 foreach ($this->participants->getMembers() as $member_id) {
600 foreach ($this->participants->getAssignedRoles($member_id) as $role_id) {
601 $members[$role_id][] = $member_id;
602 }
603 }
604 } else {
605 $members = $this->participants->getMembers();
606 }
607
608 foreach ($this->roles as $role_id) {
609 switch ($this->role_data[$role_id][1]) {
610 case "admin":
611 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getAdmins());
612 break;
613
614 case "tutor":
615 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getTutors());
616 break;
617
618 // member/local
619 default:
620 if (!$this->has_local_role) {
621 $valid_user_ids = array_merge($valid_user_ids, $members);
622 } else {
623 $valid_user_ids = array_merge($valid_user_ids, (array) ($members[$role_id] ?? []));
624 }
625 break;
626 }
627 }
628 }
629
630 if ($this->include_subscribers) {
631 $valid_user_ids = array_merge($valid_user_ids, $this->participants->getSubscribers());
632 }
633
634 if ($this->include_waiting_list) {
635 $valid_user_ids = array_merge($valid_user_ids, $this->waiting_list->getUserIds());
636 }
637
638 if ($this->user_filters) {
639 foreach ($this->user_filters as $sub_id => $sub_item) {
640 $filters[$sub_id] = (bool) ($sub_item[2] ?? false);
641 }
642 }
643 $valid_user_ids = ilUtil::_sortIds(array_unique($valid_user_ids), 'usr_data', 'lastname', 'usr_id');
644 foreach ($valid_user_ids as $user_id) {
645 if ($this->callback) {
646 $user_data = call_user_func_array($this->callback, [(int) $user_id, $filters]);
647 if (!$user_data) {
648 continue;
649 }
650
651 $tpl->setCurrentBlock("row_preset");
652 foreach ($this->presets as $id => $item) {
653 if ($item[1]) {
654 switch ($id) {
655 case 'org_units':
656 $value = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $user_id);
657 break;
658
659 case "name":
660 if (!($user_data[$id] ?? null)) {
661 $name = ilObjUser::_lookupName((int) $user_id);
662 $value = $name["lastname"] . ", " . $name["firstname"];
663 break;
664 }
665 // no break
666 case "login":
667 if (!($user_data[$id] ?? false)) {
668 $value = ilObjUser::_lookupLogin((int) $user_id);
669 break;
670 }
671
672 // no break
673 default:
674 $value = (string) ($user_data[$id] ?? '');
675 break;
676 }
677 $tpl->setVariable("TXT_PRESET", $value);
679 }
680 }
681 }
682
683 if ($this->blank_columns) {
684 for ($loop = 0, $loopMax = count($this->blank_columns); $loop < $loopMax; $loop++) {
685 $tpl->touchBlock('row_blank');
686 }
687 }
688
689 $tpl->touchBlock("member_row");
690 }
691 return $tpl->get();
692 }
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 foreach ($this->profile->getVisibleUserDefinedFields(
231 Context::buildFromObjectType($this->parent_obj->getType())
232 ) as $field) {
233 $profile_data = $this->profile->getDataForMultiple($user_ids);
234 foreach ($profile_data as $user_id => $field) {
235 $a_res[$user_id]['udf_' . $field->getIdentifier()] = $profile_data->getAdditionalFieldByIdentifier(
236 $field->getIdentifier()
237 );
238 }
239 }
240
241 if (count($user_ids)) {
242 // object specific user data
243 $cdfs = ilCourseUserData::_getValuesByObjId($this->parent_obj->getId());
244 foreach (array_unique($user_ids) as $user_id) {
245 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
246 $a_res[$user_id]['login'] = $tmp_obj->getLogin();
247 $a_res[$user_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
248
249 if (in_array($user_id, $subscriber_ids)) {
250 $a_res[$user_id]['status'] = $this->lng->txt('crs_subscriber');
251 } else {
252 $a_res[$user_id]['status'] = $this->lng->txt('crs_waiting_list');
253 }
254
255 foreach ((array) ($cdfs[$user_id] ?? []) as $field_id => $value) {
256 $a_res[$user_id]['cdf_' . $field_id] = (string) $value;
257 }
258 }
259 }
260 }
261 }
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 297 of file class.ilAttendanceList.php.

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

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

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

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

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

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

284 : void
285 {
286 $this->callback = $a_callback;
287 }

◆ setId()

ilAttendanceList::setId ( string  $a_value)

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

289 : void
290 {
291 $this->id = $a_value;
292 }

◆ 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: