ryxeo-glpi-git / front / networking.form.php @ b67d8923
Historique | Voir | Annoter | Télécharger (6,4 ko)
1 |
<?php
|
---|---|
2 |
/*
|
3 |
* @version $Id: networking.form.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:
|
33 |
// Purpose of file:
|
34 |
// ----------------------------------------------------------------------
|
35 |
|
36 |
|
37 |
$NEEDED_ITEMS=array("computer","peripheral","printer","networking","reservation","tracking","document","user","group","link","phone","enterprise","infocom","contract"); |
38 |
|
39 |
define('GLPI_ROOT', '..'); |
40 |
include (GLPI_ROOT . "/inc/includes.php"); |
41 |
|
42 |
if(!isset($_GET["ID"])) $_GET["ID"] = ""; |
43 |
if(!isset($_GET["sort"])) $_GET["sort"] = ""; |
44 |
if(!isset($_GET["order"])) $_GET["order"] = ""; |
45 |
if(!isset($_GET["withtemplate"])) $_GET["withtemplate"] = ""; |
46 |
|
47 |
$netdevice=new Netdevice(); |
48 |
if (isset($_POST["add"])) |
49 |
{ |
50 |
checkRight("networking","w"); |
51 |
$newID=$netdevice->add($_POST); |
52 |
logEvent($newID, "networking", 4, "inventory", $_SESSION["glpiname"]." ".$LANG["log"][20]." : ".$_POST["name"]."."); |
53 |
glpi_header($_SERVER['HTTP_REFERER']); |
54 |
} |
55 |
else if (isset($_POST["delete"])) |
56 |
{ |
57 |
checkRight("networking","w"); |
58 |
if (!empty($_POST["withtemplate"])) |
59 |
$netdevice->delete($_POST,1); |
60 |
else $netdevice->delete($_POST); |
61 |
|
62 |
logEvent($_POST["ID"], "networking", 4, "inventory", $_SESSION["glpiname"] ." ".$LANG["log"][22]); |
63 |
if(!empty($_POST["withtemplate"])) |
64 |
glpi_header($CFG_GLPI["root_doc"]."/front/setup.templates.php"); |
65 |
else
|
66 |
glpi_header($CFG_GLPI["root_doc"]."/front/networking.php"); |
67 |
} |
68 |
else if (isset($_POST["restore"])) |
69 |
{ |
70 |
checkRight("networking","w"); |
71 |
$netdevice->restore($_POST); |
72 |
logEvent($_POST["ID"], "networking", 4, "inventory", $_SESSION["glpiname"]." ".$LANG["log"][23]); |
73 |
glpi_header($CFG_GLPI["root_doc"]."/front/networking.php"); |
74 |
} |
75 |
else if (isset($_POST["purge"]) || isset($_GET["purge"])) |
76 |
{ |
77 |
checkRight("networking","w"); |
78 |
|
79 |
if (isset($_POST["purge"])) |
80 |
$input["ID"]=$_POST["ID"]; |
81 |
else
|
82 |
$input["ID"] = $_GET["ID"]; |
83 |
|
84 |
$netdevice->delete($input,1); |
85 |
logEvent($input["ID"], "networking", 4, "inventory", $_SESSION["glpiname"]." ".$LANG["log"][24]); |
86 |
glpi_header($CFG_GLPI["root_doc"]."/front/networking.php"); |
87 |
} |
88 |
else if (isset($_POST["update"])) |
89 |
{ |
90 |
checkRight("networking","w"); |
91 |
$netdevice->update($_POST); |
92 |
logEvent($_POST["ID"], "networking", 4, "inventory", $_SESSION["glpiname"]." ".$LANG["log"][21]); |
93 |
glpi_header($_SERVER['HTTP_REFERER']); |
94 |
} |
95 |
else
|
96 |
{ |
97 |
checkRight("networking","r"); |
98 |
|
99 |
if (!isset($_SESSION['glpi_onglet'])) $_SESSION['glpi_onglet']=1; |
100 |
if (isset($_GET['onglet'])) { |
101 |
$_SESSION['glpi_onglet']=$_GET['onglet']; |
102 |
// glpi_header($_SERVER['HTTP_REFERER']);
|
103 |
} |
104 |
|
105 |
commonHeader($LANG["title"][6],$_SERVER['PHP_SELF'],"inventory","networking"); |
106 |
|
107 |
if (!empty($_GET["withtemplate"])) { |
108 |
|
109 |
if ($netdevice->showForm($_SERVER['PHP_SELF'],$_GET["ID"], $_GET["withtemplate"])){ |
110 |
if ($_GET["ID"]>0){ |
111 |
switch($_SESSION['glpi_onglet']){ |
112 |
case 4 : |
113 |
showInfocomForm($CFG_GLPI["root_doc"]."/front/infocom.form.php",NETWORKING_TYPE,$_GET["ID"],1,$_GET["withtemplate"]); |
114 |
showContractAssociated(NETWORKING_TYPE,$_GET["ID"],$_GET["withtemplate"]); |
115 |
break;
|
116 |
case 5 : |
117 |
showDocumentAssociated(NETWORKING_TYPE,$_GET["ID"],$_GET["withtemplate"]); |
118 |
break;
|
119 |
|
120 |
default :
|
121 |
if (!displayPluginAction(NETWORKING_TYPE,$_GET["ID"],$_SESSION['glpi_onglet'],$_GET["withtemplate"])){ |
122 |
showPorts($_GET["ID"], NETWORKING_TYPE,$_GET["withtemplate"]); |
123 |
if ($_GET["withtemplate"]!=2) showPortsAdd($_GET["ID"],NETWORKING_TYPE); |
124 |
} |
125 |
break;
|
126 |
} |
127 |
|
128 |
|
129 |
|
130 |
} |
131 |
} |
132 |
|
133 |
} else {
|
134 |
|
135 |
if ($netdevice->showForm ($_SERVER['PHP_SELF'],$_GET["ID"])){ |
136 |
switch($_SESSION['glpi_onglet']){ |
137 |
case -1: |
138 |
showPortsAdd($_GET["ID"],NETWORKING_TYPE); |
139 |
showPorts($_GET["ID"],NETWORKING_TYPE); |
140 |
showInfocomForm($CFG_GLPI["root_doc"]."/front/infocom.form.php",NETWORKING_TYPE,$_GET["ID"]); |
141 |
showContractAssociated(NETWORKING_TYPE,$_GET["ID"]); |
142 |
showDocumentAssociated(NETWORKING_TYPE,$_GET["ID"],$_GET["withtemplate"]); |
143 |
showJobListForItem($_SESSION["glpiname"],NETWORKING_TYPE,$_GET["ID"],$_GET["sort"],$_GET["order"]); |
144 |
showOldJobListForItem($_SESSION["glpiname"],NETWORKING_TYPE,$_GET["ID"],$_GET["sort"],$_GET["order"]); |
145 |
showLinkOnDevice(NETWORKING_TYPE,$_GET["ID"]); |
146 |
displayPluginAction(NETWORKING_TYPE,$_GET["ID"],$_SESSION['glpi_onglet'],$_GET["withtemplate"]); |
147 |
break;
|
148 |
case 4 : |
149 |
showInfocomForm($CFG_GLPI["root_doc"]."/front/infocom.form.php",NETWORKING_TYPE,$_GET["ID"]); |
150 |
showContractAssociated(NETWORKING_TYPE,$_GET["ID"]); |
151 |
break;
|
152 |
case 5 : |
153 |
showDocumentAssociated(NETWORKING_TYPE,$_GET["ID"],$_GET["withtemplate"]); |
154 |
break;
|
155 |
case 6 : |
156 |
showJobListForItem($_SESSION["glpiname"],NETWORKING_TYPE,$_GET["ID"],$_GET["sort"],$_GET["order"]); |
157 |
showOldJobListForItem($_SESSION["glpiname"],NETWORKING_TYPE,$_GET["ID"],$_GET["sort"],$_GET["order"]); |
158 |
break;
|
159 |
case 7 : |
160 |
showLinkOnDevice(NETWORKING_TYPE,$_GET["ID"]); |
161 |
break;
|
162 |
case 10 : |
163 |
showNotesForm($_SERVER['PHP_SELF'],NETWORKING_TYPE,$_GET["ID"]); |
164 |
break;
|
165 |
case 11 : |
166 |
showDeviceReservations($_SERVER['PHP_SELF'],NETWORKING_TYPE,$_GET["ID"]); |
167 |
break;
|
168 |
case 12 : |
169 |
showHistory(NETWORKING_TYPE,$_GET["ID"]); |
170 |
break;
|
171 |
default :
|
172 |
if (!displayPluginAction(NETWORKING_TYPE,$_GET["ID"],$_SESSION['glpi_onglet'],$_GET["withtemplate"])){ |
173 |
showPortsAdd($_GET["ID"],NETWORKING_TYPE); |
174 |
showPorts($_GET["ID"],NETWORKING_TYPE); |
175 |
} |
176 |
break;
|
177 |
} |
178 |
} |
179 |
} |
180 |
commonFooter(); |
181 |
} |
182 |
|
183 |
|
184 |
|
185 |
?>
|