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");
61 $licenses = strval($this->license->getLicenses());
62 $used_licenses = strval($this->license->getAccesses());
63 $remaining_licenses = $licenses ==
"0" ? $this->lng->txt(
"arbitrary") : strval($this->license->getRemainingLicenses());
64 $potential_accesses = strval($this->license->getPotentialAccesses());
66 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.lic_edit_license.html',
"Services/License");
67 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
68 $this->tpl->setVariable(
"TXT_EDIT_LICENSE", $this->lng->txt(
"edit_license"));
69 $this->tpl->setVariable(
"TXT_EXISTING_LICENSES", $this->lng->txt(
"existing_licenses"));
70 $this->tpl->setVariable(
"LICENSES", $licenses);
71 $this->tpl->setVariable(
"TXT_ZERO_LICENSES_EXPLANATION", $this->lng->txt(
"zero_licenses_explanation"));
72 $this->tpl->setVariable(
"TXT_USED_LICENSES", $this->lng->txt(
"used_licenses"));
73 $this->tpl->setVariable(
"USED_LICENSES", $used_licenses);
74 $this->tpl->setVariable(
"TXT_USED_LICENSES_EXPLANATION", $this->lng->txt(
"used_licenses_explanation"));
75 $this->tpl->setVariable(
"TXT_REMAINING_LICENSES", $this->lng->txt(
"remaining_licenses"));
76 $this->tpl->setVariable(
"REMAINING_LICENSES", $remaining_licenses);
77 $this->tpl->setVariable(
"TXT_REMAINING_LICENSES_EXPLANATION", $this->lng->txt(
"remaining_licenses_explanation"));
78 $this->tpl->setVariable(
"TXT_POTENTIAL_ACCESSES", $this->lng->txt(
"potential_accesses"));
79 $this->tpl->setVariable(
"POTENTIAL_ACCESSES", $potential_accesses);
80 $this->tpl->setVariable(
"TXT_POTENTIAL_ACCESSES_EXPLANATION", $this->lng->txt(
"potential_accesses_explanation"));
81 $this->tpl->setVariable(
"TXT_REMARKS", $this->lng->txt(
"comment"));
82 $this->tpl->setVariable(
"REMARKS", $this->license->getRemarks());
83 $this->tpl->setVariable(
"BTN_UPDATE", $this->lng->txt(
"save"));
92 $this->license->setLicenses((
int)
$_REQUEST[
"licenses"]);
93 $this->license->setRemarks($_REQUEST[
"remarks"]);
94 $this->license->update();
96 $this->ctrl->redirect($this,
"editLicense");