5 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
57 $this->logger =
$GLOBALS[
'DIC']->logger()->sess();
59 $this->rep_object = $a_parent_obj;
61 include_once
'./Services/Membership/classes/class.ilParticipants.php';
65 parent::__construct($a_parent_gui, $a_parent_cmd);
67 $this->parent_ref_id =
$GLOBALS[
'DIC']->repositoryTree()->getParentId(
72 if ($member_ref =
$tree->checkForParentType($this->parent_ref_id,
'grp')) {
73 $this->member_ref_id = $member_ref;
74 } elseif ($member_ref =
$tree->checkForParentType($this->parent_ref_id,
'crs')) {
75 $this->member_ref_id = $member_ref;
77 throw new \InvalidArgumentException(
"Error in tree structure. Session has no parent course/group ref_id: " . $this->
getRepositoryObject()->getRefId());
115 $this->lng->loadLanguageModule(
'sess');
116 $this->lng->loadLanguageModule(
'crs');
117 $this->lng->loadLanguageModule(
'trac');
118 $this->lng->loadLanguageModule(
'mmbr');
131 $this->
enable(
'select_all');
136 $this->
setRowTemplate(
"tpl.sess_members_row.html",
"Modules/Session");
139 $this->
addColumn($this->lng->txt(
'name'),
'name',
'20%');
140 $this->
addColumn($this->lng->txt(
'login'),
'login',
'10%');
144 $this->
addColumn($all_cols[$col][
'txt'], $col);
149 $this->
addColumn($this->lng->txt(
'event_tbl_registered'),
'registered');
155 $this->
addColumn($this->lng->txt(
'event_tbl_participated'),
'participated');
156 $this->
addColumn($this->lng->txt(
'sess_contact'),
'contact');
157 $this->
addColumn($this->lng->txt(
'trac_mark'),
'mark');
158 $this->
addColumn($this->lng->txt(
'trac_comment'),
'comment');
161 $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->lng->txt(
'mmbr_btn_mail_selected_users'));
162 $this->lng->loadLanguageModule(
'user');
163 $this->
addMultiCommand(
'addToClipboard', $this->lng->txt(
'clipboard_add_btn'));
175 $this->lng->txt(
'name')
177 $this->current_filter[
'login'] =
$login->getValue();
189 $options[0] = $this->lng->txt(
'all_roles');
191 $this->current_filter[
'roles'] = $role->getValue();
196 'filter_registration',
199 $this->lng->txt(
'sess_part_filter_registered')
201 $this->current_filter[
'filter_registration'] = (bool) $reg->getChecked();
204 'filter_participated',
207 $this->lng->txt(
'sess_part_filter_participated')
209 $this->current_filter[
'filter_participated'] = (bool) $participated->getChecked();
223 self::$all_columns[
'roles'] = array(
224 'txt' => $this->lng->txt(
'objs_role'),
228 return self::$all_columns;
240 $all_participants = [];
242 if ($all_possible_participants) {
245 $user_query->setLimit(50000);
246 $user_query->setUserFilter($all_possible_participants);
247 $user_query->setTextFilter((
string) $this->current_filter[
'login']);
248 $res = $user_query->query();
249 $all_participants =
$res[
'set'];
252 foreach ($all_participants as $counter => $participant) {
253 $usr_data = $this->
getParticipants()->getEventParticipants()->getUser($participant[
'usr_id']);
256 $tmp_data[
'id'] = $participant[
'usr_id'];
258 $tmp_data[
'name'] = $participant[
'lastname'];
259 $tmp_data[
'lastname'] = $participant[
'lastname'];
260 $tmp_data[
'firstname'] = $participant[
'firstname'];
261 $tmp_data[
'login'] = $participant[
'login'];
262 $tmp_data[
'mark'] = $usr_data[
'mark'];
263 $tmp_data[
'comment'] = $usr_data[
'comment'];
264 $tmp_data[
'participated'] = $this->
getParticipants()->getEventParticipants()->hasParticipated($participant[
'usr_id']);
265 $tmp_data[
'registered'] = $this->
getParticipants()->getEventParticipants()->isRegistered($participant[
'usr_id']);
266 $tmp_data[
'contact'] = $this->
getParticipants()->isContact($participant[
'usr_id']);
270 foreach ($local_roles as $role_id => $role_name) {
272 if (
$GLOBALS[
'DIC'][
'rbacreview']->isAssigned($participant[
'usr_id'], $role_id)) {
273 $tmp_data[
'role_ids'][] = $role_id;
274 $roles[] = $role_name;
277 $tmp_data[
'roles'] = implode(
'<br />', $roles);
283 $this->
setData($part ? $part : array());
296 return $part->getParticipants();
306 foreach ($this->current_filter as $filter => $filter_value) {
307 if (!$filter_value) {
312 if (!in_array($filter_value, $a_user_info[
'role_ids'])) {
317 case 'filter_participated':
318 if (!$a_user_info[
'participated']) {
323 case 'filter_registration':
324 if (!$a_user_info[
'registered']) {
331 $this->logger->info(
'Filter: ' . $filter .
' -> ' . $filter_value);
345 $this->tpl->setVariable(
'VAL_POSTNAME',
'participants');
348 $this->tpl->setCurrentBlock(
'registered_col');
349 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
350 $this->tpl->setVariable(
'REG_CHECKED', $a_set[
'registered'] ?
'checked="checked"' :
'');
351 $this->tpl->parseCurrentBlock();
357 $this->tpl->setCurrentBlock(
'custom_fields');
358 $this->tpl->setVariable(
'VAL_CUST', (
string) $a_set[
'roles']);
359 $this->tpl->parseCurrentBlock();
364 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
365 $this->tpl->setVariable(
'LASTNAME', $a_set[
'lastname']);
366 $this->tpl->setVariable(
'FIRSTNAME', $a_set[
'firstname']);
367 $this->tpl->setVariable(
'LOGIN', $a_set[
'login']);
368 $this->tpl->setVariable(
'MARK', $a_set[
'mark']);
369 $this->tpl->setVariable(
'COMMENT', $a_set[
'comment']);
370 $this->tpl->setVariable(
'PART_CHECKED', $a_set[
'participated'] ?
'checked="checked"' :
'');
371 $this->tpl->setVariable(
'CONTACT_CHECKED', $a_set[
'contact'] ?
'checked="checked"' :
'');
393 $review =
$GLOBALS[
'DIC']->rbac()->review();
395 $local_parent_roles = $review->getLocalRoles($this->member_ref_id);
396 $this->logger->dump($local_parent_roles);
398 $local_roles_info = [];
399 foreach ($local_parent_roles as
$index => $role_id) {
404 return $local_roles_info;
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
__construct($a_parent_gui, ilObjSession $a_parent_obj, $a_parent_cmd)
getSelectableColumns()
Get selectable columns.
matchesFilterCriteria($a_user_info)
Check if user is filtered.
getParentLocalRoles()
Get local roles of parent object.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
static _lookupTitle($a_id)
lookup object title
getParentCmd()
Get parent command.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static getInstance($a_ref_id)
Get instance by ref_id.
isRegistrationEnabled()
Check if registration is enabled.
foreach($_POST as $key=> $value) $res
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _getTranslation($a_role_title)
static _lookupType($a_id, $a_reference=false)
lookup object type
isColumnSelected($a_col)
Is given column selected?
getParticipants()
Get participants.
collectParticipants()
Collect participants.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
Description of class class.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.