コード例 #1
0
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
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);
コード例 #2
0
ファイル: softwareversion.form.php プロジェクト: btry/glpi
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("software", READ);
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["softwares_id"])) {
    $_GET["softwares_id"] = "";
}
$version = new SoftwareVersion();
if (isset($_POST["add"])) {
    $version->check(-1, CREATE, $_POST);
    if ($newID = $version->add($_POST)) {
        Event::log($_POST['softwares_id'], "software", 4, "inventory", sprintf(__('%1$s adds the version %2$s'), $_SESSION["glpiname"], $newID));
        Html::redirect($CFG_GLPI["root_doc"] . "/front/software.form.php?id=" . $version->fields['softwares_id']);
    }
    Html::back();
} else {
    if (isset($_POST["purge"])) {
        $version->check($_POST['id'], PURGE);
        $version->delete($_POST, 1);
        Event::log($version->fields['softwares_id'], "software", 4, "inventory", sprintf(__('%1$s purges the version %2$s'), $_SESSION["glpiname"], $_POST["id"]));
        $version->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $version->check($_POST['id'], UPDATE);
            $version->update($_POST);