ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRepositoryUserResultTableGUI Class Reference

TableGUI class user search results. More...

+ Inheritance diagram for ilRepositoryUserResultTableGUI:
+ Collaboration diagram for ilRepositoryUserResultTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $a_admin_mode=false, $a_type=self::TYPE_STANDARD)
 
 getType ()
 
 setLuceneResult (ilLuceneSearchResult $res)
 
 getLuceneResult ()
 
 setUserLimitations (bool $a_limitations)
 
 getUserLimitations ()
 
 getSelectableColumns ()
 
 initMultiCommands (array $a_commands)
 
 parseUserIds (array $a_user_ids)
 
 getHTML ()
 Get HTML. 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)
 

Data Fields

const TYPE_STANDARD = 1
 
const TYPE_GLOBAL_SEARCH = 2
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Protected Member Functions

 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 applySortation (array $set)
 
 getPossibleSortations ()
 
 getDefaultSortation ()
 
- 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 $admin_mode
 
int $type
 
bool $user_limitations = true
 
Profile $profile
 
ilObjUser $user
 
ilRbacReview $review
 
UIServices $ui
 
HTTP $http
 
Refinery $refinery
 
- 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
 

Static Protected Attributes

static array $all_selectable_cols = []
 

Private Attributes

ilLuceneSearchResult $lucene_result = null
 

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='')
 

Detailed Description

TableGUI class user search results.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilRepositoryUserResultTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_admin_mode = false,
  $a_type = self::TYPE_STANDARD 
)

Definition at line 59 of file class.ilRepositoryUserResultTableGUI.php.

60 {
61 global $DIC;
62
63 $this->profile = $DIC['user']->getProfile();
64 $this->user = $DIC['user']->getLoggedInUser();
65 $this->review = $DIC->rbac()->review();
66 $this->ui = $DIC->ui();
67 $this->http = $DIC->http();
68 $this->refinery = $DIC->refinery();
69
70 $this->admin_mode = (bool) $a_admin_mode;
71 $this->type = $a_type;
72
73 $this->setId("rep_search_" . $this->user->getId());
74 parent::__construct($a_parent_obj, $a_parent_cmd);
75
76
77 $this->setFormAction($this->ctrl->getFormAction($this->parent_obj));
78 $this->setTitle($this->lng->txt('search_results'));
79 $this->setEnableTitle(true);
80 $this->setShowRowsSelector(true);
81
82
83 if ($this->getType() == self::TYPE_STANDARD) {
84 $this->setRowTemplate("tpl.rep_search_usr_result_row.html", "components/ILIAS/Search");
85 $this->addColumn("", "", "1", true);
86 $this->enable('select_all');
87 $this->setSelectAllCheckbox("user[]");
88 $this->setDefaultOrderField("login");
89 $this->setDefaultOrderDirection("asc");
90 } else {
91 $this->setRowTemplate("tpl.global_search_usr_result_row.html", "components/ILIAS/Search");
92 $this->addColumn('', '', "110px");
93 $this->setExternalSorting(true);
94 }
95
96 $all_cols = $this->getSelectableColumns();
97 foreach ($this->getSelectedColumns() as $col) {
98 $sort_field = '';
99 if ($this->getType() == self::TYPE_STANDARD) {
100 $sort_field = $col;
101 }
102 $this->addColumn($all_cols[$col]['txt'], $sort_field);
103 }
104
105 if (
106 $this->getType() != self::TYPE_STANDARD &&
107 ilBuddySystem::getInstance()->isEnabled()
108 ) {
109 $this->addColumn('', '');
110 }
111 }
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableTitle(bool $a_enabletitle)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
enable(string $a_module_name)
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ILIAS\Repository\ctrl(), ilTableGUI\enable(), ilBuddySystem\getInstance(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), getType(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), ILIAS\Repository\refinery(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), ilTable2GUI\setTitle(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ applySortation()

ilRepositoryUserResultTableGUI::applySortation ( array  $set)
protected

Definition at line 378 of file class.ilRepositoryUserResultTableGUI.php.

378 : array
379 {
380 $sort = $this->getCurrentSortation();
381
382 if ($sort === 'relevance') {
383 usort($set, function ($a, $b) {
384 return $b['relevance'] <=> $a['relevance'];
385 });
386 return $set;
387 }
388
389 if (str_ends_with($sort, '_asc')) {
390 $col = substr($sort, 0, -4);
391 usort($set, function ($a, $b) use ($col) {
392 return [$a[$col], $b['relevance'] ?? ''] <=> [$b[$col], $a['relevance'] ?? ''];
393 });
394 } elseif (str_ends_with($sort, '_desc')) {
395 $col = substr($sort, 0, -5);
396 usort($set, function ($a, $b) use ($col) {
397 return [$b[$col], $b['relevance'] ?? ''] <=> [$a[$col], $a['relevance'] ?? ''];
398 });
399 }
400
401 return $set;
402 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, and getCurrentSortation().

Referenced by parseUserIds().

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

◆ fillRow()

ilRepositoryUserResultTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

Definition at line 167 of file class.ilRepositoryUserResultTableGUI.php.

167 : void
168 {
169 $this->tpl->setVariable("VAL_ID", $a_set["usr_id"]);
170
171 $link = '';
172 if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
173 $link = ilUserUtil::getProfileLink((int) $a_set['usr_id']);
174 if ($link) {
175 $this->tpl->setVariable('IMG_LINKED_TO_PROFILE', $link);
176 $this->tpl->setVariable(
177 'USR_IMG_SRC_LINKED',
178 ilObjUser::_getPersonalPicturePath((int) $a_set['usr_id'], 'xsmall')
179 );
180 } else {
181 $this->tpl->setVariable(
182 'USR_IMG_SRC',
183 ilObjUser::_getPersonalPicturePath((int) $a_set['usr_id'], 'xsmall')
184 );
185 }
186 }
187
188
189 foreach ($this->getSelectedColumns() as $field) {
190 switch ($field) {
191 case 'gender':
192 $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
193 $this->tpl->setCurrentBlock('custom_fields');
194 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
195 $this->tpl->parseCurrentBlock();
196 break;
197
198 case 'birthday':
199 $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date');
200 $this->tpl->setCurrentBlock('custom_fields');
201 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
202 $this->tpl->parseCurrentBlock();
203 break;
204
205 case 'access_until':
206 $this->tpl->setCurrentBlock('custom_fields');
207 $this->tpl->setVariable('CUST_CLASS', ' ' . $a_set['access_class']);
208 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
209 $this->tpl->parseCurrentBlock();
210 break;
211
212 case 'last_login':
213 $a_set['last_login'] = $a_set['last_login'] ? ilDatePresentation::formatDate(new ilDateTime($a_set['last_login'], IL_CAL_DATETIME)) : $this->lng->txt('no_date');
214 $this->tpl->setCurrentBlock('custom_fields');
215 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
216 $this->tpl->parseCurrentBlock();
217 break;
218
219 case 'interests_general':
220 case 'interests_help_offered':
221 case 'interests_help_looking':
222 $this->tpl->setCurrentBlock('custom_fields');
223 $this->tpl->setVariable('VAL_CUST', implode(', ', (array) $a_set[$field]));
224 $this->tpl->parseCurrentBlock();
225 break;
226
227 case 'org_units':
228 $this->tpl->setCurrentBlock('custom_fields');
229 $this->tpl->setVariable(
230 'VAL_CUST',
231 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $a_set['usr_id'])
232 );
233 $this->tpl->parseCurrentBlock();
234 break;
235
236
237 case 'login':
238 if ($this->admin_mode) {
239 $this->ctrl->setParameterByClass("ilobjusergui", "ref_id", "7");
240 $this->ctrl->setParameterByClass("ilobjusergui", "obj_id", $a_set["usr_id"]);
241 $this->ctrl->setParameterByClass("ilobjusergui", "search", "1");
242 $link = $this->ctrl->getLinkTargetByClass(array("iladministrationgui", "ilobjusergui"), "view");
243 $a_set[$field] = "<a href=\"" . $link . "\">" . $a_set[$field] . "</a>";
244 } elseif ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
245 $a_set[$field] = "<a href=\"" . $link . "\">" . $a_set[$field] . "</a>";
246 }
247 // fallthrough
248
249 // no break
250 default:
251 $this->tpl->setCurrentBlock('custom_fields');
252 $this->tpl->setVariable('VAL_CUST', (string) ($a_set[$field] ?: ''));
253 $this->tpl->parseCurrentBlock();
254 break;
255 }
256 }
257
258 if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
259 if (ilBuddySystem::getInstance()->isEnabled() && $a_set['usr_id'] != $this->user->getId()) {
260 $this->tpl->setVariable('CONTACT_ACTIONS', ilBuddySystemLinkButton::getInstanceByUserId((int) $a_set['usr_id'])->getHtml());
261 } else {
262 $this->tpl->setVariable('CONTACT_ACTIONS', '');
263 }
264 }
265 }
const IL_CAL_DATE
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Class for single dates.
static _getPersonalPicturePath(int $a_usr_id, string $a_size='small', bool $a_force_pic=false)
static getProfileLink(int $a_usr_id)
Get link to personal profile Return empty string in case of not public profile.

References ilObjUser\_getPersonalPicturePath(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilBuddySystem\getInstance(), ilBuddySystemLinkButton\getInstanceByUserId(), ilUserUtil\getProfileLink(), ilTable2GUI\getSelectedColumns(), getType(), IL_CAL_DATE, IL_CAL_DATETIME, ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getDefaultSortation()

ilRepositoryUserResultTableGUI::getDefaultSortation ( )
protected

Definition at line 421 of file class.ilRepositoryUserResultTableGUI.php.

421 : string
422 {
423 $lucene_enabled = ($this->getType() == self::TYPE_GLOBAL_SEARCH) &&
424 ($this->getLuceneResult() instanceof ilLuceneSearchResult);
425 return $lucene_enabled ? 'relevance' : 'login_asc';
426 }
Search result implementing iterator interface.

References getLuceneResult(), getType(), and TYPE_GLOBAL_SEARCH.

+ Here is the call graph for this function:

◆ getHTML()

ilRepositoryUserResultTableGUI::getHTML ( )

Get HTML.

Reimplemented from ilTable2GUI.

Definition at line 369 of file class.ilRepositoryUserResultTableGUI.php.

369 : string
370 {
371 $html = parent::getHTML();
372 if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
373 $html = $this->ui->renderer()->render($this->buildSortationViewControl()) . $html;
374 }
375 return $html;
376 }

References buildSortationViewControl(), getType(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getLuceneResult()

ilRepositoryUserResultTableGUI::getLuceneResult ( )

Definition at line 123 of file class.ilRepositoryUserResultTableGUI.php.

References $lucene_result.

Referenced by getDefaultSortation(), and parseUserIds().

+ Here is the caller graph for this function:

◆ getPossibleSortations()

ilRepositoryUserResultTableGUI::getPossibleSortations ( )
protected

Definition at line 404 of file class.ilRepositoryUserResultTableGUI.php.

404 : array
405 {
406 $sorts = ['relevance' => $this->lng->txt('search_sort_relevance')];
407 $all_cols = $this->getSelectableColumns();
408 foreach ($this->getSelectedColumns() as $col) {
409 $sorts[$col . '_asc'] = sprintf(
410 $this->lng->txt('search_sort_generic_asc'),
411 $all_cols[$col]['txt']
412 );
413 $sorts[$col . '_desc'] = sprintf(
414 $this->lng->txt('search_sort_generic_desc'),
415 $all_cols[$col]['txt']
416 );
417 }
418 return $sorts;
419 }

References getSelectableColumns(), ilTable2GUI\getSelectedColumns(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getSelectableColumns()

ilRepositoryUserResultTableGUI::getSelectableColumns ( )
Returns
array

Reimplemented from ilTable2GUI.

Definition at line 141 of file class.ilRepositoryUserResultTableGUI.php.

141 : array
142 {
143 if (!self::$all_selectable_cols) {
144 $columns = ilUserSearchOptions::getSelectableColumnInfo($this->review->isAssigned($this->user->getId(), SYSTEM_ROLE_ID));
145
146 if ($this->admin_mode) {
147 // #11293
148 $columns['access_until'] = array('txt' => $this->lng->txt('access_until'));
149 $columns['last_login'] = array('txt' => $this->lng->txt('last_login'));
150 }
151
152 self::$all_selectable_cols = $columns;
153 }
155 }
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
const SYSTEM_ROLE_ID
Definition: constants.php:29

References $all_selectable_cols, ilUserSearchOptions\getSelectableColumnInfo(), ILIAS\Repository\lng(), and SYSTEM_ROLE_ID.

Referenced by __construct(), and getPossibleSortations().

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

◆ getType()

ilRepositoryUserResultTableGUI::getType ( )

Definition at line 113 of file class.ilRepositoryUserResultTableGUI.php.

References $type.

Referenced by __construct(), fillRow(), getDefaultSortation(), getHTML(), and parseUserIds().

+ Here is the caller graph for this function:

◆ getUserLimitations()

ilRepositoryUserResultTableGUI::getUserLimitations ( )

Definition at line 133 of file class.ilRepositoryUserResultTableGUI.php.

References $user_limitations.

Referenced by parseUserIds().

+ Here is the caller graph for this function:

◆ initMultiCommands()

ilRepositoryUserResultTableGUI::initMultiCommands ( array  $a_commands)

Definition at line 157 of file class.ilRepositoryUserResultTableGUI.php.

157 : bool
158 {
159 if (!count($a_commands)) {
160 $this->addMultiCommand('addUser', $this->lng->txt('btn_add'));
161 return true;
162 }
163 $this->addMultiItemSelectionButton('member_type', $a_commands, 'addUser', $this->lng->txt('btn_add'));
164 return true;
165 }
addMultiCommand(string $a_cmd, string $a_text)
addMultiItemSelectionButton(string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')

References ilTable2GUI\addMultiCommand(), ilTable2GUI\addMultiItemSelectionButton(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ parseUserIds()

ilRepositoryUserResultTableGUI::parseUserIds ( array  $a_user_ids)

Definition at line 267 of file class.ilRepositoryUserResultTableGUI.php.

267 : bool
268 {
269 if (!$a_user_ids) {
270 $this->setData(array());
271 return true;
272 }
273
274 $additional_fields = $this->getSelectedColumns();
275
276 $parse_access = false;
277 if (isset($additional_fields['access_until'])) {
278 $parse_access = true;
279 unset($additional_fields['access_until']);
280 }
281
282 $udf_ids = $usr_data_fields = $odf_ids = array();
283 foreach ($additional_fields as $field) {
284 if ($field == 'org_units') {
285 continue;
286 }
287 if (substr($field, 0, 3) == 'udf') {
288 $udf_ids[] = substr($field, 4);
289 continue;
290 }
291 $usr_data_fields[] = $field;
292 }
293
294 $u_query = new ilUserQuery();
295 $u_query->setOrderField('login');
296 $u_query->setOrderDirection('ASC');
297 $u_query->setLimit(999999);
298
299 if (!ilSearchSettings::getInstance()->isInactiveUserVisible() && $this->getUserLimitations()) {
300 $u_query->setActionFilter("active");
301 }
302
303 if (!ilSearchSettings::getInstance()->isLimitedUserVisible() && $this->getUserLimitations()) {
304 $u_query->setAccessFilter(true);
305 }
306
307 $u_query->setAdditionalFields($usr_data_fields);
308 $u_query->setUserFilter($a_user_ids);
309
310 $usr_data = $u_query->query();
311
312
313 if ($this->admin_mode && $parse_access) {
314 // see ilUserTableGUI
315 $current_time = time();
316 foreach ($usr_data['set'] as $k => $user) {
317 if ($user['active']) {
318 if ($user["time_limit_unlimited"]) {
319 $txt_access = $this->lng->txt("access_unlimited");
320 $usr_data["set"][$k]["access_class"] = "smallgreen";
321 } elseif ($user["time_limit_until"] < $current_time) {
322 $txt_access = $this->lng->txt("access_expired");
323 $usr_data["set"][$k]["access_class"] = "smallred";
324 } else {
325 $txt_access = ilDatePresentation::formatDate(new ilDateTime($user["time_limit_until"], IL_CAL_UNIX));
326 $usr_data["set"][$k]["access_class"] = "small";
327 }
328 } else {
329 $txt_access = $this->lng->txt("inactive");
330 $usr_data["set"][$k]["access_class"] = "smallred";
331 }
332 $usr_data["set"][$k]["access_until"] = $txt_access;
333 }
334 }
335
336 // Custom user data fields
337 if ($udf_ids) {
338 $users = array();
339 $counter = 0;
340 foreach ($usr_data['set'] as $set) {
341 $users[$counter] = $set;
342 if ((int) ($set['usr_id'] ?? 0) === 0) {
343 continue;
344 }
345 $data = $this->profile->getDataFor((int) $set['usr_id']);
346 foreach ($udf_ids as $udf_field) {
347 $users[$counter]['udf_' . $udf_field] = $data->getAdditionalFieldByIdentifier($udf_field);
348 }
349 ++$counter;
350 }
351 } else {
352 $users = $usr_data['set'];
353 }
354
355 if ($this->getType() == self::TYPE_GLOBAL_SEARCH) {
356 if ($this->getLuceneResult() instanceof ilLuceneSearchResult) {
357 foreach ($users as $counter => $ud) {
358 $users[$counter]['relevance'] = $this->getLuceneResult()->getRelevance((int) ($ud['usr_id']) ?? 0);
359 }
360 }
361 }
362 if ($this->getType() === self::TYPE_GLOBAL_SEARCH) {
363 $users = $this->applySortation($users);
364 }
365 $this->setData($users);
366 return true;
367 }
const IL_CAL_UNIX
setData(array $a_data)
Set table data.
User query class.
$counter

References $counter, ilTableGUI\$data, $user, applySortation(), ilDatePresentation\formatDate(), ilSearchSettings\getInstance(), getLuceneResult(), ilTable2GUI\getSelectedColumns(), getType(), getUserLimitations(), IL_CAL_UNIX, ILIAS\Repository\lng(), ILIAS\Repository\profile(), and ilTable2GUI\setData().

+ Here is the call graph for this function:

◆ setLuceneResult()

ilRepositoryUserResultTableGUI::setLuceneResult ( ilLuceneSearchResult  $res)

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

118 : void
119 {
120 $this->lucene_result = $res;
121 }
$res
Definition: ltiservices.php:69

References $res.

◆ setUserLimitations()

ilRepositoryUserResultTableGUI::setUserLimitations ( bool  $a_limitations)

Definition at line 128 of file class.ilRepositoryUserResultTableGUI.php.

128 : void
129 {
130 $this->user_limitations = $a_limitations;
131 }

Field Documentation

◆ $admin_mode

bool ilRepositoryUserResultTableGUI::$admin_mode
protected

Definition at line 47 of file class.ilRepositoryUserResultTableGUI.php.

◆ $all_selectable_cols

array ilRepositoryUserResultTableGUI::$all_selectable_cols = []
staticprotected

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

Referenced by getSelectableColumns().

◆ $http

HTTP ilRepositoryUserResultTableGUI::$http
protected

Definition at line 55 of file class.ilRepositoryUserResultTableGUI.php.

◆ $lucene_result

ilLuceneSearchResult ilRepositoryUserResultTableGUI::$lucene_result = null
private

Definition at line 44 of file class.ilRepositoryUserResultTableGUI.php.

Referenced by getLuceneResult().

◆ $profile

Profile ilRepositoryUserResultTableGUI::$profile
protected

Definition at line 51 of file class.ilRepositoryUserResultTableGUI.php.

◆ $refinery

Refinery ilRepositoryUserResultTableGUI::$refinery
protected

Definition at line 56 of file class.ilRepositoryUserResultTableGUI.php.

◆ $review

ilRbacReview ilRepositoryUserResultTableGUI::$review
protected

Definition at line 53 of file class.ilRepositoryUserResultTableGUI.php.

◆ $type

int ilRepositoryUserResultTableGUI::$type
protected

Definition at line 48 of file class.ilRepositoryUserResultTableGUI.php.

Referenced by getType().

◆ $ui

UIServices ilRepositoryUserResultTableGUI::$ui
protected

Definition at line 54 of file class.ilRepositoryUserResultTableGUI.php.

◆ $user

ilObjUser ilRepositoryUserResultTableGUI::$user
protected

Definition at line 52 of file class.ilRepositoryUserResultTableGUI.php.

Referenced by parseUserIds().

◆ $user_limitations

bool ilRepositoryUserResultTableGUI::$user_limitations = true
protected

Definition at line 49 of file class.ilRepositoryUserResultTableGUI.php.

Referenced by getUserLimitations().

◆ TYPE_GLOBAL_SEARCH

const ilRepositoryUserResultTableGUI::TYPE_GLOBAL_SEARCH = 2

◆ TYPE_STANDARD

const ilRepositoryUserResultTableGUI::TYPE_STANDARD = 1

Definition at line 41 of file class.ilRepositoryUserResultTableGUI.php.


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