This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning GUI class for account codes
- Author
- Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Definition at line 23 of file class.ilAccountCodesGUI.php.
◆ __construct()
ilAccountCodesGUI::__construct |
( |
int |
$a_ref_id | ) |
|
Definition at line 31 of file class.ilAccountCodesGUI.php.
References $DIC, and $lng.
34 $this->main_tpl = $DIC->ui()->mainTemplate();
38 $this->ref_id = $a_ref_id;
39 $lng->loadLanguageModule(
"user");
40 $this->request = new \ILIAS\User\StandardGUIRequest(
◆ addCodes()
ilAccountCodesGUI::addCodes |
( |
| ) |
|
Definition at line 135 of file class.ilAccountCodesGUI.php.
References $DIC, $ilErr, $lng, $tpl, and initAddCodesForm().
139 $ilAccess = $DIC[
'ilAccess'];
144 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
149 $tpl->setContent($this->form_gui->getHTML());
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
◆ applyCodesFilter()
ilAccountCodesGUI::applyCodesFilter |
( |
| ) |
|
Definition at line 249 of file class.ilAccountCodesGUI.php.
References listCodes().
252 $utab->resetOffset();
253 $utab->writeFilterToSession();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ createCodes()
ilAccountCodesGUI::createCodes |
( |
| ) |
|
Definition at line 152 of file class.ilAccountCodesGUI.php.
References $DIC, $ilErr, $lng, $tpl, $valid, ilAccountCode\create(), IL_CAL_DATE, and initAddCodesForm().
156 $ilAccess = $DIC[
'ilAccess'];
160 $ilCtrl = $DIC[
'ilCtrl'];
164 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
169 if ($this->form_gui->checkInput()) {
170 $number = $this->form_gui->getInput(
'acc_codes_number');
171 switch ($this->form_gui->getInput(
'valid_type')) {
172 case 'valid_unlimited':
177 $valid = $this->form_gui->getItemByPostVar(
'valid_date')->getDate()->get(
IL_CAL_DATE);
180 case 'valid_dynamic':
181 $valid = $this->form_gui->getInput(
'valid_days');
186 for ($loop = 1; $loop <= $number; $loop++) {
190 $this->main_tpl->setOnScreenMessage(
'success',
$lng->txt(
'saved_successfully'),
true);
191 $ilCtrl->redirect($this,
"listCodes");
193 $this->form_gui->setValuesByPost();
194 $tpl->setContent($this->form_gui->getHTML());
static create(string $valid_until, int $stamp)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
◆ deleteCodes()
ilAccountCodesGUI::deleteCodes |
( |
| ) |
|
◆ deleteConfirmation()
ilAccountCodesGUI::deleteConfirmation |
( |
| ) |
|
Definition at line 212 of file class.ilAccountCodesGUI.php.
References $data, $DIC, $lng, $tpl, listCodes(), and ilAccountCode\loadCodesByIds().
217 $ilCtrl = $DIC[
'ilCtrl'];
220 $ids = $this->request->getIds();
221 if (count($ids) == 0) {
222 $this->main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
227 $gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
228 $gui->setCancel(
$lng->txt(
"cancel"),
"listCodes");
229 $gui->setConfirm(
$lng->txt(
"confirm"),
"deleteCodes");
230 $gui->setFormAction($ilCtrl->getFormAction($this,
"deleteCodes"));
233 foreach (
$data as $code) {
234 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
237 $tpl->setContent($gui->getHTML());
static loadCodesByIds(array $ids)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ executeCommand()
ilAccountCodesGUI::executeCommand |
( |
| ) |
|
Definition at line 46 of file class.ilAccountCodesGUI.php.
References $DIC.
50 $ilCtrl = $DIC[
'ilCtrl'];
52 $next_class = $ilCtrl->getNextClass($this);
53 $cmd = $ilCtrl->getCmd();
55 switch ($next_class) {
◆ exportCodes()
ilAccountCodesGUI::exportCodes |
( |
| ) |
|
Definition at line 258 of file class.ilAccountCodesGUI.php.
References $DIC, $ilErr, $lng, ilUtil\deliverData(), ilAccountCode\getCodesForExport(), and listCodes().
262 $ilAccess = $DIC[
'ilAccess'];
266 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
275 ilUtil::deliverData(implode(
"\r\n", $codes),
"ilias_account_codes_" . date(
"d-m-Y") .
".txt",
"text/plain");
277 $this->main_tpl->setOnScreenMessage(
'failure',
$lng->txt(
"account_export_codes_no_data"));
static getCodesForExport(string $filter_code, string $filter_valid_until, string $filter_generated)
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ initAddCodesForm()
ilAccountCodesGUI::initAddCodesForm |
( |
| ) |
|
Definition at line 89 of file class.ilAccountCodesGUI.php.
References $DIC, $lng, $valid, ilFormPropertyGUI\setRequired(), and ilNumberInputGUI\setSize().
Referenced by addCodes(), and createCodes().
93 $ilCtrl = $DIC[
'ilCtrl'];
97 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
'createCodes'));
98 $this->form_gui->setTitle(
$lng->txt(
'user_account_codes_edit_header'));
102 $count->setMaxLength(4);
103 $count->setMinValue(1);
104 $count->setMaxValue(1000);
105 $count->setRequired(
true);
106 $this->form_gui->addItem($count);
109 $valid->setRequired(
true);
111 $unl =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_unlimited'),
'valid_unlimited');
114 $st =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_static'),
'valid_static');
119 $st->addSubItem($dt);
121 $dyn =
new ilRadioOption(
$lng->txt(
'user_account_code_valid_until_dynamic'),
'valid_dynamic');
126 $ds->setRequired(
true);
127 $dyn->addSubItem($ds);
129 $this->form_gui->addItem(
$valid);
131 $this->form_gui->addCommandButton(
'createCodes',
$lng->txt(
'create'));
132 $this->form_gui->addCommandButton(
'listCodes',
$lng->txt(
'cancel'));
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ listCodes()
ilAccountCodesGUI::listCodes |
( |
| ) |
|
Definition at line 65 of file class.ilAccountCodesGUI.php.
References $DIC, $ilErr, $lng, $tpl, and ilLinkButton\getInstance().
Referenced by applyCodesFilter(), deleteConfirmation(), exportCodes(), and resetCodesFilter().
69 $ilAccess = $DIC[
'ilAccess'];
71 $ilCtrl = $DIC[
'ilCtrl'];
72 $ilToolbar = $DIC[
'ilToolbar'];
76 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
81 $button->setCaption(
"user_account_codes_add");
82 $button->setUrl($ilCtrl->getLinkTarget($this,
"addCodes"));
83 $ilToolbar->addButtonInstance($button);
86 $tpl->setContent($ctab->getHTML());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
◆ resetCodesFilter()
ilAccountCodesGUI::resetCodesFilter |
( |
| ) |
|
Definition at line 240 of file class.ilAccountCodesGUI.php.
References listCodes().
243 $utab->resetOffset();
244 $utab->resetFilter();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ $filter
array ilAccountCodesGUI::$filter |
|
protected |
◆ $form_gui
◆ $main_tpl
◆ $ref_id
int ilAccountCodesGUI::$ref_id |
|
protected |
◆ $request
ILIAS User StandardGUIRequest ilAccountCodesGUI::$request |
|
protected |
The documentation for this class was generated from the following file: