4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
24 $this->
setId(
"user_account_code");
29 $this->
addColumn($lng->txt(
"user_account_code"),
"code");
30 $this->
addColumn($lng->txt(
"user_account_code_valid_until"),
"valid_until");
31 $this->
addColumn($lng->txt(
"user_account_code_generated"),
"generated");
32 $this->
addColumn($lng->txt(
"user_account_code_used"),
"used");
37 $this->
setFormAction($ilCtrl->getFormAction($this->parent_obj,
"listCodes"));
50 $this->
addCommandButton(
"exportCodes", $lng->txt(
"user_account_codes_export"));
60 global
$lng, $rbacreview, $ilObjDataCache;
64 include_once(
"./Services/User/classes/class.ilAccountCode.php");
71 $this->filter[
"code"],
72 $this->filter[
"valid_until"],
73 $this->filter[
"generated"]
76 if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0)
84 $this->filter[
"code"],
85 $this->filter[
"valid_until"],
86 $this->filter[
"generated"]
91 foreach ($codes_data[
"set"] as $k => $code)
104 if($code[
"valid_until"] ===
"0")
106 $valid = $lng->txt(
"user_account_code_valid_until_unlimited");
108 else if(is_numeric($code[
"valid_until"]))
110 $valid = $code[
"valid_until"].
" ".($code[
"valid_until"] == 1 ? $lng->txt(
"day") : $lng->txt(
"days"));
118 $result[$k][
"code"] = $code[
"code"];
119 $result[$k][
"code_id"] = $code[
"code_id"];
134 include_once(
"./Services/User/classes/class.ilAccountCode.php");
137 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
138 $ti =
new ilTextInputGUI($lng->txt(
"user_account_code"),
"query");
141 $ti->setSubmitFormOnEnter(
true);
143 $ti->readFromSession();
144 $this->filter[
"code"] = $ti->getValue();
147 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
148 $options = array(
"" => $lng->txt(
"user_account_code_generated_all"));
154 $si->setOptions($options);
156 $si->readFromSession();
157 $this->filter[
"generated"] =
$si->getValue();
165 $this->tpl->setVariable(
"ID", $code[
"code_id"]);
166 $this->tpl->setVariable(
"VAL_CODE", $code[
"code"]);
167 $this->tpl->setVariable(
"VAL_VALID_UNTIL", $code[
"valid_until"]);
168 $this->tpl->setVariable(
"VAL_GENERATED", $code[
"generated"]);
169 $this->tpl->setVariable(
"VAL_USED", $code[
"used"]);