ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilGroupParticipantsTableGUI Class Reference
+ Inheritance diagram for ilGroupParticipantsTableGUI:
+ Collaboration diagram for ilGroupParticipantsTableGUI:

Public Member Functions

 __construct (?object $a_parent_obj, ilObject $rep_object, bool $show_learning_progress=false)
 
 parse ()
 
- Public Member Functions inherited from ilParticipantTableGUI
 __construct (mixed $a_parent_obj, $a_parent_cmd="", $a_template_context="")
 
 initFilter ()
 Init table filter. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 checkAcceptance (int $a_usr_id)
 
- 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 ()
 
 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

 fillRow (array $a_set)
 @inheritDoc More...
 
 lookupUserName (int $user_id)
 
- Protected Member Functions inherited from ilParticipantTableGUI
 getRepositoryObject ()
 
 getParticipants ()
 
 initSettings ()
 
 showActionLinks ($a_set)
 
- 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...
 

Protected Attributes

bool $show_learning_progress = false
 
ilPrivacySettings $privacy
 
ilAccessHandler $access
 
ilRbacReview $rbacreview
 
ilObjUser $user
 
Profile $profile
 
array $cached_user_names = []
 
- Protected Attributes inherited from ilParticipantTableGUI
ilParticipants $participants = null
 
array $current_filter = []
 
ilObject $rep_object
 
- Protected Attributes inherited from ilTable2GUI
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_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
 

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
 
- Static Protected Attributes inherited from ilParticipantTableGUI
static bool $export_allowed = false
 
static bool $confirmation_required = true
 
static array $accepted_ids = null
 
static array $all_columns = null
 
static bool $has_odf_definitions = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGroupParticipantsTableGUI::__construct ( ?object  $a_parent_obj,
ilObject  $rep_object,
bool  $show_learning_progress = false 
)

Definition at line 42 of file class.ilGroupParticipantsTableGUI.php.

46 {
47 global $DIC;
48
49 $this->show_learning_progress = $show_learning_progress;
50 $this->rep_object = $rep_object;
51
52 $this->privacy = ilPrivacySettings::getInstance();
53
54 $this->participants = ilParticipants::getInstanceByObjId($this->getRepositoryObject()->getId());
55
56 $this->access = $DIC->access();
57 $this->rbacreview = $DIC->rbac()->review();
58 $this->user = $DIC->user();
59 $this->user = $DIC['user']->getProfile();
60
61
62 $this->setPrefix('participants');
63 $this->setId('grp_' . $this->getRepositoryObject()->getId());
64 parent::__construct($a_parent_obj, 'participants');
65 $this->lng->loadLanguageModule('grp');
66 $this->lng->loadLanguageModule('trac');
67 $this->lng->loadLanguageModule('rbac');
68 $this->lng->loadLanguageModule('mmbr');
69
70 $this->initSettings();
71
72 $this->setFormName('participants');
73 $this->addColumn('', 'f', "1", true);
74 $this->addColumn($this->lng->txt('name'), 'lastname', '20%');
75
76 $all_cols = $this->getSelectableColumns();
77 foreach ($this->getSelectedColumns() as $col) {
78 $this->addColumn($all_cols[$col]['txt'], $col);
79 }
80
81 if ($this->show_learning_progress) {
82 $this->addColumn($this->lng->txt('learning_progress'), 'progress');
83 }
84
85 if ($this->privacy->enabledGroupAccessTimes()) {
86 $this->addColumn($this->lng->txt('last_access'), 'access_time_unix');
87 }
88 $this->addColumn($this->lng->txt('grp_mem_contacts'), 'contact');
89 $this->addColumn($this->lng->txt('grp_notification'), 'notification');
90
91 $this->addColumn($this->lng->txt('actions'), 'optional', '', false, 'ilMembershipRowActionsHeader');
92 $this->setDefaultOrderField('roles');
93
94 $this->setRowTemplate("tpl.show_participants_row.html", "components/ILIAS/Group");
95
96 $this->setShowRowsSelector(true);
97
98 $this->enable('sort');
99 $this->enable('header');
100 $this->enable('numinfo');
101 $this->enable('select_all');
102
103 $this->initFilter();
104
105 $this->addMultiCommand('editParticipants', $this->lng->txt('edit'));
106 $this->addMultiCommand('confirmDeleteParticipants', $this->lng->txt('remove'));
107 $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('mmbr_btn_mail_selected_users'));
108 $this->lng->loadLanguageModule('user');
109 $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
110
111 $this->setSelectAllCheckbox('participants', true);
112 $this->addCommandButton('updateParticipantsStatus', $this->lng->txt('save'));
113 }
getSelectableColumns()
Get selectable columns.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
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)
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...
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.
setId(string $a_val)
enable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilParticipantTableGUI\$rep_object, $show_learning_progress, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ilTableGUI\enable(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilParticipants\getInstanceByObjId(), ilParticipantTableGUI\getRepositoryObject(), ilParticipantTableGUI\getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ilParticipantTableGUI\initFilter(), ilParticipantTableGUI\initSettings(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilGroupParticipantsTableGUI::fillRow ( array  $a_set)
protected

@inheritDoc

Reimplemented from ilTable2GUI.

Definition at line 118 of file class.ilGroupParticipantsTableGUI.php.

118 : void
119 {
120 global $DIC;
121
122 $ilAccess = $DIC->access();
123
124 $a_set['usr_id'] = (int) $a_set['usr_id'];
125 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
126 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
127 if (!$ilAccess->checkAccessOfUser($a_set['usr_id'], 'read', '', $this->getRepositoryObject()->getRefId()) and
128 is_array($info = $ilAccess->getInfo())) {
129 $this->tpl->setCurrentBlock('access_warning');
130 $this->tpl->setVariable('PARENT_ACCESS', $info[0]['text']);
131 $this->tpl->parseCurrentBlock();
132 }
133
134 if (!$a_set['active']) {
135 $this->tpl->setCurrentBlock('access_warning');
136 $this->tpl->setVariable('PARENT_ACCESS', $this->lng->txt('usr_account_inactive'));
137 $this->tpl->parseCurrentBlock();
138 }
139
140
141 foreach ($this->getSelectedColumns() as $field) {
142 switch ($field) {
143 case 'gender':
144 $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
145 $this->tpl->setCurrentBlock('custom_fields');
146 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
147 $this->tpl->parseCurrentBlock();
148 break;
149
150 case 'birthday':
151 $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date');
152 $this->tpl->setCurrentBlock('custom_fields');
153 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
154 $this->tpl->parseCurrentBlock();
155 break;
156
157 case 'consultation_hour':
158 $this->tpl->setCurrentBlock('custom_fields');
159 $dts = array();
160 foreach ((array) $a_set['consultation_hours'] as $ch) {
162 new ilDateTime($ch['dt'], IL_CAL_UNIX),
163 new ilDateTime($ch['dtend'], IL_CAL_UNIX)
164 );
165 if ($ch['explanation']) {
166 $tmp .= ' ' . $ch['explanation'];
167 }
168 $dts[] = $tmp;
169 }
170 $dt_string = implode('<br />', $dts);
171 $this->tpl->setVariable('VAL_CUST', $dt_string) ;
172 $this->tpl->parseCurrentBlock();
173 break;
174
175 case 'prtf':
176 $tmp = array();
177 if (is_array($a_set['prtf'])) {
178 foreach ($a_set['prtf'] as $prtf_url => $prtf_txt) {
179 $tmp[] = '<a href="' . $prtf_url . '">' . $prtf_txt . '</a>';
180 }
181 }
182 $this->tpl->setCurrentBlock('custom_fields');
183 $this->tpl->setVariable('VAL_CUST', implode('<br />', $tmp)) ;
184 $this->tpl->parseCurrentBlock();
185 break;
186
187 case 'odf_last_update':
188 $this->tpl->setCurrentBlock('custom_fields');
189 $this->tpl->setVariable('VAL_CUST', $a_set['odf_info_txt'] ?? '');
190 $this->tpl->parseCurrentBlock();
191 break;
192
193 case 'roles':
194 $this->tpl->setCurrentBlock('custom_fields');
195 $this->tpl->setVariable('VAL_CUST', (string) $a_set['roles_label']);
196 $this->tpl->parseCurrentBlock();
197 break;
198
199 case 'org_units':
200 $this->tpl->setCurrentBlock('custom_fields');
201 $this->tpl->setVariable(
202 'VAL_CUST',
203 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set['usr_id'])
204 );
205 $this->tpl->parseCurrentBlock();
206 break;
207
208 default:
209 $this->tpl->setCurrentBlock('custom_fields');
210 $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
211 $this->tpl->parseCurrentBlock();
212 break;
213 }
214 }
215
216 if ($this->privacy->enabledGroupAccessTimes()) {
217 $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
218 }
219
220 if ($this->show_learning_progress) {
221 $this->tpl->setCurrentBlock('lp');
223 $icon_rendered = $icons->renderIconForStatus($icons->lookupNumStatus($a_set['progress']));
224
225 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
226 $this->tpl->setVariable('LP_STATUS_ICON', $icon_rendered);
227
228 $this->tpl->parseCurrentBlock();
229 }
230
231 $this->tpl->setVariable('VAL_POSTNAME', 'participants');
232
233 if ($this->getParticipants()->isAdmin($a_set['usr_id'])) {
234 $this->tpl->setVariable('VAL_CONTACT_ID', $a_set['usr_id']);
235 $this->tpl->setVariable(
236 'VAL_CONTACT_CHECKED',
237 $a_set['contact'] ? 'checked="checked"' : ''
238 );
239 }
240
241 if (
242 $this->getParticipants()->isAdmin($a_set['usr_id'])
243 ) {
244 $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
245 $this->tpl->setVariable(
246 'VAL_NOTIFICATION_CHECKED',
247 $a_set['notification'] ? 'checked="checked"' : ''
248 );
249 }
250 $this->showActionLinks($a_set);
251 $this->tpl->setVariable('VAL_LOGIN', $a_set['login']);
252 }
const IL_CAL_DATE
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
@classDescription Date and time handling
Class for single dates.
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
$info
Definition: entry_point.php:21

References $DIC, $info, ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilLPStatusIcons\getInstance(), ilParticipantTableGUI\getParticipants(), ilTable2GUI\getSelectedColumns(), ilLPStatusIcons\ICON_VARIANT_LONG, IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilParticipantTableGUI\showActionLinks().

+ Here is the call graph for this function:

◆ lookupUserName()

ilGroupParticipantsTableGUI::lookupUserName ( int  $user_id)
protected
Returns
array{user_id: int, firstname: string, lastname: string, login: string, title: string}

Definition at line 428 of file class.ilGroupParticipantsTableGUI.php.

428 : array
429 {
430 if (isset($this->cached_user_names[$user_id])) {
431 return $this->cached_user_names[$user_id];
432 }
433 return $this->cached_user_names[$user_id] = ilObjUser::_lookupName($user_id);
434 }
static _lookupName(int $a_user_id)

References $user_id, and ilObjUser\_lookupName().

Referenced by parse().

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

◆ parse()

ilGroupParticipantsTableGUI::parse ( )

Definition at line 254 of file class.ilGroupParticipantsTableGUI.php.

254 : void
255 {
256 $this->determineOffsetAndOrder(true);
257 $part = ilGroupParticipants::_getInstanceByObjId($this->getRepositoryObject()->getId())->getParticipants();
258 $part = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
259 'manage_members',
260 'manage_members',
261 $this->getRepositoryObject()->getRefId(),
262 $part
263 );
264
265 if (!$part) {
266 $this->setData(array());
267 return;
268 }
269
270
271 $group_user_data = (array) $this->getParentObject()->readMemberData(
272 $part,
273 $this->getSelectedColumns()
274 );
275
276
277 $additional_fields = $this->getSelectedColumns();
278 unset($additional_fields["firstname"]);
279 unset($additional_fields["lastname"]);
280 unset($additional_fields["last_login"]);
281 unset($additional_fields["access_until"]);
282 unset($additional_fields['consultation_hour']);
283 unset($additional_fields['prtf']);
284 unset($additional_fields['roles']);
285 unset($additional_fields['org_units']);
286
287
288
289 $udf_ids = $usr_data_fields = $odf_ids = array();
290 foreach ($additional_fields as $field) {
291 if (substr($field, 0, 3) == 'udf') {
292 $udf_ids[] = substr($field, 4);
293 continue;
294 }
295 if (substr($field, 0, 3) == 'odf') {
296 $odf_ids[] = substr($field, 4);
297 continue;
298 }
299
300 $usr_data_fields[] = $field;
301 }
302
304 '',
305 '',
306 0,
307 9999,
308 (string) $this->current_filter['login'],
309 '',
310 null,
311 false,
312 false,
313 0,
314 0,
315 null,
316 $usr_data_fields,
317 $part
318 );
319
320 $a_user_data = array();
321 $filtered_user_ids = array();
322 $local_roles = $this->getParentObject()->getLocalRoles();
323 foreach ((array) $usr_data['set'] as $ud) {
324 $user_id = (int) $ud['usr_id'];
325 if ($this->current_filter['roles']) {
326 if (!$this->rbacreview->isAssigned($user_id, $this->current_filter['roles'])) {
327 continue;
328 }
329 }
330 if (array_key_exists('org_units', $this->current_filter) && $this->current_filter['org_units']) {
331 $org_unit = $this->current_filter['org_units'];
332 $assigned = ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($user_id);
333 if (!in_array($org_unit, $assigned)) {
334 continue;
335 }
336 }
337
338 $filtered_user_ids[] = $user_id;
339 $a_user_data[$user_id] = array_merge($ud, (array) $group_user_data[$user_id]);
340
341 $roles = array();
342 foreach ($local_roles as $role_id => $role_name) {
343 // @todo fix performance
344 if ($this->rbacreview->isAssigned($user_id, $role_id)) {
345 $roles[] = $role_name;
346 }
347 }
348 $a_user_data[$user_id]['name'] = $a_user_data[$user_id]['lastname'] . ', ' . $a_user_data[$user_id]['firstname'];
349 $a_user_data[$user_id]['roles_label'] = implode('<br />', $roles);
350 $a_user_data[$user_id]['roles'] = $this->participants->setRoleOrderPosition($user_id);
351 }
352
353 // Custom user data fields
354 if ($udf_ids) {
355 $a_user_data = array_reduce(
356 $this->profile->getDataForMultiple($filtered_user_ids),
357 function (array $c, ProfileData $v) use ($udf_ids): array {
358 if (!$this->checkAcceptance($v->getId())) {
359 return $c;
360 }
361
362 foreach ($udf_ids as $field_id) {
363 $c[$v->getId()]['udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
364 }
365 },
366 $a_user_data
367 );
368 }
369 // Object specific user data fields
370 if ($odf_ids) {
372 foreach ($data as $usr_id => $fields) {
373 $usr_id = (int) $usr_id;
374 if (!$this->checkAcceptance($usr_id)) {
375 continue;
376 }
377 foreach ($fields as $field_id => $value) {
378 if ($a_user_data[$usr_id] ?? false) {
379 $a_user_data[$usr_id]['odf_' . $field_id] = $value;
380 }
381 }
382 }
383 // add last edit date
384 foreach (ilObjectCustomUserFieldHistory::lookupEntriesByObjectId($this->getRepositoryObject()->getId()) as $usr_id => $edit_info) {
385 if (!isset($a_user_data[$usr_id])) {
386 continue;
387 }
388
389 if ($usr_id == $edit_info['update_user']) {
390 $a_user_data[$usr_id]['odf_last_update'] = '';
391 $a_user_data[$usr_id]['odf_info_txt'] = $this->lng->txt('cdf_edited_by_self');
392 if (ilPrivacySettings::getInstance()->enabledAccessTimesByType($this->getRepositoryObject()->getType())) {
393 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
394 $a_user_data[$usr_id]['odf_info_txt'] .= (', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
395 }
396 } else {
397 $a_user_data[$usr_id]['odf_last_update'] = $edit_info['update_user'];
398 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
399
400 $name = $this->lookupUserName((int) $edit_info['update_user']);
401 $a_user_data[$usr_id]['odf_info_txt'] = ($name['firstname'] . ' ' . $name['lastname'] . ', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
402 }
403 }
404 }
405
406 // consultation hours
407 if ($this->isColumnSelected('consultation_hour')) {
408 foreach (ilBookingEntry::lookupManagedBookingsForObject($this->getRepositoryObject()->getId(), $this->user->getId()) as $buser => $booking) {
409 if (isset($a_user_data[$buser])) {
410 $a_user_data[$buser]['consultation_hour'] = $booking[0]['dt'];
411 $a_user_data[$buser]['consultation_hour_end'] = $booking[0]['dtend'];
412 $a_user_data[$buser]['consultation_hours'] = $booking;
413 }
414 }
415 }
416 // always sort by name first
417 $a_user_data = ilArrayUtil::sortArray(
418 $a_user_data,
419 'name',
420 $this->getOrderDirection()
421 );
422 $this->setData($a_user_data);
423 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
static _getValuesByObjId(int $a_obj_id)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
isColumnSelected(string $col)
determineOffsetAndOrder(bool $a_omit_offset=false)
setData(array $a_data)
Set table data.
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
$c
Definition: deliver.php:25

References $c, ilTableGUI\$data, $user_id, ilObjOrgUnitTree\_getInstance(), ilGroupParticipants\_getInstanceByObjId(), ilCourseUserData\_getValuesByObjId(), ILIAS\Repository\access(), ilParticipantTableGUI\checkAcceptance(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilTableGUI\getOrderDirection(), ilTable2GUI\getParentObject(), ilParticipantTableGUI\getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilUserQuery\getUserListData(), IL_CAL_UNIX, ILIAS\Repository\int(), ilTable2GUI\isColumnSelected(), ILIAS\Repository\lng(), ilObjectCustomUserFieldHistory\lookupEntriesByObjectId(), ilBookingEntry\lookupManagedBookingsForObject(), lookupUserName(), ILIAS\Repository\profile(), ilTable2GUI\setData(), ilArrayUtil\sortArray(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilGroupParticipantsTableGUI::$access
protected

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

◆ $cached_user_names

array ilGroupParticipantsTableGUI::$cached_user_names = []
protected

Definition at line 40 of file class.ilGroupParticipantsTableGUI.php.

◆ $privacy

ilPrivacySettings ilGroupParticipantsTableGUI::$privacy
protected

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

◆ $profile

Profile ilGroupParticipantsTableGUI::$profile
protected

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

◆ $rbacreview

ilRbacReview ilGroupParticipantsTableGUI::$rbacreview
protected

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

◆ $show_learning_progress

bool ilGroupParticipantsTableGUI::$show_learning_progress = false
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilGroupParticipantsTableGUI::$user
protected

Definition at line 37 of file class.ilGroupParticipantsTableGUI.php.


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