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 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
52 $button->setCaption(
"user_account_codes_export");
53 $button->setCommand(
"exportCodes");
54 $button->setOmitPreventDoubleSubmission(
true);
65 global
$lng, $rbacreview, $ilObjDataCache;
69 include_once(
"./Services/User/classes/class.ilAccountCode.php");
76 $this->filter[
"code"],
77 $this->filter[
"valid_until"],
78 $this->filter[
"generated"]
81 if (count($codes_data[
"set"]) == 0 && $this->
getOffset() > 0)
89 $this->filter[
"code"],
90 $this->filter[
"valid_until"],
91 $this->filter[
"generated"]
96 foreach ($codes_data[
"set"] as $k => $code)
109 if($code[
"valid_until"] ===
"0")
111 $valid = $lng->txt(
"user_account_code_valid_until_unlimited");
113 else if(is_numeric($code[
"valid_until"]))
115 $valid = $code[
"valid_until"].
" ".($code[
"valid_until"] == 1 ? $lng->txt(
"day") : $lng->txt(
"days"));
123 $result[$k][
"code"] = $code[
"code"];
124 $result[$k][
"code_id"] = $code[
"code_id"];
139 include_once(
"./Services/User/classes/class.ilAccountCode.php");
142 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
143 $ti =
new ilTextInputGUI($lng->txt(
"user_account_code"),
"query");
146 $ti->setSubmitFormOnEnter(
true);
148 $ti->readFromSession();
149 $this->filter[
"code"] = $ti->getValue();
152 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
153 $options = array(
"" => $lng->txt(
"user_account_code_generated_all"));
161 $si->readFromSession();
162 $this->filter[
"generated"] =
$si->getValue();
170 $this->tpl->setVariable(
"ID", $code[
"code_id"]);
171 $this->tpl->setVariable(
"VAL_CODE", $code[
"code"]);
172 $this->tpl->setVariable(
"VAL_VALID_UNTIL", $code[
"valid_until"]);
173 $this->tpl->setVariable(
"VAL_GENERATED", $code[
"generated"]);
174 $this->tpl->setVariable(
"VAL_USED", $code[
"used"]);