4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
25 $this->
setId(
"registration_code");
27 parent::__construct($a_parent_obj, $a_parent_cmd);
32 if($c ==
"role_local" || $c ==
"alimit")
36 $this->
addColumn($this->lng->txt($caption), $c);
42 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"listCodes"));
43 $this->
setRowTemplate(
"tpl.code_list_row.html",
"Services/Registration");
55 $this->
addCommandButton(
"exportCodes", $lng->txt(
"registration_codes_export"));
65 global $rbacreview, $ilObjDataCache;
69 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
82 $this->filter[
"code"],
83 $this->filter[
"role"],
84 $this->filter[
"generated"],
85 $this->filter[
"alimit"]
88 if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0)
96 $this->filter[
"code"],
97 $this->filter[
"role"],
98 $this->filter[
"generated"],
99 $this->filter[
"alimit"]
103 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
105 foreach($rbacreview->getGlobalRoles() as $role_id)
107 if(!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
109 $role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
114 foreach ($codes_data[
"set"] as $k =>
$code)
131 if(
$code[
"role_local"])
134 foreach(explode(
";",
$code[
"role_local"]) as $role_id)
145 $result[$k][
"role_local"] = implode(
"<br />", $local);
151 switch(
$code[
"alimit"])
154 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_none");
158 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_absolute_target").
163 $limit_caption =
array();
167 $limit_caption[] = (int)$limit[
"d"].
" ".$this->lng->txt(
"days");
171 $limit_caption[] = (int)$limit[
"m"].
" ".$this->lng->txt(
"months");
175 $limit_caption[] = (int)$limit[
"y"].
" ".$this->lng->txt(
"years");
177 if(
sizeof($limit_caption))
179 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_relative_target").
180 ": ".implode(
", ", $limit_caption);
197 global
$lng, $rbacreview,
$ilUser, $ilObjDataCache;
199 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
202 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
203 $ti =
new ilTextInputGUI($lng->txt(
"registration_code"),
"query");
206 $ti->setSubmitFormOnEnter(
true);
208 $ti->readFromSession();
209 $this->filter[
"code"] = $ti->getValue();
213 $this->role_map =
array();
214 foreach($rbacreview->getGlobalRoles() as $role_id)
216 if(!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
218 $this->role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
222 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
223 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
224 $options =
array(
"" => $this->lng->txt(
"registration_roles_all"))+
229 $si->readFromSession();
230 $this->filter[
"role"] = $si->getValue();
233 $options =
array(
"" => $this->lng->txt(
"registration_codes_access_limitation_all"),
234 "unlimited" => $this->lng->txt(
"reg_access_limitation_none"),
235 "absolute" => $this->lng->txt(
"reg_access_limitation_mode_absolute"),
236 "relative" => $this->lng->txt(
"reg_access_limitation_mode_relative"));
237 $si =
new ilSelectInputGUI($this->lng->txt(
"reg_access_limitations"),
"alimit");
240 $si->readFromSession();
241 $this->filter[
"alimit"] = $si->getValue();
244 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
245 $options =
array(
"" => $this->lng->txt(
"registration_generated_all"));
250 $si =
new ilSelectInputGUI($this->lng->txt(
"registration_generated"),
"generated");
253 $si->readFromSession();
254 $this->filter[
"generated"] = $si->getValue();
259 return array(
"code" =>
"registration_code",
260 "role" =>
"registration_codes_roles",
261 "role_local" =>
"registration_codes_roles_local",
262 "alimit" =>
"reg_access_limitations",
263 "generated" =>
"registration_generated",
264 "used" =>
"registration_used");
269 $this->tpl->setVariable(
"ID",
$code[
"code_id"]);
272 $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 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.
if(!is_array($argv)) $options
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
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.
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.
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.
setFilterCommand($a_val, $a_caption=null)
Set filter command.