4 include_once
"./Services/License/classes/class.ilLicense.php";
30 $this->lng->loadLanguageModule(
"license");
31 $this->parent_gui =& $a_parent_gui;
32 $this->license =&
new ilLicense($this->parent_gui->object->getId());
41 global $rbacsystem,
$ilErr;
44 if (!$rbacsystem->checkAccess(
"edit_permission",$this->parent_gui->object->getRefId()))
46 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
49 $cmd = $this->ctrl->getCmd(
"editLicense");
57 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
59 $form->setFormAction($this->ctrl->getFormAction($this,
"updateLicense"));
60 $form->setTitle($this->lng->txt(
'edit_license'));
62 $exist =
new ilNumberInputGUI($this->lng->txt(
"existing_licenses"),
"licenses");
63 $exist->
setInfo($this->lng->txt(
"zero_licenses_explanation"));
64 $exist->setMaxLength(10);
66 $exist->setValue($this->license->getLicenses());
67 $form->addItem($exist);
70 $info_used->
setInfo($this->lng->txt(
"used_licenses_explanation"));
71 $info_used->setValue($this->license->getAccesses());
72 $form->addItem($info_used);
74 $remaining_licenses = ($this->license->getLicenses() ==
"0")
75 ? $this->lng->txt(
"arbitrary")
76 : $this->license->getRemainingLicenses();
79 $info_remain->
setInfo($this->lng->txt(
"remaining_licenses_explanation"));
80 $info_remain->setValue($remaining_licenses);
81 $form->addItem($info_remain);
84 $info_potential->
setInfo($this->lng->txt(
"potential_accesses_explanation"));
85 $info_potential->setValue($this->license->getPotentialAccesses());
86 $form->addItem($info_potential);
90 $comm->setValue($this->license->getRemarks());
91 $form->addItem($comm);
93 $form->addCommandButton(
'updateLicense', $this->lng->txt(
'save'));
109 $this->tpl->setContent($a_form->getHTML());
119 if($form->checkInput())
121 $this->license->setLicenses($form->getInput(
"licenses"));
122 $this->license->setRemarks($form->getInput(
"remarks"));
123 $this->license->update();
126 $this->ctrl->redirect($this,
"editLicense");
129 $form->setValuesByPost();