4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
25 $this->
setId(
"registration_code");
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)
116 $result[$k][
"code"] = $code[
"code"];
117 $result[$k][
"code_id"] = $code[
"code_id"];
128 $result[$k][
"role"] = $this->role_map[$code[
"role"]];
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();
164 $limit = unserialize($code[
"alimitdt"]);
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]);