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(
57 if ($member_ref = $this->tree->checkForParentType($this->parent_ref_id,
'grp')) {
58 $this->member_ref_id = $member_ref;
59 } elseif ($member_ref = $this->tree->checkForParentType($this->parent_ref_id,
'crs')) {
60 $this->member_ref_id = $member_ref;
62 throw new \InvalidArgumentException(
"Error in tree structure. Session has no parent course/group ref_id: " . $this->
getRepositoryObject()->getRefId());
81 public function init(): void
83 $this->
lng->loadLanguageModule(
'sess');
84 $this->
lng->loadLanguageModule(
'crs');
85 $this->
lng->loadLanguageModule(
'trac');
86 $this->
lng->loadLanguageModule(
'mmbr');
99 $this->
enable(
'select_all');
104 $this->
setRowTemplate(
"tpl.sess_members_row.html",
"Modules/Session");
107 $this->
addColumn($this->
lng->txt(
'name'),
'name',
'20%');
108 $this->
addColumn($this->
lng->txt(
'login'),
'login',
'10%');
112 $this->
addColumn($all_cols[$col][
'txt'], $col);
117 $this->
addColumn($this->
lng->txt(
'event_tbl_registered'),
'registered');
124 $this->
addColumn($this->
lng->txt(
'event_tbl_participated'),
'participated');
127 $this->
addColumn($this->
lng->txt(
'sess_part_table_excused'),
'excused');
130 $this->
addColumn($this->
lng->txt(
'sess_contact'),
'contact');
132 $this->
addColumn($this->
lng->txt(
'notification'),
'notification_checked');
136 $this->
addColumn($this->
lng->txt(
'trac_comment'),
'comment');
139 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->
lng->txt(
'mmbr_btn_mail_selected_users'));
140 $this->
lng->loadLanguageModule(
'user');
153 $this->
lng->txt(
'name')
155 $this->current_filter[
'login'] = $login->getValue();
167 $options[0] = $this->
lng->txt(
'all_roles');
169 $this->current_filter[
'roles'] = $role->getValue();
174 'filter_registration',
177 $this->
lng->txt(
'sess_part_filter_registered')
179 $this->current_filter[
'filter_registration'] = $reg->getChecked();
182 'filter_participated',
185 $this->
lng->txt(
'sess_part_filter_participated')
187 $this->current_filter[
'filter_participated'] = $participated->getChecked();
192 self::$all_columns[
'roles'] = array(
193 'txt' => $this->
lng->txt(
'objs_role'),
197 return self::$all_columns;
202 $all_participants = [];
204 if ($all_possible_participants !== []) {
207 $user_query->setLimit(50000);
208 $user_query->setUserFilter($all_possible_participants);
209 $user_query->setTextFilter((
string) $this->current_filter[
'login']);
210 $res = $user_query->query();
211 $all_participants =
$res[
'set'];
215 foreach ($all_participants as $counter => $participant) {
216 $usr_data = $this->
getParticipants()->getEventParticipants()->getUser((
int) $participant[
'usr_id']);
218 $tmp_data[
'id'] = $participant[
'usr_id'];
220 $tmp_data[
'name'] = $participant[
'lastname'];
221 $tmp_data[
'lastname'] = $participant[
'lastname'];
222 $tmp_data[
'firstname'] = $participant[
'firstname'];
223 $tmp_data[
'login'] = $participant[
'login'];
224 $tmp_data[
'mark'] = $usr_data[
'mark'] ?? null;
225 $tmp_data[
'comment'] = $usr_data[
'comment'] ?? null;
226 $tmp_data[
'participated'] = $this->
getParticipants()->getEventParticipants()->hasParticipated((
int) $participant[
'usr_id']);
227 $tmp_data[
'registered'] = $this->
getParticipants()->getEventParticipants()->isRegistered((
int) $participant[
'usr_id']);
228 $tmp_data[
'excused'] = $this->
getParticipants()->getEventParticipants()->isExcused((
int) $participant[
'usr_id']);
229 $tmp_data[
'contact'] = $this->
getParticipants()->isContact((
int) $participant[
'usr_id']);
231 $notificationShown =
false;
233 $notificationShown =
true;
234 $notificationCheckboxEnabled =
true;
236 $notificationCheckboxEnabled =
false;
238 $tmp_data[
'notification_checkbox_enabled'] = $notificationCheckboxEnabled;
239 $tmp_data[
'notification_checked'] = $usr_data[
'notification_enabled'] ??
false;
241 $tmp_data[
'show_notification'] = $notificationShown;
245 foreach ($local_roles as $role_id => $role_name) {
247 if ($this->
rbac->review()->isAssigned((
int) $participant[
'usr_id'], $role_id)) {
248 $tmp_data[
'role_ids'][] = $role_id;
249 $roles[] = $role_name;
252 $tmp_data[
'roles'] = implode(
'<br />', $roles);
267 ->getEventParticipants()
269 $direct_participants = array_keys($direct_participants);
273 return $direct_participants;
276 return array_unique(array_merge(
277 $direct_participants,
278 $part->getParticipants()
284 foreach ($this->current_filter as $filter => $filter_value) {
285 if (!$filter_value) {
290 if (!in_array($filter_value, ($a_user_info[
'role_ids'] ?? []))) {
295 case 'filter_participated':
296 if (!($a_user_info[
'participated'] ??
false)) {
301 case 'filter_registration':
302 if (!($a_user_info[
'registered'] ??
false)) {
311 protected function fillRow(array $a_set): void
313 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
316 $this->tpl->setCurrentBlock(
'registered_col');
317 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
318 $this->tpl->setVariable(
'REG_CHECKED', $a_set[
'registered'] ?
'checked="checked"' :
'');
319 $this->tpl->parseCurrentBlock();
323 if ($field ==
'roles') {
324 $this->tpl->setCurrentBlock(
'custom_fields');
325 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles']);
326 $this->tpl->parseCurrentBlock();
330 if (
true === $a_set[
'show_notification']) {
331 $this->tpl->setCurrentBlock(
'notification_column');
332 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
333 $this->tpl->setVariable(
'NOTIFICATION_CHECKED', $a_set[
'notification_checked'] ?
'checked="checked"' :
'');
335 $enableCheckbox = $a_set[
'notification_checkbox_enabled'];
337 $this->tpl->setVariable(
'NOTIFICATION_ENABLED', $enableCheckbox ?
'' :
'disabled');
338 $this->tpl->parseCurrentBlock();
341 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
342 $this->tpl->setVariable(
'LASTNAME', $a_set[
'lastname']);
343 $this->tpl->setVariable(
'FIRSTNAME', $a_set[
'firstname']);
344 $this->tpl->setVariable(
'LOGIN', $a_set[
'login']);
345 $this->tpl->setVariable(
'MARK', $a_set[
'mark']);
346 $this->tpl->setVariable(
'COMMENT', $a_set[
'comment']);
347 $this->tpl->setVariable(
'PART_CHECKED', $a_set[
'participated'] ?
'checked="checked"' :
'');
348 $this->tpl->setVariable(
'CONTACT_CHECKED', $a_set[
'contact'] ?
'checked="checked"' :
'');
349 $this->tpl->setVariable(
'PART_CHECKED', $a_set[
'participated'] ?
'checked="checked"' :
'');
351 $this->tpl->setVariable(
'EXCUSED_CHECKED', $a_set[
'excused'] ?
'checked="checked"' :
'');
371 $review = $this->
rbac->review();
372 $local_parent_roles = $review->getLocalRoles($this->member_ref_id);
373 $local_roles_info = [];
374 foreach ($local_parent_roles as
$index => $role_id) {
379 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.
__construct(Container $dic, ilPlugin $plugin)
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)