1<?php
2
3/*
4   ------------------------------------------------------------------------
5   FusionInventory
6   Copyright (C) 2010-2016 by the FusionInventory Development Team.
7
8   http://www.fusioninventory.org/   http://forge.fusioninventory.org/
9   ------------------------------------------------------------------------
10
11   LICENSE
12
13   This file is part of FusionInventory project.
14
15   FusionInventory is free software: you can redistribute it and/or modify
16   it under the terms of the GNU Affero General Public License as published by
17   the Free Software Foundation, either version 3 of the License, or
18   (at your option) any later version.
19
20   FusionInventory is distributed in the hope that it will be useful,
21   but WITHOUT ANY WARRANTY; without even the implied warranty of
22   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23   GNU Affero General Public License for more details.
24
25   You should have received a copy of the GNU Affero General Public License
26   along with FusionInventory. If not, see <http://www.gnu.org/licenses/>.
27
28   ------------------------------------------------------------------------
29
30   @package   FusionInventory
31   @author    David Durieux
32   @co-author
33   @copyright Copyright (c) 2010-2016 FusionInventory team
34   @license   AGPL License 3.0 or (at your option) any later version
35              http://www.gnu.org/licenses/agpl-3.0-standalone.html
36   @link      http://www.fusioninventory.org/
37   @link      http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/
38   @since     2013
39
40   ------------------------------------------------------------------------
41 */
42
43include ("../../../inc/includes.php");
44
45Html::header(__('Collect management', 'fusioninventory'),
46             $_SERVER["PHP_SELF"],
47             "plugins",
48             "pluginfusioninventorymenu",
49             "collect");
50
51$pfCollect = new PluginFusioninventoryCollect();
52
53if (isset($_POST["add"])) {
54   $collects_id = $pfCollect->add($_POST);
55   Html::redirect(Toolbox::getItemTypeFormURL('PluginFusioninventoryCollect').
56           "?id=".$collects_id);
57} else if (isset($_POST["update"])) {
58   $pfCollect->update($_POST);
59   Html::back();
60} else if (isset($_REQUEST["purge"])) {
61   $pfCollect->delete($_POST);
62   $pfCollect->redirectToList();
63}
64
65PluginFusioninventoryMenu::displayMenu("mini");
66
67if (!isset($_GET["id"])) {
68   $_GET['id'] = '';
69}
70$pfCollect->display($_GET);
71
72Html::footer();
73
74?>