Ejemplo n.º 1
0
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
if (empty($_GET["id"])) {
    $_GET["id"] = '';
}
Session::checkLoginUser();
$change = new Change();
if (isset($_POST["add"])) {
    $change->check(-1, 'w', $_POST);
    $newID = $change->add($_POST);
    Event::log($newID, "change", 4, "maintain", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $_POST["name"]));
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $change->check($_POST["id"], 'd');
        $change->delete($_POST);
        Event::log($_POST["id"], "change", 4, "maintain", sprintf(__('%s deletes an item'), $_SESSION["glpiname"]));
        $change->redirectToList();
    } else {
        if (isset($_POST["restore"])) {
            $change->check($_POST["id"], 'd');
            $change->restore($_POST);
            Event::log($_POST["id"], "change", 4, "maintain", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            $change->redirectToList();
        } else {