-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidation.form.php
75 lines (60 loc) · 2.51 KB
/
validation.form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*
LICENSE
This file is part of the purchaserequest plugin.
Purchaserequest plugin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Purchaserequest plugin is distributed in the hope that it will be useful,
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 Purchaserequest. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
@package purchaserequest
@author the purchaserequest plugin team
@copyright Copyright (c) 2015-2022 Purchaserequest plugin team
@license GPLv2+
http://www.gnu.org/licenses/gpl.txt
@link https://github.com/InfotelGLPI/purchaserequest
@link http://www.glpi-project.org/
@since 2009
---------------------------------------------------------------------- */
include("../../../inc/includes.php");
if (!isset($_GET["id"])) {
$_GET["id"] = "";
}
if (Plugin::isPluginActive("order")
&& $DB->tableExists("glpi_plugin_order_orders")) {
$validation = new PluginPurchaserequestValidation();
if (isset($_POST["add"])) {
$validation->check(-1, CREATE, $_POST);
$newID = $validation->add($_POST);
Html::back();
} else if (isset($_POST["delete"])) {
$validation->check($_POST['id'], DELETE);
$validation->delete($_POST);
$validation->redirectToList();
} else if (isset($_POST["restore"])) {
$validation->check($_POST['id'], DELETE);
$validation->restore($_POST);
$validation->redirectToList();
} else if (isset($_POST["purge"])) {
$validation->check($_POST['id'], PURGE);
$validation->delete($_POST, 1);
$validation->redirectToList();
/* update purchaserequest */
} else if (isset($_POST["update"]) || (isset($_POST['update_status']))) {
// $validation->check($_POST['id'], READ);
$validation->update($_POST);
Html::back();
}
Html::back();
} else {
Html::header(__('Setup'), '', "tools", "pluginpurchaserequestpurchaserequest", "config");
echo "<div class='alert alert-important alert-warning d-flex'>";
echo "<b>" . __('Please activate the plugin order', 'purchaserequest') . "</b></div>";
}
Html::footer();