ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWaitingListTableGUI Class Reference

GUI class for course/group waiting list. More...

+ Inheritance diagram for ilWaitingListTableGUI:
+ Collaboration diagram for ilWaitingListTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, ilObject $rep_object, ilWaitingList $waiting_list)
 
 setUserIds (array $a_user_ids)
 Set user ids. More...
 
 numericOrdering (string $a_field)
 
 getSelectableColumns ()
 
 readUserData ()
 
 showActionLinks (array $a_set)
 
- 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

 getWaitingList ()
 
 getRepositoryObject ()
 
 fillRow (array $a_set)
 
 checkAcceptance (int $a_usr_id)
 
- 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 $wait = []
 
array $wait_user_ids = []
 
ilObject $rep_object
 
ilObjUser $user
 
ilWaitingList $waiting_list
 
- 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_columns = null
 
static bool $has_odf_definitions
 

Private Attributes

UIRenderer $renderer
 
UIFactory $uiFactory
 

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

GUI class for course/group waiting list.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 29 of file class.ilWaitingListTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWaitingListTableGUI::__construct ( object  $a_parent_obj,
ilObject  $rep_object,
ilWaitingList  $waiting_list 
)

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

References $DIC, $rep_object, $waiting_list, ILIAS\GlobalScreen\Provider\__construct(), ilCourseDefinedFieldDefinition\_hasFields(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTableGUI\enable(), ilTable2GUI\getId(), getRepositoryObject(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ILIAS\Repository\lng(), renderer(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and ILIAS\Repository\user().

46  {
47  global $DIC;
48  $this->renderer = $DIC->ui()->renderer();
49  $this->uiFactory = $DIC->ui()->factory();
50 
51  $this->rep_object = $rep_object;
52  $this->user = $DIC->user();
53 
54  $this->setId('crs_wait_' . $this->getRepositoryObject()->getId());
55  parent::__construct($a_parent_obj, 'participants');
56  $this->setFormName('waiting');
57  $this->setPrefix('waiting');
58 
59  $this->lng->loadLanguageModule('grp');
60  $this->lng->loadLanguageModule('crs');
61  $this->lng->loadLanguageModule('sess');
62  $this->lng->loadLanguageModule('ps');
63 
64  $this->setExternalSorting(false);
65  $this->setExternalSegmentation(true);
66 
67  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'participants'));
68 
69  $this->addColumn('', 'f', "1", true);
70  $this->addColumn($this->lng->txt('name'), 'lastname', '20%');
71 
72  $all_cols = $this->getSelectableColumns();
73  foreach ($this->getSelectedColumns() as $col) {
74  $this->addColumn($all_cols[$col]['txt'], $col);
75  }
76 
77  $this->addColumn($this->lng->txt('application_date'), 'sub_time', "10%");
78  $this->addColumn('', 'mail', '10%');
79 
80  $this->addMultiCommand('confirmAssignFromWaitingList', $this->lng->txt('assign'));
81  $this->addMultiCommand('confirmRefuseFromList', $this->lng->txt('refuse'));
82  $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('crs_mem_send_mail'));
83 
84  $this->setDefaultOrderField('sub_time');
85 
86  // begin-patch clipboard
87  $this->lng->loadLanguageModule('user');
88  $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
89  // end-patch clipboard
90 
91  $this->setPrefix('waiting');
92  $this->setSelectAllCheckbox('waiting', true);
93 
94  $this->setRowTemplate("tpl.show_waiting_list_row.html", "components/ILIAS/Membership");
95 
96  $this->enable('sort');
97  $this->enable('header');
98  $this->enable('numinfo');
99  $this->enable('select_all');
100 
101  $this->waiting_list = $waiting_list;
102 
103  self::$has_odf_definitions = (bool) ilCourseDefinedFieldDefinition::_hasFields($this->getRepositoryObject()->getId());
104  }
enable(string $a_module_name)
setFormAction(string $a_form_action, bool $a_multipart=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
renderer()
setFormName(string $a_name="")
setId(string $a_val)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)
static _hasFields(int $a_container_id)
Check if there are any define fields.
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkAcceptance()

ilWaitingListTableGUI::checkAcceptance ( int  $a_usr_id)
protected

Definition at line 405 of file class.ilWaitingListTableGUI.php.

Referenced by readUserData().

405  : bool
406  {
407  return true;
408  }
+ Here is the caller graph for this function:

◆ fillRow()

ilWaitingListTableGUI::fillRow ( array  $a_set)
protected

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

References ilTableGUI\$prefix, ilObjCourseGrouping\_checkGroupingDependencies(), ilObject\_lookupTitle(), ilDatePresentation\formatDate(), ilObjCourseGrouping\getAssignedObjects(), getRepositoryObject(), ilTable2GUI\getSelectedColumns(), IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\lng(), and showActionLinks().

167  : void
168  {
169  if (
170  !ilObjCourseGrouping::_checkGroupingDependencies($this->getRepositoryObject(), (int) $a_set['usr_id']) &&
172  ) {
173  $prefix = $this->getRepositoryObject()->getType();
174  $this->tpl->setVariable(
175  'ALERT_MSG',
176  sprintf(
177  $this->lng->txt($prefix . '_lim_assigned'),
178  ilObject::_lookupTitle(current($ids))
179  )
180  );
181  }
182 
183  $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
184  $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
185 
186  foreach ($this->getSelectedColumns() as $field) {
187  switch ($field) {
188  case 'gender':
189  $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
190  $this->tpl->setCurrentBlock('custom_fields');
191  $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
192  $this->tpl->parseCurrentBlock();
193  break;
194 
195  case 'birthday':
196  $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate(
197  $a_set['birthday'],
199  )) : $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 'odf_last_update':
206  $this->tpl->setVariable('VAL_CUST', (string) ($a_set['odf_info_txt'] ?? ''));
207  break;
208 
209  case 'org_units':
210  $this->tpl->setCurrentBlock('custom_fields');
211  $this->tpl->setVariable(
212  'VAL_CUST',
213  ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $a_set['usr_id'])
214  );
215  $this->tpl->parseCurrentBlock();
216  break;
217 
218  default:
219  $this->tpl->setCurrentBlock('custom_fields');
220  $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
221  $this->tpl->parseCurrentBlock();
222  break;
223  }
224  }
225  $this->tpl->setVariable(
226  'VAL_SUBTIME',
227  ilDatePresentation::formatDate(new ilDateTime($a_set['sub_time'], IL_CAL_UNIX))
228  );
229  $this->showActionLinks($a_set);
230  }
static _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
const IL_CAL_UNIX
static _lookupTitle(int $obj_id)
const IL_CAL_DATE
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
+ Here is the call graph for this function:

◆ getRepositoryObject()

ilWaitingListTableGUI::getRepositoryObject ( )
protected

Definition at line 111 of file class.ilWaitingListTableGUI.php.

References $rep_object.

Referenced by __construct(), fillRow(), getSelectableColumns(), and readUserData().

111  : ilObject
112  {
113  return $this->rep_object;
114  }
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilWaitingListTableGUI::getSelectableColumns ( )

Definition at line 138 of file class.ilWaitingListTableGUI.php.

References ilExportFieldsInfo\_getInstanceByType(), ilTable2GUI\getId(), getRepositoryObject(), and ILIAS\Repository\lng().

Referenced by __construct().

138  : array
139  {
140  if (self::$all_columns) {
141  return self::$all_columns;
142  }
143 
145  self::$all_columns = $ef->getSelectableFieldsInfo($this->getRepositoryObject()->getId());
146 
147  // #25215
148  if (
149  is_array(self::$all_columns) &&
150  array_key_exists('consultation_hour', self::$all_columns)
151  ) {
152  unset(self::$all_columns['consultation_hour']);
153  }
154 
155  if (
156  !is_array(self::$all_columns) ||
157  !array_key_exists('login', self::$all_columns)
158  ) {
159  self::$all_columns['login'] = [
160  'default' => 1,
161  'txt' => $this->lng->txt('login')
162  ];
163  }
164  return self::$all_columns;
165  }
static _getInstanceByType(string $a_type)
Get Singleton Instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWaitingList()

ilWaitingListTableGUI::getWaitingList ( )
protected

Definition at line 106 of file class.ilWaitingListTableGUI.php.

References $waiting_list.

Referenced by setUserIds().

106  : ilWaitingList
107  {
108  return $this->waiting_list;
109  }
Base class for course and group waiting lists.
+ Here is the caller graph for this function:

◆ numericOrdering()

ilWaitingListTableGUI::numericOrdering ( string  $a_field)

Definition at line 129 of file class.ilWaitingListTableGUI.php.

129  : bool
130  {
131  switch ($a_field) {
132  case 'sub_time':
133  return true;
134  }
135  return parent::numericOrdering($a_field);
136  }

◆ readUserData()

ilWaitingListTableGUI::readUserData ( )

Definition at line 232 of file class.ilWaitingListTableGUI.php.

References ilTableGUI\$data, $GLOBALS, ilCourseUserData\_getValuesByObjId(), ilObjUser\_lookupName(), checkAcceptance(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getExternalSegmentation(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getParentObject(), getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilUserQuery\getUserListData(), IL_CAL_UNIX, ILIAS\Repository\int(), ilUserDefinedData\lookupData(), ilObjectCustomUserFieldHistory\lookupEntriesByObjectId(), null, ilTable2GUI\resetOffset(), ilTable2GUI\setData(), and ilTableGUI\setMaxCount().

232  : void
233  {
234  $this->determineOffsetAndOrder();
235 
236  $additional_fields = $this->getSelectedColumns();
237  unset(
238  $additional_fields["firstname"],
239  $additional_fields["lastname"],
240  $additional_fields["last_login"],
241  $additional_fields["access_until"],
242  $additional_fields['org_units']
243  );
244 
245  $udf_ids = $usr_data_fields = $odf_ids = array();
246  foreach ($additional_fields as $field) {
247  if (strpos($field, 'udf') === 0) {
248  $udf_ids[] = substr($field, 4);
249  continue;
250  }
251  if (strpos($field, 'odf') === 0) {
252  $odf_ids[] = substr($field, 4);
253  continue;
254  }
255 
256  $usr_data_fields[] = $field;
257  }
258 
259  $usr_data = ilUserQuery::getUserListData(
260  $this->getOrderField(),
261  $this->getOrderDirection(),
262  $this->getOffset(),
263  $this->getLimit(),
264  '',
265  '',
266  null,
267  false,
268  false,
269  0,
270  0,
271  null,
272  $usr_data_fields,
273  $this->wait_user_ids
274  );
275  if (0 === count($usr_data['set']) && $this->getOffset() > 0 && $this->getExternalSegmentation()) {
276  $this->resetOffset();
277 
278  $usr_data = ilUserQuery::getUserListData(
279  $this->getOrderField(),
280  $this->getOrderDirection(),
281  $this->getOffset(),
282  $this->getLimit(),
283  '',
284  '',
285  null,
286  false,
287  false,
288  0,
289  0,
290  null,
291  $usr_data_fields,
292  $this->wait_user_ids
293  );
294  }
295  $usr_ids = [];
296  foreach ((array) $usr_data['set'] as $user) {
297  $usr_ids[] = (int) $user['usr_id'];
298  }
299 
300  // merge course data
301  $course_user_data = $this->getParentObject()->readMemberData($usr_ids, array());
302  $a_user_data = array();
303  foreach ((array) $usr_data['set'] as $ud) {
304  $a_user_data[(int) $ud['usr_id']] = array_merge($ud, $course_user_data[(int) $ud['usr_id']]);
305  }
306 
307  // Custom user data fields
308  if ($udf_ids) {
309  $data = ilUserDefinedData::lookupData($usr_ids, $udf_ids);
310  foreach ($data as $usr_id => $fields) {
311  if (!$this->checkAcceptance($usr_id)) {
312  continue;
313  }
314 
315  foreach ($fields as $field_id => $value) {
316  $a_user_data[$usr_id]['udf_' . $field_id] = $value;
317  }
318  }
319  }
320  // Object specific user data fields
321  if ($odf_ids) {
323  foreach ($data as $usr_id => $fields) {
324  // #7264: as we get data for all course members filter against user data
325  if (!$this->checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
326  continue;
327  }
328 
329  foreach ($fields as $field_id => $value) {
330  $a_user_data[$usr_id]['odf_' . $field_id] = $value;
331  }
332  }
333 
334  // add last edit date
335  foreach (ilObjectCustomUserFieldHistory::lookupEntriesByObjectId($this->getRepositoryObject()->getId()) as $usr_id => $edit_info) {
336  if (!isset($a_user_data[$usr_id])) {
337  continue;
338  }
339 
340  if ($usr_id == $edit_info['update_user']) {
341  $a_user_data[$usr_id]['odf_last_update'] = '';
342  $a_user_data[$usr_id]['odf_info_txt'] = $GLOBALS['DIC']['lng']->txt('cdf_edited_by_self');
343  if (ilPrivacySettings::getInstance()->enabledAccessTimesByType($this->getRepositoryObject()->getType())) {
344  $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
345  $a_user_data[$usr_id]['odf_info_txt'] .= (', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
346  }
347  } else {
348  $a_user_data[$usr_id]['odf_last_update'] = $edit_info['update_user'];
349  $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
350 
351  $name = ilObjUser::_lookupName($edit_info['update_user']);
352  $a_user_data[$usr_id]['odf_info_txt'] = ($name['firstname'] . ' ' . $name['lastname'] . ', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
353  }
354  }
355  }
356 
357  foreach ($usr_data['set'] as $user) {
358  // Check acceptance
359  if (!$this->checkAcceptance((int) $user['usr_id'])) {
360  continue;
361  }
362  // DONE: accepted
363  foreach ($usr_data_fields as $field) {
364  $a_user_data[(int) $user['usr_id']][$field] = $user[$field] ?: '';
365  }
366  }
367 
368  // Waiting list subscription
369  foreach ($this->wait as $usr_id => $wait_usr_data) {
370  if (isset($a_user_data[$usr_id])) {
371  $a_user_data[$usr_id]['sub_time'] = $wait_usr_data['time'];
372  }
373  }
374 
375  $this->setMaxCount((int) ($usr_data['cnt'] ?? 0));
376  $this->setData($a_user_data);
377  }
static lookupData(array $a_user_ids, array $a_field_ids)
Lookup data.
setData(array $a_data)
static _getValuesByObjId(int $a_obj_id)
static _lookupName(int $a_user_id)
lookup user name
const IL_CAL_UNIX
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
resetOffset(bool $a_in_determination=false)
$GLOBALS["DIC"]
Definition: wac.php:53
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:

◆ setUserIds()

ilWaitingListTableGUI::setUserIds ( array  $a_user_ids)

Set user ids.

Parameters
int[]$a_user_ids

Definition at line 120 of file class.ilWaitingListTableGUI.php.

References getWaitingList().

120  : void
121  {
122  $this->wait_user_ids = $this->wait = [];
123  foreach ($a_user_ids as $usr_id) {
124  $this->wait_user_ids[] = $usr_id;
125  $this->wait[$usr_id] = $this->getWaitingList()->getUser($usr_id);
126  }
127  }
+ Here is the call graph for this function:

◆ showActionLinks()

ilWaitingListTableGUI::showActionLinks ( array  $a_set)

Definition at line 379 of file class.ilWaitingListTableGUI.php.

References ILIAS\Repository\ctrl(), ilTable2GUI\getParentObject(), ILIAS\Repository\lng(), null, and renderer().

Referenced by fillRow().

379  : void
380  {
381  // tpl variables MAIL_LINK and MAIL_TITLE are unused but not removed
382  // from the template.
383  $this->ctrl->setParameterByClass(get_class($this->getParentObject()), 'member_id', $a_set['usr_id']);
384 
385  $dropDownItems = array();
386  $dropDownItems[] = $this->uiFactory->button()->shy(
387  $this->lng->txt($this->getRepositoryObject()->getType() . '_mem_send_mail'),
388  $this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()), 'sendMailToSelectedUsers')
389  );
390 
391  if (self::$has_odf_definitions) {
392  $dropDownItems[] = $this->uiFactory->button()->shy(
393  $this->lng->txt($this->getRepositoryObject()->getType() . '_cdf_edit_member'),
394  $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui', 'editMember')
395  );
396  }
397 
398  $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
399  ->withLabel($this->lng->txt('actions'));
400 
401  $this->tpl->setVariable('ACTION_USER', $this->renderer->render($dropDown));
402  $this->ctrl->setParameterByClass(get_class($this->getParentObject()), 'member_id', null);
403  }
renderer()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $all_columns

array ilWaitingListTableGUI::$all_columns = null
staticprotected

Definition at line 31 of file class.ilWaitingListTableGUI.php.

◆ $has_odf_definitions

bool ilWaitingListTableGUI::$has_odf_definitions
staticprotected

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

◆ $renderer

UIRenderer ilWaitingListTableGUI::$renderer
private

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

◆ $rep_object

ilObject ilWaitingListTableGUI::$rep_object
protected

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

Referenced by __construct(), and getRepositoryObject().

◆ $uiFactory

UIFactory ilWaitingListTableGUI::$uiFactory
private

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

◆ $user

ilObjUser ilWaitingListTableGUI::$user
protected

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

◆ $wait

array ilWaitingListTableGUI::$wait = []
protected

Definition at line 33 of file class.ilWaitingListTableGUI.php.

◆ $wait_user_ids

array ilWaitingListTableGUI::$wait_user_ids = []
protected

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

◆ $waiting_list

ilWaitingList ilWaitingListTableGUI::$waiting_list
protected

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

Referenced by __construct(), and getWaitingList().


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