GUI class for account codes.
More...
◆ __construct()
ilAccountCodesGUI::__construct |
( |
|
$a_ref_id | ) |
|
Constructor.
- Parameters
-
Definition at line 22 of file class.ilAccountCodesGUI.php.
References $lng.
26 $this->ref_id = $a_ref_id;
27 $lng->loadLanguageModule(
"user");
◆ addCodes()
ilAccountCodesGUI::addCodes |
( |
| ) |
|
◆ applyCodesFilter()
ilAccountCodesGUI::applyCodesFilter |
( |
| ) |
|
Definition at line 210 of file class.ilAccountCodesGUI.php.
References listCodes().
212 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
214 $utab->resetOffset();
215 $utab->writeFilterToSession();
TableGUI class for account codes.
◆ createCodes()
ilAccountCodesGUI::createCodes |
( |
| ) |
|
Definition at line 125 of file class.ilAccountCodesGUI.php.
References $ilCtrl, $ilErr, $lng, $tpl, $valid, ilAccountCode\create(), IL_CAL_DATE, initAddCodesForm(), ilUtil\sendSuccess(), and time.
129 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
130 $ilErr->raiseError($lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
134 if ($this->form_gui->checkInput()) {
135 $number = $this->form_gui->getInput(
'acc_codes_number');
136 switch ($this->form_gui->getInput(
'valid_type')) {
137 case 'valid_unlimited':
142 $valid = $this->form_gui->getItemByPostVar(
'valid_date')->getDate()->get(
IL_CAL_DATE);
145 case 'valid_dynamic':
146 $valid = $this->form_gui->getInput(
'valid_days');
150 include_once
'./Services/User/classes/class.ilAccountCode.php';
153 for ($loop = 1; $loop <= $number; $loop++) {
158 $ilCtrl->redirect($this,
"listCodes");
160 $this->form_gui->setValuesByPost();
161 $tpl->setContent($this->form_gui->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static create($valid_until, $stamp)
◆ deleteCodes()
ilAccountCodesGUI::deleteCodes |
( |
| ) |
|
◆ deleteConfirmation()
ilAccountCodesGUI::deleteConfirmation |
( |
| ) |
|
Definition at line 176 of file class.ilAccountCodesGUI.php.
References $_POST, $code, $data, $ilCtrl, $ilErr, $lng, $tpl, and ilAccountCode\loadCodesByIds().
180 if (!isset(
$_POST[
"id"])) {
181 $ilErr->raiseError($lng->txt(
"no_checkbox"), $ilErr->MESSAGE);
184 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
186 $gui->setHeaderText($lng->txt(
"info_delete_sure"));
187 $gui->setCancel($lng->txt(
"cancel"),
"listCodes");
188 $gui->setConfirm($lng->txt(
"confirm"),
"deleteCodes");
189 $gui->setFormAction($ilCtrl->getFormAction($this,
"deleteCodes"));
191 include_once
'./Services/User/classes/class.ilAccountCode.php';
194 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
197 $tpl->setContent($gui->getHTML());
static loadCodesByIds(array $ids)
Confirmation screen class.
◆ executeCommand()
ilAccountCodesGUI::executeCommand |
( |
| ) |
|
Definition at line 30 of file class.ilAccountCodesGUI.php.
References $ilCtrl.
34 $next_class = $ilCtrl->getNextClass($this);
35 $cmd = $ilCtrl->getCmd();
37 switch ($next_class) {
◆ exportCodes()
ilAccountCodesGUI::exportCodes |
( |
| ) |
|
Definition at line 220 of file class.ilAccountCodesGUI.php.
References $ilErr, $lng, date, ilUtil\deliverData(), ilAccountCode\getCodesForExport(), listCodes(), and ilUtil\sendFailure().
224 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
225 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
228 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
231 include_once
'./Services/User/classes/class.ilAccountCode.php';
234 if (
sizeof($codes)) {
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.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ initAddCodesForm()
ilAccountCodesGUI::initAddCodesForm |
( |
| ) |
|
Definition at line 68 of file class.ilAccountCodesGUI.php.
References $ilCtrl, $lng, $valid, ilFormPropertyGUI\setRequired(), and ilNumberInputGUI\setSize().
Referenced by addCodes(), and createCodes().
72 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
75 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
'createCodes'));
76 $this->form_gui->setTitle($lng->txt(
'user_account_codes_edit_header'));
78 $count =
new ilNumberInputGUI($lng->txt(
'user_account_codes_number'),
'acc_codes_number');
80 $count->setMaxLength(4);
81 $count->setMinValue(1);
82 $count->setMaxValue(1000);
83 $count->setRequired(
true);
84 $this->form_gui->addItem($count);
89 $unl =
new ilRadioOption($lng->txt(
'user_account_code_valid_until_unlimited'),
'valid_unlimited');
92 $st =
new ilRadioOption($lng->txt(
'user_account_code_valid_until_static'),
'valid_static');
99 $dyn =
new ilRadioOption($lng->txt(
'user_account_code_valid_until_dynamic'),
'valid_dynamic');
104 $ds->setRequired(
true);
105 $dyn->addSubItem($ds);
107 $this->form_gui->addItem(
$valid);
109 $this->form_gui->addCommandButton(
'createCodes', $lng->txt(
'create'));
110 $this->form_gui->addCommandButton(
'listCodes', $lng->txt(
'cancel'));
This class represents an option in a radio group.
◆ listCodes()
ilAccountCodesGUI::listCodes |
( |
| ) |
|
Definition at line 49 of file class.ilAccountCodesGUI.php.
References $ilCtrl, $ilErr, $lng, $tpl, and ilLinkButton\getInstance().
Referenced by applyCodesFilter(), exportCodes(), and resetCodesFilter().
53 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
54 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
57 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
59 $button->setCaption(
"user_account_codes_add");
60 $button->setUrl($ilCtrl->getLinkTarget($this,
"addCodes"));
61 $ilToolbar->addButtonInstance($button);
63 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
65 $tpl->setContent($ctab->getHTML());
TableGUI class for account codes.
◆ resetCodesFilter()
ilAccountCodesGUI::resetCodesFilter |
( |
| ) |
|
Definition at line 200 of file class.ilAccountCodesGUI.php.
References listCodes().
202 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
204 $utab->resetOffset();
205 $utab->resetFilter();
TableGUI class for account codes.
◆ $ref_id
ilAccountCodesGUI::$ref_id |
|
protected |
The documentation for this class was generated from the following file: