ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilUserTableGUI Class Reference

TableGUI class for user administration. More...

+ Inheritance diagram for ilUserTableGUI:
+ Collaboration diagram for ilUserTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $a_mode=self::MODE_USER_FOLDER, $a_load_items=true)
 Constructor. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 getItems ()
 Get user items. More...
 
 getUserIdsForFilter ()
 
 initFilter ()
 Init filter. More...
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 Constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname)
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate (&$a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($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) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Data Fields

const MODE_USER_FOLDER = 1
 
const MODE_LOCAL_USER = 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 EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Protected Member Functions

 setMode ($a_mode)
 
 getMode ()
 
 getUserFolderId ()
 
 fillRow ($user)
 Fill table row. More...
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel ($worksheet, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel ($a_worksheet, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Private Attributes

 $mode = null
 
 $user_folder_id = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 
- Protected Attributes inherited from ilTable2GUI
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = null
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 

Detailed Description

TableGUI class for user administration.

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

ilUserTableGUI: ilFormPropertyDispatchGUI

Definition at line 15 of file class.ilUserTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_mode = self::MODE_USER_FOLDER,
  $a_load_items = true 
)

Constructor.

Definition at line 26 of file class.ilUserTableGUI.php.

References $cmd, $ilCtrl, $lng, ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), getItems(), getMode(), ilTable2GUI\getSelectedColumns(), getUserFolderId(), initFilter(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableAllCommand(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), setMode(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), and ilTable2GUI\setTopCommands().

27  {
28  global $ilCtrl, $lng, $ilAccess, $lng, $rbacsystem;
29 
30  $this->user_folder_id = $a_parent_obj->object->getRefId();
31 
32  $this->setMode($a_mode);
33  $this->setId("user".$this->getUserFolderId());
34 
35  parent::__construct($a_parent_obj, $a_parent_cmd);
36 // $this->setTitle($this->lng->txt("users"));
37 
38  $this->addColumn("", "", "1", true);
39  $this->addColumn($this->lng->txt("login"), "login");
40 
41  foreach ($this->getSelectedColumns() as $c)
42  {
43  $this->addColumn($this->lng->txt($c), $c);
44  }
45 
46  if($this->getMode() == self::MODE_LOCAL_USER)
47  {
48  $this->addColumn($this->lng->txt('context'),'time_limit_owner');
49  $this->addColumn($this->lng->txt('role_assignment'));
50  }
51 
52  $this->setShowRowsSelector(true);
53  $this->setExternalSorting(true);
54  $this->setExternalSegmentation(true);
55  $this->setEnableHeader(true);
56  $this->setFormAction($ilCtrl->getFormAction($this->parent_obj, "applyFilter"));
57  $this->setRowTemplate("tpl.user_list_row.html", "Services/User");
58  //$this->disable("footer");
59  $this->setEnableTitle(true);
60  $this->initFilter();
61  $this->setFilterCommand("applyFilter");
62  $this->setDefaultOrderField("login");
63  $this->setDefaultOrderDirection("asc");
64 
65  $this->setSelectAllCheckbox("id[]");
66  $this->setTopCommands(true);
67 
68 
69  if($this->getMode() == self::MODE_USER_FOLDER)
70  {
71  $this->setEnableAllCommand(true);
72 
73  $cmds = $a_parent_obj->getUserMultiCommands();
74  foreach($cmds as $cmd => $caption)
75  {
76  $this->addMultiCommand($cmd, $caption);
77  }
78  }
79  else
80  {
81  $this->addMultiCommand("deleteUsers", $lng->txt("delete"));
82  }
83 
84  if($a_load_items)
85  {
86  $this->getItems();
87  }
88  }
setExternalSorting($a_val)
Set external sorting.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExternalSegmentation($a_val)
Set external segmentation.
$cmd
Definition: sahs_server.php:35
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
initFilter()
Init filter.
addMultiCommand($a_cmd, $a_text)
Add Command button.
getSelectedColumns()
Get selected columns.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $lng
Definition: privfeed.php:40
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
getItems()
Get user items.
setFilterCommand($a_val, $a_caption=null)
Set filter command.
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilUserTableGUI::fillRow (   $user)
protected

Fill table row.

Definition at line 499 of file class.ilUserTableGUI.php.

References $_GET, $ilCtrl, $lng, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), getMode(), ilTable2GUI\getParentObject(), ilTable2GUI\getSelectedColumns(), getUserFolderId(), IL_CAL_DATE, and IL_CAL_DATETIME.

500  {
501  global $ilCtrl, $lng;
502 
503  $ilCtrl->setParameterByClass("ilobjusergui", "letter", $_GET["letter"]);
504 
505  foreach ($this->getSelectedColumns() as $c)
506  {
507  if ($c == "access_until")
508  {
509  $this->tpl->setCurrentBlock("access_until");
510  $this->tpl->setVariable("VAL_ACCESS_UNTIL", $user["access_until"]);
511  $this->tpl->setVariable("CLASS_ACCESS_UNTIL", $user["access_class"]);
512  }
513  else if ($c == "last_login")
514  {
515  $this->tpl->setCurrentBlock("last_login");
516  $this->tpl->setVariable("VAL_LAST_LOGIN",
517  ilDatePresentation::formatDate(new ilDateTime($user['last_login'],IL_CAL_DATETIME)));
518  }
519  else if (in_array($c, array("firstname", "lastname")))
520  {
521  $this->tpl->setCurrentBlock($c);
522  $this->tpl->setVariable("VAL_".strtoupper($c), (string) $user[$c]);
523  }
524  else // all other fields
525  {
526  $this->tpl->setCurrentBlock("user_field");
527  $val = (trim($user[$c]) == "")
528  ? " "
529  : $user[$c];
530 
531  if ($user[$c] != "")
532  {
533  switch ($c)
534  {
535  case "birthday":
537  break;
538 
539  case "gender":
540  $val = $lng->txt("gender_".$user[$c]);
541  break;
542 
543  case "create_date":
544  case "agree_date":
545  case "approve_date":
546  // $val = ilDatePresentation::formatDate(new ilDateTime($val,IL_CAL_DATETIME));
548  break;
549  }
550  }
551  $this->tpl->setVariable("VAL_UF", $val);
552  }
553 
554  $this->tpl->parseCurrentBlock();
555  }
556 
557  if ($user["usr_id"] != 6)
558  {
559  if($this->getMode() == self::MODE_USER_FOLDER or $user['time_limit_owner'] == $this->getUserFolderId())
560  {
561  $this->tpl->setCurrentBlock("checkb");
562  $this->tpl->setVariable("ID", $user["usr_id"]);
563  $this->tpl->parseCurrentBlock();
564  }
565  }
566 
567  if($this->getMode() == self::MODE_USER_FOLDER or $user['time_limit_owner'] == $this->getUserFolderId())
568  {
569  $this->tpl->setVariable("VAL_LOGIN", $user["login"]);
570  $ilCtrl->setParameterByClass("ilobjusergui", "obj_id", $user["usr_id"]);
571  $this->tpl->setVariable("HREF_LOGIN",
572  $ilCtrl->getLinkTargetByClass("ilobjusergui", "view"));
573  $ilCtrl->setParameterByClass("ilobjusergui", "obj_id", "");
574  }
575  else
576  {
577  $this->tpl->setVariable('VAL_LOGIN_PLAIN',$user['login']);
578  }
579 
580  if($this->getMode() == self::MODE_LOCAL_USER)
581  {
582  $this->tpl->setCurrentBlock('context');
583  $this->tpl->setVariable('VAL_CONTEXT',(string)ilObject::_lookupTitle(ilObject::_lookupObjId($user['time_limit_owner'])));
584  $this->tpl->parseCurrentBlock();
585 
586  $this->tpl->setCurrentBlock('roles');
587  $ilCtrl->setParameter($this->getParentObject(),'obj_id',$user['usr_id']);
588  $this->tpl->setVariable('ROLE_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),'assignRoles'));
589  $this->tpl->setVariable('TXT_ROLES',$this->lng->txt('edit'));
590  $ilCtrl->clearParameters($this->getParentObject());
591  $this->tpl->parseCurrentBlock();
592 
593  }
594  }
const IL_CAL_DATETIME
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
Class for single dates.
static _lookupObjId($a_id)
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
getSelectedColumns()
Get selected columns.
const IL_CAL_DATE
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getItems()

ilUserTableGUI::getItems ( )

Get user items.

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

References $_GET, $lng, $query, ilLocalUser\_getFolderIds(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getLimit(), getMode(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getSelectedColumns(), IL_CAL_UNIX, ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), and ilUtil\stripSlashes().

Referenced by __construct().

191  {
192  global $lng;
193 //if ($GLOBALS["kk"]++ == 1) nj();
194 
195  $this->determineOffsetAndOrder();
196 
197  if($this->getMode() == self::MODE_USER_FOLDER)
198  {
199  // All accessible users
200  include_once './Services/User/classes/class.ilLocalUser.php';
201  $user_filter = ilLocalUser::_getFolderIds();
202  }
203  else
204  {
205  if($this->filter['time_limit_owner'])
206  {
207  $user_filter = array($this->filter['time_limit_owner']);
208  }
209  else
210  {
211  // All accessible users
212  include_once './Services/User/classes/class.ilLocalUser.php';
213  $user_filter = ilLocalUser::_getFolderIds();
214  }
215  }
216 
217  //#13221 don't show all users if user filter is empty!
218  if(!count($user_filter))
219  {
220  $this->setMaxCount(0);
221  $this->setData(array());
222  return;
223  }
224 
225  include_once("./Services/User/classes/class.ilUserQuery.php");
226 
227  $additional_fields = $this->getSelectedColumns();
228  unset($additional_fields["firstname"]);
229  unset($additional_fields["lastname"]);
230  unset($additional_fields["email"]);
231  unset($additional_fields["last_login"]);
232  unset($additional_fields["access_until"]);
233 
234  $query = new ilUserQuery();
235  $query->setOrderField($this->getOrderField());
236  $query->setOrderDirection($this->getOrderDirection());
237  $query->setOffset($this->getOffset());
238  $query->setLimit($this->getLimit());
239  $query->setTextFilter($this->filter['query']);
240  $query->setActionFilter($this->filter['activation']);
241  $query->setLastLogin($this->filter['last_login']);
242  $query->setLimitedAccessFilter($this->filter['limited_access']);
243  $query->setNoCourseFilter($this->filter['no_courses']);
244  $query->setNoGroupFilter($this->filter['no_groups']);
245  $query->setCourseGroupFilter($this->filter['course_group']);
246  $query->setRoleFilter($this->filter['global_role']);
247  $query->setAdditionalFields($additional_fields);
248  $query->setUserFolder($user_filter);
249  $query->setFirstLetterLastname(ilUtil::stripSlashes($_GET['letter']));
250 
251  $usr_data = $query->query();
252 
253 
254  if (count($usr_data["set"]) == 0 && $this->getOffset() > 0)
255  {
256  $this->resetOffset();
257  $query->setOffset($this->getOffset());
258  $usr_data = $query->query();
259  }
260 
261  foreach ($usr_data["set"] as $k => $user)
262  {
263  $current_time = time();
264  if ($user['active'])
265  {
266  if ($user["time_limit_unlimited"])
267  {
268  $txt_access = $lng->txt("access_unlimited");
269  $usr_data["set"][$k]["access_class"] = "smallgreen";
270  }
271  elseif ($user["time_limit_until"] < $current_time)
272  {
273  $txt_access = $lng->txt("access_expired");
274  $usr_data["set"][$k]["access_class"] = "smallred";
275  }
276  else
277  {
278  $txt_access = ilDatePresentation::formatDate(new ilDateTime($user["time_limit_until"],IL_CAL_UNIX));
279  $usr_data["set"][$k]["access_class"] = "small";
280  }
281  }
282  else
283  {
284  $txt_access = $lng->txt("inactive");
285  $usr_data["set"][$k]["access_class"] = "smallred";
286  }
287  $usr_data["set"][$k]["access_until"] = $txt_access;
288  }
289 
290  $this->setMaxCount($usr_data["cnt"]);
291  $this->setData($usr_data["set"]);
292  }
User query class.
$_GET["client_id"]
resetOffset($a_in_determination=false)
Reset offset.
const IL_CAL_UNIX
getOrderDirection()
Get order direction.
getOffset()
Get offset.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
getSelectedColumns()
Get selected columns.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
global $lng
Definition: privfeed.php:40
getLimit()
Get limit.
static _getFolderIds()
setMaxCount($a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMode()

ilUserTableGUI::getMode ( )
protected

Definition at line 95 of file class.ilUserTableGUI.php.

References $mode.

Referenced by __construct(), fillRow(), getItems(), getSelectableColumns(), getUserIdsForFilter(), and initFilter().

96  {
97  return $this->mode;
98  }
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilUserTableGUI::getSelectableColumns ( )

Get selectable columns.

Parameters

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

References $lng, and getMode().

114  {
115  global $lng;
116 
117  include_once("./Services/User/classes/class.ilUserProfile.php");
118  $up = new ilUserProfile();
119  $up->skipGroup("preferences");
120  $up->skipGroup("interests");
121  $up->skipGroup("settings");
122 
123  // default fields
124  $cols = array();
125 
126  // first and last name cannot be hidden
127  $cols["firstname"] = array(
128  "txt" => $lng->txt("firstname"),
129  "default" => true);
130  $cols["lastname"] = array(
131  "txt" => $lng->txt("lastname"),
132  "default" => true);
133 
134  if($this->getMode() == self::MODE_USER_FOLDER)
135  {
136  $ufs = $up->getStandardFields();
137 
138  $cols["access_until"] = array(
139  "txt" => $lng->txt("access_until"),
140  "default" => true);
141  $cols["last_login"] = array(
142  "txt" => $lng->txt("last_login"),
143  "default" => true);
144 
145  // #13967
146  $cols["create_date"] = array(
147  "txt" => $lng->txt("create_date"));
148  $cols["approve_date"] = array(
149  "txt" => $lng->txt("approve_date"));
150  $cols["agree_date"] = array(
151  "txt" => $lng->txt("agree_date"));
152  }
153  else
154  {
155  $ufs = $up->getLocalUserAdministrationFields();
156  }
157 
158  // email should be the 1st "optional" field (can be hidden)
159  if(isset($ufs["email"]))
160  {
161  $cols["email"] = array(
162  "txt" => $lng->txt("email"),
163  "default" => true);
164  }
165 
166  // other user profile fields
167  foreach ($ufs as $f => $fd)
168  {
169  if (!isset($cols[$f]) && !$fd["lists_hide"])
170  {
171  // #18795
172  $caption = $fd["lang_var"]
173  ? $fd["lang_var"]
174  : $f;
175  $cols[$f] = array(
176  "txt" => $lng->txt($caption),
177  "default" => false);
178  }
179  }
180 
181  // fields that are always shown
182  unset($cols["username"]);
183 
184  return $cols;
185  }
Class ilUserProfile.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getUserFolderId()

ilUserTableGUI::getUserFolderId ( )
protected

Definition at line 100 of file class.ilUserTableGUI.php.

References $user_folder_id.

Referenced by __construct(), fillRow(), and initFilter().

101  {
102  return $this->user_folder_id;
103  }
+ Here is the caller graph for this function:

◆ getUserIdsForFilter()

ilUserTableGUI::getUserIdsForFilter ( )

Definition at line 294 of file class.ilUserTableGUI.php.

References $_GET, $query, ilLocalUser\_getFolderIds(), getMode(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), and ilUtil\stripSlashes().

295  {
296  if($this->getMode() == self::MODE_USER_FOLDER)
297  {
298  // All accessible users
299  include_once './Services/User/classes/class.ilLocalUser.php';
300  $user_filter = ilLocalUser::_getFolderIds();
301  }
302  else
303  {
304  if($this->filter['time_limit_owner'])
305  {
306  $user_filter = array($this->filter['time_limit_owner']);
307  }
308  else
309  {
310  // All accessible users
311  include_once './Services/User/classes/class.ilLocalUser.php';
312  $user_filter = ilLocalUser::_getFolderIds();
313  }
314  }
315 
316  include_once("./Services/User/classes/class.ilUserQuery.php");
317  $query = new ilUserQuery();
318  $query->setOffset(0);
319  $query->setLimit(self::getAllCommandLimit());
320  $query->setTextFilter($this->filter['query']);
321  $query->setActionFilter($this->filter['activation']);
322  $query->setLastLogin($this->filter['last_login']);
323  $query->setLimitedAccessFilter($this->filter['limited_access']);
324  $query->setNoCourseFilter($this->filter['no_courses']);
325  $query->setNoGroupFilter($this->filter['no_groups']);
326  $query->setCourseGroupFilter($this->filter['course_group']);
327  $query->setRoleFilter($this->filter['global_role']);
328  $query->setUserFolder($user_filter);
329  $query->setFirstLetterLastname(ilUtil::stripSlashes($_GET['letter']));
330 
331  if($this->getOrderField())
332  {
333  $query->setOrderField(ilUtil::stripSlashes($this->getOrderField()));
334  $query->setOrderDirection(ilUtil::stripSlashes($this->getOrderDirection()));
335  }
336 
337  $usr_data = $query->query();
338 
339  $user_ids = array();
340  foreach($usr_data["set"] as $item)
341  {
342  // #11632
343  if($item["usr_id"] != SYSTEM_USER_ID)
344  {
345  $user_ids[] = $item["usr_id"];
346  }
347  }
348  return $user_ids;
349  }
User query class.
$_GET["client_id"]
getOrderDirection()
Get order direction.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _getFolderIds()
+ Here is the call graph for this function:

◆ initFilter()

ilUserTableGUI::initFilter ( )

Init filter.

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

References $ilCtrl, $ilUser, $lng, $options, $ref_id, $si, ilLocalUser\_getFolderIds(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilTable2GUI\addFilterItem(), getMode(), getUserFolderId(), IL_CAL_DAY, IL_CAL_UNIX, ilTextInputGUI\setDataSource(), ilDateTimeInputGUI\setDate(), ilSelectInputGUI\setOptions(), ilRepositorySelectorInputGUI\setSelectText(), and USER_FOLDER_ID.

Referenced by __construct().

356  {
357  global $lng, $rbacreview, $ilUser, $ilCtrl;
358 
359 
360  // Show context filter
361  if($this->getMode() == self::MODE_LOCAL_USER)
362  {
363  include_once './Services/User/classes/class.ilLocalUser.php';
364  $parent_ids = ilLocalUser::_getFolderIds();
365 
366  if(count($parent_ids) > 1)
367  {
368  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
369  $co = new ilSelectInputGUI($lng->txt('context'),'time_limit_owner');
370 
371  $ref_id = $this->getUserFolderId();
372 
373  $opt[0] = $this->lng->txt('all_users');
374  $opt[$this->getUserFolderId()] = $lng->txt('users').' ('.ilObject::_lookupTitle(ilObject::_lookupObjId($this->getUserFolderId())).')';
375 
376  foreach($parent_ids as $parent_id)
377  {
378  if($parent_id == $this->getUserFolderId())
379  {
380  continue;
381  }
382  switch($parent_id)
383  {
384  case USER_FOLDER_ID:
385  $opt[USER_FOLDER_ID] = $lng->txt('global_user');
386  break;
387 
388  default:
389  $opt[$parent_id] = $lng->txt('users').' ('.ilObject::_lookupTitle(ilObject::_lookupObjId($parent_id)).')';
390  break;
391  }
392  }
393  $co->setOptions($opt);
394  $this->addFilterItem($co);
395  $co->readFromSession();
396  $this->filter['time_limit_owner'] = $co->getValue();
397  }
398  }
399 
400  // User name, login, email filter
401  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
402  $ul = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".
403  $lng->txt("name"), "query");
404  $ul->setDataSource($ilCtrl->getLinkTarget($this->getParentObject(),
405  "addUserAutoComplete", "", true));
406  $ul->setSize(20);
407  $ul->setSubmitFormOnEnter(true);
408  $this->addFilterItem($ul);
409  $ul->readFromSession();
410  $this->filter["query"] = $ul->getValue();
411 
412  /*
413  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
414  $ti = new ilTextInputGUI($lng->txt("login")."/".$lng->txt("email")."/".$lng->txt("name"), "query");
415  $ti->setMaxLength(64);
416  $ti->setSize(20);
417  $ti->setSubmitFormOnEnter(true);
418  $this->addFilterItem($ti);
419  $ti->readFromSession();
420  $this->filter["query"] = $ti->getValue();
421  */
422 
423  // activation
424  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
425  $options = array(
426  "" => $lng->txt("user_all"),
427  "active" => $lng->txt("active"),
428  "inactive" => $lng->txt("inactive"),
429  );
430  $si = new ilSelectInputGUI($this->lng->txt("user_activation"), "activation");
431  $si->setOptions($options);
432  $this->addFilterItem($si);
433  $si->readFromSession();
434  $this->filter["activation"] = $si->getValue();
435 
436  // limited access
437  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
438  $cb = new ilCheckboxInputGUI($this->lng->txt("user_limited_access"), "limited_access");
439  $this->addFilterItem($cb);
440  $cb->readFromSession();
441  $this->filter["limited_access"] = $cb->getChecked();
442 
443  // last login
444  include_once("./Services/Form/classes/class.ilDateTimeInputGUI.php");
445  $di = new ilDateTimeInputGUI($this->lng->txt("user_last_login_before"), "last_login");
446  $default_date = new ilDateTime(time(),IL_CAL_UNIX);
447  $default_date->increment(IL_CAL_DAY, 1);
448  $di->setDate($default_date);
449  $this->addFilterItem($di);
450  $di->readFromSession();
451  $this->filter["last_login"] = $di->getDate();
452 
453  if($this->getMode() == self::MODE_USER_FOLDER)
454  {
455  // no assigned courses
456  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
457  $cb = new ilCheckboxInputGUI($this->lng->txt("user_no_courses"), "no_courses");
458  $this->addFilterItem($cb);
459  $cb->readFromSession();
460  $this->filter["no_courses"] = $cb->getChecked();
461 
462  // no assigned groups
463  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
464  $ng = new ilCheckboxInputGUI($this->lng->txt("user_no_groups"), "no_groups");
465  $this->addFilterItem($ng);
466  $ng->readFromSession();
467  $this->filter['no_groups'] = $ng->getChecked();
468 
469  // course/group members
470  include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
471  $rs = new ilRepositorySelectorInputGUI($lng->txt("user_member_of_course_group"), "course_group");
472  $rs->setSelectText($lng->txt("user_select_course_group"));
473  $rs->setHeaderMessage($lng->txt("user_please_select_course_group"));
474  $rs->setClickableTypes(array("crs", "grp"));
475  $this->addFilterItem($rs);
476  $rs->readFromSession();
477  $this->filter["course_group"] = $rs->getValue();
478  }
479 
480  // global roles
481  $options = array(
482  "" => $lng->txt("user_any"),
483  );
484  $roles = $rbacreview->getRolesByFilter(2, $ilUser->getId());
485  foreach ($roles as $role)
486  {
487  $options[$role["rol_id"]] = $role["title"];
488  }
489  $si = new ilSelectInputGUI($this->lng->txt("user_global_role"), "global_role");
490  $si->setOptions($options);
491  $this->addFilterItem($si);
492  $si->readFromSession();
493  $this->filter["global_role"] = $si->getValue();
494  }
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
This class represents a selection list property in a property form.
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
const IL_CAL_UNIX
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
This class represents a date/time property in a property form.
global $ilCtrl
Definition: ilias.php:18
const IL_CAL_DAY
if(!is_array($argv)) $options
This class represents a repository selector in a property form.
static _lookupObjId($a_id)
This class represents a text property in a property form.
Date and time handling
setOptions($a_options)
Set Options.
global $ilUser
Definition: imgupload.php:15
$ref_id
Definition: sahs_server.php:39
global $lng
Definition: privfeed.php:40
const USER_FOLDER_ID
Class ilObjUserFolder.
static _getFolderIds()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMode()

ilUserTableGUI::setMode (   $a_mode)
protected

Definition at line 90 of file class.ilUserTableGUI.php.

Referenced by __construct().

91  {
92  $this->mode = $a_mode;
93  }
+ Here is the caller graph for this function:

Field Documentation

◆ $mode

ilUserTableGUI::$mode = null
private

Definition at line 20 of file class.ilUserTableGUI.php.

Referenced by getMode().

◆ $user_folder_id

ilUserTableGUI::$user_folder_id = 0
private

Definition at line 21 of file class.ilUserTableGUI.php.

Referenced by getUserFolderId().

◆ MODE_LOCAL_USER

◆ MODE_USER_FOLDER

const ilUserTableGUI::MODE_USER_FOLDER = 1

Definition at line 17 of file class.ilUserTableGUI.php.

Referenced by ilObjUserFolderGUI\getActionUserIds().


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