ryxeo-glpi-git / inc / central.function.php @ b67d8923
Historique | Voir | Annoter | Télécharger (5,85 ko)
1 | b67d8923 | Eric Seigne | <?php
|
---|---|---|---|
2 | /*
|
||
3 | * @version $Id: central.function.php 7906 2009-01-26 19:22:31Z remi $
|
||
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 | * Show onglet for central
|
||
38 | *
|
||
39 | * @param $target target URL
|
||
40 | * @param $actif which onglet is active ? (my, global or plugins)
|
||
41 | * @return nothing
|
||
42 | */
|
||
43 | function showCentralOnglets($target,$actif) { |
||
44 | global $LANG,$PLUGIN_HOOKS; |
||
45 | echo "<div id='barre_onglets'><ul id='onglet'>"; |
||
46 | echo "<li ".($actif=="my"?"class='actif'":"")."><a href='$target?onglet=my'>".$LANG["central"][12]."</a></li>"; |
||
47 | echo "<li ".($actif=="group"?"class='actif'":"")."><a href='$target?onglet=group'>".$LANG["central"][14]."</a></li>"; |
||
48 | if (haveRight("show_all_ticket","1")||haveRight("logs","r")||haveRight("contract_infocom","r")) |
||
49 | echo "<li ".($actif=="global"?"class='actif'":"")."><a href='$target?onglet=global'>".$LANG["central"][13]."</a></li>"; |
||
50 | if (isset($PLUGIN_HOOKS['central_action'])&&count($PLUGIN_HOOKS['central_action'])){ |
||
51 | echo "<li ".($actif=="plugins"?"class='actif'":"")."><a href='$target?onglet=plugins'>".$LANG["common"][29]."</a></li>"; |
||
52 | } |
||
53 | echo "<li class='invisible'> </li>"; |
||
54 | echo "<li ".($actif=="all"?"class='actif'":"")."><a href='$target?onglet=all'>".$LANG["common"][66]."</a></li>"; |
||
55 | |||
56 | echo "</ul></div>"; |
||
57 | } |
||
58 | |||
59 | /**
|
||
60 | * Show the central global view
|
||
61 | *
|
||
62 | *
|
||
63 | **/
|
||
64 | function showCentralGlobalView(){ |
||
65 | |||
66 | global $CFG_GLPI,$LANG; |
||
67 | |||
68 | $showticket=haveRight("show_all_ticket","1"); |
||
69 | |||
70 | |||
71 | echo "<table class='tab_cadre_central' ><tr>"; |
||
72 | |||
73 | echo "<td class='top'><br>"; |
||
74 | echo "<table >"; |
||
75 | if ($showticket){ |
||
76 | echo "<tr><td class='top' width='450px'>"; |
||
77 | showCentralJobCount(); |
||
78 | echo "</td></tr>"; |
||
79 | } |
||
80 | if (haveRight("contract_infocom","r")){ |
||
81 | echo "<tr>"; |
||
82 | echo "<td class='top' width='450px'>"; |
||
83 | showCentralContract(); |
||
84 | echo "</td>"; |
||
85 | echo "</tr>"; |
||
86 | } |
||
87 | echo "</table>"; |
||
88 | echo "</td>"; |
||
89 | |||
90 | if (haveRight("logs","r")){ |
||
91 | echo "<td class='top' width='450px'>"; |
||
92 | |||
93 | if ($CFG_GLPI["num_of_events"]>0){ |
||
94 | |||
95 | //Show last add events
|
||
96 | showAddEvents($_SERVER['PHP_SELF'],$_SESSION["glpiname"]); |
||
97 | |||
98 | } else {
|
||
99 | echo " "; |
||
100 | } |
||
101 | |||
102 | echo "</td>"; |
||
103 | } |
||
104 | echo "</tr>"; |
||
105 | |||
106 | echo "</table>"; |
||
107 | echo "</div>"; |
||
108 | |||
109 | |||
110 | if ($CFG_GLPI["jobs_at_login"]&&$showticket){ |
||
111 | echo "<br>"; |
||
112 | |||
113 | echo "<div class='center'><strong>"; |
||
114 | echo $LANG["central"][10]; |
||
115 | echo "</strong></div>"; |
||
116 | |||
117 | showTrackingList($_SERVER['PHP_SELF'],$_GET["start"],$_GET["sort"],$_GET["order"],"new"); |
||
118 | } |
||
119 | |||
120 | } |
||
121 | /**
|
||
122 | * Show the central personal view
|
||
123 | *
|
||
124 | *
|
||
125 | **/
|
||
126 | function showCentralMyView(){ |
||
127 | global $LANG, $DB; |
||
128 | |||
129 | $showticket=(haveRight("show_all_ticket","1")||haveRight("show_assign_ticket","1")); |
||
130 | |||
131 | echo "<table class='tab_cadre_central' >"; |
||
132 | |||
133 | if ($DB->isSlave() && !$DB->first_connection){ |
||
134 | echo "<tr><th colspan='2'><br>"; |
||
135 | displayTitle(GLPI_ROOT."/pics/warning.png", $LANG["setup"][809], $LANG["setup"][809]); |
||
136 | echo "</th></tr>"; |
||
137 | } |
||
138 | echo "<tr><td class='top'>"; |
||
139 | |||
140 | echo "<table>"; |
||
141 | |||
142 | if ($showticket){ |
||
143 | echo "<tr><td class='top' width='450px'><br>"; |
||
144 | showCentralJobList($_SERVER['PHP_SELF'],$_GET['start'],"process",false); |
||
145 | echo "</td></tr>"; |
||
146 | echo "<tr><td class='top' width='450px'>"; |
||
147 | showCentralJobList($_SERVER['PHP_SELF'],$_GET['start'],"waiting",false); |
||
148 | echo "</td></tr>"; |
||
149 | } |
||
150 | |||
151 | echo "</table></td><td class='top'><table><tr>"; |
||
152 | |||
153 | echo "<td class='top' width='450px'><br>"; |
||
154 | showPlanningCentral($_SESSION["glpiID"]); |
||
155 | echo "</td></tr>"; |
||
156 | echo "<tr>"; |
||
157 | |||
158 | |||
159 | echo "<td class='top' width='450px'>"; |
||
160 | showCentralReminder(); |
||
161 | echo "</td>"; |
||
162 | echo "</tr>"; |
||
163 | |||
164 | if (haveRight("reminder_public","r")){ |
||
165 | echo "<tr><td class='top' width='450px'>"; |
||
166 | |||
167 | showCentralReminder($_SESSION["glpiactive_entity"]); |
||
168 | |||
169 | $entities=array_reverse(getEntityAncestors($_SESSION["glpiactive_entity"])); |
||
170 | foreach ($entities as $entity) { |
||
171 | showCentralReminder($entity, true); |
||
172 | } |
||
173 | |||
174 | foreach ($_SESSION["glpiactiveentities"] as $entity) { |
||
175 | if ($entity != $_SESSION["glpiactive_entity"]) { |
||
176 | showCentralReminder($entity, false); |
||
177 | } |
||
178 | } |
||
179 | echo "</td></tr>"; |
||
180 | } |
||
181 | |||
182 | |||
183 | echo "</table></td></tr></table>"; |
||
184 | |||
185 | |||
186 | |||
187 | } |
||
188 | |||
189 | /**
|
||
190 | * Show the central group view
|
||
191 | *
|
||
192 | *
|
||
193 | **/
|
||
194 | function showCentralGroupView(){ |
||
195 | |||
196 | $showticket=haveRight("show_all_ticket","1")||haveRight("show_assign_ticket","1"); |
||
197 | |||
198 | echo "<table class='tab_cadre_central' >"; |
||
199 | echo "<tr><td class='top'>"; |
||
200 | echo "<table>"; |
||
201 | |||
202 | if ($showticket){ |
||
203 | echo "<tr><td class='top' width='450px'><br>"; |
||
204 | showCentralJobList($_SERVER['PHP_SELF'],$_GET['start'],"process",true); |
||
205 | echo "</td></tr>"; |
||
206 | } |
||
207 | |||
208 | echo "</table></td><td class='top'><table>"; |
||
209 | |||
210 | if ($showticket){ |
||
211 | echo "<tr><td class='top' width='450px'><br>"; |
||
212 | showCentralJobList($_SERVER['PHP_SELF'],$_GET['start'],"waiting",true); |
||
213 | echo "</td></tr>"; |
||
214 | } |
||
215 | |||
216 | |||
217 | |||
218 | echo "</table></td></tr></table>"; |
||
219 | |||
220 | |||
221 | |||
222 | } |
||
223 | |||
224 | ?> |