ryxeo-glpi-git / plugins / manageentity / inc / plugin_manageentity.functions_display.php @ 57ea0d38
Historique | Voir | Annoter | Télécharger (20,7 ko)
1 |
<?php
|
---|---|
2 |
/*
|
3 |
----------------------------------------------------------------------
|
4 |
GLPI - Gestionnaire Libre de Parc Informatique
|
5 |
Copyright (C) 2003-2008 by the INDEPNET Development Team.
|
6 |
|
7 |
http://indepnet.net/ http://glpi-manageentity.org/
|
8 |
----------------------------------------------------------------------
|
9 |
|
10 |
LICENSE
|
11 |
|
12 |
This file is part of GLPI.
|
13 |
|
14 |
GLPI is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
16 |
the Free Software Foundation; either version 2 of the License, or
|
17 |
(at your option) any later version.
|
18 |
|
19 |
GLPI is distributed in the hope that it will be useful,
|
20 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
GNU General Public License for more details.
|
23 |
|
24 |
You should have received a copy of the GNU General Public License
|
25 |
along with GLPI; if not, write to the Free Software
|
26 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
27 |
------------------------------------------------------------------------
|
28 |
*/
|
29 |
|
30 |
// ----------------------------------------------------------------------
|
31 |
// Original Author of file: GRISARD Jean Marc & CAILLAUD Xavier
|
32 |
// Purpose of file:
|
33 |
// ----------------------------------------------------------------------
|
34 |
|
35 |
if (!defined('GLPI_ROOT')){ |
36 |
die("Sorry. You can't access directly to this file"); |
37 |
} |
38 |
|
39 |
function plugin_manageentity_showcontractsassociated($instID) { |
40 |
GLOBAL $DB,$CFG_GLPI, $LANG, $LANGMANAGEENTITY; |
41 |
|
42 |
$query = "SELECT glpi_contracts.*, glpi_plugin_manageentity_contracts.ID as ID_us FROM glpi_plugin_manageentity_contracts, glpi_contracts WHERE glpi_plugin_manageentity_contracts.FK_contracts=glpi_contracts.ID AND glpi_plugin_manageentity_contracts.FK_entity = '$instID' ORDER BY glpi_contracts.name"; |
43 |
$result = $DB->query($query); |
44 |
$number = $DB->numrows($result); |
45 |
|
46 |
if($number !="0"){ |
47 |
echo "<form method='post' action=\"./index.php\">"; |
48 |
echo "<div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
49 |
echo "<tr><th colspan='4'>".$LANGMANAGEENTITY["manageentity"][3]."</th></tr>"; |
50 |
echo "<tr><th>".$LANG["common"][16]."</th>"; |
51 |
echo "<th>".$LANG["financial"][4]."</th>"; |
52 |
echo "<th>".$LANG["common"][25]."</th>"; |
53 |
if(plugin_manageentity_HaveRight("manageentity","w")) |
54 |
echo "<th> </th>"; |
55 |
echo "</tr>"; |
56 |
|
57 |
while ($data=$DB->fetch_array($result)){ |
58 |
|
59 |
echo "<tr class='tab_bg_1".($data["deleted"]=='1'?"_2":"")."'>"; |
60 |
echo "<td><a href=\"".$CFG_GLPI["root_doc"]."/front/contract.form.php?ID=".$data["ID"]."\">".$data["name"].""; |
61 |
if ($CFG_GLPI["view_ID"]||empty($data["name"])) echo " (".$data["ID"].")"; |
62 |
echo "</a></td>"; |
63 |
echo "<td align='center'>".$data["num"]."</td>"; |
64 |
echo "<td align='center'>".nl2br($data["comments"])."</td>"; |
65 |
if(plugin_manageentity_HaveRight("manageentity","w")) |
66 |
echo "<td align='center' class='tab_bg_2'><a href=\"".$_SERVER["PHP_SELF"]."?deletecontracts=deletecontracts&ID=".$data["ID_us"]."&manageentity=$instID\">".$LANG["buttons"][6]."</a></td>"; |
67 |
else echo ""; |
68 |
echo "</tr>"; |
69 |
|
70 |
} |
71 |
echo "</table></div>" ; |
72 |
echo"</form>"; |
73 |
} |
74 |
else{
|
75 |
echo "<form method='post' action=\"./index.php\">"; |
76 |
echo "<div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
77 |
echo "<tr><th colspan='3'>".$LANGMANAGEENTITY["manageentity"][3]." - <a href=\"" . $CFG_GLPI["root_doc"] . "/front/contract.form.php\">[créer un contrat]</a> :</th></tr>"; |
78 |
echo "<tr><th>".$LANG["common"][16]."</th>"; |
79 |
echo "<th>".$LANG["financial"][4]."</th>"; |
80 |
echo "<th>".$LANG["common"][25]."</th>"; |
81 |
|
82 |
echo "</tr>"; |
83 |
if(plugin_manageentity_HaveRight("manageentity","w")){ |
84 |
echo "<tr class='tab_bg_1'><td align='center'>"; |
85 |
echo "<input type='hidden' name='conID' value='$instID'>"; |
86 |
|
87 |
dropdown("glpi_contracts","entID",1,$instID); |
88 |
echo "</td><td align='center'><input type='submit' name='addcontracts' value=\"".$LANG["buttons"][8]."\" class='submit'>"; |
89 |
echo "</td><td></td>"; |
90 |
echo "</tr>"; |
91 |
} |
92 |
echo "</table></div></form>"; |
93 |
} |
94 |
} |
95 |
|
96 |
function plugin_manageentity_showreports($instID) { |
97 |
GLOBAL $DB,$CFG_GLPI, $LANG, $LANGMANAGEENTITY; |
98 |
|
99 |
$plugin_ticketreport= new plugin_ticketreport(); |
100 |
$plugin_ticketreport->GetFromDB(1); |
101 |
|
102 |
$query = "SELECT glpi_docs.* FROM glpi_docs WHERE glpi_docs.FK_entities='".$instID."' AND rubrique='".$plugin_ticketreport->fields["rubrique"]."' ORDER BY glpi_docs.date_mod DESC LIMIT 10"; |
103 |
$result = $DB->query($query); |
104 |
$number = $DB->numrows($result); |
105 |
|
106 |
if($number !="0"){ |
107 |
echo "<br><form method='post' action=\"./index.php\">"; |
108 |
echo "<div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
109 |
echo "<tr><th colspan='6'>".$LANGMANAGEENTITY["manageentity"][4]." <a href='".$CFG_GLPI["root_doc"]."/front/document.php?contains%5B0%5D=cri&field%5B0%5D=7&sort=19&deleted=0&start=0'>".$LANGMANAGEENTITY["manageentity"][9]."</a></th></tr>"; |
110 |
echo "<tr><th>".$LANG["common"][16]."</th>"; |
111 |
echo "<th width='100px'>".$LANG["document"][2]."</th>"; |
112 |
echo "<th>".$LANG["common"][27]."</th>"; |
113 |
echo "<th>".$LANGMANAGEENTITY["manageentity"][8]."</th>"; |
114 |
|
115 |
|
116 |
echo "</tr>"; |
117 |
|
118 |
while ($data=$DB->fetch_array($result)){ |
119 |
|
120 |
echo "<tr class='tab_bg_1".($data["deleted"]=='1'?"_2":"")."'>"; |
121 |
echo "<td align='left'><a href='".$CFG_GLPI["root_doc"]."/front/document.form.php?ID=".$data["ID"]."'><b>".$data["name"]; |
122 |
if ($CFG_GLPI["view_ID"]) echo " (".$data["ID"].")"; |
123 |
echo "</b></a></td>"; |
124 |
|
125 |
echo "<td align='center' width='100px'>".getDocumentLink($data["filename"])."</td>"; |
126 |
echo "<td align='center'>".convdate($data["date_mod"])."</td>"; |
127 |
$job=new job(); |
128 |
if($job->getFromDB($data["FK_tracking"])){ |
129 |
if($job->fields["assign"]) |
130 |
echo "<td align='center'>".getUserName($job->fields["assign"])."</td>"; |
131 |
else echo "<td align='center'>".$LANG["mailing"][105]."</td>"; |
132 |
}else echo "<td align='center'></td>"; |
133 |
echo "</tr>"; |
134 |
|
135 |
} |
136 |
echo "</table></div></form>"; |
137 |
} |
138 |
} |
139 |
|
140 |
function plugin_manageentity_showJobVeryShort($ID) { |
141 |
// Prints a job in short form
|
142 |
// Should be called in a <table>-segment
|
143 |
// Print links or not in case of user view
|
144 |
|
145 |
global $CFG_GLPI, $LANG; |
146 |
|
147 |
// Make new job object and fill it from database, if success, print it
|
148 |
$job = new Job; |
149 |
$viewusers=haveRight("user","r"); |
150 |
if ($job->getfromDBwithData($ID,0)) |
151 |
{ |
152 |
$bgcolor=$CFG_GLPI["priority_".$job->fields["priority"]]; |
153 |
|
154 |
echo "<tr class='tab_bg_2'>"; |
155 |
echo "<td align='center' bgcolor='$bgcolor' >ID: ".$job->fields["ID"]."</td>"; |
156 |
|
157 |
echo "<td ><a href=\"".$CFG_GLPI["root_doc"]."/front/tracking.form.php?ID=".$job->fields["ID"]."\">".$job->fields["date"] . ": " . $job->fields["name"]."</a></td>"; |
158 |
|
159 |
echo "<td align='center'>"; |
160 |
if ($job->fields['assign']){ |
161 |
if ($viewusers){ |
162 |
$userdata=getUserName($job->fields['assign'],2); |
163 |
|
164 |
$comments_display=""; |
165 |
$comments_display="<a href='".$userdata["link"]."'>"; |
166 |
$comments_display.="<img alt='' src='".$CFG_GLPI["root_doc"]."/pics/aide.png' onmouseout=\"cleanhide('comments_trackassign".$ID."')\" onmouseover=\"cleandisplay('comments_trackassign".$ID."')\">"; |
167 |
$comments_display.="</a>"; |
168 |
$comments_display.="<span class='over_link' id='comments_trackassign".$ID."'>".$userdata["comments"]."</span>"; |
169 |
|
170 |
echo "<strong>".$userdata['name']." ".$comments_display."</strong>"; |
171 |
} else {
|
172 |
echo "<strong>".$job->getAssignName()."</strong>"; |
173 |
} |
174 |
}else echo $LANG["mailing"][105]; |
175 |
|
176 |
echo "</td>"; |
177 |
echo "<td align='center'>".getStatusName($job->fields["status"])."</td>"; |
178 |
|
179 |
echo "<td ><strong>".resume_text($job->fields["contents"],$CFG_GLPI["cut"]); |
180 |
echo "</strong>"; |
181 |
echo "</td>"; |
182 |
|
183 |
// Finish Line
|
184 |
echo "</tr>"; |
185 |
} |
186 |
else
|
187 |
{ |
188 |
echo "<tr class='tab_bg_2'><td colspan='6' ><i>".$LANG["joblist"][16]."</i></td></tr>"; |
189 |
} |
190 |
} |
191 |
|
192 |
function plugin_manageentity_showtickets($instID) { |
193 |
|
194 |
global $DB,$CFG_GLPI, $LANG,$LANGMANAGEENTITY; |
195 |
|
196 |
if (!haveRight("show_all_ticket","1")&&!haveRight("show_assign_ticket","1")) return false; |
197 |
|
198 |
//ryxeo show all tickets
|
199 |
$query = "SELECT ID FROM glpi_tracking WHERE glpi_tracking.FK_entities=".$instID." ORDER BY date DESC"; |
200 |
|
201 |
$title=$LANG["central"][9]; |
202 |
|
203 |
$result = $DB->query($query); |
204 |
$i = 0; |
205 |
$number = $DB->numrows($result); |
206 |
|
207 |
if ($number > 0) { |
208 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
209 |
|
210 |
echo "<tr><th colspan='6'>".$LANGMANAGEENTITY["manageentity"][5]." -- <a href=\"../../front/helpdesk.php\">[ouvrir un nouveau ticket]</a></th></tr>"; |
211 |
echo "<tr><th></th>"; |
212 |
echo "<th>".$LANG["common"][57]."</th>"; |
213 |
echo "<th width='75px'>".$LANG["job"][5]."</th>"; |
214 |
echo "<th>".$LANG["joblist"][0]."</th>"; |
215 |
echo "<th colspan='2'>".$LANG["joblist"][6]."</th></tr>"; |
216 |
while ($i < $number) { |
217 |
$ID = $DB->result($result, $i, "ID"); |
218 |
plugin_manageentity_showJobVeryShort($ID);
|
219 |
$i++;
|
220 |
} |
221 |
echo "</table></div>"; |
222 |
} |
223 |
else
|
224 |
{ |
225 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
226 |
echo "<tr><th>".$LANGMANAGEENTITY["manageentity"][5]." -- <a href=\"../../front/helpdesk.php\">[ouvrir un nouveau ticket]</a></th></tr>"; |
227 |
echo "</table></div>"; |
228 |
} |
229 |
} |
230 |
|
231 |
function plugin_manageentity_showdocuments($instID) { |
232 |
GLOBAL $DB,$CFG_GLPI, $LANG, $LANGMANAGEENTITY; |
233 |
|
234 |
$query = "SELECT glpi_docs.*, glpi_plugin_manageentity_documents.ID as ID_us FROM glpi_plugin_manageentity_documents, glpi_docs WHERE glpi_plugin_manageentity_documents.FK_documents=glpi_docs.ID AND glpi_plugin_manageentity_documents.FK_entity = '$instID' ORDER BY glpi_docs.name"; |
235 |
$result = $DB->query($query); |
236 |
$number = $DB->numrows($result); |
237 |
$i = 0; |
238 |
if($number !="0"){ |
239 |
echo "<form method='post' action=\"./index.php\">"; |
240 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
241 |
echo "<tr><th colspan='6'>".$LANGMANAGEENTITY["manageentity"][6]."</th></tr>"; |
242 |
echo "<tr><th>".$LANG["common"][16]."</th>"; |
243 |
echo "<th width='100px'>".$LANG["document"][2]."</th>"; |
244 |
echo "<th>".$LANG["document"][33]."</th>"; |
245 |
echo "<th>".$LANG["document"][3]."</th>"; |
246 |
echo "<th>".$LANG["document"][4]."</th>"; |
247 |
if(plugin_manageentity_HaveRight("manageentity","w")) |
248 |
echo "<th> </th>"; |
249 |
echo "</tr>"; |
250 |
|
251 |
while ($data=$DB->fetch_array($result)){ |
252 |
|
253 |
echo "<tr class='tab_bg_1".($data["deleted"]=='1'?"_2":"")."'>"; |
254 |
echo "<td align='left'><a href='".$CFG_GLPI["root_doc"]."/front/document.form.php?ID=".$data["ID"]."'><b>".$data["name"]; |
255 |
if ($CFG_GLPI["view_ID"]) echo " (".$data["ID"].")"; |
256 |
echo "</b></a></td>"; |
257 |
|
258 |
echo "<td align='center' width='100px'>".getDocumentLink($data["filename"])."</td>"; |
259 |
|
260 |
echo "<td align='center'>"; |
261 |
if (!empty($data["link"])) |
262 |
echo "<a target=_blank href='".$data["link"]."'>".$data["link"]."</a>"; |
263 |
else echo " "; |
264 |
echo "</td>"; |
265 |
echo "<td align='center'>".getDropdownName("glpi_dropdown_rubdocs",$data["rubrique"])."</td>"; |
266 |
echo "<td align='center'>".$data["mime"]."</td>"; |
267 |
if(plugin_manageentity_HaveRight("manageentity","w")) |
268 |
echo "<td align='center' class='tab_bg_2'><a href='".$_SERVER["PHP_SELF"]."?deletedocuments=deletedocuments&ID=".$data["ID_us"]."'><b>".$LANG["buttons"][6]."</b></a></td>"; |
269 |
echo "</tr>"; |
270 |
|
271 |
} |
272 |
if(plugin_manageentity_HaveRight("manageentity","w")){ |
273 |
echo "<tr class='tab_bg_1'><td colspan='5' align='center'>"; |
274 |
echo "<input type='hidden' name='conID' value='$instID'>"; |
275 |
dropdownDocument("entID",$instID); |
276 |
echo "</td><td align='center'><input type='submit' name='adddocuments' value=\"".$LANG["buttons"][8]."\" class='submit'></td>"; |
277 |
echo "</tr>"; |
278 |
} |
279 |
|
280 |
echo "</table></div></form>"; |
281 |
} |
282 |
else{
|
283 |
|
284 |
echo "<form method='post' action=\"./index.php\">"; |
285 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
286 |
echo "<tr><th colspan='5'>".$LANGMANAGEENTITY["manageentity"][6]."</th></tr>"; |
287 |
echo "<tr><th>".$LANG["common"][16]."</th>"; |
288 |
echo "<th width='100px'>".$LANG["document"][2]."</th>"; |
289 |
echo "<th>".$LANG["document"][33]."</th>"; |
290 |
echo "<th>".$LANG["document"][3]."</th>"; |
291 |
echo "<th>".$LANG["document"][4]."</th>"; |
292 |
echo "</tr>"; |
293 |
if(plugin_manageentity_HaveRight("manageentity","w")){ |
294 |
echo "<tr class='tab_bg_1'><td colspan='4' align='center'>"; |
295 |
echo "<input type='hidden' name='conID' value='$instID'>"; |
296 |
dropdownDocument("entID",$instID); |
297 |
echo "</td><td align='center'><input type='submit' name='adddocuments' value=\"".$LANG["buttons"][8]."\" class='submit'></td>"; |
298 |
|
299 |
echo "</tr>"; |
300 |
|
301 |
} |
302 |
echo "</table></div></form>"; |
303 |
} |
304 |
|
305 |
} |
306 |
|
307 |
function plugin_manageentity_showcontacts($instID) { |
308 |
global $DB,$CFG_GLPI, $LANG,$LANGMANAGEENTITY; |
309 |
|
310 |
|
311 |
$query = "SELECT glpi_contacts.*, glpi_plugin_manageentity_contacts.ID as ID_ent FROM glpi_plugin_manageentity_contacts, glpi_contacts WHERE glpi_plugin_manageentity_contacts.FK_contacts=glpi_contacts.ID AND glpi_plugin_manageentity_contacts.FK_entity = '$instID' order by glpi_contacts.name"; |
312 |
|
313 |
$result = $DB->query($query); |
314 |
$number = $DB->numrows($result); |
315 |
$i = 0; |
316 |
if ($number){ |
317 |
echo "<form method='post' action=\"./index.php\">"; |
318 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
319 |
echo "<tr><th colspan='8'>".$LANGMANAGEENTITY["manageentity"][7]."</th></tr>"; |
320 |
echo "<tr><th>".$LANG["common"][16]."</th><th>".$LANG["help"][35]."</th>"; |
321 |
echo "<th>".$LANG["help"][35]." 2</th><th>".$LANG["common"][42]."</th><th>".$LANG["financial"][30]."</th>"; |
322 |
echo "<th>".$LANG["setup"][14]."</th><th>".$LANG["common"][17]."</th>"; |
323 |
echo "<th> </th></tr>"; |
324 |
|
325 |
|
326 |
while ($data=$DB->fetch_array($result)) { |
327 |
$ID=$data["ID_ent"]; |
328 |
echo "<tr class='tab_bg_1'>"; |
329 |
echo "<td align='left'><a href='".$CFG_GLPI["root_doc"]."/front/contact.form.php?ID=".$data["ID"]."'>".$data["name"]." ".$data["firstname"]."</a></td>"; |
330 |
echo "<td align='center' width='100'>".$data["phone"]."</td>"; |
331 |
echo "<td align='center' width='100'>".$data["phone2"]."</td>"; |
332 |
echo "<td align='center' width='100'>".$data["mobile"]."</td>"; |
333 |
echo "<td align='center' width='100'>".$data["fax"]."</td>"; |
334 |
echo "<td align='center'><a href='mailto:".$data["email"]."'>".$DB->result($result, $i, "glpi_contacts.email")."</a></td>"; |
335 |
echo "<td align='center'>".getDropdownName("glpi_dropdown_contact_type",$data["type"])."</td>"; |
336 |
echo "<td align='center' class='tab_bg_2'>"; |
337 |
if(plugin_manageentity_HaveRight("manageentity","w")) |
338 |
echo "<a href='".$_SERVER['PHP_SELF']."?deletecontacts=deletecontacts&ID=$ID&eID=$instID'><strong>".$LANG["buttons"][6]."</strong></a>"; |
339 |
else echo " "; |
340 |
echo "</td></tr>"; |
341 |
$i++;
|
342 |
} |
343 |
if(plugin_manageentity_HaveRight("manageentity","w")){ |
344 |
echo "<tr class='tab_bg_1'><td colspan='7' align='center'>"; |
345 |
echo "<input type='hidden' name='eID' value='$instID'>"; |
346 |
dropdown("glpi_contacts","cID"); |
347 |
echo "</td><td align='center'><input type='submit' name='addcontacts' value=\"".$LANG["buttons"][8]."\" class='submit'></td>"; |
348 |
echo "</tr>"; |
349 |
} |
350 |
echo "</table></div></form>"; |
351 |
} |
352 |
else{
|
353 |
|
354 |
if(plugin_manageentity_HaveRight("manageentity","w")){ |
355 |
echo "<form method='post' action=\"./index.php\">"; |
356 |
echo "<br><table class='tab_cadre' align='center' width='95%'>"; |
357 |
|
358 |
echo "<tr class='tab_bg_1'><th colspan='2'>".$LANGMANAGEENTITY["manageentity"][7]."</tr><tr><td class='tab_bg_2' align='center'>"; |
359 |
echo "<input type='hidden' name='eID' value='$instID'>"; |
360 |
dropdown("glpi_contacts","cID"); |
361 |
echo "</td><td align='center' class='tab_bg_2'>"; |
362 |
echo "<input type='submit' name='addcontacts' value=\"".$LANG["buttons"][8]."\" class='submit'>"; |
363 |
echo "</td></tr>"; |
364 |
|
365 |
echo "</table></form>"; |
366 |
} |
367 |
} |
368 |
} |
369 |
|
370 |
|
371 |
//ryxeo ... add show inventory
|
372 |
|
373 |
function plugin_manageentity_showinventory($instID) { |
374 |
|
375 |
global $DB,$CFG_GLPI, $LANG,$LANGMANAGEENTITY; |
376 |
|
377 |
if (!haveRight("computer","r")) return false; |
378 |
|
379 |
$query = "SELECT ID FROM glpi_computers WHERE glpi_computers.FK_entities=".$instID." ORDER BY name"; |
380 |
|
381 |
$title=$LANG["central"][9]; |
382 |
|
383 |
$result = $DB->query($query); |
384 |
$i = 0; |
385 |
$number = $DB->numrows($result); |
386 |
|
387 |
if ($number > 0) { |
388 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
389 |
|
390 |
echo "<tr>"; |
391 |
echo "<th colspan='5'>".$LANGMANAGEENTITY["manageentity"][12]."</th>"; |
392 |
echo "</tr>"; |
393 |
echo "<tr>"; |
394 |
echo "<th>".$LANG["common"][16]."</th>"; |
395 |
echo "<th width='75px'>".$LANG["common"][17]."</th>"; |
396 |
echo "<th>".$LANG["common"][5]."</th>"; |
397 |
echo "<th>".$LANG["common"][22]."</th>"; |
398 |
echo "<th>".$LANG["common"][19]."</th>"; |
399 |
echo "</tr>"; |
400 |
while ($i < $number) { |
401 |
$ID = $DB->result($result, $i, "ID"); |
402 |
plugin_manageentity_showInventoryVeryShort($ID);
|
403 |
$i++;
|
404 |
} |
405 |
echo "</table></div>"; |
406 |
} |
407 |
else
|
408 |
{ |
409 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
410 |
echo "<tr><th>".$LANGMANAGEENTITY["manageentity"][5]." -- <a href=\"../../front/helpdesk.php\">[ouvrir un nouveau ticket]</a></th></tr>"; |
411 |
echo "</table></div>"; |
412 |
} |
413 |
echo "<br />"; |
414 |
} |
415 |
|
416 |
|
417 |
function plugin_manageentity_showInventoryVeryShort($ID) { |
418 |
// Prints an inventory in short form
|
419 |
// Should be called in a <table>-segment
|
420 |
// Print links or not in case of user view
|
421 |
|
422 |
global $CFG_GLPI, $LANG; |
423 |
|
424 |
// Make new job object and fill it from database, if success, print it
|
425 |
$computer = new Computer; |
426 |
|
427 |
if ($computer->getfromDB($ID)) |
428 |
{ |
429 |
echo "<tr class='tab_bg_2'>"; |
430 |
echo "<td ><a href=\"".$CFG_GLPI["root_doc"]."/front/computer.form.php?ID=".$computer->fields["ID"]."\">".$computer->fields["name"]."</a></td>"; |
431 |
// echo "<td>" . $computer->fields["model"] . "</td>";
|
432 |
// echo "<td>" . $computer->fields["type"] . "</td>";
|
433 |
echo "<td>" . $computer->fields[""] . "</td>"; |
434 |
echo "<td>" . $computer->fields[""] . "</td>"; |
435 |
echo "<td>" . $computer->fields[""] . "</td>"; |
436 |
|
437 |
// echo "<td><pre>";
|
438 |
// print_r($computer);
|
439 |
// echo "</pre></td>";
|
440 |
echo "<td>".$computer->fields["serial"]."</td>"; |
441 |
// Finish Line
|
442 |
echo "</tr>"; |
443 |
} |
444 |
else
|
445 |
{ |
446 |
echo "<tr class='tab_bg_2'><td colspan='6' ><i>".$LANG["joblist"][16]."</i></td></tr>"; |
447 |
} |
448 |
} |
449 |
|
450 |
//ryxeo
|
451 |
function plugin_manageentity_showanetepack($instID) { |
452 |
|
453 |
global $DB,$CFG_GLPI, $LANG,$LANGMANAGEENTITY; |
454 |
|
455 |
if (!haveRight("computer","r")) return false; |
456 |
|
457 |
$query = "SELECT code,activation_date,FK_contract as contract,g.name as installateur FROM glpi_plugin_anet_epacks |
458 |
LEFT JOIN glpi_entities AS g ON FK_activation=g.ID
|
459 |
WHERE FK_enduser=".$instID; |
460 |
// print $query;
|
461 |
$title=$LANG["central"][9]; |
462 |
|
463 |
$result = $DB->query($query); |
464 |
$i = 0; |
465 |
$number = $DB->numrows($result); |
466 |
|
467 |
if ($number > 0) { |
468 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
469 |
echo "<tr>"; |
470 |
echo "<th colspan='4'>Epack et Installation</th>"; |
471 |
echo "</tr>"; |
472 |
while($i < $number) { |
473 |
echo "<tr class='tab_bg_2'>"; |
474 |
echo "<td width=\"20%\">".$DB->result($result, $i, "code")."</td>"; |
475 |
echo "<td width=\"20%\">Date d'activation: ".$DB->result($result, $i, "activation_date")."</td>"; |
476 |
echo "<td width=\"20%\">Installateur: ".$DB->result($result, $i, "installateur")."</td>"; |
477 |
if($DB->result($result, $i, "contract") < 0) |
478 |
echo "<td width=\"20%\"><a href=\"".$CFG_GLPI["root_doc"]."/plugins/anet_epacks/front/plugin_anet_epacks.out_of_maintenance.php?status=renewmaintenance&code=" . $DB->result($result, $i, "code") . "\" target=\"_blank\">[remarquer sous maintenance]</a> </td>"; |
479 |
if($DB->result($result, $i, "contract") >= 0) |
480 |
echo "<td width=\"20%\"><a href=\"".$CFG_GLPI["root_doc"]."/plugins/anet_epacks/front/plugin_anet_epacks.out_of_maintenance.php?status=outofmaintenance&code=" . $DB->result($result, $i, "code") . "\" target=\"_blank\">[marquer hors maintenance]</a> </td>"; |
481 |
echo "</tr>"; |
482 |
$i++;
|
483 |
} |
484 |
echo "</table></div>"; |
485 |
} |
486 |
echo "<br />"; |
487 |
} |
488 |
|
489 |
//ryxeo
|
490 |
function plugin_manageentity_showanetnextupgrade($instID) { |
491 |
|
492 |
global $DB,$CFG_GLPI, $LANG,$LANGMANAGEENTITY; |
493 |
|
494 |
if (!haveRight("computer","r")) return false; |
495 |
|
496 |
$query = "SELECT upgradecmd FROM glpi_plugin_anet_epacks_upgrade as u |
497 |
LEFT JOIN glpi_plugin_anet_epacks AS g ON g.FK_serveur=u.FK_serveur
|
498 |
WHERE FK_enduser=".$instID; |
499 |
//print $query;
|
500 |
$title=$LANG["central"][9]; |
501 |
|
502 |
$result = $DB->query($query); |
503 |
$number = $DB->numrows($result); |
504 |
$upgradecmd = $DB->result($result, 0, "upgradecmd"); |
505 |
|
506 |
$query = "SELECT FK_serveur as srvID FROM glpi_plugin_anet_epacks WHERE FK_enduser=".$instID; |
507 |
// print $query;
|
508 |
$result = $DB->query($query); |
509 |
$srvID = $DB->result($result, 0, "srvID"); |
510 |
|
511 |
echo "<form method='post' action=\"./index.php\">"; |
512 |
echo "<input type='hidden' name='srvID' value='$srvID'>"; |
513 |
echo "<br><div align='center'><table class='tab_cadre' align='center' width='95%'>"; |
514 |
echo "<tr>"; |
515 |
echo "<th colspan='4'>Commande à lancer lors de la prochaine mise à jour de ce serveur </th>"; |
516 |
echo "</tr>"; |
517 |
|
518 |
echo "<tr class='tab_bg_2'>"; |
519 |
echo "<td width=\"100%\"><u>Note:</u> Cette commande doit-être gpg signée par une clé GPG acceptée par ce serveur !<br /><textarea name=\"upgradecmd\" cols=\"100\" rows=\"10\">".$upgradecmd."</textarea></td>"; |
520 |
echo "</tr>"; |
521 |
echo "<tr class='tab_bg_2'>"; |
522 |
echo "<td width=\"100%\"><input type=\"submit\" name=\"anetinsertnextupgrade\" value=\"Enregistrer\" class=\"submit\"></td>"; |
523 |
echo "</tr>"; |
524 |
|
525 |
echo "</table></div>"; |
526 |
echo"</form>"; |
527 |
echo "<br />"; |
528 |
} |
529 |
|
530 |
|
531 |
/**/
|
532 |
?>
|