GUI class for account codes.
More...
◆ __construct()
ilAccountCodesGUI::__construct |
( |
|
$a_ref_id | ) |
|
◆ addCodes()
ilAccountCodesGUI::addCodes |
( |
| ) |
|
◆ applyCodesFilter()
ilAccountCodesGUI::applyCodesFilter |
( |
| ) |
|
Definition at line 243 of file class.ilAccountCodesGUI.php.
References listCodes().
245 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
247 $utab->resetOffset();
248 $utab->writeFilterToSession();
TableGUI class for account codes.
◆ createCodes()
ilAccountCodesGUI::createCodes |
( |
| ) |
|
Definition at line 144 of file class.ilAccountCodesGUI.php.
References $DIC, $ilCtrl, $ilErr, $lng, $tpl, $valid, ilAccountCode\create(), IL_CAL_DATE, and initAddCodesForm().
148 $ilAccess = $DIC[
'ilAccess'];
154 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
159 if ($this->form_gui->checkInput()) {
160 $number = $this->form_gui->getInput(
'acc_codes_number');
161 switch ($this->form_gui->getInput(
'valid_type')) {
162 case 'valid_unlimited':
167 $valid = $this->form_gui->getItemByPostVar(
'valid_date')->getDate()->get(
IL_CAL_DATE);
170 case 'valid_dynamic':
171 $valid = $this->form_gui->getInput(
'valid_days');
175 include_once
'./Services/User/classes/class.ilAccountCode.php';
178 for ($loop = 1; $loop <= $number; $loop++) {
182 ilUtil::sendSuccess(
$lng->txt(
'saved_successfully'),
true);
183 $ilCtrl->redirect($this,
"listCodes");
185 $this->form_gui->setValuesByPost();
186 $tpl->setContent($this->form_gui->getHtml());
static create($valid_until, $stamp)
◆ deleteCodes()
ilAccountCodesGUI::deleteCodes |
( |
| ) |
|
◆ deleteConfirmation()
ilAccountCodesGUI::deleteConfirmation |
( |
| ) |
|
Definition at line 204 of file class.ilAccountCodesGUI.php.
References $_POST, $code, $data, $DIC, $ilCtrl, $ilErr, $lng, $tpl, and ilAccountCode\loadCodesByIds().
213 if (!isset(
$_POST[
"id"])) {
217 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
219 $gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
220 $gui->setCancel(
$lng->txt(
"cancel"),
"listCodes");
221 $gui->setConfirm(
$lng->txt(
"confirm"),
"deleteCodes");
222 $gui->setFormAction(
$ilCtrl->getFormAction($this,
"deleteCodes"));
224 include_once
'./Services/User/classes/class.ilAccountCode.php';
227 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
230 $tpl->setContent($gui->getHTML());
static loadCodesByIds(array $ids)
Confirmation screen class.
◆ executeCommand()
ilAccountCodesGUI::executeCommand |
( |
| ) |
|
◆ exportCodes()
ilAccountCodesGUI::exportCodes |
( |
| ) |
|
Definition at line 253 of file class.ilAccountCodesGUI.php.
References $DIC, $ilErr, $lng, ilUtil\deliverData(), ilAccountCode\getCodesForExport(), listCodes(), and ilUtil\sendFailure().
257 $ilAccess = $DIC[
'ilAccess'];
261 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
265 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
268 include_once
'./Services/User/classes/class.ilAccountCode.php';
271 if (
sizeof($codes)) {
273 ilUtil::deliverData(implode(
"\r\n", $codes),
"ilias_account_codes_" . date(
"d-m-Y") .
".txt",
"text/plain");
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static getCodesForExport($filter_code, $filter_valid_until, $filter_generated)
TableGUI class for account codes.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ initAddCodesForm()
ilAccountCodesGUI::initAddCodesForm |
( |
| ) |
|
Definition at line 79 of file class.ilAccountCodesGUI.php.
References $DIC, $ilCtrl, $lng, $valid, ilFormPropertyGUI\setRequired(), and ilNumberInputGUI\setSize().
Referenced by addCodes(), and createCodes().
86 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
89 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this,
'createCodes'));
90 $this->form_gui->setTitle(
$lng->txt(
'user_account_codes_edit_header'));
94 $count->setMaxLength(4);
95 $count->setMinValue(1);
96 $count->setMaxValue(1000);
97 $count->setRequired(
true);
98 $this->form_gui->addItem($count);
101 $valid->setRequired(
true);
103 $unl =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_unlimited'),
'valid_unlimited');
106 $st =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_static'),
'valid_static');
111 $st->addSubItem($dt);
113 $dyn =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_dynamic'),
'valid_dynamic');
118 $ds->setRequired(
true);
119 $dyn->addSubItem($ds);
121 $this->form_gui->addItem(
$valid);
123 $this->form_gui->addCommandButton(
'createCodes',
$lng->txt(
'create'));
124 $this->form_gui->addCommandButton(
'listCodes',
$lng->txt(
'cancel'));
This class represents an option in a radio group.
◆ listCodes()
ilAccountCodesGUI::listCodes |
( |
| ) |
|
Definition at line 53 of file class.ilAccountCodesGUI.php.
References $DIC, $ilCtrl, $ilErr, $lng, $tpl, and ilLinkButton\getInstance().
Referenced by applyCodesFilter(), exportCodes(), and resetCodesFilter().
57 $ilAccess = $DIC[
'ilAccess'];
60 $ilToolbar = $DIC[
'ilToolbar'];
64 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
68 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
70 $button->setCaption(
"user_account_codes_add");
71 $button->setUrl(
$ilCtrl->getLinkTarget($this,
"addCodes"));
72 $ilToolbar->addButtonInstance($button);
74 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
76 $tpl->setContent($ctab->getHTML());
TableGUI class for account codes.
◆ resetCodesFilter()
ilAccountCodesGUI::resetCodesFilter |
( |
| ) |
|
Definition at line 233 of file class.ilAccountCodesGUI.php.
References listCodes().
235 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
237 $utab->resetOffset();
238 $utab->resetFilter();
TableGUI class for account codes.
◆ $ref_id
ilAccountCodesGUI::$ref_id |
|
protected |
The documentation for this class was generated from the following file: