4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
25 $this->
setId(
"registration_code");
27 parent::__construct($a_parent_obj, $a_parent_cmd);
31 if ($c ==
"role_local" || $c ==
"alimit") {
34 $this->
addColumn($this->lng->txt($caption), $c);
40 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"listCodes"));
41 $this->
setRowTemplate(
"tpl.code_list_row.html",
"Services/Registration");
53 $this->
addCommandButton(
"exportCodes", $lng->txt(
"registration_codes_export"));
63 global $rbacreview, $ilObjDataCache;
67 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
79 $this->filter[
"code"],
80 $this->filter[
"role"],
81 $this->filter[
"generated"],
82 $this->filter[
"alimit"]
85 if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0) {
92 $this->filter[
"code"],
93 $this->filter[
"role"],
94 $this->filter[
"generated"],
95 $this->filter[
"alimit"]
99 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
101 foreach ($rbacreview->getGlobalRoles() as $role_id) {
102 if (!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
103 $role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
108 foreach ($codes_data[
"set"] as $k =>
$code) {
122 if (
$code[
"role_local"]) {
124 foreach (explode(
";",
$code[
"role_local"]) as $role_id) {
130 if (
sizeof($local)) {
132 $result[$k][
"role_local"] = implode(
"<br />", $local);
136 if (
$code[
"alimit"]) {
137 switch (
$code[
"alimit"]) {
139 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_none");
143 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_absolute_target") .
148 $limit_caption =
array();
151 $limit_caption[] = (int) $limit[
"d"] .
" " . $this->lng->txt(
"days");
153 if ((
int) $limit[
"m"]) {
154 $limit_caption[] = (int) $limit[
"m"] .
" " . $this->lng->txt(
"months");
156 if ((
int) $limit[
"y"]) {
157 $limit_caption[] = (int) $limit[
"y"] .
" " . $this->lng->txt(
"years");
159 if (
sizeof($limit_caption)) {
160 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_relative_target") .
161 ": " . implode(
", ", $limit_caption);
178 global
$lng, $rbacreview,
$ilUser, $ilObjDataCache;
180 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
183 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
184 $ti =
new ilTextInputGUI($lng->txt(
"registration_code"),
"query");
187 $ti->setSubmitFormOnEnter(
true);
189 $ti->readFromSession();
190 $this->filter[
"code"] = $ti->getValue();
194 $this->role_map =
array();
195 foreach ($rbacreview->getGlobalRoles() as $role_id) {
196 if (!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
197 $this->role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
201 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
202 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
203 $options =
array(
"" => $this->lng->txt(
"registration_roles_all"))+
208 $si->readFromSession();
209 $this->filter[
"role"] = $si->getValue();
212 $options =
array(
"" => $this->lng->txt(
"registration_codes_access_limitation_all"),
213 "unlimited" => $this->lng->txt(
"reg_access_limitation_none"),
214 "absolute" => $this->lng->txt(
"reg_access_limitation_mode_absolute"),
215 "relative" => $this->lng->txt(
"reg_access_limitation_mode_relative"));
216 $si =
new ilSelectInputGUI($this->lng->txt(
"reg_access_limitations"),
"alimit");
219 $si->readFromSession();
220 $this->filter[
"alimit"] = $si->getValue();
223 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
224 $options =
array(
"" => $this->lng->txt(
"registration_generated_all"));
228 $si =
new ilSelectInputGUI($this->lng->txt(
"registration_generated"),
"generated");
231 $si->readFromSession();
232 $this->filter[
"generated"] = $si->getValue();
237 return array(
"code" =>
"registration_code",
238 "role" =>
"registration_codes_roles",
239 "role_local" =>
"registration_codes_roles_local",
240 "alimit" =>
"reg_access_limitations",
241 "generated" =>
"registration_generated",
242 "used" =>
"registration_used");
247 $this->tpl->setVariable(
"ID",
$code[
"code_id"]);
249 $this->tpl->setVariable(
"VAL_" . strtoupper($c),
$code[$c]);
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setExternalSorting($a_val)
Set external sorting.
getDefaultOrderField()
Get Default order field.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static getCodesData($order_field, $order_direction, $offset, $limit, $filter_code, $filter_role, $filter_generated, $filter_access_limitation)
setExternalSegmentation($a_val)
Set external segmentation.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static getGenerationDates()
resetOffset($a_in_determination=false)
Reset offset.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static _lookupTitle($a_id)
lookup object title
getOrderDirection()
Get order direction.
getItems()
Get user items.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setOrderField($a_order_field)
set order column
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
TableGUI class for registration codes.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
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.
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.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
setFilterCommand($a_val, $a_caption=null)
Set filter command.