4 include_once
"./Services/License/classes/class.ilLicense.php";
27 $this->module =
"Services/License";
31 $this->lng->loadLanguageModule(
"license");
32 $this->parent_gui =& $a_parent_gui;
33 $this->license =&
new ilLicense($this->parent_gui->object->getId());
42 global $rbacsystem,
$ilErr;
45 if (!$rbacsystem->checkAccess(
"edit_permission",$this->parent_gui->object->getRefId()))
47 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
50 $cmd = $this->ctrl->getCmd(
"editLicense");
62 $licenses = strval($this->license->getLicenses());
63 $used_licenses = strval($this->license->getAccesses());
64 $remaining_licenses = $licenses ==
"0" ? $this->lng->txt(
"arbitrary") : strval($this->license->getRemainingLicenses());
65 $potential_accesses = strval($this->license->getPotentialAccesses());
67 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.lic_edit_license.html',$this->module);
68 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
69 $this->tpl->setVariable(
"TXT_EDIT_LICENSE", $this->lng->txt(
"edit_license"));
70 $this->tpl->setVariable(
"TXT_EXISTING_LICENSES", $this->lng->txt(
"existing_licenses"));
71 $this->tpl->setVariable(
"LICENSES", $licenses);
72 $this->tpl->setVariable(
"TXT_ZERO_LICENSES_EXPLANATION", $this->lng->txt(
"zero_licenses_explanation"));
73 $this->tpl->setVariable(
"TXT_USED_LICENSES", $this->lng->txt(
"used_licenses"));
74 $this->tpl->setVariable(
"USED_LICENSES", $used_licenses);
75 $this->tpl->setVariable(
"TXT_USED_LICENSES_EXPLANATION", $this->lng->txt(
"used_licenses_explanation"));
76 $this->tpl->setVariable(
"TXT_REMAINING_LICENSES", $this->lng->txt(
"remaining_licenses"));
77 $this->tpl->setVariable(
"REMAINING_LICENSES", $remaining_licenses);
78 $this->tpl->setVariable(
"TXT_REMAINING_LICENSES_EXPLANATION", $this->lng->txt(
"remaining_licenses_explanation"));
79 $this->tpl->setVariable(
"TXT_POTENTIAL_ACCESSES", $this->lng->txt(
"potential_accesses"));
80 $this->tpl->setVariable(
"POTENTIAL_ACCESSES", $potential_accesses);
81 $this->tpl->setVariable(
"TXT_POTENTIAL_ACCESSES_EXPLANATION", $this->lng->txt(
"potential_accesses_explanation"));
82 $this->tpl->setVariable(
"TXT_REMARKS", $this->lng->txt(
"comment"));
83 $this->tpl->setVariable(
"REMARKS", $this->license->getRemarks());
84 $this->tpl->setVariable(
"BTN_UPDATE", $this->lng->txt(
"save"));
93 $this->license->setLicenses((
int)
$_REQUEST[
"licenses"]);
94 $this->license->setRemarks($_REQUEST[
"remarks"]);
95 $this->license->update();
97 $this->ctrl->redirect($this,
"editLicense");