ryxeo-glpi-git / front / cartridge.edit.php @ b67d8923
Historique | Voir | Annoter | Télécharger (3,22 ko)
1 |
<?php
|
---|---|
2 |
/*
|
3 |
* @version $Id: cartridge.edit.php 7763 2009-01-06 18:44:50Z moyo $
|
4 |
-------------------------------------------------------------------------
|
5 |
GLPI - Gestionnaire Libre de Parc Informatique
|
6 |
Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
7 |
|
8 |
http://indepnet.net/ http://glpi-project.org
|
9 |
-------------------------------------------------------------------------
|
10 |
|
11 |
LICENSE
|
12 |
|
13 |
This file is part of GLPI.
|
14 |
|
15 |
GLPI is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
17 |
the Free Software Foundation; either version 2 of the License, or
|
18 |
(at your option) any later version.
|
19 |
|
20 |
GLPI 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 General Public License for more details.
|
24 |
|
25 |
You should have received a copy of the GNU General Public License
|
26 |
along with GLPI; if not, write to the Free Software
|
27 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
--------------------------------------------------------------------------
|
29 |
*/
|
30 |
|
31 |
// ----------------------------------------------------------------------
|
32 |
// Original Author of file: Julien Dombre
|
33 |
// Purpose of file:
|
34 |
// ----------------------------------------------------------------------
|
35 |
|
36 |
|
37 |
$NEEDED_ITEMS=array("cartridge","infocom"); |
38 |
|
39 |
define('GLPI_ROOT', '..'); |
40 |
include (GLPI_ROOT . "/inc/includes.php"); |
41 |
|
42 |
if(!isset($_GET["tID"])) $_GET["tID"] = ""; |
43 |
if(!isset($_GET["cID"])) $_GET["cID"] = ""; |
44 |
|
45 |
//print_r($_POST);
|
46 |
|
47 |
$cart= new Cartridge(); |
48 |
if (isset($_POST["update_pages"])||isset($_POST["update_pages_x"])) |
49 |
{ |
50 |
checkRight("cartridge","w"); |
51 |
$cart->updatePages($_POST["cID"],$_POST['pages']); |
52 |
|
53 |
logEvent(0, "cartridges", 4, "inventory", $_SESSION["glpiname"]." update a cartridge."); |
54 |
|
55 |
glpi_header($_SERVER['HTTP_REFERER']); |
56 |
} |
57 |
else if (isset($_POST["add_several"])) |
58 |
{ |
59 |
checkRight("cartridge","w"); |
60 |
for ($i=0;$i<$_POST["to_add"];$i++){ |
61 |
unset($cart->fields["ID"]); |
62 |
$cart->add($_POST); |
63 |
} |
64 |
logEvent($_POST["tID"], "cartridges", 4, "inventory", $_SESSION["glpiname"]." added ".$_POST["to_add"]." cartridge."); |
65 |
|
66 |
glpi_header($_SERVER['HTTP_REFERER']); |
67 |
} |
68 |
else if (isset($_GET["delete"])) |
69 |
{ |
70 |
checkRight("cartridge","w"); |
71 |
$cart->delete($_GET); |
72 |
logEvent($_GET['tID'], "cartridges", 4, "inventory", $_SESSION["glpiname"]." deleted a cartridge."); |
73 |
glpi_header($_SERVER['HTTP_REFERER']); |
74 |
} |
75 |
else if (isset($_GET["restore"])) |
76 |
{ |
77 |
checkRight("cartridge","w"); |
78 |
$cart->restore($_GET); |
79 |
logEvent($_GET["tID"], "cartridges", 5, "inventory", $_SESSION["glpiname"]." restore cartridge."); |
80 |
glpi_header($_SERVER['HTTP_REFERER']); |
81 |
} |
82 |
else if (isset($_POST["install"])) |
83 |
{ |
84 |
checkRight("cartridge","w"); |
85 |
$cart->install($_POST["pID"],$_POST["tID"]); |
86 |
logEvent($_POST["tID"], "cartridges", 5, "inventory", $_SESSION["glpiname"]." installed cartridge."); |
87 |
|
88 |
glpi_header($CFG_GLPI["root_doc"]."/front/printer.form.php?ID=".$_POST["pID"]); |
89 |
} |
90 |
else if (isset($_GET["uninstall"])) |
91 |
{ |
92 |
checkRight("cartridge","w"); |
93 |
$cart->uninstall($_GET["ID"]); |
94 |
logEvent($_GET['tID'], "cartridges", 5, "inventory", $_SESSION["glpiname"]." uninstalled cartridge."); |
95 |
glpi_header($_SERVER['HTTP_REFERER']); |
96 |
} |
97 |
glpi_header($_SERVER['HTTP_REFERER']); |
98 |
|
99 |
|
100 |
?>
|