Exemplo n.º 1
0
            if (isset($_REQUEST["purge"])) {
                $simcard->check($_REQUEST['id'], PURGE);
                if ($simcard->delete($_REQUEST, 1)) {
                    Event::log($_POST["id"], "simcard", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                }
                $simcard->redirectToList();
                //update a simcard
            } else {
                if (isset($_POST["update"])) {
                    $simcard->check($_POST['id'], UPDATE);
                    $simcard->update($_POST);
                    Event::log($_POST["id"], "simcard", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    if (isset($_GET["unglobalize"])) {
                        $simcard->check($_GET["id"], UPDATE);
                        //TODO There is probably a bug here...
                        Html::redirect(Toolbox::getItemTypeFormURL('PluginSimcardSimcard') . "?id=" . $_GET["id"]);
                    } else {
                        //print simcard information
                        // Affichage du fil d'Ariane
                        Html::header(PluginSimcardSimcard::getTypeName(2), '', "assets", "pluginsimcardsimcard", "simcard");
                        //show simcard form to add
                        $simcard->display(array('id' => $_GET["id"], 'withtemplate' => $_GET["withtemplate"]));
                        html::footer();
                    }
                }
            }
        }
    }
}