4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
28 $this->
setId(
"registration_code");
30 parent::__construct($a_parent_obj, $a_parent_cmd);
34 if (
$c ==
"role_local" ||
$c ==
"alimit") {
44 $this->
setRowTemplate(
"tpl.code_list_row.html",
"Services/Registration");
68 $rbacreview = $DIC[
'rbacreview'];
69 $ilObjDataCache = $DIC[
'ilObjDataCache'];
73 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
85 $this->filter[
"code"],
86 $this->filter[
"role"],
87 $this->filter[
"generated"],
88 $this->filter[
"alimit"]
91 if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0) {
98 $this->filter[
"code"],
99 $this->filter[
"role"],
100 $this->filter[
"generated"],
101 $this->filter[
"alimit"]
105 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
107 foreach ($rbacreview->getGlobalRoles() as $role_id) {
108 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) {
128 if (
$code[
"role_local"]) {
130 foreach (explode(
";",
$code[
"role_local"]) as $role_id) {
136 if (
sizeof($local)) {
138 $result[$k][
"role_local"] = implode(
"<br />", $local);
142 if (
$code[
"alimit"]) {
143 switch (
$code[
"alimit"]) {
145 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_none");
149 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_absolute_target") .
154 $limit_caption = array();
157 $limit_caption[] = (int) $limit[
"d"] .
" " . $this->lng->txt(
"days");
159 if ((
int) $limit[
"m"]) {
160 $limit_caption[] = (int) $limit[
"m"] .
" " . $this->lng->txt(
"months");
162 if ((
int) $limit[
"y"]) {
163 $limit_caption[] = (int) $limit[
"y"] .
" " . $this->lng->txt(
"years");
165 if (
sizeof($limit_caption)) {
166 $result[$k][
"alimit"] = $this->lng->txt(
"reg_access_limitation_mode_relative_target") .
167 ": " . implode(
", ", $limit_caption);
187 $rbacreview = $DIC[
'rbacreview'];
189 $ilObjDataCache = $DIC[
'ilObjDataCache'];
191 include_once(
"./Services/Registration/classes/class.ilRegistrationCode.php");
194 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
198 $ti->setSubmitFormOnEnter(
true);
200 $ti->readFromSession();
201 $this->filter[
"code"] = $ti->getValue();
205 $this->role_map = array();
206 foreach ($rbacreview->getGlobalRoles() as $role_id) {
207 if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
208 $this->role_map[$role_id] = $ilObjDataCache->lookupTitle($role_id);
212 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
213 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
214 $options = array(
"" => $this->lng->txt(
"registration_roles_all")) +
219 $si->readFromSession();
220 $this->filter[
"role"] = $si->getValue();
223 $options = array(
"" => $this->lng->txt(
"registration_codes_access_limitation_all"),
224 "unlimited" => $this->lng->txt(
"reg_access_limitation_none"),
225 "absolute" => $this->lng->txt(
"reg_access_limitation_mode_absolute"),
226 "relative" => $this->lng->txt(
"reg_access_limitation_mode_relative"));
227 $si =
new ilSelectInputGUI($this->lng->txt(
"reg_access_limitations"),
"alimit");
230 $si->readFromSession();
231 $this->filter[
"alimit"] = $si->getValue();
234 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
235 $options = array(
"" => $this->lng->txt(
"registration_generated_all"));
239 $si =
new ilSelectInputGUI($this->lng->txt(
"registration_generated"),
"generated");
242 $si->readFromSession();
243 $this->filter[
"generated"] = $si->getValue();
248 return array(
"code" =>
"registration_code",
249 "role" =>
"registration_codes_roles",
250 "role_local" =>
"registration_codes_roles_local",
251 "alimit" =>
"reg_access_limitations",
252 "generated" =>
"registration_generated",
253 "used" =>
"registration_used");
258 $this->tpl->setVariable(
"ID",
$code[
"code_id"]);
260 $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.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
setFilterCommand($a_val, $a_caption=null)
Set filter command.