示例#1
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

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
* @since version 0.85
*/
include '../inc/includes.php';
$criteria = new SlaLevelAction();
if (isset($_POST["add"])) {
    $criteria->check(-1, CREATE, $_POST);
    $criteria->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $criteria->check($_POST['id'], UPDATE);
        $criteria->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["purge"])) {
            $criteria->check($_POST['id'], PURGE);
            $criteria->delete($_POST, 1);
            Html::back();
        }
    }
}
示例#2
0
     } else {
         if (isset($_POST["add_action"])) {
             $item->check($_POST['slalevels_id'], 'w');
             $action = new SlaLevelAction();
             $action->add($_POST);
             // Can't do this in SlaLevelAction, so do it here
             $item->update(array('id' => $_POST['slalevels_id'], 'date_mod' => $_SESSION['glpi_currenttime']));
             glpi_header($_SERVER['HTTP_REFERER']);
         } else {
             if (isset($_POST["delete_action"])) {
                 $item->check($_POST['slalevels_id'], 'w');
                 $action = new SlaLevelAction();
                 if (count($_POST["item"])) {
                     foreach ($_POST["item"] as $key => $val) {
                         $input["id"] = $key;
                         $action->delete($input);
                     }
                 }
                 // Can't do this in RuleAction, so do it here
                 $item->update(array('id' => $_POST['slalevels_id'], 'date_mod' => $_SESSION['glpi_currenttime']));
                 glpi_header($_SERVER['HTTP_REFERER']);
             } else {
                 //print computer informations
                 commonHeader($LANG['sla'][6], $_SERVER['PHP_SELF'], "config", "sla");
                 //show computer form to add
                 $item->showForm($_GET["id"]);
                 commonFooter();
             }
         }
     }
 }