ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilRegistrationCodesTableGUI Class Reference

TableGUI class for registration codes. More...

+ Inheritance diagram for ilRegistrationCodesTableGUI:
+ Collaboration diagram for ilRegistrationCodesTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, string $a_parent_cmd)
 Constructor. More...
 
 initFilter ()
 Init filter. More...
 
 getSelectedColumns ()
 
- 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)
 

Data Fields

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

Protected Member Functions

 fillRow (array $a_set)
 
- 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

ilAccessHandler $access
 
ilRbacReview $rbacreview
 
array $role_map = []
 
- Protected Attributes inherited from ilTable2GUI
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Member Functions

 getItems ()
 Get user items. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 

Detailed Description

TableGUI class for registration codes.

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

Definition at line 28 of file class.ilRegistrationCodesTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationCodesTableGUI::__construct ( object  $a_parent_obj,
string  $a_parent_cmd 
)

Constructor.

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

References $c, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), getItems(), getSelectedColumns(), initFilter(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), and ilTable2GUI\setTopCommands().

41  {
42  global $DIC;
43 
44  $this->access = $DIC->access();
45  $this->rbacreview = $DIC->rbac()->review();
46  $this->setId("registration_code");
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48 
49  $this->addColumn("", "", "1", true);
50  foreach ($this->getSelectedColumns() as $c => $caption) {
51  if ($c === "role_local" || $c === "alimit") {
52  $c = "";
53  }
54  $this->addColumn($this->lng->txt($caption), $c);
55  }
56 
57  $this->setExternalSorting(true);
58  $this->setExternalSegmentation(true);
59  $this->setEnableHeader(true);
60  $this->setFormAction($this->ctrl->getFormAction($this->parent_obj, "listCodes"));
61  $this->setRowTemplate("tpl.code_list_row.html", "components/ILIAS/Registration");
62  $this->setEnableTitle(true);
63  $this->initFilter();
64  $this->setFilterCommand("applyCodesFilter");
65  $this->setResetCommand("resetCodesFilter");
66  $this->setDefaultOrderField("generated"); // #11341
67  $this->setDefaultOrderDirection("desc");
68 
69  $this->setSelectAllCheckbox("id[]");
70  $this->setTopCommands(true);
71 
72  if ($this->access->checkAccess("write", '', $a_parent_obj->ref_id)) {
73  $this->addMultiCommand("deleteConfirmation", $this->lng->txt("delete"));
74  }
75  $this->addCommandButton("exportCodes", $this->lng->txt("registration_codes_export"));
76  $this->getItems();
77  }
setTopCommands(bool $a_val)
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setResetCommand(string $a_val, string $a_caption="")
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
$c
Definition: deliver.php:25
setId(string $a_val)
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setFilterCommand(string $a_val, string $a_caption="")
global $DIC
Definition: shib_login.php:22
setDefaultOrderDirection(string $a_defaultorderdirection)
__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)
setEnableHeader(bool $a_enableheader)
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilRegistrationCodesTableGUI::fillRow ( array  $a_set)
protected

Definition at line 263 of file class.ilRegistrationCodesTableGUI.php.

References $c, and getSelectedColumns().

263  : void
264  {
265  $this->tpl->setVariable("ID", $a_set["code_id"]);
266  foreach (array_keys($this->getSelectedColumns()) as $c) {
267  $this->tpl->setVariable("VAL_" . strtoupper($c), $a_set[$c] ?? "");
268  }
269  }
$c
Definition: deliver.php:25
+ Here is the call graph for this function:

◆ getItems()

ilRegistrationCodesTableGUI::getItems ( )
private

Get user items.

Definition at line 82 of file class.ilRegistrationCodesTableGUI.php.

References ilTableGUI\$limit, ilObject\_lookupTitle(), ANONYMOUS_ROLE_ID, ilTable2GUI\determineOffsetAndOrder(), ILIAS\Repository\filter(), ilDatePresentation\formatDate(), ilRegistrationCode\getCodesData(), ilTable2GUI\getDefaultOrderField(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), getSelectedColumns(), IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\int(), ILIAS\Repository\lng(), ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), ilTable2GUI\setOrderField(), ILIAS\UI\examples\Symbol\Glyph\Sort\sort(), and SYSTEM_ROLE_ID.

Referenced by __construct().

82  : void
83  {
84  $this->determineOffsetAndOrder();
85 
86  // #12737
87  if (!array_key_exists($this->getOrderField(), $this->getSelectedColumns())) {
88  $this->setOrderField($this->getDefaultOrderField());
89  }
90 
92  $this->getOrderField(),
93  $this->getOrderDirection(),
94  $this->getOffset(),
95  $this->getLimit(),
96  (string) $this->filter["code"],
97  (int) $this->filter["role"],
98  (string) $this->filter["generated"],
99  (string) $this->filter["alimit"]
100  );
101 
102  if (count($codes_data["set"]) === 0 && $this->getOffset() > 0) {
103  $this->resetOffset();
104  $codes_data = ilRegistrationCode::getCodesData(
105  $this->getOrderField(),
106  $this->getOrderDirection(),
107  $this->getOffset(),
108  $this->getLimit(),
109  (string) $this->filter["code"],
110  (int) $this->filter["role"],
111  (string) $this->filter["generated"],
112  (string) $this->filter["alimit"]
113  );
114  }
115 
116  $options = [];
117  $this->role_map = [];
118  foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
119  if (!in_array($role_id, [SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID], true)) {
120  $this->role_map[$role_id] = ilObject::_lookupTitle($role_id);
121  }
122  }
123 
124  $result = [];
125  foreach ($codes_data["set"] as $k => $code) {
126  $result[$k]["code"] = $code["code"];
127  $result[$k]["code_id"] = $code["code_id"];
128 
129  $result[$k]["generated"] = ilDatePresentation::formatDate(new ilDateTime($code["generated"], IL_CAL_UNIX));
130 
131  if ($code["used"]) {
132  $result[$k]["used"] = ilDatePresentation::formatDate(new ilDateTime($code["used"], IL_CAL_UNIX));
133  } else {
134  $result[$k]["used"] = "";
135  }
136 
137  if ($code["role"]) {
138  $result[$k]["role"] = $this->role_map[$code["role"]] ?? $this->lng->txt('deleted');
139  } else {
140  $result[$k]["role"] = "";
141  }
142 
143  if ($code["role_local"]) {
144  $local = [];
145  foreach (explode(";", $code["role_local"]) as $role_id) {
146  $role = ilObject::_lookupTitle((int) $role_id);
147  if ($role) {
148  $local[] = $role;
149  }
150  }
151  if (count($local)) {
152  sort($local);
153  $result[$k]["role_local"] = implode("<br />", $local);
154  }
155  } else {
156  $result[$k]["role_local"] = "";
157  }
158 
159  if ($code["alimit"]) {
160  switch ($code["alimit"]) {
161  case "unlimited":
162  $result[$k]["alimit"] = $this->lng->txt("reg_access_limitation_none");
163  break;
164 
165  case "absolute":
166  $result[$k]["alimit"] = $this->lng->txt("reg_access_limitation_mode_absolute_target") .
167  ": " . ilDatePresentation::formatDate(new ilDate($code["alimitdt"], IL_CAL_DATE));
168  break;
169 
170  case "relative":
171  $limit_caption = [];
172  $limit = unserialize($code["alimitdt"], ['allowed_classes' => false]);
173  if ((int) $limit["d"]) {
174  $limit_caption[] = (int) $limit["d"] . " " . $this->lng->txt("days");
175  }
176  if ((int) $limit["m"]) {
177  $limit_caption[] = (int) $limit["m"] . " " . $this->lng->txt("months");
178  }
179  if ((int) $limit["y"]) {
180  $limit_caption[] = (int) $limit["y"] . " " . $this->lng->txt("years");
181  }
182  if (count($limit_caption)) {
183  $result[$k]["alimit"] = $this->lng->txt("reg_access_limitation_mode_relative_target") .
184  ": " . implode(", ", $limit_caption);
185  }
186  break;
187  }
188  }
189  }
190 
191  $this->setMaxCount((int) $codes_data["cnt"]);
192  $this->setData($result);
193  }
setData(array $a_data)
const SYSTEM_ROLE_ID
Definition: constants.php:29
const IL_CAL_UNIX
sort()
description: > Example for rendering a Sort Glyph.
Definition: sort.php:41
resetOffset(bool $a_in_determination=false)
static _lookupTitle(int $obj_id)
static getCodesData(string $order_field, string $order_direction, int $offset, int $limit, string $filter_code, int $filter_role, string $filter_generated, string $filter_access_limitation)
setOrderField(string $a_order_field)
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
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,)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedColumns()

ilRegistrationCodesTableGUI::getSelectedColumns ( )

Definition at line 251 of file class.ilRegistrationCodesTableGUI.php.

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

251  : array
252  {
253  return [
254  "code" => "registration_code",
255  "role" => "registration_codes_roles",
256  "role_local" => "registration_codes_roles_local",
257  "alimit" => "reg_access_limitations",
258  "generated" => "registration_generated",
259  "used" => "registration_used"
260  ];
261  }
+ Here is the caller graph for this function:

◆ initFilter()

ilRegistrationCodesTableGUI::initFilter ( )

Init filter.

Definition at line 198 of file class.ilRegistrationCodesTableGUI.php.

References $role_map, ilObject\_lookupTitle(), ilTable2GUI\addFilterItem(), ANONYMOUS_ROLE_ID, ilRegistrationCode\CODE_LENGTH, ILIAS\Repository\filter(), ilDatePresentation\formatDate(), ilRegistrationCode\getGenerationDates(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilSelectInputGUI\setOptions(), and SYSTEM_ROLE_ID.

Referenced by __construct().

198  : void
199  {
200  // code
201  $ti = new ilTextInputGUI($this->lng->txt("registration_code"), "query");
202  $ti->setMaxLength(ilRegistrationCode::CODE_LENGTH);
203  $ti->setSize(20);
204  $ti->setSubmitFormOnEnter(true);
205  $this->addFilterItem($ti);
206  $ti->readFromSession();
207  $this->filter["code"] = $ti->getValue();
208 
209  // role
210 
211  $this->role_map = [];
212  foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
213  if (!in_array($role_id, [SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID], true)) {
214  $this->role_map[$role_id] = ilObject::_lookupTitle($role_id);
215  }
216  }
217 
218  $options = ["" => $this->lng->txt("registration_roles_all")] +
220  $si = new ilSelectInputGUI($this->lng->txt("role"), "role");
221  $si->setOptions($options);
222  $this->addFilterItem($si);
223  $si->readFromSession();
224  $this->filter["role"] = $si->getValue();
225 
226  // access limitation
227  $options = [
228  "" => $this->lng->txt("registration_codes_access_limitation_all"),
229  "unlimited" => $this->lng->txt("reg_access_limitation_none"),
230  "absolute" => $this->lng->txt("reg_access_limitation_mode_absolute"),
231  "relative" => $this->lng->txt("reg_access_limitation_mode_relative")
232  ];
233  $si = new ilSelectInputGUI($this->lng->txt("reg_access_limitations"), "alimit");
234  $si->setOptions($options);
235  $this->addFilterItem($si);
236  $si->readFromSession();
237  $this->filter["alimit"] = $si->getValue();
238 
239  // generated
240  $options = ["" => $this->lng->txt("registration_generated_all")];
241  foreach (ilRegistrationCode::getGenerationDates() as $date) {
242  $options[$date] = ilDatePresentation::formatDate(new ilDateTime($date, IL_CAL_UNIX));
243  }
244  $si = new ilSelectInputGUI($this->lng->txt("registration_generated"), "generated");
245  $si->setOptions($options);
246  $this->addFilterItem($si);
247  $si->readFromSession();
248  $this->filter["generated"] = $si->getValue();
249  }
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const SYSTEM_ROLE_ID
Definition: constants.php:29
setOptions(array $a_options)
const IL_CAL_UNIX
static _lookupTitle(int $obj_id)
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilRegistrationCodesTableGUI::$access
protected

Definition at line 30 of file class.ilRegistrationCodesTableGUI.php.

◆ $filter

array ilRegistrationCodesTableGUI::$filter = []

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

◆ $rbacreview

ilRbacReview ilRegistrationCodesTableGUI::$rbacreview
protected

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

◆ $role_map

array ilRegistrationCodesTableGUI::$role_map = []
protected

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

Referenced by initFilter().


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