$constype->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $constype->check($_POST["id"], 'w');
            if ($constype->restore($_POST)) {
                Event::log($_POST["id"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][23]);
            }
            $constype->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $constype->check($_POST["id"], 'w');
                if ($constype->delete($_POST, 1)) {
                    Event::log($_POST["id"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][24]);
                }
                $constype->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $constype->check($_POST["id"], 'w');
                    if ($constype->update($_POST)) {
                        Event::log($_POST["id"], "consumables", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][21]);
                    }
                    glpi_header($_SERVER['HTTP_REFERER']);
                } else {
                    commonHeader($LANG['Menu'][32], $_SERVER['PHP_SELF'], "inventory", "consumable");
                    $constype->showForm($_GET["id"]);
                    commonFooter();
                }
            }
        }
    }
}