ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI Class Reference

Class ilMStListUsersTableGUI. More...

+ Inheritance diagram for ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI:
+ Collaboration diagram for ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI:

Public Member Functions

 __construct (\ilMStListUsersGUI $parent_obj, $parent_cmd=\ilMStListUsersGUI::CMD_INDEX)
 
 initFilter ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
- 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

 parseData ()
 
 initSelectableColumns ()
 
 getTextRepresentationOfUsersOrgUnits (int $user_id)
 
 fillRow (array $a_set)
 
 fillRowExcel (\ilExcel $a_excel, int &$a_row, array $a_set)
 
 fillRowCSV (\ilCSVWriter $a_csv, array $a_set)
 
 getFieldValuesForExport (ilMStListUser $my_staff_user)
 
- 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

array $filter = []
 
array $cached_selectable_columns = []
 
array $usr_orgu_names = []
 
ilMyStaffAccess $access
 
- 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
 

Private Member Functions

 addColumns ()
 
 getProfileBackUrl ()
 

Private Attributes

ILIAS UI Factory $uiFactory
 
ILIAS UI Renderer $uiRenderer
 
ilLanguage $language
 
Profile $profile
 

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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::__construct ( \ilMStListUsersGUI  $parent_obj,
  $parent_cmd = \ilMStListUsersGUI::CMD_INDEX 
)
Parameters
\ilMStListUsersGUI$parent_obj
string$parent_cmd

Definition at line 46 of file class.ilMStListUsersTableGUI.php.

47 {
48 global $DIC;
49
51
52 $this->setPrefix('myst_lu');
53 $this->setFormName('myst_lu');
54 $this->setId('myst_lu');
55
57
58 $this->uiFactory = $DIC->ui()->factory();
59 $this->uiRenderer = $DIC->ui()->renderer();
60 $this->language = $DIC->language();
61 $this->profile = $DIC['user']->getProfile();
62
63 $this->setRowTemplate('tpl.list_users_row.html', "components/ILIAS/MyStaff");
64 $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
65 $this->setDefaultOrderDirection('desc');
66
67 $this->setShowRowsSelector(true);
68
69 $this->setEnableTitle(true);
70 $this->setDisableFilterHiding(true);
71 $this->setEnableNumInfo(true);
72
73 $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
74
75 $this->setFilterCols(4);
76 $this->initFilter();
77 $this->addColumns();
78
79 $this->parseData();
80 }
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setEnableNumInfo(bool $a_val)
setExportFormats(array $formats)
Set available export formats.
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
setDisableFilterHiding(bool $a_val=true)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setFilterCols(int $a_val)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilTable2GUI\$parent_cmd, ilTable2GUI\$parent_obj, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\addColumns(), ILIAS\MyStaff\ilMyStaffAccess\getInstance(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\initFilter(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\parseData(), ILIAS\Repository\profile(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDisableFilterHiding(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFilterCols(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowRowsSelector().

+ Here is the call graph for this function:

Member Function Documentation

◆ addColumns()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::addColumns ( )
private

Definition at line 182 of file class.ilMStListUsersTableGUI.php.

182 : void
183 {
184 global $DIC;
185
186 //User Profile Picture
187 if (!$this->getExportMode()) {
188 $this->addColumn('');
189 }
190
191 foreach ($this->getSelectableColumns() as $k => $v) {
192 if ($this->isColumnSelected($k)) {
193 $sort = $v['sort_field'] ?? "";
194 $this->addColumn($v['txt'], $sort);
195 }
196 }
197 //Actions
198 if (!$this->getExportMode()) {
199 $this->addColumn($DIC->language()->txt('actions'));
200 }
201 }
isColumnSelected(string $col)
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)

References $DIC, ilTable2GUI\addColumn(), ilTable2GUI\getExportMode(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getSelectableColumns(), and ilTable2GUI\isColumnSelected().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\__construct().

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

◆ fillRow()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::fillRow ( array  $a_set)
finalprotected
Parameters
array<ilMStListUser>$a_set
Returns
void
Exceptions

ilCtrlException

Exceptions

ilTemplateException

Reimplemented from ilTable2GUI.

Definition at line 218 of file class.ilMStListUsersTableGUI.php.

218 : void
219 {
220 $set = array_pop($a_set);
221
222 $propGetter = \Closure::bind(function ($prop) {
223 return $this->$prop ?? null;
224 }, $set, $set);
225
226 //Avatar
227 $this->tpl->setCurrentBlock('user_profile_picture');
228 $il_obj_user = $set->returnIlUserObj();
229 $avatar = $this->uiFactory->image()->standard($il_obj_user->getPersonalPicturePath('small'), $il_obj_user->getPublicName());
230 $this->tpl->setVariable('user_profile_picture', $this->uiRenderer->render($avatar));
231 $this->tpl->parseCurrentBlock();
232
233 foreach ($this->getSelectedColumns() as $k => $v) {
234 switch ($k) {
235 case 'org_units':
236 $this->tpl->setCurrentBlock('td');
237 $this->tpl->setVariable(
238 'VALUE',
239 $this->getTextRepresentationOfUsersOrgUnits($set->getUsrId())
240 );
241 $this->tpl->parseCurrentBlock();
242 break;
243 case 'gender':
244 $this->tpl->setCurrentBlock('td');
245 $this->tpl->setVariable('VALUE', $this->language->txt('gender_' . $set->getGender()));
246 $this->tpl->parseCurrentBlock();
247 break;
248 case 'interests_general':
249 $this->tpl->setCurrentBlock('td');
250 $this->tpl->setVariable('VALUE', ($set->returnIlUserObj()
251 ->getGeneralInterestsAsText() ? $set->returnIlUserObj()->getGeneralInterestsAsText() : '&nbsp;'));
252 $this->tpl->parseCurrentBlock();
253 break;
254 case 'interests_help_offered':
255 $this->tpl->setCurrentBlock('td');
256 $this->tpl->setVariable('VALUE', ($set->returnIlUserObj()
257 ->getOfferingHelpAsText() ? $set->returnIlUserObj()->getOfferingHelpAsText() : '&nbsp;'));
258 $this->tpl->parseCurrentBlock();
259 break;
260 case 'interests_help_looking':
261 $this->tpl->setCurrentBlock('td');
262 $this->tpl->setVariable('VALUE', ($set->returnIlUserObj()
263 ->getLookingForHelpAsText() ? $set->returnIlUserObj()->getLookingForHelpAsText() : '&nbsp;'));
264 $this->tpl->parseCurrentBlock();
265 break;
266 default:
267 if ($propGetter($k) !== null) {
268 $this->tpl->setCurrentBlock('td');
269 $this->tpl->setVariable(
270 'VALUE',
271 (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))
272 );
273 $this->tpl->parseCurrentBlock();
274 } else {
275 $this->tpl->setCurrentBlock('td');
276 $this->tpl->setVariable('VALUE', '&nbsp;');
277 $this->tpl->parseCurrentBlock();
278 }
279 break;
280 }
281 }
282
283 $mst_lus_usr_id = $set->getUsrId();
284
285 $actions = [];
286
287 if ($this->access->hasCurrentUserAccessToCourseMemberships()) {
288 $this->ctrl->setParameterByClass(\ilMStShowUserCoursesGUI::class, 'usr_id', $mst_lus_usr_id);
289 $actions[] = $this->uiFactory->link()->standard(
290 $this->language->txt("mst_show_courses"),
291 $this->ctrl->getLinkTargetByClass([
292 \ilDashboardGUI::class,
293 \ilMyStaffGUI::class,
294 \ilMStShowUserGUI::class,
295 \ilMStShowUserCoursesGUI::class,
296 ])
297 );
298 }
299
300 if ($this->access->hasCurrentUserAccessToCertificates()) {
301 $this->ctrl->setParameterByClass(\ilUserCertificateGUI::class, 'usr_id', $mst_lus_usr_id);
302 $actions[] = $this->uiFactory->link()->standard(
303 $this->language->txt("mst_list_certificates"),
304 $this->ctrl->getLinkTargetByClass([
305 \ilDashboardGUI::class,
306 \ilMyStaffGUI::class,
307 \ilMStShowUserGUI::class,
308 \ilUserCertificateGUI::class,
309 ])
310 );
311 }
312
313 if ($this->access->hasCurrentUserAccessToCompetences()) {
314 $this->ctrl->setParameterByClass(\ilMStShowUserCompetencesGUI::class, 'usr_id', $mst_lus_usr_id);
315 $actions[] = $this->uiFactory->link()->standard(
316 $this->language->txt("mst_list_competences"),
317 $this->ctrl->getLinkTargetByClass([
318 \ilDashboardGUI::class,
319 \ilMyStaffGUI::class,
320 \ilMStShowUserGUI::class,
321 \ilMStShowUserCompetencesGUI::class,
322 ])
323 );
324 }
325
326
327 $this->ctrl->setParameterByClass(\ilMStListUsersGUI::class, 'mst_lus_usr_id', $mst_lus_usr_id);
328
329 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
330 $mst_lus_usr_id,
331 rawurlencode($this->ctrl->getLinkTargetByClass("ilMStListUsersGUI", \ilMStListUsersGUI::CMD_INDEX))
332 );
333
334 $dropdown = $this->uiFactory->dropdown()->standard($actions)->withLabel($this->lng->txt("actions"));
335 $this->tpl->setVariable("ACTIONS", $this->uiRenderer->render($dropdown));
336 $this->tpl->parseCurrentBlock();
337 }

References ILIAS\Repository\access(), ilMStListUsersGUI\CMD_INDEX, ILIAS\Repository\ctrl(), ilTable2GUI\getSelectedColumns(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getTextRepresentationOfUsersOrgUnits(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ fillRowCSV()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::fillRowCSV ( \ilCSVWriter  $a_csv,
array  $a_set 
)
protected

Definition at line 360 of file class.ilMStListUsersTableGUI.php.

360 : void
361 {
362 $set = array_pop($a_set);
363
364 foreach ($this->getFieldValuesForExport($set) as $k => $v) {
365 $a_csv->addColumn($v);
366 }
367 $a_csv->addRow();
368 }

References ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getFieldValuesForExport().

+ Here is the call graph for this function:

◆ fillRowExcel()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::fillRowExcel ( \ilExcel  $a_excel,
int &  $a_row,
array  $a_set 
)
protected

Definition at line 349 of file class.ilMStListUsersTableGUI.php.

349 : void
350 {
351 $set = array_pop($a_set);
352
353 $col = 0;
354 foreach ($this->getFieldValuesForExport($set) as $k => $v) {
355 $a_excel->setCell($a_row, $col, $v);
356 $col++;
357 }
358 }

References ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getFieldValuesForExport(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ getFieldValuesForExport()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::getFieldValuesForExport ( ilMStListUser  $my_staff_user)
protected

Definition at line 370 of file class.ilMStListUsersTableGUI.php.

370 : array
371 {
372 global $DIC;
373
374 $propGetter = \Closure::bind(function ($prop) {
375 return $this->$prop ?? null;
376 }, $my_staff_user, $my_staff_user);
377
378 $field_values = array();
379
380 foreach ($this->getSelectedColumns() as $k => $v) {
381 switch ($k) {
382 case 'org_units':
383 $field_values[$k] = $this->getTextRepresentationOfUsersOrgUnits($my_staff_user->getUsrId());
384 break;
385 case 'gender':
386 $field_values[$k] = $DIC->language()->txt('gender_' . $my_staff_user->getGender());
387 break;
388 case 'interests_general':
389 $field_values[$k] = $my_staff_user->returnIlUserObj()->getGeneralInterestsAsText();
390 break;
391 case 'interests_help_offered':
392 $field_values[$k] = $my_staff_user->returnIlUserObj()->getOfferingHelpAsText();
393 break;
394 case 'interests_help_looking':
395 $field_values[$k] = $my_staff_user->returnIlUserObj()->getLookingForHelpAsText();
396 break;
397 default:
398 $field_values[$k] = strip_tags($propGetter($k) ?? "");
399 break;
400 }
401 }
402
403 return $field_values;
404 }

References $DIC, ILIAS\MyStaff\ListUsers\ilMStListUser\getGender(), ilTable2GUI\getSelectedColumns(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getTextRepresentationOfUsersOrgUnits(), ILIAS\MyStaff\ListUsers\ilMStListUser\getUsrId(), and ILIAS\MyStaff\ListUsers\ilMStListUser\returnIlUserObj().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowCSV(), and ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowExcel().

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

◆ getProfileBackUrl()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::getProfileBackUrl ( )
private

Definition at line 339 of file class.ilMStListUsersTableGUI.php.

339 : string
340 {
341 global $DIC;
342
343 return rawurlencode($DIC->ctrl()->getLinkTargetByClass(
344 strtolower(\ilMyStaffGUI::class),
346 ));
347 }
const string CMD_INDEX

References $DIC, and ilMyStaffGUI\CMD_INDEX.

◆ getSelectableColumns()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::getSelectableColumns ( )
final

Get selectable columns.

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

Reimplemented from ilTable2GUI.

Definition at line 150 of file class.ilMStListUsersTableGUI.php.

150 : array
151 {
152 if ($this->cached_selectable_columns) {
154 }
155
156 return $this->cached_selectable_columns = $this->initSelectableColumns();
157 }

References ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\$cached_selectable_columns, and ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\initSelectableColumns().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\addColumns().

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

◆ getTextRepresentationOfUsersOrgUnits()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::getTextRepresentationOfUsersOrgUnits ( int  $user_id)
protected

Definition at line 203 of file class.ilMStListUsersTableGUI.php.

203 : string
204 {
205 if (isset($this->usr_orgu_names[$user_id])) {
206 return $this->usr_orgu_names[$user_id];
207 }
208
209 return $this->usr_orgu_names[$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
210 }

References $user_id.

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRow(), and ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getFieldValuesForExport().

+ Here is the caller graph for this function:

◆ initFilter()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::initFilter ( )
final

Reimplemented from ilTable2GUI.

Definition at line 121 of file class.ilMStListUsersTableGUI.php.

121 : void
122 {
123 global $DIC;
124
125 // User name, login, email filter
126 $item = new \ilTextInputGUI(
127 $DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language()
128 ->txt("name"),
129 "user"
130 );
131 $this->addFilterItem($item);
132 $item->readFromSession();
133 $this->filter['user'] = $item->getValue();
134
135 if (\ilUserSearchOptions::_isEnabled('org_units')) {
137 $options[0] = $DIC->language()->txt('mst_opt_all');
138 foreach ($paths as $org_ref_id => $path) {
139 $options[$org_ref_id] = $path;
140 }
141 $item = new \ilSelectInputGUI($DIC->language()->txt('obj_orgu'), 'org_unit');
142 $item->setOptions($options);
143 $item->addCustomAttribute("style='width:100%'");
144 $this->addFilterItem($item);
145 $item->readFromSession();
146 $this->filter['org_unit'] = $item->getValue();
147 }
148 }
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
$path
Definition: ltiservices.php:30
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)

References $DIC, $path, ilUserSearchOptions\_isEnabled(), ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), and ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\__construct().

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

◆ initSelectableColumns()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::initSelectableColumns ( )
protected

Definition at line 159 of file class.ilMStListUsersTableGUI.php.

159 : array
160 {
161 $arr_fields_without_table_sort = array(
162 'org_units',
163 'interests_general',
164 'interests_help_offered',
165 'interests_help_looking',
166 );
167 $cols = array();
168 foreach (\ilUserSearchOptions::getSelectableColumnInfo() as $key => $col) {
169 $cols[$key] = $col;
170 if (!in_array($key, $arr_fields_without_table_sort)) {
171 $cols[$key]['sort_field'] = $key;
172 }
173 }
174
175 foreach ($this->profile->getAllUserDefinedFields() as $field) {
176 unset($cols["udf_" . $field->getIdentifier()]);
177 }
178
179 return $cols;
180 }
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.

References ilUserSearchOptions\getSelectableColumnInfo(), and ILIAS\Repository\profile().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\getSelectableColumns().

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

◆ parseData()

ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::parseData ( )
protected

Definition at line 82 of file class.ilMStListUsersTableGUI.php.

82 : void
83 {
84 global $DIC;
85
86 $this->setExternalSorting(true);
87 $this->setExternalSegmentation(true);
88 $this->setDefaultOrderField('lastname');
89
90 $this->determineLimit();
92
93 //Permission Filter
94 $arr_usr_id = $this->access->getUsersForUser($DIC->user()->getId());
95
96 $options = array(
97 'filters' => $this->filter,
98 'limit' => array(
99 'start' => $this->getOffset(),
100 'end' => $this->getLimit(),
101 ),
102 'sort' => array(
103 'field' => $this->getOrderField(),
104 'direction' => $this->getOrderDirection(),
105 ),
106 );
107
108 $list_users_fetcher = new ilMStListUsers($DIC);
109 $result = $list_users_fetcher->getData($arr_usr_id, $options);
110
111 $this->setMaxCount($result->getTotalDatasetCount());
112 $data = $result->getDataset();
113
114 // Workaround because the fillRow Method only accepts arrays
115 $data = array_map(function (ilMStListUser $it): array {
116 return [$it];
117 }, $data);
118 $this->setData($data);
119 }
determineOffsetAndOrder(bool $a_omit_offset=false)
setExternalSegmentation(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setExternalSorting(bool $a_val)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.

References ilTableGUI\$data, $DIC, ILIAS\Repository\access(), ilTable2GUI\determineLimit(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\Repository\filter(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\setData(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), and ilTableGUI\setMaxCount().

Referenced by ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\__construct().

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

Field Documentation

◆ $access

ilMyStaffAccess ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$access
protected

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

◆ $cached_selectable_columns

array ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$cached_selectable_columns = []
protected

◆ $filter

array ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$filter = []
protected

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

◆ $language

ilLanguage ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$language
private

Definition at line 39 of file class.ilMStListUsersTableGUI.php.

◆ $profile

Profile ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$profile
private

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

◆ $uiFactory

ILIAS UI Factory ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$uiFactory
private

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

◆ $uiRenderer

ILIAS UI Renderer ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$uiRenderer
private

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

◆ $usr_orgu_names

array ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI::$usr_orgu_names = []
protected

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


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