1+ <?php
2+ /*
3+ * @version $Id$
4+ LICENSE
5+
6+ This file is part of the simcard plugin.
7+
8+ Order plugin is free software; you can redistribute it and/or modify
9+ it under the terms of the GNU General Public License as published by
10+ the Free Software Foundation; either version 2 of the License, or
11+ (at your option) any later version.
12+
13+ Order plugin is distributed in the hope that it will be useful,
14+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+ GNU General Public License for more details.
17+
18+ You should have received a copy of the GNU General Public License
19+ along with GLPI; along with Simcard. If not, see <http://www.gnu.org/licenses/>.
20+ --------------------------------------------------------------------------
21+ @package simcard
22+ @author the simcard plugin team
23+ @copyright Copyright (c) 2010-2011 Simcard plugin team
24+ @license GPLv2+
25+ http://www.gnu.org/licenses/gpl.txt
26+ @link https://forge.indepnet.net/projects/simcard
27+ @link http://www.glpi-project.org/
28+ @since 2009
29+ ---------------------------------------------------------------------- */
30+
31+ define ('GLPI_ROOT ' , '../../.. ' );
32+ include (GLPI_ROOT . "/inc/includes.php " );
33+ header ("Content-Type: text/html; charset=UTF-8 " );
34+ header_nocache ();
35+
36+ if (!isset ($ _POST ["id " ])) {
37+ exit ();
38+ }
39+
40+ if (!isset ($ _REQUEST ['glpi_tab ' ])) {
41+ exit ();
42+ }
43+
44+ if (!isset ($ _POST ["withtemplate " ])) {
45+ $ _POST ["withtemplate " ] = "" ;
46+ }
47+
48+ $ simcard = new PluginSimcardSimcard ();
49+ if ($ _POST ['id ' ]>0 && $ simcard ->can ($ _POST ['id ' ],'r ' )) {
50+ switch ($ _REQUEST ['glpi_tab ' ]) {
51+ case -1 :
52+ PluginSimcardSimcard_Item::showForSimcard ($ simcard );
53+ Infocom::showForItem ($ simcard , $ _POST ["withtemplate " ]);
54+ Contract::showAssociated ($ simcard , $ _POST ["withtemplate " ]);
55+ Document::showAssociated ($ simcard );
56+ Ticket::showListForItem ('PluginSimcardSimcard ' , $ _POST ["id " ]);
57+ Reservation::showForItem ('PluginSimcardSimcard ' , $ _POST ["id " ]);
58+ Plugin::displayAction ($ simcard , $ _REQUEST ['glpi_tab ' ], $ _POST ["withtemplate " ]);
59+ break ;
60+
61+ case 1 :
62+ PluginSimcardSimcard_Item::showForSimcard ($ simcard );
63+ break ;
64+ case 2 :
65+ Infocom::showForItem ($ simcard , $ _POST ["withtemplate " ]);
66+ Contract::showAssociated ($ simcard , $ _POST ["withtemplate " ]);
67+ break ;
68+
69+ case 3 :
70+ Document::showAssociated ($ simcard );
71+ break ;
72+
73+ case 4 :
74+ Ticket::showListForItem ('PluginSimcardSimcard ' , $ _POST ["id " ]);
75+ break ;
76+
77+ case 5 :
78+ showNotesForm ($ _POST ['target ' ],'PluginSimcardSimcard ' ,$ _POST ["id " ]);
79+ break ;
80+
81+ case 6 :
82+ Reservation::showForItem ('PluginSimcardSimcard ' , $ _POST ["id " ]);
83+ break ;
84+
85+ case 12 :
86+ Log::showForItem ($ simcard );
87+ break ;
88+
89+ default :
90+ if (!Plugin::displayAction ($ simcard , $ _REQUEST ['glpi_tab ' ], $ _POST ["withtemplate " ])) {
91+ }
92+ break ;
93+ }
94+
95+ }
96+
97+ ajaxFooter ();
98+
99+ ?>
0 commit comments