ILIAS  release_8 Revision v8.24
ilSessionParticipantsTableGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSessionParticipantsTableGUI:
+ Collaboration diagram for ilSessionParticipantsTableGUI:

Public Member Functions

 __construct (object $a_parent_gui, ilObjSession $a_parent_obj, string $a_parent_cmd)
 
 init ()
 
 initFilter ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 parse ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 get the name of the parent form More...
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 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)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 getRepositoryObject ()
 
 isRegistrationEnabled ()
 
 getParticipants ()
 
 collectParticipants ()
 
 matchesFilterCriteria (array $a_user_info)
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getParentLocalRoles ()
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Static Protected Attributes

static array $all_columns = []
 

Private Attributes

ilLogger $logger
 
ilTree $tree
 
ILIAS DI RBACServices $rbac
 
ilObjSession $rep_object
 
ilParticipants $participants
 
int $parent_ref_id = 0
 
int $member_ref_id = 0
 
array $current_filter = []
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 25 of file class.ilSessionParticipantsTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionParticipantsTableGUI::__construct ( object  $a_parent_gui,
ilObjSession  $a_parent_obj,
string  $a_parent_cmd 
)

Definition at line 38 of file class.ilSessionParticipantsTableGUI.php.

39 {
40 global $DIC;
41
42 $this->logger = $DIC->logger()->sess();
43 $this->tree = $DIC->repositoryTree();
44 $this->rbac = $DIC->rbac();
45
46 $this->rep_object = $a_parent_obj;
47
48 $this->participants = ilParticipants::getInstance($this->getRepositoryObject()->getRefId());
49
50 $this->setId('session_part_' . $this->getRepositoryObject()->getId());
51 parent::__construct($a_parent_gui, $a_parent_cmd);
52
53 $this->parent_ref_id = $this->tree->getParentId(
54 $this->getRepositoryObject()->getRefId()
55 );
56
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;
61 } else {
62 throw new \InvalidArgumentException("Error in tree structure. Session has no parent course/group ref_id: " . $this->getRepositoryObject()->getRefId());
63 }
64 }
static getInstance(int $a_ref_id)
setId(string $a_val)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\getId(), ilParticipants\getInstance(), getRepositoryObject(), ILIAS\Repository\logger(), ILIAS\Repository\rbac(), and ilTable2GUI\setId().

+ Here is the call graph for this function:

Member Function Documentation

◆ collectParticipants()

ilSessionParticipantsTableGUI::collectParticipants ( )
protected
Returns
int[] array of parent course/group participants

Definition at line 264 of file class.ilSessionParticipantsTableGUI.php.

264 : array
265 {
266 $direct_participants = $this->getParticipants()
267 ->getEventParticipants()
268 ->getParticipants();
269 $direct_participants = array_keys($direct_participants);
270
271 $part = ilParticipants::getInstance($this->member_ref_id);
272 if (!$part instanceof ilParticipants) {
273 return $direct_participants;
274 }
275
276 return array_unique(array_merge(
277 $direct_participants,
278 $part->getParticipants()
279 ));
280 }
Base class for course and group participants.

References ilParticipants\getInstance(), and getParticipants().

Referenced by parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilSessionParticipantsTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 311 of file class.ilSessionParticipantsTableGUI.php.

311 : void
312 {
313 $this->tpl->setVariable('VAL_POSTNAME', 'participants');
314
315 if ($this->isRegistrationEnabled()) {
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();
320 }
321
322 foreach ($this->getSelectedColumns() as $field) {
323 if ($field == 'roles') {
324 $this->tpl->setCurrentBlock('custom_fields');
325 $this->tpl->setVariable('VAL_CUST', (string) $a_set['roles']);
326 $this->tpl->parseCurrentBlock();
327 }
328 }
329
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"' : '');
334
335 $enableCheckbox = $a_set['notification_checkbox_enabled'];
336
337 $this->tpl->setVariable('NOTIFICATION_ENABLED', $enableCheckbox ? '' : 'disabled');
338 $this->tpl->parseCurrentBlock();
339 }
340
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"' : '');
350 if ($this->isRegistrationEnabled()) {
351 $this->tpl->setVariable('EXCUSED_CHECKED', $a_set['excused'] ? 'checked="checked"' : '');
352 }
353 }

References ilTable2GUI\getSelectedColumns(), and isRegistrationEnabled().

+ Here is the call graph for this function:

◆ getParentLocalRoles()

ilSessionParticipantsTableGUI::getParentLocalRoles ( )
protected

Definition at line 355 of file class.ilSessionParticipantsTableGUI.php.

355 : array
356 {
357 $part = null;
358 $type = ilObject::_lookupType($this->member_ref_id, true);
359 switch ($type) {
360 case 'crs':
361 case 'grp':
362 $part = ilParticipants::getInstance($this->member_ref_id);
363 // no break
364 default:
365
366 }
367 if (!$part instanceof ilParticipants) {
368 return [];
369 }
370
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) {
375 $local_roles_info[$role_id] = ilObjRole::_getTranslation(
376 ilObject::_lookupTitle($role_id)
377 );
378 }
379 return $local_roles_info;
380 }
static _getTranslation(string $a_role_title)
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
$index
Definition: metadata.php:145
$type

References $index, $type, ilObjRole\_getTranslation(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilParticipants\getInstance(), and ILIAS\Repository\rbac().

Referenced by initFilter(), and parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParticipants()

ilSessionParticipantsTableGUI::getParticipants ( )
protected

Definition at line 76 of file class.ilSessionParticipantsTableGUI.php.

References $participants.

Referenced by collectParticipants(), and parse().

+ Here is the caller graph for this function:

◆ getRepositoryObject()

ilSessionParticipantsTableGUI::getRepositoryObject ( )
protected

Definition at line 66 of file class.ilSessionParticipantsTableGUI.php.

References $rep_object.

Referenced by __construct(), init(), initFilter(), isRegistrationEnabled(), and parse().

+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilSessionParticipantsTableGUI::getSelectableColumns ( )

Get selectable columns.

Returns
array key: column id, val: true/false -> default on/off

Reimplemented from ilTable2GUI.

Definition at line 190 of file class.ilSessionParticipantsTableGUI.php.

190 : array
191 {
192 self::$all_columns['roles'] = array(
193 'txt' => $this->lng->txt('objs_role'),
194 'default' => true
195 );
196
197 return self::$all_columns;
198 }

References $all_columns, and ILIAS\Repository\lng().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilSessionParticipantsTableGUI::init ( )

Definition at line 81 of file class.ilSessionParticipantsTableGUI.php.

81 : void
82 {
83 $this->lng->loadLanguageModule('sess');
84 $this->lng->loadLanguageModule('crs');
85 $this->lng->loadLanguageModule('trac');
86 $this->lng->loadLanguageModule('mmbr');
87
88 $this->setFormName('participants');
89
90 $this->initFilter();
91
92
93 $this->setSelectAllCheckbox('participants', true);
94 $this->setShowRowsSelector(true);
95
96 $this->enable('sort');
97 $this->enable('header');
98 $this->enable('numinfo');
99 $this->enable('select_all');
100
101
102 $this->setFormAction($this->ctrl->getFormAction($this->getParentObject(), $this->getParentCmd()));
103
104 $this->setRowTemplate("tpl.sess_members_row.html", "Modules/Session");
105
106 $this->addColumn('', 'f', '1', true);
107 $this->addColumn($this->lng->txt('name'), 'name', '20%');
108 $this->addColumn($this->lng->txt('login'), 'login', '10%');
109
110 $all_cols = $this->getSelectableColumns();
111 foreach ($this->getSelectedColumns() as $col) {
112 $this->addColumn($all_cols[$col]['txt'], $col);
113 }
114
115
116 if ($this->isRegistrationEnabled()) {
117 $this->addColumn($this->lng->txt('event_tbl_registered'), 'registered');
118 $this->setDefaultOrderField('registered');
119 $this->setDefaultOrderDirection('desc');
120 } else {
121 $this->setDefaultOrderField('name');
122 }
123
124 $this->addColumn($this->lng->txt('event_tbl_participated'), 'participated');
125
126 if ($this->isRegistrationEnabled()) {
127 $this->addColumn($this->lng->txt('sess_part_table_excused'), 'excused');
128 }
129
130 $this->addColumn($this->lng->txt('sess_contact'), 'contact');
131 if (true === $this->getRepositoryObject()->isRegistrationNotificationEnabled()) {
132 $this->addColumn($this->lng->txt('notification'), 'notification_checked');
133 }
134
135 $this->addColumn($this->lng->txt('trac_mark'), 'mark');
136 $this->addColumn($this->lng->txt('trac_comment'), 'comment');
137
138
139 $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('mmbr_btn_mail_selected_users'));
140 $this->lng->loadLanguageModule('user');
141 $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
142
143
144 $this->addCommandButton('updateMembers', $this->lng->txt('save'));
145 }
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
enable(string $a_module_name)

References ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTableGUI\enable(), getRepositoryObject(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), initFilter(), isRegistrationEnabled(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and ilTable2GUI\setShowRowsSelector().

+ Here is the call graph for this function:

◆ initFilter()

ilSessionParticipantsTableGUI::initFilter ( )

Reimplemented from ilTable2GUI.

Definition at line 147 of file class.ilSessionParticipantsTableGUI.php.

147 : void
148 {
149 $login = $this->addFilterItemByMetaType(
150 'login',
152 false,
153 $this->lng->txt('name')
154 );
155 $this->current_filter['login'] = $login->getValue();
156
157
158 if ($this->isColumnSelected('roles')) {
159 $role = $this->addFilterItemByMetaType(
160 'roles',
162 false,
163 $this->lng->txt('objs_' . ilObject::_lookupType(ilObject::_lookupObjId($this->member_ref_id)) . '_role')
164 );
165
166 $options = [];
167 $options[0] = $this->lng->txt('all_roles');
168 $role->setOptions($options + $this->getParentLocalRoles());
169 $this->current_filter['roles'] = $role->getValue();
170 }
171
172 if ($this->getRepositoryObject()->enabledRegistration()) {
173 $reg = $this->addFilterItemByMetaType(
174 'filter_registration',
176 false,
177 $this->lng->txt('sess_part_filter_registered')
178 );
179 $this->current_filter['filter_registration'] = $reg->getChecked();
180 }
181 $participated = $this->addFilterItemByMetaType(
182 'filter_participated',
184 false,
185 $this->lng->txt('sess_part_filter_participated')
186 );
187 $this->current_filter['filter_participated'] = $participated->getChecked();
188 }
static _lookupObjId(int $ref_id)
isColumnSelected(string $col)
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.

References ilObject\_lookupObjId(), ilObject\_lookupType(), ilTable2GUI\addFilterItemByMetaType(), ilTable2GUI\FILTER_CHECKBOX, ilTable2GUI\FILTER_SELECT, ilTable2GUI\FILTER_TEXT, getParentLocalRoles(), getRepositoryObject(), ilTable2GUI\isColumnSelected(), and ILIAS\Repository\lng().

Referenced by init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRegistrationEnabled()

ilSessionParticipantsTableGUI::isRegistrationEnabled ( )
protected

Definition at line 71 of file class.ilSessionParticipantsTableGUI.php.

71 : bool
72 {
73 return $this->getRepositoryObject()->enabledRegistration();
74 }

References getRepositoryObject().

Referenced by fillRow(), and init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ matchesFilterCriteria()

ilSessionParticipantsTableGUI::matchesFilterCriteria ( array  $a_user_info)
protected

Definition at line 282 of file class.ilSessionParticipantsTableGUI.php.

282 : bool
283 {
284 foreach ($this->current_filter as $filter => $filter_value) {
285 if (!$filter_value) {
286 continue;
287 }
288 switch ($filter) {
289 case 'roles':
290 if (!in_array($filter_value, ($a_user_info['role_ids'] ?? []))) {
291 return false;
292 }
293 break;
294
295 case 'filter_participated':
296 if (!($a_user_info['participated'] ?? false)) {
297 return false;
298 }
299 break;
300
301 case 'filter_registration':
302 if (!($a_user_info['registered'] ?? false)) {
303 return false;
304 }
305 break;
306 }
307 }
308 return true;
309 }

Referenced by parse().

+ Here is the caller graph for this function:

◆ parse()

ilSessionParticipantsTableGUI::parse ( )

Definition at line 200 of file class.ilSessionParticipantsTableGUI.php.

200 : void
201 {
202 $all_participants = [];
203 $all_possible_participants = $this->collectParticipants();
204 if ($all_possible_participants !== []) {
205 // user filter
206 $user_query = new ilUserQuery();
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'];
212 }
213
214 $part = [];
215 foreach ($all_participants as $counter => $participant) {
216 $usr_data = $this->getParticipants()->getEventParticipants()->getUser((int) $participant['usr_id']);
217 $tmp_data = [];
218 $tmp_data['id'] = $participant['usr_id'];
219
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']);
230
231 $notificationShown = false;
232 if (true === $this->getRepositoryObject()->isRegistrationNotificationEnabled()) {
233 $notificationShown = true;
234 $notificationCheckboxEnabled = true;
235 if (ilSessionConstants::NOTIFICATION_INHERIT_OPTION === $this->getRepositoryObject()->getRegistrationNotificationOption()) {
236 $notificationCheckboxEnabled = false;
237 }
238 $tmp_data['notification_checkbox_enabled'] = $notificationCheckboxEnabled;
239 $tmp_data['notification_checked'] = $usr_data['notification_enabled'] ?? false;
240 }
241 $tmp_data['show_notification'] = $notificationShown;
242
243 $roles = [];
244 $local_roles = $this->getParentLocalRoles();
245 foreach ($local_roles as $role_id => $role_name) {
246 // @todo fix performance
247 if ($this->rbac->review()->isAssigned((int) $participant['usr_id'], $role_id)) {
248 $tmp_data['role_ids'][] = $role_id;
249 $roles[] = $role_name;
250 }
251 }
252 $tmp_data['roles'] = implode('<br />', $roles);
253
254 if ($this->matchesFilterCriteria($tmp_data)) {
255 $part[] = $tmp_data;
256 }
257 }
258 $this->setData($part);
259 }
setData(array $a_data)
Set table data.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69

References $res, collectParticipants(), getParentLocalRoles(), getParticipants(), getRepositoryObject(), matchesFilterCriteria(), ilSessionConstants\NOTIFICATION_INHERIT_OPTION, ILIAS\Repository\rbac(), and ilTable2GUI\setData().

+ Here is the call graph for this function:

Field Documentation

◆ $all_columns

array ilSessionParticipantsTableGUI::$all_columns = []
staticprotected

Definition at line 27 of file class.ilSessionParticipantsTableGUI.php.

Referenced by getSelectableColumns().

◆ $current_filter

array ilSessionParticipantsTableGUI::$current_filter = []
private

Definition at line 36 of file class.ilSessionParticipantsTableGUI.php.

◆ $logger

ilLogger ilSessionParticipantsTableGUI::$logger
private

Definition at line 29 of file class.ilSessionParticipantsTableGUI.php.

◆ $member_ref_id

int ilSessionParticipantsTableGUI::$member_ref_id = 0
private

Definition at line 35 of file class.ilSessionParticipantsTableGUI.php.

◆ $parent_ref_id

int ilSessionParticipantsTableGUI::$parent_ref_id = 0
private

Definition at line 34 of file class.ilSessionParticipantsTableGUI.php.

◆ $participants

ilParticipants ilSessionParticipantsTableGUI::$participants
private

Definition at line 33 of file class.ilSessionParticipantsTableGUI.php.

Referenced by getParticipants().

◆ $rbac

ILIAS DI RBACServices ilSessionParticipantsTableGUI::$rbac
private

Definition at line 31 of file class.ilSessionParticipantsTableGUI.php.

◆ $rep_object

ilObjSession ilSessionParticipantsTableGUI::$rep_object
private

Definition at line 32 of file class.ilSessionParticipantsTableGUI.php.

Referenced by getRepositoryObject().

◆ $tree

ilTree ilSessionParticipantsTableGUI::$tree
private

Definition at line 30 of file class.ilSessionParticipantsTableGUI.php.


The documentation for this class was generated from the following file: