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

GUI class for course/group subscriptions. More...

+ Inheritance diagram for ilSubscriberTableGUI:
+ Collaboration diagram for ilSubscriberTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, ilObject $rep_object, bool $show_content=true, bool $show_subject=true)
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 showActionLinks (array $a_set)
 Show action links (mail ; edit crs|grp data) More...
 
 readSubscriberData (array $a_subscriber_ids)
 read data @access protected More...
 
 setShowSubject (bool $a_value)
 
 getShowSubject ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 get the name of the parent form More...
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 getRepositoryObject ()
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 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 $subscribers = array()
 
bool $show_subject = true
 
ilObject $rep_object
 
- 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 = false
 

Private Attributes

UIRenderer $renderer
 
UIFactory $uiFactory
 
Profile $profile
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

GUI class for course/group subscriptions.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSubscriberTableGUI::__construct ( object  $a_parent_obj,
ilObject  $rep_object,
bool  $show_content = true,
bool  $show_subject = true 
)

Definition at line 43 of file class.ilSubscriberTableGUI.php.

48 {
49 $this->rep_object = $rep_object;
50 $this->setId('crs_sub_' . $this->getRepositoryObject()->getId());
51 parent::__construct($a_parent_obj, 'participants');
52
53 global $DIC;
54 $this->renderer = $DIC->ui()->renderer();
55 $this->uiFactory = $DIC->ui()->factory();
56 $this->profile = $DIC['user']->getProfile();
57
58 $this->lng->loadLanguageModule('grp');
59 $this->lng->loadLanguageModule('crs');
61 $this->setFormName('subscribers');
62 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, 'participants'));
63
64 $this->addColumn('', 'f', "1%", true);
65 $this->addColumn($this->lng->txt('name'), 'lastname', '20%');
66
67 $all_cols = $this->getSelectableColumns();
68 foreach ($this->getSelectedColumns() as $col) {
69 $this->addColumn(
70 $all_cols[$col]['txt'],
71 $col
72 );
73 }
74
75 if ($this->getShowSubject()) {
76 $this->addColumn($this->lng->txt('application_date'), 'sub_time');
77 $this->addColumn($this->lng->txt('message'), 'subject', '40%');
78 } else {
79 $this->addColumn($this->lng->txt('application_date'), 'sub_time');
80 }
81 $this->addColumn('', 'mail');
82 if ($this->getRepositoryObject()->getType() === "sess") {
83 $this->addMultiCommand('confirmAssignSubscribers', $this->lng->txt('sess_accept_request'));
84 } else {
85 $this->addMultiCommand('confirmAssignSubscribers', $this->lng->txt('assign'));
86 }
87 $this->addMultiCommand('confirmRefuseSubscribers', $this->lng->txt('refuse'));
88 $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('crs_mem_send_mail'));
89
90 // begin-patch clipboard
91 $this->lng->loadLanguageModule('user');
92 $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
93 // end-patch clipboard
94
95 $this->setPrefix('subscribers');
96 $this->setSelectAllCheckbox('subscribers', true);
97 $this->setRowTemplate("tpl.show_subscribers_row.html", "components/ILIAS/Membership");
98
99 if ($show_content) {
100 $this->enable('sort');
101 $this->enable('header');
102 $this->enable('numinfo');
103 $this->enable('select_all');
104 } else {
105 $this->disable('content');
106 $this->disable('header');
107 $this->disable('footer');
108 $this->disable('numinfo');
109 $this->disable('select_all');
110 }
111
112 $this->setExternalSegmentation(true);
113 self::$has_odf_definitions = (bool) ilCourseDefinedFieldDefinition::_hasFields($this->getRepositoryObject()->getId());
114 }
renderer()
static _hasFields(int $a_container_id)
Check if there are any define fields.
getSelectableColumns()
Get selectable columns.
setExternalSegmentation(bool $a_val)
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
enable(string $a_module_name)
disable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ checkAcceptance()

ilSubscriberTableGUI::checkAcceptance ( int  $a_usr_id)
protected

Definition at line 392 of file class.ilSubscriberTableGUI.php.

392 : bool
393 {
394 return true;
395 }

Referenced by readSubscriberData().

+ Here is the caller graph for this function:

◆ fillRow()

ilSubscriberTableGUI::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 147 of file class.ilSubscriberTableGUI.php.

147 : void
148 {
149 if (!ilObjCourseGrouping::_checkGroupingDependencies($this->getRepositoryObject(), (int) $a_set['usr_id']) and
151 $prefix = $this->getRepositoryObject()->getType();
152 $this->tpl->setVariable(
153 'ALERT_MSG',
154 sprintf(
155 $this->lng->txt($prefix . '_lim_assigned'),
156 ilObject::_lookupTitle(current($ids))
157 )
158 );
159 }
160 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
161 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
162
163 foreach ($this->getSelectedColumns() as $field) {
164 switch ($field) {
165 case 'gender':
166 $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : '';
167 $this->tpl->setCurrentBlock('custom_fields');
168 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
169 $this->tpl->parseCurrentBlock();
170 break;
171
172 case 'birthday':
173 $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate(
174 $a_set['birthday'],
176 )) : $this->lng->txt('no_date');
177 $this->tpl->setCurrentBlock('custom_fields');
178 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
179 $this->tpl->parseCurrentBlock();
180 break;
181
182 case 'odf_last_update':
183 $this->tpl->setVariable('VAL_CUST', (string) ($a_set['odf_info_txt'] ?? ''));
184 break;
185
186 case 'org_units':
187 $this->tpl->setCurrentBlock('custom_fields');
188 $this->tpl->setVariable(
189 'VAL_CUST',
190 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $a_set['usr_id'])
191 );
192 $this->tpl->parseCurrentBlock();
193 break;
194
195 default:
196 $this->tpl->setCurrentBlock('custom_fields');
197 $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
198 $this->tpl->parseCurrentBlock();
199 break;
200 }
201 }
202
203 $this->tpl->setVariable(
204 'VAL_SUBTIME',
206 );
207 $this->showActionLinks($a_set);
208 if ($this->getShowSubject()) {
209 if (strlen($a_set['subject'])) {
210 $this->tpl->setCurrentBlock('subject');
211 $this->tpl->setVariable('VAL_SUBJECT', '"' . $a_set['subject'] . '"');
212 $this->tpl->parseCurrentBlock();
213 } else {
214 $this->tpl->touchBlock('subject');
215 }
216 }
217 }
const IL_CAL_DATE
const IL_CAL_UNIX
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 _checkGroupingDependencies(ilObject $container_obj, ?int $a_user_id=null)
static _lookupTitle(int $obj_id)
showActionLinks(array $a_set)
Show action links (mail ; edit crs|grp data)

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

+ Here is the call graph for this function:

◆ getRepositoryObject()

ilSubscriberTableGUI::getRepositoryObject ( )
protected

Definition at line 116 of file class.ilSubscriberTableGUI.php.

116 : ilObject
117 {
118 return $this->rep_object;
119 }
Class ilObject Basic functions for all objects.

References $rep_object.

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

+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilSubscriberTableGUI::getSelectableColumns ( )

Get selectable columns.

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

Reimplemented from ilTable2GUI.

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

121 : array
122 {
123 if (self::$all_columns) {
124 return self::$all_columns;
125 }
126
127 if ($this->getRepositoryObject()->getType() === 'sess') {
128 self::$all_columns['login'] = [
129 'txt' => $this->lng->txt('login'),
130 'default' => 1
131 ];
132 return self::$all_columns;
133 }
135 self::$all_columns = $ef->getSelectableFieldsInfo($this->getRepositoryObject()->getId());
136
137 // #25215
138 if (
139 is_array(self::$all_columns) &&
140 array_key_exists('consultation_hour', self::$all_columns)
141 ) {
142 unset(self::$all_columns['consultation_hour']);
143 }
144 return self::$all_columns;
145 }
static _getInstanceByType(string $a_type)
Get Singleton Instance.

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

Referenced by __construct().

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

◆ getShowSubject()

ilSubscriberTableGUI::getShowSubject ( )

Definition at line 402 of file class.ilSubscriberTableGUI.php.

402 : bool
403 {
404 return $this->show_subject;
405 }

References $show_subject.

Referenced by __construct(), and fillRow().

+ Here is the caller graph for this function:

◆ readSubscriberData()

ilSubscriberTableGUI::readSubscriberData ( array  $a_subscriber_ids)

read data @access protected

Parameters
int[]subscriber ids
Exceptions
ilDateTimeException

Definition at line 252 of file class.ilSubscriberTableGUI.php.

252 : void
253 {
255 $sub_ids = $sub_data = [];
256 foreach ($a_subscriber_ids as $usr_id) {
257 $sub_ids[] = $usr_id;
258 $sub_data[$usr_id] = $subscriber_data[$usr_id];
259 }
260
262
263 $additional_fields = $this->getSelectedColumns();
264 unset(
265 $additional_fields["firstname"],
266 $additional_fields["lastname"],
267 $additional_fields["last_login"],
268 $additional_fields["access_until"],
269 $additional_fields['org_units']
270 );
271
272 $udf_ids = $usr_data_fields = $odf_ids = array();
273 foreach ($additional_fields as $field) {
274 if (strpos($field, 'udf') === 0) {
275 $udf_ids[] = substr($field, 4);
276 continue;
277 }
278 if (strpos($field, 'odf') === 0) {
279 $odf_ids[] = substr($field, 4);
280 continue;
281 }
282
283 $usr_data_fields[] = $field;
284 }
285
287 $this->getOrderField(),
288 $this->getOrderDirection(),
289 $this->getOffset(),
290 $this->getLimit(),
291 '',
292 '',
293 null,
294 false,
295 false,
296 0,
297 0,
298 null,
299 $usr_data_fields,
300 $sub_ids
301 );
302
303 $usr_ids = [];
304 foreach ((array) $usr_data['set'] as $user) {
305 $usr_ids[] = $user['usr_id'];
306 }
307
308 // merge course data
309 $course_user_data = $this->getParentObject()->readMemberData($usr_ids, array());
310 $a_user_data = array();
311 foreach ((array) $usr_data['set'] as $ud) {
312 $a_user_data[$ud['usr_id']] = array_merge($ud, (array) $course_user_data[$ud['usr_id']]);
313 }
314
315 // Custom user data fields
316 if (is_array($udf_ids)) {
317 $a_user_data = array_reduce(
318 $this->profile->getDataForMultiple($usr_ids),
319 function (array $c, ProfileData $v) use ($udf_ids): array {
320 if (!$this->checkAcceptance($v->getId())) {
321 return $c;
322 }
323
324 foreach ($udf_ids as $field_id) {
325 $c[$v->getId()]['udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
326 }
327 },
328 $a_user_data
329 );
330 }
331 // Object specific user data fields
332 if (is_array($odf_ids)) {
334 foreach ($data as $usr_id => $fields) {
335 // #7264: as we get data for all course members filter against user data
336 if (!$this->checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
337 continue;
338 }
339
340 foreach ($fields as $field_id => $value) {
341 $a_user_data[$usr_id]['odf_' . $field_id] = $value;
342 }
343 }
344
345 // add last edit date
346 foreach (ilObjectCustomUserFieldHistory::lookupEntriesByObjectId($this->getRepositoryObject()->getId()) as $usr_id => $edit_info) {
347 if (!isset($a_user_data[$usr_id])) {
348 continue;
349 }
350
351 if ($usr_id == $edit_info['update_user']) {
352 $a_user_data[$usr_id]['odf_last_update'] = '';
353 $a_user_data[$usr_id]['odf_info_txt'] = $GLOBALS['DIC']['lng']->txt('cdf_edited_by_self');
354 if (ilPrivacySettings::getInstance()->enabledAccessTimesByType($this->getRepositoryObject()->getType())) {
355 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
356 $a_user_data[$usr_id]['odf_info_txt'] .= (', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
357 }
358 } else {
359 $a_user_data[$usr_id]['odf_last_update'] = $edit_info['update_user'];
360 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
361
362 $name = ilObjUser::_lookupName($edit_info['update_user']);
363 $a_user_data[$usr_id]['odf_info_txt'] = ($name['firstname'] . ' ' . $name['lastname'] . ', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
364 }
365 }
366 }
367
368 foreach ($usr_data['set'] as $user) {
369 // Check acceptance
370 if (!$this->checkAcceptance((int) $user['usr_id'])) {
371 continue;
372 }
373 // DONE: accepted
374 foreach ($usr_data_fields as $field) {
375 $a_user_data[$user['usr_id']][$field] = $user[$field] ?: '';
376 }
377 }
378
379 // Waiting list subscription
380 foreach ($sub_data as $usr_id => $usr_data) {
381 if (!in_array($usr_id, $usr_ids)) {
382 continue;
383 }
384 $a_user_data[$usr_id]['sub_time'] = $usr_data['time'];
385 $a_user_data[$usr_id]['subject'] = $usr_data['subject'];
386 }
387
388 $this->setMaxCount(count($sub_ids));
389 $this->setData($a_user_data);
390 }
static _getValuesByObjId(int $a_obj_id)
static _lookupName(int $a_user_id)
static lookupSubscribersData(int $a_obj_id)
determineOffsetAndOrder(bool $a_omit_offset=false)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
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.
$c
Definition: deliver.php:25
$GLOBALS["DIC"]
Definition: wac.php:54

References $c, ilTableGUI\$data, $GLOBALS, ilCourseUserData\_getValuesByObjId(), ilObjUser\_lookupName(), checkAcceptance(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getParentObject(), getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilUserQuery\getUserListData(), IL_CAL_UNIX, ilObjectCustomUserFieldHistory\lookupEntriesByObjectId(), ilParticipants\lookupSubscribersData(), ILIAS\Repository\profile(), ilTable2GUI\setData(), and ilTableGUI\setMaxCount().

+ Here is the call graph for this function:

◆ setShowSubject()

ilSubscriberTableGUI::setShowSubject ( bool  $a_value)

Definition at line 397 of file class.ilSubscriberTableGUI.php.

397 : void
398 {
399 $this->show_subject = $a_value;
400 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ showActionLinks()

ilSubscriberTableGUI::showActionLinks ( array  $a_set)

Show action links (mail ; edit crs|grp data)

Definition at line 222 of file class.ilSubscriberTableGUI.php.

222 : void
223 {
224 $this->ctrl->setParameterByClass(get_class($this->getParentObject()), 'member_id', $a_set['usr_id']);
225 $this->ctrl->setParameter($this->parent_obj, 'member_id', $a_set['usr_id']);
226
227 $dropDownItems = array();
228 $dropDownItems[] = $this->uiFactory->button()->shy(
229 $this->lng->txt($this->getRepositoryObject()->getType() . '_mem_send_mail'),
230 $this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()), 'sendMailToSelectedUsers')
231 );
232
233 if (self::$has_odf_definitions) {
234 $this->ctrl->setParameterByClass('ilobjectcustomuserfieldsgui', 'member_id', $a_set['usr_id']);
235 $dropDownItems[] = $this->uiFactory->button()->shy(
236 $this->lng->txt($this->getRepositoryObject()->getType() . '_cdf_edit_member'),
237 $this->ctrl->getLinkTargetByClass('ilobjectcustomuserfieldsgui', 'editMember')
238 );
239 }
240
241 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
242 ->withLabel($this->lng->txt('actions'));
243 $this->tpl->setVariable('ACTION_USER', $this->renderer->render($dropDown));
244 }

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

Referenced by fillRow().

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

Field Documentation

◆ $all_columns

array ilSubscriberTableGUI::$all_columns = null
staticprotected

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

Referenced by getSelectableColumns().

◆ $has_odf_definitions

bool ilSubscriberTableGUI::$has_odf_definitions = false
staticprotected

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

◆ $profile

Profile ilSubscriberTableGUI::$profile
private

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

◆ $renderer

UIRenderer ilSubscriberTableGUI::$renderer
private

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

◆ $rep_object

ilObject ilSubscriberTableGUI::$rep_object
protected

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

Referenced by __construct(), and getRepositoryObject().

◆ $show_subject

bool ilSubscriberTableGUI::$show_subject = true
protected

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

Referenced by getShowSubject().

◆ $subscribers

array ilSubscriberTableGUI::$subscribers = array()
protected

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

◆ $uiFactory

UIFactory ilSubscriberTableGUI::$uiFactory
private

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


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