Print the Software / version 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["softwares_id"])) { $_GET["softwares_id"] = ""; } $version = new SoftwareVersion(); if (isset($_POST["add"])) { $version->check(-1, 'w', $_POST); if ($newID = $version->add($_POST)) { Event::log($_POST['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][82] . " {$newID}."); glpi_header($CFG_GLPI["root_doc"] . "/front/software.form.php?id=" . $version->fields['softwares_id']); } glpi_header($_SERVER['HTTP_REFERER']); } else { if (isset($_POST["delete"])) { $version->check($_POST['id'], 'w'); $version->delete($_POST); Event::log($version->fields['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][84] . " " . $_POST["id"]); $version->redirectToList(); } else { if (isset($_POST["update"])) { $version->check($_POST['id'], 'w'); $version->update($_POST); Event::log($version->fields['softwares_id'], "software", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][83] . " " . $_POST["id"]); glpi_header($_SERVER['HTTP_REFERER']); } else { commonHeader($LANG['Menu'][4], $_SERVER['PHP_SELF'], "inventory", "software"); $version->showForm($_GET["id"], array('softwares_id' => $_GET["softwares_id"])); commonFooter(); } } }