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 |
( |
| ) |
|
Definition at line 113 of file class.ilAccountCodesGUI.php.
References $ilErr, $lng, $tpl, and initAddCodesForm().
117 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
119 $ilErr->raiseError($lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
123 $tpl->setContent($this->form_gui->getHTML());
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
◆ applyCodesFilter()
ilAccountCodesGUI::applyCodesFilter |
( |
| ) |
|
Definition at line 220 of file class.ilAccountCodesGUI.php.
References listCodes().
222 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
224 $utab->resetOffset();
225 $utab->writeFilterToSession();
TableGUI class for account codes.
◆ createCodes()
ilAccountCodesGUI::createCodes |
( |
| ) |
|
Definition at line 126 of file class.ilAccountCodesGUI.php.
References $ilCtrl, $ilErr, $lng, $tpl, $valid, ilAccountCode\create(), initAddCodesForm(), and ilUtil\sendSuccess().
130 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
132 $ilErr->raiseError($lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
136 if($this->form_gui->checkInput())
138 $number = $this->form_gui->getInput(
'acc_codes_number');
139 switch($this->form_gui->getInput(
'valid_type'))
141 case 'valid_unlimited':
146 $valid = $this->form_gui->getInput(
'valid_date');
150 case 'valid_dynamic':
151 $valid = $this->form_gui->getInput(
'valid_days');
155 include_once
'./Services/User/classes/class.ilAccountCode.php';
158 for($loop = 1; $loop <= $number; $loop++)
164 $ilCtrl->redirect($this,
"listCodes");
168 $this->form_gui->setValuesByPost();
169 $tpl->setContent($this->form_gui->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static create($valid_until, $stamp)
◆ deleteCodes()
ilAccountCodesGUI::deleteCodes |
( |
| ) |
|
◆ deleteConfirmation()
ilAccountCodesGUI::deleteConfirmation |
( |
| ) |
|
Definition at line 184 of file class.ilAccountCodesGUI.php.
References $_POST, $data, $ilCtrl, $ilErr, $lng, $tpl, and ilAccountCode\loadCodesByIds().
190 $ilErr->raiseError($lng->txt(
"no_checkbox"), $ilErr->MESSAGE);
193 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
195 $gui->setHeaderText($lng->txt(
"info_delete_sure"));
196 $gui->setCancel($lng->txt(
"cancel"),
"listCodes");
197 $gui->setConfirm($lng->txt(
"confirm"),
"deleteCodes");
198 $gui->setFormAction($ilCtrl->getFormAction($this,
"deleteCodes"));
200 include_once
'./Services/User/classes/class.ilAccountCode.php';
202 foreach(
$data as $code)
204 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
207 $tpl->setContent($gui->getHTML());
static loadCodesByIds(array $ids)
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
Confirmation screen class.
◆ executeCommand()
ilAccountCodesGUI::executeCommand |
( |
| ) |
|
◆ exportCodes()
ilAccountCodesGUI::exportCodes |
( |
| ) |
|
Definition at line 230 of file class.ilAccountCodesGUI.php.
References $ilErr, $lng, ilUtil\deliverData(), ilAccountCode\getCodesForExport(), listCodes(), and ilUtil\sendFailure().
234 if(!$ilAccess->checkAccess(
'read',
'', $this->ref_id))
236 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
239 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
242 include_once
'./Services/User/classes/class.ilAccountCode.php';
248 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 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 51 of file class.ilAccountCodesGUI.php.
References $ilCtrl, $ilErr, $lng, and $tpl.
Referenced by applyCodesFilter(), exportCodes(), and resetCodesFilter().
55 if(!$ilAccess->checkAccess(
'read',
'',$this->ref_id))
57 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
60 $ilToolbar->addButton($lng->txt(
"user_account_codes_add"),
61 $ilCtrl->getLinkTarget($this,
"addCodes"));
63 include_once(
"./Services/User/classes/class.ilAccountCodesTableGUI.php");
65 $tpl->setContent($ctab->getHTML());
TableGUI class for account codes.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
◆ resetCodesFilter()
ilAccountCodesGUI::resetCodesFilter |
( |
| ) |
|
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->resetFilter();
TableGUI class for account codes.
◆ $ref_id
ilAccountCodesGUI::$ref_id |
|
protected |
The documentation for this class was generated from the following file: