Example #1
0
 if (isset($_POST["delete"])) {
     $projet->check($_POST['id'], 'w');
     if (!empty($_POST["withtemplate"])) {
         $projet->delete($_POST, 1);
     } else {
         $projet->delete($_POST);
     }
     if (!empty($_POST["withtemplate"])) {
         Html::redirect($CFG_GLPI["root_doc"] . "/plugins/projet/front/setup.templates.php?add=0");
     } else {
         $projet->redirectToList();
     }
 } else {
     if (isset($_POST["restore"])) {
         $projet->check($_POST['id'], 'w');
         $projet->restore($_POST);
         $projet->redirectToList();
     } else {
         if (isset($_POST["purge"])) {
             $projet->check($_POST['id'], 'w');
             $projet->delete($_POST, 1);
             if (!empty($_POST["withtemplate"])) {
                 Html::redirect($CFG_GLPI["root_doc"] . "/plugins/projet/front/setup.templates.php?add=0");
             } else {
                 $projet->redirectToList();
             }
         } else {
             if (isset($_POST["update"])) {
                 $projet->check($_POST['id'], 'w');
                 $projet->update($_POST);
                 Html::back();