ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 ()
 
- 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)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 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 ()
 
 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)
 
- 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
 

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 43 of file class.ilMStListUsersTableGUI.php.

References $DIC, ilTable2GUI\$parent_cmd, 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(), 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().

44  {
45  global $DIC;
46 
48 
49  $this->setPrefix('myst_lu');
50  $this->setFormName('myst_lu');
51  $this->setId('myst_lu');
52 
54 
55  $this->uiFactory = $DIC->ui()->factory();
56  $this->uiRenderer = $DIC->ui()->renderer();
57  $this->language = $DIC->language();
58 
59  $this->setRowTemplate('tpl.list_users_row.html', "components/ILIAS/MyStaff");
60  $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
61  $this->setDefaultOrderDirection('desc');
62 
63  $this->setShowRowsSelector(true);
64 
65  $this->setEnableTitle(true);
66  $this->setDisableFilterHiding(true);
67  $this->setEnableNumInfo(true);
68 
69  $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
70 
71  $this->setFilterCols(4);
72  $this->initFilter();
73  $this->addColumns();
74 
75  $this->parseData();
76  }
setExportFormats(array $formats)
Set available export formats.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setDisableFilterHiding(bool $a_val=true)
setFormName(string $a_name="")
setId(string $a_val)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:26
setDefaultOrderDirection(string $a_defaultorderdirection)
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
setFilterCols(int $a_val)
setPrefix(string $a_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ addColumns()

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

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

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

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

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

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

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

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

◆ fillRowCSV()

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

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

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

357  : void
358  {
359  $set = array_pop($a_set);
360 
361  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
362  $a_csv->addColumn($v);
363  }
364  $a_csv->addRow();
365  }
+ 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 346 of file class.ilMStListUsersTableGUI.php.

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

346  : void
347  {
348  $set = array_pop($a_set);
349 
350  $col = 0;
351  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
352  $a_excel->setCell($a_row, $col, $v);
353  $col++;
354  }
355  }
+ Here is the call graph for this function:

◆ getFieldValuesForExport()

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

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

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

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

367  : array
368  {
369  global $DIC;
370 
371  $propGetter = \Closure::bind(function ($prop) {
372  return $this->$prop ?? null;
373  }, $my_staff_user, $my_staff_user);
374 
375  $field_values = array();
376 
377  foreach ($this->getSelectedColumns() as $k => $v) {
378  switch ($k) {
379  case 'org_units':
380  $field_values[$k] = $this->getTextRepresentationOfUsersOrgUnits($my_staff_user->getUsrId());
381  break;
382  case 'gender':
383  $field_values[$k] = $DIC->language()->txt('gender_' . $my_staff_user->getGender());
384  break;
385  case 'interests_general':
386  $field_values[$k] = $my_staff_user->returnIlUserObj()->getGeneralInterestsAsText();
387  break;
388  case 'interests_help_offered':
389  $field_values[$k] = $my_staff_user->returnIlUserObj()->getOfferingHelpAsText();
390  break;
391  case 'interests_help_looking':
392  $field_values[$k] = $my_staff_user->returnIlUserObj()->getLookingForHelpAsText();
393  break;
394  default:
395  $field_values[$k] = strip_tags($propGetter($k) ?? "");
396  break;
397  }
398  }
399 
400  return $field_values;
401  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:26
+ 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 336 of file class.ilMStListUsersTableGUI.php.

References $DIC, and ilMyStaffGUI\CMD_INDEX.

336  : string
337  {
338  global $DIC;
339 
340  return rawurlencode($DIC->ctrl()->getLinkTargetByClass(
341  strtolower(\ilMyStaffGUI::class),
343  ));
344  }
const string CMD_INDEX
global $DIC
Definition: shib_login.php:26

◆ getSelectableColumns()

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

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

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

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

146  : array
147  {
148  if ($this->cached_selectable_columns) {
150  }
151 
152  return $this->cached_selectable_columns = $this->initSelectableColumns();
153  }
+ 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 200 of file class.ilMStListUsersTableGUI.php.

References $user_id.

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

200  : string
201  {
202  if (isset($this->usr_orgu_names[$user_id])) {
203  return $this->usr_orgu_names[$user_id];
204  }
205 
206  return $this->usr_orgu_names[$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
207  }
+ Here is the caller graph for this function:

◆ initFilter()

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

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

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

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

117  : void
118  {
119  global $DIC;
120 
121  // User name, login, email filter
122  $item = new \ilTextInputGUI(
123  $DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language()
124  ->txt("name"),
125  "user"
126  );
127  $this->addFilterItem($item);
128  $item->readFromSession();
129  $this->filter['user'] = $item->getValue();
130 
131  if (\ilUserSearchOptions::_isEnabled('org_units')) {
133  $options[0] = $DIC->language()->txt('mst_opt_all');
134  foreach ($paths as $org_ref_id => $path) {
135  $options[$org_ref_id] = $path;
136  }
137  $item = new \ilSelectInputGUI($DIC->language()->txt('obj_orgu'), 'org_unit');
138  $item->setOptions($options);
139  $item->addCustomAttribute("style='width:100%'");
140  $this->addFilterItem($item);
141  $item->readFromSession();
142  $this->filter['org_unit'] = $item->getValue();
143  }
144  }
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
$path
Definition: ltiservices.php:29
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
global $DIC
Definition: shib_login.php:26
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ 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 155 of file class.ilMStListUsersTableGUI.php.

References ilUserDefinedFields\_getInstance(), and ilUserSearchOptions\getSelectableColumnInfo().

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

155  : array
156  {
157  $arr_fields_without_table_sort = array(
158  'org_units',
159  'interests_general',
160  'interests_help_offered',
161  'interests_help_looking',
162  );
163  $cols = array();
164  foreach (\ilUserSearchOptions::getSelectableColumnInfo() as $key => $col) {
165  $cols[$key] = $col;
166  if (!in_array($key, $arr_fields_without_table_sort)) {
167  $cols[$key]['sort_field'] = $key;
168  }
169  }
170 
171  $user_defined_fields = \ilUserDefinedFields::_getInstance();
172  foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
173  unset($cols["udf_" . $field]);
174  }
175 
176  return $cols;
177  }
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
+ 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 78 of file class.ilMStListUsersTableGUI.php.

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().

78  : void
79  {
80  global $DIC;
81 
82  $this->setExternalSorting(true);
83  $this->setExternalSegmentation(true);
84  $this->setDefaultOrderField('lastname');
85 
86  $this->determineLimit();
87  $this->determineOffsetAndOrder();
88 
89  //Permission Filter
90  $arr_usr_id = $this->access->getUsersForUser($DIC->user()->getId());
91 
92  $options = array(
93  'filters' => $this->filter,
94  'limit' => array(
95  'start' => $this->getOffset(),
96  'end' => $this->getLimit(),
97  ),
98  'sort' => array(
99  'field' => $this->getOrderField(),
100  'direction' => $this->getOrderDirection(),
101  ),
102  );
103 
104  $list_users_fetcher = new ilMStListUsers($DIC);
105  $result = $list_users_fetcher->getData($arr_usr_id, $options);
106 
107  $this->setMaxCount($result->getTotalDatasetCount());
108  $data = $result->getDataset();
109 
110  // Workaround because the fillRow Method only accepts arrays
111  $data = array_map(function (ilMStListUser $it): array {
112  return [$it];
113  }, $data);
114  $this->setData($data);
115  }
setData(array $a_data)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
global $DIC
Definition: shib_login.php:26
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setExternalSegmentation(bool $a_val)
+ 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 33 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 30 of file class.ilMStListUsersTableGUI.php.

◆ $language

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

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

◆ $uiFactory

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

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

◆ $uiRenderer

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

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

◆ $usr_orgu_names

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

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


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