Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions components/ILIAS/Membership/classes/class.ilAttendanceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ilAttendanceList
protected ilObject $parent_obj;
protected ?ilParticipants $participants;
protected ?ilWaitingList $waiting_list;
protected ilTree $tree;
/**
* @var ?callable
*/
Expand Down Expand Up @@ -67,7 +68,7 @@ public function __construct(
$this->ctrl = $DIC->ctrl();
$this->tpl = $DIC->ui()->mainTemplate();
$this->profile = $DIC['user']->getProfile();

$this->tree = $DIC->repositoryTree();
$this->parent_gui = $a_parent_gui;
$this->parent_obj = $a_parent_obj;
$this->participants = $a_participants_object;
Expand Down Expand Up @@ -137,10 +138,14 @@ protected function readOrderedExportableFields(): bool
);
}

$parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'crs') ? 'crs' : '';
$parent_obj_type = $this->tree->checkForParentType($this->parent_obj->getRefId(), 'grp') ? 'grp' : $parent_obj_type;
$user_defined_fields = $parent_obj_type === ''
? $this->profile->getAllUserDefinedFields()
: $this->profile->getVisibleUserDefinedFields(Context::buildFromObjectType($parent_obj_type));

// add udf fields
foreach ($this->profile->getVisibleUserDefinedFields(
Context::buildFromObjectType($this->parent_obj->getType())
) as $field) {
foreach ($user_defined_fields as $field) {
$this->presets['udf_' . $field->getIdentifier()] = array(
$field->getLabel($this->lng),
false
Expand Down