예제 #1
0
include GLPI_ROOT . "/inc/includes.php";
if (empty($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["sort"])) {
    $_GET["sort"] = "";
}
if (!isset($_GET["order"])) {
    $_GET["order"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$phone = new Phone();
if (isset($_POST["add"])) {
    $phone->check(-1, 'w', $_POST);
    $newID = $phone->add($_POST);
    Event::log($newID, "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][20] . " " . $_POST["name"] . ".");
    glpi_header($_SERVER['HTTP_REFERER']);
} else {
    if (isset($_POST["delete"])) {
        $phone->check($_POST["id"], 'd');
        $phone->delete($_POST);
        Event::log($_POST["id"], "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][22]);
        $phone->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $phone->check($_POST["id"], 'd');
            $phone->restore($_POST);
            Event::log($_POST["id"], "phones", 4, "inventory", $_SESSION["glpiname"] . " " . $LANG['log'][23]);
            $phone->redirectToList();
예제 #2
0
파일: phone.form.php 프로젝트: btry/glpi
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("phone", READ);
if (empty($_GET["id"])) {
    $_GET["id"] = "";
}
if (!isset($_GET["withtemplate"])) {
    $_GET["withtemplate"] = "";
}
$phone = new Phone();
if (isset($_POST["add"])) {
    $phone->check(-1, CREATE, $_POST);
    if ($newID = $phone->add($_POST)) {
        Event::log($newID, "phones", 4, "inventory", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
        if ($_SESSION['glpibackcreated']) {
            Html::redirect($phone->getFormURL() . "?id=" . $newID);
        }
    }
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $phone->check($_POST["id"], DELETE);
        $phone->delete($_POST);
        Event::log($_POST["id"], "phones", 4, "inventory", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        $phone->redirectToList();
    } else {
        if (isset($_POST["restore"])) {