Print the Software / license form
public showForm ( $ID, $options = [] ) : true | ||
$ID | integer Id of the version or the template to print | |
$options | array of possible options: - target form target - softwares_id ID of the software for add process | |
return | true | if displayed false if item not found or not right to display |
if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (!isset($_GET["softwares_id"])) { $_GET["softwares_id"] = ""; } $license = new SoftwareLicense(); if (isset($_POST["add"])) { $license->check(-1, 'w', $_POST); $newID = $license->add($_POST); Event::log($_POST['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][85] . " {$newID}."); glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["delete"])) { $license->check($_POST['id'], 'd'); $license->delete($_POST); Event::log($license->fields['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][87] . " " . $_POST["id"]); $license->redirectToList(); } else { if (isset($_POST["update"])) { $license->check($_POST['id'], 'w'); $license->update($_POST); Event::log($license->fields['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][86] . " " . $_POST["id"]); glpi_header($_SERVER['HTTP_REFERER']); } else { commonHeader($LANG['Menu'][4], $_SERVER['PHP_SELF'], "inventory", "software"); $license->showForm($_GET["id"], array('softwares_id' => $_GET["softwares_id"])); commonFooter(); } } }