3 declare(strict_types=1);
31 private \ILIAS\DI\RBACServices
$rbac;
42 $this->
logger = $DIC->logger()->sess();
43 $this->tree = $DIC->repositoryTree();
44 $this->
rbac = $DIC->rbac();
46 $this->rep_object = $a_parent_obj;
53 $this->parent_ref_id = $this->tree->getParentId(
61 if ($member_ref = $this->tree->checkForParentType($this->parent_ref_id,
'grp')) {
62 $this->member_ref_id = $member_ref;
63 } elseif ($member_ref = $this->tree->checkForParentType($this->parent_ref_id,
'crs')) {
64 $this->member_ref_id = $member_ref;
66 throw new \InvalidArgumentException(
"Error in tree structure. Session has no parent course/group ref_id: " . $this->
getRepositoryObject()->getRefId());
85 public function init(): void
87 $this->
lng->loadLanguageModule(
'sess');
88 $this->
lng->loadLanguageModule(
'crs');
89 $this->
lng->loadLanguageModule(
'trac');
90 $this->
lng->loadLanguageModule(
'mmbr');
103 $this->
enable(
'select_all');
108 $this->
setRowTemplate(
"tpl.sess_members_row.html",
"Modules/Session");
111 $this->
addColumn($this->
lng->txt(
'name'),
'name',
'20%');
112 $this->
addColumn($this->
lng->txt(
'login'),
'login',
'10%');
116 $this->
addColumn($all_cols[$col][
'txt'], $col);
121 $this->
addColumn($this->
lng->txt(
'event_tbl_registered'),
'registered');
128 $this->
addColumn($this->
lng->txt(
'event_tbl_participated'),
'participated');
131 $this->
addColumn($this->
lng->txt(
'sess_part_table_excused'),
'excused');
134 $this->
addColumn($this->
lng->txt(
'sess_contact'),
'contact');
136 $this->
addColumn($this->
lng->txt(
'notification'),
'notification_checked');
140 $this->
addColumn($this->
lng->txt(
'trac_comment'),
'comment');
143 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
144 $this->
lng->loadLanguageModule(
'user');
157 $this->
lng->txt(
'name')
159 $this->current_filter[
'login'] = $login->getValue();
171 $options[0] = $this->
lng->txt(
'all_roles');
173 $this->current_filter[
'roles'] = $role->getValue();
178 'filter_registration',
181 $this->
lng->txt(
'sess_part_filter_registered')
183 $this->current_filter[
'filter_registration'] = $reg->getChecked();
186 'filter_participated',
189 $this->
lng->txt(
'sess_part_filter_participated')
191 $this->current_filter[
'filter_participated'] = $participated->getChecked();
196 self::$all_columns[
'roles'] = array(
197 'txt' => $this->
lng->txt(
'objs_role'),
201 return self::$all_columns;
206 $all_participants = [];
208 if ($all_possible_participants !== []) {
211 $user_query->setLimit(50000);
212 $user_query->setUserFilter($all_possible_participants);
213 $user_query->setTextFilter((
string) $this->current_filter[
'login']);
214 $res = $user_query->query();
215 $all_participants =
$res[
'set'];
219 foreach ($all_participants as $counter => $participant) {
220 $usr_data = $this->
getParticipants()->getEventParticipants()->getUser((
int) $participant[
'usr_id']);
222 $tmp_data[
'id'] = $participant[
'usr_id'];
224 $tmp_data[
'name'] = $participant[
'lastname'];
225 $tmp_data[
'lastname'] = $participant[
'lastname'];
226 $tmp_data[
'firstname'] = $participant[
'firstname'];
227 $tmp_data[
'login'] = $participant[
'login'];
228 $tmp_data[
'mark'] = $usr_data[
'mark'] ?? null;
229 $tmp_data[
'comment'] = $usr_data[
'comment'] ?? null;
230 $tmp_data[
'participated'] = $this->
getParticipants()->getEventParticipants()->hasParticipated((
int) $participant[
'usr_id']);
231 $tmp_data[
'registered'] = $this->
getParticipants()->getEventParticipants()->isRegistered((
int) $participant[
'usr_id']);
232 $tmp_data[
'excused'] = $this->
getParticipants()->getEventParticipants()->isExcused((
int) $participant[
'usr_id']);
233 $tmp_data[
'contact'] = $this->
getParticipants()->isContact((
int) $participant[
'usr_id']);
235 $notificationShown =
false;
237 $notificationShown =
true;
238 $notificationCheckboxEnabled =
true;
240 $notificationCheckboxEnabled =
false;
242 $tmp_data[
'notification_checkbox_enabled'] = $notificationCheckboxEnabled;
243 $tmp_data[
'notification_checked'] = $usr_data[
'notification_enabled'] ??
false;
245 $tmp_data[
'show_notification'] = $notificationShown;
249 foreach ($local_roles as $role_id => $role_name) {
251 if ($this->
rbac->review()->isAssigned((
int) $participant[
'usr_id'], $role_id)) {
252 $tmp_data[
'role_ids'][] = $role_id;
253 $roles[] = $role_name;
256 $tmp_data[
'roles'] = implode(
'<br />', $roles);
271 ->getEventParticipants()
273 $direct_participants = array_keys($direct_participants);
277 return $direct_participants;
280 return array_unique(array_merge(
281 $direct_participants,
282 $part->getParticipants()
288 foreach ($this->current_filter as $filter => $filter_value) {
289 if (!$filter_value) {
294 if (!in_array($filter_value, ($a_user_info[
'role_ids'] ?? []))) {
299 case 'filter_participated':
300 if (!($a_user_info[
'participated'] ??
false)) {
305 case 'filter_registration':
306 if (!($a_user_info[
'registered'] ??
false)) {
315 protected function fillRow(array $a_set): void
317 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
320 $this->tpl->setCurrentBlock(
'registered_col');
321 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
322 $this->tpl->setVariable(
'REG_CHECKED', $a_set[
'registered'] ?
'checked="checked"' :
'');
323 $this->tpl->parseCurrentBlock();
327 if ($field ==
'roles') {
328 $this->tpl->setCurrentBlock(
'custom_fields');
329 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles']);
330 $this->tpl->parseCurrentBlock();
334 if (
true === $a_set[
'show_notification']) {
335 $this->tpl->setCurrentBlock(
'notification_column');
336 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
337 $this->tpl->setVariable(
'NOTIFICATION_CHECKED', $a_set[
'notification_checked'] ?
'checked="checked"' :
'');
339 $enableCheckbox = $a_set[
'notification_checkbox_enabled'];
341 $this->tpl->setVariable(
'NOTIFICATION_ENABLED', $enableCheckbox ?
'' :
'disabled');
342 $this->tpl->parseCurrentBlock();
345 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
346 $this->tpl->setVariable(
'LASTNAME', $a_set[
'lastname']);
347 $this->tpl->setVariable(
'FIRSTNAME', $a_set[
'firstname']);
348 $this->tpl->setVariable(
'LOGIN', $a_set[
'login']);
349 $this->tpl->setVariable(
'MARK', $a_set[
'mark']);
350 $this->tpl->setVariable(
'COMMENT', $a_set[
'comment']);
351 $this->tpl->setVariable(
'PART_CHECKED', $a_set[
'participated'] ?
'checked="checked"' :
'');
352 $this->tpl->setVariable(
'CONTACT_CHECKED', $a_set[
'contact'] ?
'checked="checked"' :
'');
353 $this->tpl->setVariable(
'PART_CHECKED', $a_set[
'participated'] ?
'checked="checked"' :
'');
355 $this->tpl->setVariable(
'EXCUSED_CHECKED', $a_set[
'excused'] ?
'checked="checked"' :
'');
374 $review = $this->
rbac->review();
375 $local_parent_roles = $review->getLocalRoles($this->member_ref_id);
376 $local_roles_info = [];
377 foreach ($local_parent_roles as $index => $role_id) {
382 return $local_roles_info;
matchesFilterCriteria(array $a_user_info)
ilParticipants $participants
const NOTIFICATION_INHERIT_OPTION
enable(string $a_module_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
static array $all_columns
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
static getInstance(int $a_ref_id)
setFormName(string $a_name="")
static _lookupObjId(int $ref_id)
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
ILIAS DI RBACServices $rbac
static _getTranslation(string $a_role_title)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(object $a_parent_gui, ilObjSession $a_parent_obj, string $a_parent_cmd)
Base class for course and group participants.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
static _lookupType(int $id, bool $reference=false)
addMultiCommand(string $a_cmd, string $a_text)