4 include_once
"./Services/License/classes/class.ilLicense.php";
48 $this->lng->loadLanguageModule(
"license");
49 $this->parent_gui = $a_parent_gui;
50 $this->license =
new ilLicense($this->parent_gui->object->getId());
55 global $rbacsystem,
$ilErr;
58 if (!$rbacsystem->checkAccess(
"edit_permission", $this->parent_gui->object->getRefId())) {
59 $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->MESSAGE);
62 $cmd = $this->ctrl->getCmd(
"editLicense");
70 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
72 $form->setFormAction($this->ctrl->getFormAction($this,
"updateLicense"));
73 $form->setTitle($this->lng->txt(
'edit_license'));
75 $exist =
new ilNumberInputGUI($this->lng->txt(
"existing_licenses"),
"licenses");
76 $exist->
setInfo($this->lng->txt(
"zero_licenses_explanation"));
77 $exist->setMaxLength(10);
79 $exist->setValue($this->license->getLicenses());
80 $form->addItem($exist);
83 $info_used->
setInfo($this->lng->txt(
"used_licenses_explanation"));
84 $info_used->setValue($this->license->getAccesses());
85 $form->addItem($info_used);
87 $remaining_licenses = ($this->license->getLicenses() ==
"0") ? $this->lng->txt(
"arbitrary") : $this->license->getRemainingLicenses();
90 $info_remain->
setInfo($this->lng->txt(
"remaining_licenses_explanation"));
91 $info_remain->setValue($remaining_licenses);
92 $form->addItem($info_remain);
95 $info_potential->
setInfo($this->lng->txt(
"potential_accesses_explanation"));
96 $info_potential->setValue($this->license->getPotentialAccesses());
97 $form->addItem($info_potential);
101 $comm->setValue($this->license->getRemarks());
102 $form->addItem($comm);
104 $form->addCommandButton(
'updateLicense', $this->lng->txt(
'save'));
118 $this->tpl->setContent($a_form->getHTML());
127 if ($form->checkInput()) {
128 $this->license->setLicenses($form->getInput(
"licenses"));
129 $this->license->setRemarks($form->getInput(
"remarks"));
130 $this->license->update();
133 $this->ctrl->redirect($this,
"editLicense");
136 $form->setValuesByPost();
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setInfo($a_info)
Set Information Text.
editLicense(ilPropertyFormGUI $a_form=null)
__construct(ilObjectGUI $a_parent_gui)
ilLicenseGUI constructor.
Class ilObjectGUI Basic methods of all Output classes.
updateLicense()
Save the license form.
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
This class represents a text area property in a property form.