Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / htdocs / inc / display.function.php @ 1c14bcc4

Historique | Voir | Annoter | Télécharger (88,2 ko)

1
<?php
2
/*
3
 * @version $Id: display.function.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
if (!defined('GLPI_ROOT')){
37
        die("Sorry. You can't access directly to this file");
38
        }
39

    
40

    
41
//******************************************************************************************************
42
//******************************************************************************************************
43
//***********  Fonctions d'affichage header footer helpdesk pager ***********************
44
//******************************************************************************************************
45
//******************************************************************************************************
46

    
47
function ryxeo_fastlinks() {
48
  return "";
49
}
50

    
51
/**
52
 * Include common HTML headers
53
 *
54
 * @param $title title used for the page
55
 * @return nothing
56
 **/
57
function includeCommonHtmlHeader($title=''){
58
        global $CFG_GLPI,$PLUGIN_HOOKS;
59

    
60
        // Send UTF8 Headers
61
        header("Content-Type: text/html; charset=UTF-8");
62
        // Send extra expires header if configured
63
        if ($CFG_GLPI["sendexpire"]) {
64
                header_nocache();
65
        }
66

    
67
        // Start the page
68
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
69
         // echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
70
        echo "\n<html><head><title>AbulEdu.net - GLPI - ".$title."</title>";
71
        echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8 \" >";
72
        // Send extra expires header if configured
73
        if ($CFG_GLPI["sendexpire"]) {
74
                echo "<meta http-equiv=\"Expires\" content=\"Fri, Jun 12 1981 08:20:00 GMT\" >\n";
75
                echo "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n";
76
                echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n";
77
        }
78
        //  CSS link
79
        echo "<link rel='stylesheet'  href='".$CFG_GLPI["root_doc"]."/css/styles.css' type='text/css' media='screen' >\n";
80
        // surcharge CSS hack for IE
81
        echo "<!--[if lte IE 6]>" ;
82
        echo "<link rel='stylesheet' href='".$CFG_GLPI["root_doc"]."/css/styles_ie.css' type='text/css' media='screen' >\n";
83
        echo "<![endif]-->";
84

    
85
        echo "<link rel='stylesheet' type='text/css' media='print' href='".$CFG_GLPI["root_doc"]."/css/print.css' >\n";
86
        //ryxeo
87
        echo "<link rel='stylesheet' href='".$CFG_GLPI["root_doc"]."/css/navbar.css' type='text/css' />\n";
88
        echo "<link rel='stylesheet' type='text/css' href='".$CFG_GLPI["root_doc"]."/css/abuledunet-vert.css' media='screen' title='Style par défaut de AbulÉdu.Net' />\n";
89
        echo "<link rel='shortcut icon' type='images/x-icon' href='".$CFG_GLPI["root_doc"]."/pics/favicon.ico' >\n";
90

    
91
        // AJAX library
92
        echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/lib/prototype.js'></script>\n";
93
        echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/lib/control.modal.js'></script>\n";
94
        echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/lib/scriptaculous/scriptaculous.js'></script>\n";
95

    
96
        // Some Javascript-Functions which we may need later
97
        echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/script.js'></script>\n";
98
        
99
        // Calendar scripts 
100
        if (isset($_SESSION["glpilanguage"])){
101
                echo "<style type=\"text/css\">@import url(".$CFG_GLPI["root_doc"]."/lib/calendar/aqua/theme.css);</style>\n";
102
                echo "<script type=\"text/javascript\" src=\"".$CFG_GLPI["root_doc"]."/lib/calendar/calendar.js\"></script>\n";
103
                echo "<script type=\"text/javascript\" src=\"".$CFG_GLPI["root_doc"]."/lib/calendar/lang/calendar-".$CFG_GLPI["languages"][$_SESSION["glpilanguage"]][2].".js\"></script>\n";
104
                echo "<script type=\"text/javascript\" src=\"".$CFG_GLPI["root_doc"]."/lib/calendar/calendar-setup.js\"></script>\n";
105
        }
106
        
107
        // Add specific javascript for plugins
108
        if (isset($PLUGIN_HOOKS['add_javascript'])&&count($PLUGIN_HOOKS['add_javascript'])){
109
                foreach  ($PLUGIN_HOOKS["add_javascript"] as $plugin => $file) {
110
                        echo "<script type=\"text/javascript\" src='".$CFG_GLPI["root_doc"]."/plugins/$plugin/$file'></script>\n";
111
                }
112
        }
113
        // Add specific css for plugins
114
        if (isset($PLUGIN_HOOKS['add_css'])&&count($PLUGIN_HOOKS['add_css'])){
115
                foreach  ($PLUGIN_HOOKS["add_css"] as $plugin => $file) {
116
                        echo "<link rel='stylesheet'  href='".$CFG_GLPI["root_doc"]."/plugins/$plugin/$file' type='text/css' media='screen' >\n";
117
                }
118
        }
119
        
120
        // End of Head
121
        echo "</head>\n";
122
}
123

    
124
/**
125
 * Common Title Function
126
 *
127
 * @param $ref_pic_link Path to the image to display
128
 * @param $ref_pic_text Alt text of the icon
129
 * @param $ref_title Title to display
130
 * @param $ref_btts Extra items to display array(link=>text...)
131
 * @return nothing
132
 **/
133
function displayTitle($ref_pic_link="",$ref_pic_text="",$ref_title="",$ref_btts="") {
134
        echo "<div class='center'><table border='0'><tr>";
135
        if ($ref_pic_link!="")
136
                echo "<td><img src=\"".$ref_pic_link."\" alt=\"".$ref_pic_text."\"
137
title=\"".$ref_pic_text."\" ></td>"; 
138
        if ($ref_title!="")
139
                echo "<td><span class='icon_consol'><strong>".$ref_title."</strong></span></td>"; 
140
        if (is_array($ref_btts)&&count($ref_btts))
141
        foreach ($ref_btts as $key => $val) { 
142
                echo "<td><a class='icon_consol_hov' href=\"".$key."\">".$val."</a></td>"; 
143
        }        
144
        echo "</tr></table></div>";
145
}
146

    
147
/**
148
 * Print a nice HTML head for every page
149
 *
150
 *
151
 * @param $title title of the page
152
 * @param $url not used anymore.
153
 * @param $sector sector in which the page displayed is
154
 * @param $item item corresponding to the page displayed
155
 * @param $option option corresponding to the page displayed
156
 *
157
 **/
158
function commonHeader($title,$url='',$sector="none",$item="none",$option="")
159
{
160
        // Print a nice HTML-head for every page
161

    
162
        global $CFG_GLPI,$LANG,$PLUGIN_HOOKS,$HEADER_LOADED,$INFOFORM_PAGES,$DB ;
163

    
164
        if ($HEADER_LOADED) return;
165
        $HEADER_LOADED=true;
166
        // Override list-limit if choosen
167
        if (isset($_POST['list_limit'])) {
168
                $_SESSION['glpilist_limit']=$_POST['list_limit'];
169
        }
170

    
171
        includeCommonHtmlHeader($title);
172
        if (!($CFG_GLPI["cache"]->start($sector.'_'.$item.$option,"GLPI_HEADER_".$_SESSION["glpiID"]))) {
173
                
174
        // Body 
175
                echo "<body>";
176

    
177
//ryxeo
178
echo "                <div id=\"page\">
179
                        <div id=\"top\">
180
                                <a href=\"/index\"
181
                                   title=\"Retouner directement à la page d'accueil\"
182
                                   id=\"link_home\"><h1>AbulÉdu.net</h1></a>
183
                        </div>
184
                <div id=\"navbar\">
185
                <ul>
186
              <li><a href=\"http://www.abuledu.org\" id=\"navbar_www\" title=\"Le projet AbulÉdu\" class=\"ttip\">AbulÉdu</a></li>
187
              <li><a href=\"http://www.abuledu.org/leterrier/\" id=\"navbar_leterrier\" title=\"Les logiciels libres pédagogiques fait par des enseignants dans le cadre du projet AbulÉdu\" class=\"ttip\">LeTerrier</a></li>
188
              <li><a href=\"http://libre.pedagosite.net/\" id=\"navbar_pedagosite\" title=\"Consultez les ressources pédagogiques réalisées par des enseignants et participez en envoyant vos contributions sur libre.pedagosite.net\" class=\"ttip\">Pédagosite</a></li>
189
              <li><a href=\"http://docs.abuledu.org/\" id=\"navbar_doc\" title=\"Toute la documentation d'AbulÉdu est disponible sur ce site internet\" class=\"ttip\">Documentation</a></li>
190

191
              <li><a href=\"http://forum.abuledu.org/\" id=\"navbar_forum\" title=\"Les forums\" class=\"ttip\">Forums</a></li>
192
              <li><a href=\"http://planete.abuledu.org/\" id=\"navbar_actu\" title=\"Suivez toute l'actualité du projet AbulÉdu sur la planète\" class=\"ttip\">Planète</a></li>
193
              <li><a href=\"http://www.abuledu.com/\" id=\"navbar_aepro\" title=\"AbulEdu.PRO vous propose un certain nombre de services professionnels.\" class=\"ttip\">Services PRO</a></li>
194
              <li id=\"active\"><a href=\"http://www.abuledu.net/\" id=\"navbar_anet\" title=\"AbulEdu.NET vous permet de gérer vos demandes d'interventions ou de superviser votre parc de serveurs. Ce service n'est disponible qu'aux abonnés au service AbulEdu.NET\" class=\"ttip\">AbulEdu.NET</a></li>
195
              <li><a href=\"http://servecole.abuledu.info/admin.php\" id=\"navbar_webadmin\" title=\"Administration de votre serveur AbulÉdu. Attention, Cet outil n'est accessible que si vous êtes à l'interieur d'un réseau AbulÉdu !\" class=\"ttip\">WebAdmin</a></li>
196
                </ul>
197
                <p>&nbsp;</p>
198
            </div>
199

200
                <div id=\"navigation\">
201
                <div id=\"navWiki\">
202
                        <h2>Liens rapides</h2>
203
                                <ul>
204
" . ryxeo_fastlinks() . "
205
                                </ul>
206
                        </div>
207
<div id=\"nav_connexion\">
208
<h2>Connexion</h2>
209
                        <div id=\"user_top_bar\">
210
                                <div id=\"box_unlogged\" class=\"identification_box\">
211

212
                                </div>
213
                        </div>
214
</div>
215
</div>
216
<div id=\"main\">\n";
217
                
218
                //  Generate array for menu and check right
219
                
220

    
221
                //////// INVENTORY
222
                $showstate=false;
223
                $menu['inventory']['title']=$LANG["Menu"][38];
224
                if (haveRight("computer","r")){
225
                        $menu['inventory']['default']='/front/computer.php';
226

    
227
                        $menu['inventory']['content']['computer']['title']=$LANG["Menu"][0];
228
                        $menu['inventory']['content']['computer']['shortcut']='c';
229
                        $menu['inventory']['content']['computer']['page']='/front/computer.php';
230
                        $menu['inventory']['content']['computer']['links']['search']='/front/computer.php';
231
                        if (haveRight("computer","w")){
232
                                $menu['inventory']['content']['computer']['links']['add']='/front/setup.templates.php?type='.COMPUTER_TYPE.'&amp;add=1';
233
                                $menu['inventory']['content']['computer']['links']['template']='/front/setup.templates.php?type='.COMPUTER_TYPE.'&amp;add=0';
234
                        }
235
                        $showstate=true;
236
                }
237
                if (haveRight("monitor","r")){
238
                        $menu['inventory']['content']['monitor']['title']=$LANG["Menu"][3];
239
                        $menu['inventory']['content']['monitor']['shortcut']='m';
240
                        $menu['inventory']['content']['monitor']['page']='/front/monitor.php';
241
                        $menu['inventory']['content']['monitor']['links']['search']='/front/monitor.php';
242
                        if (haveRight("monitor","w")){
243
                                $menu['inventory']['content']['monitor']['links']['add']='/front/setup.templates.php?type='.MONITOR_TYPE.'&amp;add=1';
244
                                $menu['inventory']['content']['monitor']['links']['template']='/front/setup.templates.php?type='.MONITOR_TYPE.'&amp;add=0';
245
                        }
246

    
247
                        $showstate=true;
248
                }
249
                if (haveRight("software","r")){
250
                        $menu['inventory']['content']['software']['title']=$LANG["Menu"][4];
251
                        $menu['inventory']['content']['software']['shortcut']='s';
252
                        $menu['inventory']['content']['software']['page']='/front/software.php';
253
                        $menu['inventory']['content']['software']['links']['search']='/front/software.php';
254
                        if (haveRight("software","w")){
255
                                $menu['inventory']['content']['software']['links']['add']='/front/setup.templates.php?type='.SOFTWARE_TYPE.'&amp;add=1';
256
                                $menu['inventory']['content']['software']['links']['template']='/front/setup.templates.php?type='.SOFTWARE_TYPE.'&amp;add=0';
257
                        }
258

    
259
                        $showstate=true;
260
                }
261
                if (haveRight("networking","r")){
262
                        $menu['inventory']['content']['networking']['title']=$LANG["Menu"][1];
263
                        $menu['inventory']['content']['networking']['shortcut']='n';
264
                        $menu['inventory']['content']['networking']['page']='/front/networking.php';
265
                        $menu['inventory']['content']['networking']['links']['search']='/front/networking.php';
266
                        if (haveRight("networking","w")){
267
                                $menu['inventory']['content']['networking']['links']['add']='/front/setup.templates.php?type='.NETWORKING_TYPE.'&amp;add=1';
268
                                $menu['inventory']['content']['networking']['links']['template']='/front/setup.templates.php?type='.NETWORKING_TYPE.'&amp;add=0';
269
                        }
270
                        $showstate=true;
271
                }
272
                if (haveRight("peripheral","r")){
273
                        $menu['inventory']['content']['peripheral']['title']=$LANG["Menu"][16];
274
                        $menu['inventory']['content']['peripheral']['shortcut']='n';
275
                        $menu['inventory']['content']['peripheral']['page']='/front/peripheral.php';
276
                        $menu['inventory']['content']['peripheral']['links']['search']='/front/peripheral.php';
277
                        if (haveRight("peripheral","w")){
278
                                $menu['inventory']['content']['peripheral']['links']['add']='/front/setup.templates.php?type='.PERIPHERAL_TYPE.'&amp;add=1';
279
                                $menu['inventory']['content']['peripheral']['links']['template']='/front/setup.templates.php?type='.PERIPHERAL_TYPE.'&amp;add=0';
280
                        }
281
                        $showstate=true;
282
                }
283
                if (haveRight("printer","r")){
284
                        $menu['inventory']['content']['printer']['title']=$LANG["Menu"][2];
285
                        $menu['inventory']['content']['printer']['shortcut']='p';
286
                        $menu['inventory']['content']['printer']['page']='/front/printer.php';
287
                        $menu['inventory']['content']['printer']['links']['search']='/front/printer.php';
288
                        if (haveRight("printer","w")){
289
                                $menu['inventory']['content']['printer']['links']['add']='/front/setup.templates.php?type='.PRINTER_TYPE.'&amp;add=1';
290
                                $menu['inventory']['content']['printer']['links']['template']='/front/setup.templates.php?type='.PRINTER_TYPE.'&amp;add=0';
291
                        }
292
                        $showstate=true;
293
                }
294
                if (haveRight("cartridge","r")){
295
                        $menu['inventory']['content']['cartridge']['title']=$LANG["Menu"][21];
296
                        $menu['inventory']['content']['cartridge']['shortcut']='c';
297
                        $menu['inventory']['content']['cartridge']['page']='/front/cartridge.php';
298
                        $menu['inventory']['content']['cartridge']['links']['search']='/front/cartridge.php';
299
                        if (haveRight("cartridge","w")){
300
                                $menu['inventory']['content']['cartridge']['links']['add']='/front/cartridge.form.php';
301
                        }
302
                }
303
                if (haveRight("consumable","r")){
304
                        $menu['inventory']['content']['consumable']['title']=$LANG["Menu"][32];
305
                        $menu['inventory']['content']['consumable']['shortcut']='g';
306
                        $menu['inventory']['content']['consumable']['page']='/front/consumable.php';
307
                        $menu['inventory']['content']['consumable']['links']['search']='/front/consumable.php';
308
                        if (haveRight("consumable","w")){
309
                                $menu['inventory']['content']['consumable']['links']['add']='/front/consumable.form.php';
310
                        }
311
                        $menu['inventory']['content']['consumable']['links']['summary']='/front/consumable.php?synthese=yes';
312
                }
313
                if (haveRight("phone","r")){
314
                        $menu['inventory']['content']['phone']['title']=$LANG["Menu"][34];
315
                        $menu['inventory']['content']['phone']['shortcut']='t';
316
                        $menu['inventory']['content']['phone']['page']='/front/phone.php';
317
                        $menu['inventory']['content']['phone']['links']['search']='/front/phone.php';
318
                        if (haveRight("phone","w")){
319
                                $menu['inventory']['content']['phone']['links']['add']='/front/setup.templates.php?type='.PHONE_TYPE.'&amp;add=1';
320
                                $menu['inventory']['content']['phone']['links']['template']='/front/setup.templates.php?type='.PHONE_TYPE.'&amp;add=0';
321
                        }
322
                        $showstate=true;
323
                }
324
                if ($showstate){
325
                        $menu['inventory']['content']['state']['title']=$LANG["Menu"][28];
326
                        $menu['inventory']['content']['state']['shortcut']='n';
327
                        $menu['inventory']['content']['state']['page']='/front/state.php';
328
                        $menu['inventory']['content']['state']['links']['search']='/front/state.php';
329
                        $menu['inventory']['content']['state']['links']['summary']='/front/state.php?synthese=yes';
330
                }
331

    
332

    
333
//////// ASSISTANCE
334
                $menu['maintain']['title']=$LANG["title"][24];
335

    
336
                if (haveRight("observe_ticket","1")||haveRight("show_all_ticket","1")||haveRight("create_ticket","1")){
337
                        $menu['maintain']['default']='/front/tracking.php';
338

    
339
                        $menu['maintain']['content']['tracking']['title']=$LANG["Menu"][5];
340
                        $menu['maintain']['content']['tracking']['shortcut']='t';
341
                        $menu['maintain']['content']['tracking']['page']='/front/tracking.php';
342
                        $menu['maintain']['content']['tracking']['links']['search']='/front/tracking.php';
343

    
344
                        $menu['maintain']['content']['helpdesk']['links']['search']='/front/tracking.php';
345

    
346
                }
347
                if (haveRight("create_ticket","1")){
348
                        $menu['maintain']['content']['helpdesk']['title']=$LANG["Menu"][31];
349
                        $menu['maintain']['content']['helpdesk']['shortcut']='h';
350
                        $menu['maintain']['content']['helpdesk']['page']='/front/helpdesk.php';
351
                        $menu['maintain']['content']['helpdesk']['links']['add']='/front/helpdesk.php';
352

    
353
                        $menu['maintain']['content']['tracking']['links']['add']='/front/helpdesk.php';
354
                }
355
                if (haveRight("show_planning","1")||haveRight("show_all_planning","1")){
356
                        $menu['maintain']['content']['planning']['title']=$LANG["Menu"][29];
357
                        $menu['maintain']['content']['planning']['shortcut']='l';
358
                        $menu['maintain']['content']['planning']['page']='/front/planning.php';
359
                        $menu['maintain']['content']['planning']['links']['search']='/front/planning.php';
360

    
361
                }
362
                if (haveRight("statistic","1")){
363
                        $menu['maintain']['content']['stat']['title']=$LANG["Menu"][13];
364
                        $menu['maintain']['content']['stat']['shortcut']='1';
365
                        $menu['maintain']['content']['stat']['page']='/front/stat.php';
366
                }
367
                
368
                
369
//////// FINANCIAL
370
                $menu['financial']['title']=$LANG["Menu"][26];
371
                if (haveRight("contact_enterprise","r")){
372
                        $menu['financial']['default']='/front/contact.php';
373

    
374
                        $menu['financial']['content']['contact']['title']=$LANG["Menu"][22];
375
                        $menu['financial']['content']['contact']['shortcut']='t';
376
                        $menu['financial']['content']['contact']['page']='/front/contact.php';
377
                        $menu['financial']['content']['contact']['links']['search']='/front/contact.php';
378

    
379
                        $menu['financial']['content']['enterprise']['title']=$LANG["Menu"][23];
380
                        $menu['financial']['content']['enterprise']['shortcut']='e';
381
                        $menu['financial']['content']['enterprise']['page']='/front/enterprise.php';
382
                        $menu['financial']['content']['enterprise']['links']['search']='/front/enterprise.php';
383

    
384
                        if (haveRight("contact_enterprise","w")){
385
                                $menu['financial']['content']['contact']['links']['add']='/front/contact.form.php';
386
                                $menu['financial']['content']['enterprise']['links']['add']='/front/enterprise.form.php';
387
                        }
388

    
389
                }
390
                if (haveRight("contract_infocom","r")){
391
                        $menu['financial']['content']['contract']['title']=$LANG["Menu"][25];
392
                        $menu['financial']['content']['contract']['shortcut']='n';
393
                        $menu['financial']['content']['contract']['page']='/front/contract.php';
394
                        $menu['financial']['content']['contract']['links']['search']='/front/contract.php';
395

    
396
                        if (haveRight("contract_infocom","w")){
397
                                $menu['financial']['content']['contract']['links']['add']='/front/contract.form.php';
398
                        }
399

    
400
                }
401
                if (haveRight("document","r")){
402
                        $menu['financial']['content']['document']['title']=$LANG["Menu"][27];
403
                        $menu['financial']['content']['document']['shortcut']='d';
404
                        $menu['financial']['content']['document']['page']='/front/document.php';
405
                        $menu['financial']['content']['document']['links']['search']='/front/document.php';
406

    
407
                        if (haveRight("document","w")){
408
                                $menu['financial']['content']['document']['links']['add']='/front/document.form.php';
409
                        }
410
                }
411
        
412
//////// UTILS
413
                $menu['utils']['title']=$LANG["Menu"][18];
414
                $menu['utils']['default']='/front/reminder.php';
415

    
416
                $menu['utils']['content']['reminder']['title']=$LANG["title"][37];
417
                $menu['utils']['content']['reminder']['page']='/front/reminder.php';
418
                $menu['utils']['content']['reminder']['links']['search']='/front/reminder.php';
419
                $menu['utils']['content']['reminder']['links']['add']='/front/reminder.form.php';
420

    
421
                if (haveRight("knowbase","r")||haveRight("faq","r")) {
422

    
423
                        $menu['utils']['content']['knowbase']['title']=$LANG["Menu"][19];
424
                        $menu['utils']['content']['knowbase']['page']='/front/knowbase.php';
425
                        $menu['utils']['content']['knowbase']['links']['search']='/front/knowbase.php';
426

    
427
                        if (haveRight("knowbase","w")||haveRight("faq","w")){
428
                                $menu['utils']['content']['knowbase']['links']['add']='/front/knowbase.form.php?ID=new';
429
                        }
430

    
431
                }
432
                if (haveRight("reservation_helpdesk","1")||haveRight("reservation_central","r")){
433
                        $menu['utils']['content']['reservation']['title']=$LANG["Menu"][17];
434
                        $menu['utils']['content']['reservation']['page']='/front/reservation.php';
435
                        $menu['utils']['content']['reservation']['links']['search']='/front/reservation.php';
436
                        $menu['utils']['content']['reservation']['links']['showall']='/front/reservation.php?show=resa&amp;ID';
437
                }
438
                if (haveRight("reservation_helpdesk","1")||haveRight("reservation_central","r")){
439
                        $menu['utils']['content']['reservation']['title']=$LANG["Menu"][17];
440
                        $menu['utils']['content']['reservation']['page']='/front/reservation.php';
441
                        $menu['utils']['content']['reservation']['links']['search']='/front/reservation.php';
442
                        $menu['utils']['content']['reservation']['links']['showall']='/front/reservation.php?show=resa&amp;ID';
443
                }
444
                if (haveRight("reports","r")){
445
                        $menu['utils']['content']['report']['title']=$LANG["Menu"][6];
446
                        $menu['utils']['content']['report']['page']='/front/report.php';
447
                }
448

    
449
                if ($CFG_GLPI["ocs_mode"]&&haveRight("ocsng","w")){
450
                        $menu['utils']['content']['ocsng']['title']=$LANG["Menu"][33];
451
                        $menu['utils']['content']['ocsng']['page']='/front/ocsng.php';
452
                //        $menu['utils']['content']['ocsng']['links']['search']='/front/ocsng.php';
453
                        }
454
                
455
                // PLUGINS
456
                if (isset($PLUGIN_HOOKS["menu_entry"])&&count($PLUGIN_HOOKS["menu_entry"])){        
457
                        $menu['plugins']['title']=$LANG["common"][29];
458

    
459
                        $plugins=array();
460
        
461
                        foreach  ($PLUGIN_HOOKS["menu_entry"] as $plugin => $active) {
462
                                if ($active){
463
                                        $function="plugin_version_$plugin";
464
        
465
                                        if (function_exists($function))
466
                                                $plugins[$plugin]=$function();
467
                                }
468
                        }
469
                        if (count($plugins)){
470
                                $list=array();
471
                                foreach ($plugins as $key => $val) {
472
                                        $list[$key]=$val["name"];
473
                                }
474
                                
475
                                asort($list);
476
                                foreach ($list as $key => $val) {
477
                                        $menu['plugins']['content'][$key]['title']=$val;
478
                                        $menu['plugins']['content'][$key]['page']='/plugins/'.$key.'/';
479
                                        if ($sector=="plugins"&&$item==$key){
480
                                                if (isset($PLUGIN_HOOKS["submenu_entry"][$key])&&is_array($PLUGIN_HOOKS["submenu_entry"][$key])){
481
                                                        foreach ($PLUGIN_HOOKS["submenu_entry"][$key] as $name => $link){
482
                                                                if (is_array($link))
483
                                                                {
484
                                                                         if (isset($link[$option]))
485
                                                                                 $menu['plugins']['content'][$key]['links'][$name]='/plugins/'.$key.'/'.$link[$option];
486
                                                                }
487
                                                                else
488
                                                                        $menu['plugins']['content'][$key]['links'][$name]='/plugins/'.$key.'/'.$link;
489
                                                        }
490
                                                }
491
                                        }
492
                                }
493
                                
494
                        }
495

    
496
                }
497
                //////// ADMINISTRATION
498
                $menu['admin']['title']=$LANG["Menu"][15];
499

    
500
                if (haveRight("user","r")){
501
                        $menu['admin']['default']='/front/user.php';
502

    
503
                        $menu['admin']['content']['user']['title']=$LANG["Menu"][14];
504
                        $menu['admin']['content']['user']['shortcut']='u';
505
                        $menu['admin']['content']['user']['page']='/front/user.php';
506
                        $menu['admin']['content']['user']['links']['search']='/front/user.php';
507

    
508
                        if (haveRight("user","w")){
509
                                $menu['admin']['content']['user']['links']['add']="/front/user.form.php";
510
                        }
511

    
512
                        switch($option){
513
                                case 'ldap' :
514
                                        $menu['admin']['content']['user']['links']['showall']="/front/ldap.php";
515
                                        break;
516

    
517
                        }
518

    
519
                }
520
                if (haveRight("group","r")){
521
                        $menu['admin']['content']['group']['title']=$LANG["Menu"][36];
522
                        $menu['admin']['content']['group']['shortcut']='g';
523
                        $menu['admin']['content']['group']['page']='/front/group.php';
524
                        $menu['admin']['content']['group']['links']['search']='/front/group.php';
525

    
526
                        if (haveRight("group","w")){
527
                                $menu['admin']['content']['group']['links']['add']="/front/group.form.php";
528
                        }
529

    
530
                }
531

    
532
                if (haveRight("entity","r")){
533
                        $menu['admin']['content']['entity']['title']=$LANG["Menu"][37];
534
                        $menu['admin']['content']['entity']['shortcut']='z';
535
                        $menu['admin']['content']['entity']['page']='/front/entity.php';
536
                        $menu['admin']['content']['entity']['links']['search']='/front/entity.php';
537

    
538
                        //$menu['admin']['content']['entity']['links'][$LANG["entity"][2]]="/front/entity.form.php?ID=0"; 
539
                        $menu['admin']['content']['entity']['links']['add']="/front/entity.tree.php";
540
                }
541

    
542
                if (haveRight("rule_ldap","r")||haveRight("rule_ocs","r")||haveRight("rule_tracking","r")|| haveRight("rule_softwarecategories","r")){
543
                        $menu['admin']['content']['rule']['title']=$LANG["rulesengine"][17];
544
                        $menu['admin']['content']['rule']['shortcut']='r';
545
                        $menu['admin']['content']['rule']['page']='/front/rule.php';
546
                        switch($option){
547
                                 case RULE_OCS_AFFECT_COMPUTER :
548
                                        $menu['admin']['content']['rule']['links']['search']='/front/rule.ocs.php';
549
                                        $menu['admin']['content']['rule']['links']['add']='/front/rule.ocs.form.php';
550
                                        break;
551
                                case RULE_AFFECT_RIGHTS :
552
                                        $menu['admin']['content']['rule']['links']['search']='/front/rule.right.php';
553
                                        $menu['admin']['content']['rule']['links']['add']='/front/rule.right.form.php';
554
                                        break;
555
                                case RULE_TRACKING_AUTO_ACTION :
556
                                        $menu['admin']['content']['rule']['links']['search']='/front/rule.tracking.php';
557
                                        $menu['admin']['content']['rule']['links']['add']='/front/rule.tracking.form.php';
558
                                        break;
559
                                case RULE_SOFTWARE_CATEGORY :
560
                                        $menu['admin']['content']['rule']['links']['search']='/front/rule.softwarecategories.php';
561
                                        $menu['admin']['content']['rule']['links']['add']='/front/rule.softwarecategories.form.php';
562
                                        break;
563
                        }
564
                }
565

    
566
                if (haveRight("rule_dictionnary_manufacturer","r") || haveRight("rule_dictionnary_software","r") ||
567
                        haveRight("rule_dictionnary_model","r") || haveRight("rule_dictionnary_type","r")||
568
                         haveRight("rule_dictionnary_os","r")){
569
                        $menu['admin']['content']['dictionnary']['title']=$LANG["rulesengine"][77];
570
                        $menu['admin']['content']['dictionnary']['shortcut']='r';
571
                        $menu['admin']['content']['dictionnary']['page']='/front/dictionnary.php';
572
                        switch($option){
573
                                case RULE_DICTIONNARY_MANUFACTURER :
574
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.manufacturer.php';
575
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.manufacturer.form.php';
576
                                        break;
577
                                case RULE_DICTIONNARY_SOFTWARE :
578
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.software.php';
579
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.software.form.php';
580
                                        break;
581
                                case RULE_DICTIONNARY_MODEL_COMPUTER :
582
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.computer.php';
583
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.computer.form.php';
584
                                        break;
585
                                case RULE_DICTIONNARY_MODEL_MONITOR :
586
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.monitor.php';
587
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.monitor.form.php';
588
                                        break;
589
                                case RULE_DICTIONNARY_MODEL_PRINTER :
590
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.printer.php';
591
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.printer.form.php';
592
                                        break;
593
                                case RULE_DICTIONNARY_MODEL_PERIPHERAL :
594
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.peripheral.php';
595
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.peripheral.form.php';
596
                                        break;
597
                                case RULE_DICTIONNARY_MODEL_NETWORKING :
598
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.networking.php';
599
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.networking.form.php';
600
                                        break;
601
                                case RULE_DICTIONNARY_MODEL_PHONE :
602
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.model.phone.php';
603
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.model.phone.form.php';
604
                                        break;
605
                                case RULE_DICTIONNARY_TYPE_COMPUTER :
606
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.computer.php';
607
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.computer.form.php';
608
                                        break;
609
                                case RULE_DICTIONNARY_TYPE_MONITOR :
610
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.monitor.php';
611
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.monitor.form.php';
612
                                        break;
613
                                case RULE_DICTIONNARY_TYPE_PRINTER :
614
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.printer.php';
615
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.printer.form.php';
616
                                        break;
617
                                case RULE_DICTIONNARY_TYPE_PERIPHERAL :
618
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.peripheral.php';
619
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.peripheral.form.php';
620
                                        break;
621
                                case RULE_DICTIONNARY_TYPE_NETWORKING :
622
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.networking.php';
623
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.networking.form.php';
624
                                        break;
625
                                case RULE_DICTIONNARY_TYPE_PHONE :
626
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.type.phone.php';
627
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.type.phone.form.php';
628
                                        break;
629
                                case RULE_DICTIONNARY_OS :
630
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.os.php';
631
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.os.form.php';
632
                                        break;
633
                                case RULE_DICTIONNARY_OS_SP :
634
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.os_sp.php';
635
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.os_sp.form.php';
636
                                        break;
637
                                case RULE_DICTIONNARY_OS_VERSION :
638
                                        $menu['admin']['content']['dictionnary']['links']['search']='/front/rule.dictionnary.os_version.php';
639
                                        $menu['admin']['content']['dictionnary']['links']['add']='/front/rule.dictionnary.os_version.form.php';
640
                                        break;
641
                        }
642
                }
643

    
644

    
645
                if (haveRight("profile","r")){
646
                        $menu['admin']['content']['profile']['title']=$LANG["Menu"][35];
647
                        $menu['admin']['content']['profile']['shortcut']='p';
648
                        $menu['admin']['content']['profile']['page']='/front/profile.php';
649
                        $menu['admin']['content']['profile']['links']['search']="/front/profile.php";
650
                        if (haveRight("profile","w")){
651
                                $menu['admin']['content']['profile']['links']['add']="/front/profile.form.php";
652
                        }
653

    
654
                }
655

    
656
                if (haveRight("transfer","r")&&isMultiEntitiesMode()){
657
                        $menu['admin']['content']['transfer']['title']=$LANG["transfer"][1];
658
                        $menu['admin']['content']['transfer']['shortcut']='t';
659
                        $menu['admin']['content']['transfer']['page']='/front/transfer.php';
660
                        $menu['admin']['content']['transfer']['links']['search']="/front/transfer.php";
661
                        if (haveRight("transfer","w")){
662
                                $menu['admin']['content']['transfer']['links']['summary']="/front/transfer.action.php";
663
                                $menu['admin']['content']['transfer']['links']['add']="/front/transfer.form.php";
664
                        }
665
                }
666

    
667
//                $config[$LANG["common"][12]]=array("setup.php","2");
668
                if (haveRight("backup","w")){
669
                        $menu['admin']['content']['backup']['title']=$LANG["Menu"][12];
670
                        $menu['admin']['content']['backup']['shortcut']='b';
671
                        $menu['admin']['content']['backup']['page']='/front/backup.php';
672
                }
673
                if (haveRight("logs","r")){
674
                        $menu['admin']['content']['log']['title']=$LANG["Menu"][30];
675
                        $menu['admin']['content']['log']['shortcut']='l';
676
                        $menu['admin']['content']['log']['page']='/front/log.php';
677
                }
678
                
679

    
680
// CONFIG
681
                $config=array();
682
                $addconfig=array();
683
                $menu['config']['title']=$LANG["common"][12];
684
                $menu['config']['default']='/front/setup.php';
685

    
686
                if (haveRight("dropdown","w")||haveRight("entity_dropdown","w")){
687
                        $menu['config']['content']['dropdowns']['title']=$LANG["setup"][0];
688
                        $menu['config']['content']['dropdowns']['page']='/front/setup.dropdowns.php';
689
                }
690
                if (haveRight("device","w")){
691
                        $menu['config']['content']['device']['title']=$LANG["title"][30];
692
                        $menu['config']['content']['device']['page']='/front/device.php';
693
                }
694

    
695
                if (haveRight("config","w")){
696
                        $menu['config']['content']['config']['title']=$LANG["setup"][703];
697
                        $menu['config']['content']['config']['page']='/front/setup.config.php';
698

    
699
                        $menu['config']['content']['mailing']['title']=$LANG["setup"][704];
700
                        $menu['config']['content']['mailing']['page']='/front/setup.mailing.php';
701

    
702
                        $menu['config']['content']['extauth']['title']=$LANG["login"][10];
703
                        $menu['config']['content']['extauth']['page']='/front/setup.auth.php';
704
                        $menu['config']['content']['extauth']['links']['search']='/front/setup.auth.php';
705
                        switch ($option){
706
                                case 1 : // LDAP
707
                                        $menu['config']['content']['extauth']['links']['add']='/front/setup.auth.php?next=extauth_ldap';
708
                                        break;
709
                                case 2 : // IMAP
710
                                        $menu['config']['content']['extauth']['links']['add']='/front/setup.auth.php?next=extauth_mail';
711
                                        break;
712
                        }
713

    
714
                        $menu['config']['content']['mailgate']['title']=$LANG["Menu"][39];
715
                        $menu['config']['content']['mailgate']['page']='/front/mailgate.php';
716
                        $menu['config']['content']['mailgate']['links']['search']='/front/mailgate.php';
717
                        $menu['config']['content']['mailgate']['links']['add']='/front/mailgate.form.php';
718

    
719
                }
720

    
721
                if ($CFG_GLPI["ocs_mode"]&&haveRight("config","w")){
722
                        $menu['config']['content']['ocsng']['title']=$LANG["setup"][134];
723
                        $menu['config']['content']['ocsng']['page']='/front/setup.ocsng.php';
724
                        $menu['config']['content']['ocsng']['links']['search']='/front/setup.ocsng.php';
725
                        $menu['config']['content']['ocsng']['links']['add']='/front/setup.templates.php?type='.OCSNG_TYPE.'&amp;add=1';
726
                        $menu['config']['content']['ocsng']['links']['template']='/front/setup.templates.php?type='.OCSNG_TYPE.'&amp;add=0';
727
                }
728

    
729
                if (haveRight("typedoc","r")){
730
                        $menu['config']['content']['typedoc']['title']=$LANG["document"][7];
731
                        $menu['config']['content']['typedoc']['page']='/front/typedoc.php';
732
                        $menu['config']['content']['typedoc']['hide']=true;
733
                        $menu['config']['content']['typedoc']['links']['search']='/front/typedoc.php';
734

    
735
                        if (haveRight("typedoc","w")){
736
                                $menu['config']['content']['typedoc']['links']['add']="/front/typedoc.form.php";
737
                        }
738

    
739
                }
740
                if (haveRight("link","r")){
741
                        $menu['config']['content']['link']['title']=$LANG["title"][33];
742
                        $menu['config']['content']['link']['page']='/front/link.php';
743
                        $menu['config']['content']['link']['hide']=true;
744
                        $menu['config']['content']['link']['links']['search']='/front/link.php';
745

    
746
                        if (haveRight("link","w")){
747
                                $menu['config']['content']['link']['links']['add']="/front/link.form.php";
748
                        }
749

    
750
                }        
751

    
752

    
753
                if (isset($PLUGIN_HOOKS['config_page'])&&is_array($PLUGIN_HOOKS['config_page'])&&count($PLUGIN_HOOKS['config_page']))        {
754
                        $menu['config']['content']['plugins']['title']=$LANG["common"][29];
755
                        $menu['config']['content']['plugins']['page']='/front/setup.plugins.php';
756
                }
757
                echo "<div id='header'>";
758
                //ryxeo
759
                //echo "<div id='c_logo' ><a href='".$CFG_GLPI["root_doc"]."/front/central.php'  title=\"".$LANG["central"][5]."\"></a></div>";
760
                
761
                // Les préférences + lien déconnexion 
762
                echo "<div id='c_preference' >";
763
                echo "<ul><li id='deconnexion'><a href=\"".$CFG_GLPI["root_doc"]."/logout.php";
764
                // logout witour noAuto login for extauth
765
                if (isset($_SESSION['glpiextauth'])&&$_SESSION['glpiextauth']){
766
                        echo "?noAUTO=1";
767
                }
768
                echo "\"  title=\"".$LANG["central"][6]."\">".$LANG["central"][6]."  </a>";
769

    
770
                echo "(";
771
                echo formatUserName (0,$_SESSION["glpiname"],$_SESSION["glpirealname"],$_SESSION["glpifirstname"],0,20);
772
                echo ")</li>\n"; 
773

    
774
                echo "        <li><a href='".(empty($CFG_GLPI["centralhelp_url"])?"http://glpi-project.org/help-central":$CFG_GLPI["centralhelp_url"])."' target='_blank' title='".$LANG["central"][7]."'>    ".$LANG["central"][7]."</a></li>\n"; 
775

    
776
                echo "        <li> <a href=\"".$CFG_GLPI["root_doc"]."/front/user.form.my.php\" title=\"".$LANG["Menu"][11]."\" >".$LANG["Menu"][11]."   </a></li>\n"; 
777
                echo "</ul>\n"; 
778
                echo "<div class='sep'></div>\n"; 
779
                echo "</div>\n"; 
780
                
781
                //-- Le moteur de recherche -->
782
                echo "<div id='c_recherche' >\n"; 
783

    
784
                echo "<form method='get' action='".$CFG_GLPI["root_doc"]."/front/search.php'>\n"; 
785
                echo "        <div id='boutonRecherche'><input type='image' src='".$CFG_GLPI["root_doc"]."/pics/ok2.png'  value='OK'   title=\"".$LANG["buttons"][2]."\"  alt=\"".$LANG["buttons"][2]."\"  ></div>\n"; 
786
                echo "        <div id='champRecherche'><input size='15' type='text' name='globalsearch' value='".$LANG["buttons"][0]."' onfocus=\"this.value='';\" ></div>        \n";                 
787

    
788
                echo "</form>\n"; 
789

    
790
                echo "<div class='sep'></div>\n"; 
791
                echo "</div>";
792
        
793
                //<!-- Le menu principal -->
794
                echo "<div id='c_menu'>";
795
                echo "        <ul id='menu'>";
796
                
797
        
798
                // Get object-variables and build the navigation-elements
799
                $i=1;
800
                foreach ($menu as $part => $data){
801
                        if (isset($data['content'])&&count($data['content'])){
802
                                echo "        <li id='menu$i' onmouseover=\"javascript:menuAff('menu$i','menu');\" >";
803

    
804
                                $link="#";
805
                                if (isset($data['default'])&&!empty($data['default'])){
806
                                        $link=$CFG_GLPI["root_doc"].$data['default'];
807
                                }
808
                                if (strlen($data['title'])>14){
809
                                        $data['title']=utf8_substr($data['title'],0,14)."...";
810
                                }
811

    
812
                                echo "<a href=\"$link\" class='itemP'>".$data['title']."</a>"; 
813
                                echo "<ul class='ssmenu'>"; 
814
                                // list menu item 
815
                                foreach ($data['content'] as $key => $val) {
816
                                        if (isset($val['page'])&&isset($val['title'])){
817
                                                echo "<li><a href=\"".$CFG_GLPI["root_doc"].$val['page']."\"";
818
                                                if (isset($data['shortcut'])&&!empty($data['shortcut'])){
819
                                                        echo " accesskey=\"".$val['shortcut']."\" ";
820
                                                }
821
                                                        
822
                                                echo ">".$val['title']."</a></li>\n";
823
                                        }
824
                                }
825
        
826
                                echo "</ul>";
827
                                echo "</li>";                
828
                        
829
                        $i++;        
830
                        }
831
                }
832

    
833
                echo "</ul>";                
834
                echo "<div class='sep'></div>";
835
                echo "</div>";
836
        
837
                // End navigation bar
838
        
839
                // End headline
840

    
841
                // Le sous menu contextuel 1
842
                echo "<div id='c_ssmenu1' >";
843
                echo "<ul>";
844
                // list sous-menu item 
845
                if (isset($menu[$sector])){
846
                        if (isset($menu[$sector]['content'])&&is_array($menu[$sector]['content'])){
847

    
848
                                $ssmenu=$menu[$sector]['content'];
849
                                if (count($ssmenu)>12){
850
                                        foreach ($ssmenu as $key => $val){
851
                                                if (isset($val['hide'])){
852
                                                        unset($ssmenu[$key]);
853
                                                }
854
                                        }
855
                                        $ssmenu=array_splice($ssmenu,0,12);
856
                                }
857
                        
858
                                foreach ($ssmenu as $key => $val) {
859
                                        if (isset($val['page'])&&isset($val['title'])){
860
                                                echo "<li><a href=\"".$CFG_GLPI["root_doc"].$val['page']."\" ";
861
                                                if (isset($val['shortcut'])&&!empty($val['shortcut'])){
862
                                                        echo " accesskey=\"".$val['shortcut']."\"";
863
                                                }
864
                                                echo ">".$val['title']."</a></li>\n";
865
                                        }
866
                                }
867
                        } else echo "<li>&nbsp;</li>";
868
                } else echo "<li>&nbsp;</li>";
869
                echo "</ul>";
870
                echo "</div>";
871
                
872
                //  Le fil d arianne 
873
                echo "<div id='c_ssmenu2' >";
874
                echo "<ul>";
875

    
876
                // Display item
877
                echo "        <li><a   href='".$CFG_GLPI["root_doc"]."/front/central.php' title='".$LANG["common"][56]."' >".$LANG["common"][56]." </a> ></li>";
878

    
879
                if (isset($menu[$sector])){
880
                        $link="/front/central.php";
881
                        if (isset($menu[$sector]['default'])){
882
                                $link=$menu[$sector]['default'];
883
                        }
884
                        echo "        <li><a href='".$CFG_GLPI["root_doc"].$link."' title='".$menu[$sector]['title']."' >".$menu[$sector]['title']." </a> > </li>";
885
                }
886

    
887
                if (isset($menu[$sector]['content'][$item])){
888
                        // Title
889
                        echo "        <li><a href='".$CFG_GLPI["root_doc"].$menu[$sector]['content'][$item]['page']."' class='here' title='".$menu[$sector]['content'][$item]['title']."' >".$menu[$sector]['content'][$item]['title']." </a></li>";
890
                        echo "<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>";
891

    
892
                        // Add item
893
                        echo "<li>";
894
                        if (isset($menu[$sector]['content'][$item]['links']['add'])){
895
                                echo "<a href='".$CFG_GLPI["root_doc"].$menu[$sector]['content'][$item]['links']['add']."'><img  src='".$CFG_GLPI["root_doc"]."/pics/menu_add.png' title='".$LANG["buttons"][8]."' alt='".$LANG["buttons"][8]."'></a>";
896
                        } else {
897
                                echo "<img src='".$CFG_GLPI["root_doc"]."/pics/menu_add_off.png' title='".$LANG["buttons"][8]."' alt='".$LANG["buttons"][8]."'>";
898
                        }
899
                        echo "</li>";
900
                        // Search Item
901
                        if (isset($menu[$sector]['content'][$item]['links']['search'])){
902
                                echo "<li><a href='".$CFG_GLPI["root_doc"].$menu[$sector]['content'][$item]['links']['search']."' ><img  src='".$CFG_GLPI["root_doc"]."/pics/menu_search.png' title='".$LANG["buttons"][0]."' alt='".$LANG["buttons"][0]."'></a></li>";
903
                        } else {
904
                                echo "<li><img src='".$CFG_GLPI["root_doc"]."/pics/menu_search_off.png' title='".$LANG["buttons"][0]."' alt='".$LANG["buttons"][0]."'></li>";
905
                        }
906
                        
907
                        // Links
908
                        if (isset($menu[$sector]['content'][$item]['links'])&&is_array($menu[$sector]['content'][$item]['links'])){
909
                                foreach ($menu[$sector]['content'][$item]['links'] as $key => $val) {
910
                                        switch ($key){
911
                                                case "add":
912
                                                case "search":
913
                                                        break;
914
                                                case "template":
915
                                                        echo "<li><a href='".$CFG_GLPI["root_doc"].$val."' ><img title='".$LANG["common"][8]."' alt='".$LANG["common"][8]."' src='".$CFG_GLPI["root_doc"]."/pics/menu_addtemplate.png' > </a></li>";
916
                                                        break;
917
                                                case "showall":
918
                                                        echo "<li><a href='".$CFG_GLPI["root_doc"].$val."' ><img title='".$LANG["buttons"][40]."' alt='".$LANG["buttons"][40]."' src='".$CFG_GLPI["root_doc"]."/pics/menu_showall.png' > </a></li>";
919
                                                        break;
920
                                                case "summary":
921
                                                        echo "<li><a href='".$CFG_GLPI["root_doc"].$val."' ><img title='".$LANG["state"][11]."' alt='".$LANG["state"][11]."' src='".$CFG_GLPI["root_doc"]."/pics/menu_show.png' > </a></li>";
922
                                                        break;
923
                                                case "config":
924
                                                        echo "<li><a href='".$CFG_GLPI["root_doc"].$val."' ><img title='".$LANG["common"][12]."' alt='".$LANG["common"][12]."' src='".$CFG_GLPI["root_doc"]."/pics/menu_config.png' > </a></li>";
925
                                                        break;
926

    
927
                                                default :
928
                                                        echo "<li><a href='".$CFG_GLPI["root_doc"].$val."' >".$key." </a></li>";
929
                                                        break;
930
                                        }
931
                                }
932
                        }
933
                } else {
934
                        echo "<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>";
935
                        echo "<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>";
936
                }
937
                // Add common items 
938
                echo "<li>";
939

    
940
                        // Display MENU ALL
941
                        echo "<div id='show_all_menu' onmouseover=\"completecleandisplay('show_all_menu');\">";
942
                        $items_per_columns=15;
943
                        $i=-1;
944
                        echo "<table><tr><td valign='top'><table>";
945
                        foreach ($menu as $part => $data){
946
                                if (isset($data['content'])&&count($data['content'])){
947
        
948
                                        if ($i>$items_per_columns){
949
                                                $i=0;
950
                                                echo "</table></td><td valign='top'><table>";
951
                                        }
952
                                        $link="#";
953
                                        if (isset($data['default'])&&!empty($data['default'])){
954
                                                $link=$CFG_GLPI["root_doc"].$data['default'];
955
                                        }
956
                                        echo "<tr><td class='tab_bg_1'><strong><a href=\"$link\" title=\"".$data['title']."\" class='itemP'>".$data['title']."</a></strong></td></tr>"; 
957
                                        $i++;
958
        
959
                                        // list menu item 
960
                                        foreach ($data['content'] as $key => $val) {
961
                                                if ($i>$items_per_columns){
962
                                                        $i=0;
963
                                                        echo "</table></td><td valign='top'><table>";
964
                                                }
965
                                                if (isset($val['page'])&&isset($val['title'])){
966
                                                        echo "<tr><td><a href=\"".$CFG_GLPI["root_doc"].$val['page']."\"";
967
                                                        if (isset($data['shortcut'])&&!empty($data['shortcut'])){
968
                                                                echo " accesskey=\"".$val['shortcut']."\" ";
969
                                                        }
970
                                                                
971
                                                        echo ">".$val['title']."</a></td></tr>\n";
972
                                                        $i++;
973
                                                }
974
                                        }                        
975
                                }
976
                        }
977
                        echo "</table></td></tr></table>";
978
                        
979
                        echo "</div>";
980
                echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
981
                echo "</li>";
982

    
983
                // Bookmark load
984
                echo "<li>";
985
                echo "  <a href='#' onClick=\"var w=window.open('".$CFG_GLPI["root_doc"]."/front/popup.php?popup=load_bookmark' ,'glpibookmarks', 'height=400, width=600, top=100, left=100, scrollbars=yes' );w.focus();\">"; 
986
                echo "   <img src='".$CFG_GLPI["root_doc"]."/pics/bookmark.png' title=\"".$LANG["buttons"][52]." ".$LANG["bookmark"][1]."\"  alt=\"".$LANG["buttons"][52]." ".$LANG["bookmark"][1]."\"    >"; 
987
                echo "  </a>";
988
                echo "</li>";
989

    
990

    
991
/*                echo "<li  id='headercalendar'><img  src='".$CFG_GLPI["root_doc"]."/pics/menu_calendar.png'  alt='".$LANG["buttons"][15]."' title='".$LANG["buttons"][15]."'>";
992

993
                echo "<script type='text/javascript'>";
994
                echo "Calendar.setup(";
995
                echo "{";
996
                echo "ifFormat : '%Y-%m-%d',"; // the datetime format
997
                echo "button : 'headercalendar' "; // ID of the button
998
                echo "});";
999
                echo "</script>";
1000
                echo "</li>";
1001
*/                
1002

    
1003
                // MENU ALL
1004
                echo "<li >";
1005
                echo "<img  alt='' src='".$CFG_GLPI["root_doc"]."/pics/menu_all.png' onclick=\"completecleandisplay('show_all_menu');
1006
                \">";
1007
                echo "</li>";
1008
                showProfileSelecter($CFG_GLPI["root_doc"]."/front/central.php");        
1009
                echo "</ul>";        
1010

    
1011
                echo "        </div>";
1012
                        
1013
                echo "</div>\n"; // fin header
1014

    
1015
                
1016
                
1017
                echo "<div  id='page' >";
1018
                
1019
                $CFG_GLPI["cache"]->end();
1020
        }
1021

    
1022
        if ($DB->isSlave() && !$DB->first_connection)
1023
        {        
1024
                echo "<div id='dbslave-float'>";                
1025
                echo "<a href='#see_debug'>".$LANG["setup"][809]."</a>";
1026
                echo "</div>";
1027
        }
1028
        
1029
        // call function callcron() every 5min
1030
        if (isset($_SESSION["glpicrontimer"])){
1031
                if (abs(time()-$_SESSION["glpicrontimer"])>300){
1032
                        callCron();
1033
                        $_SESSION["glpicrontimer"]=time();
1034
                } 
1035
        } else $_SESSION["glpicrontimer"]=time();
1036

    
1037
        displayMessageAfterRedirect();
1038
}
1039

    
1040
/**
1041
 * Display a div containing a message set in session in the previous page
1042
 *
1043
 *
1044
 **/
1045
function displayMessageAfterRedirect(){
1046
        // Affichage du message apres redirection
1047
        if (isset($_SESSION["MESSAGE_AFTER_REDIRECT"])&&!empty($_SESSION["MESSAGE_AFTER_REDIRECT"])){
1048
                echo "<div class=\"box\" style=\"margin-bottom:20px;\">";
1049
                echo "<div class=\"box-tleft\"><div class=\"box-tright\"><div class=\"box-tcenter\"></div></div></div>";
1050
                echo "<div class=\"box-mleft\"><div class=\"box-mright\"><div class=\"box-mcenter\">";
1051
                echo "<h3>".$_SESSION["MESSAGE_AFTER_REDIRECT"]."</h3>";
1052
                echo "</div></div></div>";
1053
                echo "<div class=\"box-bleft\"><div class=\"box-bright\"><div class=\"box-bcenter\"></div></div></div>";
1054
                echo "</div>";
1055

    
1056
        } 
1057
        // Clean message
1058
        $_SESSION["MESSAGE_AFTER_REDIRECT"]="";
1059
}
1060
/**
1061
 * Add a message to be displayed after redirect
1062
 *
1063
 * @param $msg Message to add
1064
 * @param $check_once Check if the message is not already added
1065
 **/
1066
function addMessageAfterRedirect($msg,$check_once=false){
1067
        if (!empty($msg)){
1068
                if ($check_once){
1069
                        if (strstr($_SESSION["MESSAGE_AFTER_REDIRECT"],$msg)===false){
1070
                                $_SESSION["MESSAGE_AFTER_REDIRECT"].=$msg.'<br>';
1071
                        }
1072
                } else {
1073
                        $_SESSION["MESSAGE_AFTER_REDIRECT"].=$msg.'<br>';
1074
                }
1075
        }
1076
}
1077

    
1078
/**
1079
 * Print a nice HTML head for help page
1080
 *
1081
 *
1082
 * @param $title title of the page
1083
 * @param $url not used anymore.
1084
 **/
1085
function helpHeader($title,$url='') {
1086
        // Print a nice HTML-head for help page
1087

    
1088
        global $CFG_GLPI,$LANG, $CFG_GLPI,$HEADER_LOADED,$PLUGIN_HOOKS ;
1089

    
1090
        if ($HEADER_LOADED) return;
1091
        $HEADER_LOADED=true;
1092

    
1093
        // Override list-limit if choosen
1094
        if (isset($_POST['list_limit'])) {
1095
                $_SESSION['glpilist_limit']=$_POST['list_limit'];
1096
        }
1097

    
1098

    
1099
        includeCommonHtmlHeader($title);
1100

    
1101
        // Body 
1102
        echo "<body>";
1103

    
1104
//ryxeo
1105
echo "                <div id=\"page\">
1106
                        <div id=\"top\">
1107
                                <a href=\"/index\"
1108
                                   title=\"Retouner directement à la page d'accueil\"
1109
                                   id=\"link_home\"><h1>AbulÉdu.net</h1></a>
1110
                        </div>
1111
                <div id=\"navbar\">
1112
                <ul>
1113
              <li><a href=\"http://www.abuledu.org\" id=\"navbar_www\" title=\"Le projet AbulÉdu\" class=\"ttip\">AbulÉdu</a></li>
1114
              <li><a href=\"http://www.abuledu.org/leterrier/\" id=\"navbar_leterrier\" title=\"Les logiciels libres pédagogiques fait par des enseignants dans le cadre du projet AbulÉdu\" class=\"ttip\">LeTerrier</a></li>
1115
              <li><a href=\"http://libre.pedagosite.net/\" id=\"navbar_pedagosite\" title=\"Consultez les ressources pédagogiques réalisées par des enseignants et participez en envoyant vos contributions sur libre.pedagosite.net\" class=\"ttip\">Pédagosite</a></li>
1116
              <li><a href=\"http://docs.abuledu.org/\" id=\"navbar_doc\" title=\"Toute la documentation d'AbulÉdu est disponible sur ce site internet\" class=\"ttip\">Documentation</a></li>
1117

1118
              <li><a href=\"http://forum.abuledu.org/\" id=\"navbar_forum\" title=\"Les forums\" class=\"ttip\">Forums</a></li>
1119
              <li><a href=\"http://planete.abuledu.org/\" id=\"navbar_actu\" title=\"Suivez toute l'actualité du projet AbulÉdu sur la planète\" class=\"ttip\">Planète</a></li>
1120
              <li><a href=\"http://www.abuledu.com/\" id=\"navbar_aepro\" title=\"AbulEdu.PRO vous propose un certain nombre de services professionnels.\" class=\"ttip\">Services PRO</a></li>
1121
              <li id=\"active\"><a href=\"http://www.abuledu.net/\" id=\"navbar_anet\" title=\"AbulEdu.NET vous permet de gérer vos demandes d'interventions ou de superviser votre parc de serveurs. Ce service n'est disponible qu'aux abonnés au service AbulEdu.NET\" class=\"ttip\">AbulEdu.NET</a></li>
1122
              <li><a href=\"http://servecole.abuledu.info/admin.php\" id=\"navbar_webadmin\" title=\"Administration de votre serveur AbulÉdu. Attention, Cet outil n'est accessible que si vous êtes à l'interieur d'un réseau AbulÉdu !\" class=\"ttip\">WebAdmin</a></li>
1123
                </ul>
1124
                <p>&nbsp;</p>
1125
            </div>
1126

1127
                <div id=\"navigation\">
1128
                <div id=\"navWiki\">
1129
                        <h2>Liens rapides</h2>
1130
                                <ul>
1131
" . ryxeo_fastlinks() . "
1132
                                </ul>
1133
                        </div>
1134
<div id=\"nav_connexion\">
1135
<h2>Connexion</h2>
1136
                        <div id=\"user_top_bar\">
1137
                                <div id=\"box_unlogged\" class=\"identification_box\">
1138

1139
                                </div>
1140
                        </div>
1141
</div>
1142
</div>
1143
<div id=\"main\">\n";        
1144

    
1145
        // Main Headline
1146
        echo "<div id='header'>";
1147
                echo "<div id='c_logo' ><a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.public.php\" accesskey=\"0\"  title=\"".$LANG["central"][5]."\"><span class='invisible'>Logo</span></a></div>";
1148

    
1149
                // Les préférences + lien déconnexion 
1150
                echo "<div id='c_preference' >";
1151
                echo" <ul><li id='deconnexion'><a href=\"".$CFG_GLPI["root_doc"]."/logout.php\"  title=\"".$LANG["central"][6]."\">".$LANG["central"][6]."  </a>";
1152
                echo "(";
1153
                echo formatUserName (0,$_SESSION["glpiname"],$_SESSION["glpirealname"],$_SESSION["glpifirstname"],0,20);
1154
                echo ")</li>\n"; 
1155

    
1156
                echo "        <li><a href='".(empty($CFG_GLPI["helpdeskhelp_url"])?"http://glpi-project.org/help-helpdesk":$CFG_GLPI["helpdeskhelp_url"])."' target='_blank' title='".$LANG["central"][7]."'>    ".$LANG["central"][7]."</a></li>\n"; 
1157
                echo "        <li> <a href=\"".$CFG_GLPI["root_doc"]."/front/user.form.my.php\" title=\"".$LANG["Menu"][11]."\" >".$LANG["Menu"][11]."   </a></li>\n"; 
1158
                                        
1159
                echo "</ul>\n"; 
1160
                echo "<div class='sep'></div>\n"; 
1161
                echo "</div>\n"; 
1162
                //-- Le moteur de recherche -->
1163
                echo "<div id='c_recherche' >\n"; 
1164
                /*
1165
                echo "<form id='recherche' action=''>\n"; 
1166
                echo "        <div id='boutonRecherche'><input type='submit' value='OK' /></div>\n"; 
1167
                echo "        <div id='champRecherche'><input type='text' value='Recherche' /></div>        \n";                 
1168
                echo "</form>\n"; 
1169
                */
1170
                echo "<div class='sep'></div>\n"; 
1171
                echo "</div>";
1172
        
1173
                //<!-- Le menu principal -->
1174
                echo "<div id='c_menu'>";
1175
                echo "        <ul id='menu'>";
1176
                
1177
        
1178
                // Build the navigation-elements
1179
        
1180
                // Ticket
1181
                if (haveRight("create_ticket","1")){
1182
                        echo "        <li id='menu1' >";
1183
                        echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.public.php\"  title=\"".$LANG["job"][13]."\" class='itemP'>".$LANG["Menu"][31]."</a>";
1184
                        
1185
                        echo "</li>";                
1186
                }
1187
        
1188
                //  Suivi  ticket
1189
                if (haveRight("observe_ticket","1")){
1190
                        echo "        <li id='menu2' >";
1191
                        echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.public.php?show=user\" title=\"".$LANG["title"][10]."\"   class='itemP'>".$LANG["title"][28]."</a>";
1192
                        
1193
                        echo "</li>";
1194
                }
1195
                // Reservation
1196
                if (haveRight("reservation_helpdesk","1")){
1197
                        echo "        <li id='menu3' >";
1198
                        echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.resa.php\"  title=\"".$LANG["Menu"][17]."\" class='itemP'>".$LANG["Menu"][17]."</a>";
1199
                        
1200
                        echo "</li>";
1201
                }
1202
        
1203
                // FAQ
1204
                if (haveRight("faq","r")){
1205
                        echo "        <li id='menu4' >";
1206
                        echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.faq.php\" title=\"".$LANG["knowbase"][1]."\" class='itemP'>".$LANG["Menu"][20]."</a>";
1207
                        
1208
                        echo "</li>";
1209
                }
1210

    
1211
                //RyXeo en attendant d'avoir un plugin propre
1212
                echo "        <li id='menu5' >";
1213
                echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.abuledu_details.php\" title=\"Détails sur votre serveur\" class='itemP'>Votre installation en détails</a>";
1214
                echo "</li>";
1215

    
1216
                // PLUGINS
1217
                $plugins=array();
1218
                if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"])&&count($PLUGIN_HOOKS["helpdesk_menu_entry"]))
1219
                        foreach  ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
1220
                                if ($active){
1221
                                        $function="plugin_version_$plugin";
1222
        
1223
                                        if (function_exists($function))
1224
                                                $plugins[$plugin]=$function();
1225
                                }
1226
                        }
1227
        
1228
                if (isset($plugins)&&count($plugins)>0){
1229
                        $list=array();
1230
                        foreach ($plugins as $key => $val) {
1231
                                $list[$key]=$val["name"];
1232
                        }
1233
                        asort($list);
1234
                        echo "        <li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\" >";
1235
                        echo "<a href='#' title=\"".$LANG["common"][29]."\"  class='itemP'>".$LANG["common"][29]."</a>";  // default none
1236
                        echo "<ul class='ssmenu'>"; 
1237
                        // list menu item 
1238
                        foreach ($list as $key => $val) {
1239
                                echo "<li><a href=\"".$CFG_GLPI["root_doc"]."/plugins/".$key."/\">".$plugins[$key]["name"]."</a></li>\n";
1240
                        }
1241
                        echo "</ul>";
1242
                        echo "</li>";
1243
                }
1244
        
1245
                        
1246
                echo "</ul>";                
1247
                echo "<div class='sep'></div>";
1248
                echo "</div>";
1249
        
1250
                // End navigation bar
1251
        
1252
                // End headline
1253
                
1254
                ///Le sous menu contextuel 1
1255
                echo "<div id='c_ssmenu1' >";
1256
                //echo "<ul>";
1257
                //echo "        <li><a href='' title='' >Suivi</a></li>";
1258
                //echo "        <li>Planning</li>";
1259
                //echo "        <li>Statistique</li>";
1260
                //echo "        <li>Helpdesk</li>";
1261
                //echo "</ul>";
1262
                echo "</div>";
1263

    
1264
                //  Le fil d arianne 
1265
                echo "<div id='c_ssmenu2' >";
1266
                echo "<ul>";
1267
                echo "        <li>Choisissez votre serveur :</li>";
1268
                showProfileSelecter($CFG_GLPI["root_doc"]."/front/helpdesk.public.php");        
1269
                echo "</ul>";        
1270
                echo "        </div>";
1271
                        
1272
                echo "</div>\n"; // fin header
1273

    
1274
                echo "<div  id='page' >";
1275
                
1276
        
1277
        
1278
        
1279

    
1280
        // call function callcron() every 5min
1281
        if (isset($_SESSION["glpicrontimer"])){
1282
                if (($_SESSION["glpicrontimer"]-time())>300){
1283
                        callCron();
1284
                        $_SESSION["glpicrontimer"]=time();
1285
                }
1286
        } else $_SESSION["glpicrontimer"]=time();
1287

    
1288
        displayMessageAfterRedirect();
1289
}
1290

    
1291

    
1292
/**
1293
 * Print a simple HTML head with links
1294
 *
1295
 *
1296
 * @param $title title of the page
1297
 * @param $links links to display
1298
 **/
1299
function simpleHeader($title,$links=array()) {
1300
        // Print a nice HTML-head for help page
1301

    
1302
        global $CFG_GLPI,$LANG, $CFG_GLPI,$HEADER_LOADED ;
1303

    
1304
        if ($HEADER_LOADED) return;
1305
        $HEADER_LOADED=true;
1306

    
1307
        // Override list-limit if choosen
1308
        if (isset($_POST['list_limit'])) {
1309
                $_SESSION['glpilist_limit']=$_POST['list_limit'];
1310
        }
1311

    
1312
        includeCommonHtmlHeader($title);
1313

    
1314
        // Body 
1315
        echo "<body>";
1316

    
1317
//ryxeo
1318
echo "                <div id=\"page\">
1319
                        <div id=\"top\">
1320
                                <a href=\"/index\"
1321
                                   title=\"Retouner directement à la page d'accueil\"
1322
                                   id=\"link_home\"><h1>AbulÉdu.net</h1></a>
1323
                        </div>
1324
                <div id=\"navbar\">
1325
                <ul>
1326
              <li><a href=\"http://www.abuledu.org\" id=\"navbar_www\" title=\"Le projet AbulÉdu\" class=\"ttip\">AbulÉdu</a></li>
1327
              <li><a href=\"http://www.abuledu.org/leterrier/\" id=\"navbar_leterrier\" title=\"Les logiciels libres pédagogiques fait par des enseignants dans le cadre du projet AbulÉdu\" class=\"ttip\">LeTerrier</a></li>
1328
              <li><a href=\"http://libre.pedagosite.net/\" id=\"navbar_pedagosite\" title=\"Consultez les ressources pédagogiques réalisées par des enseignants et participez en envoyant vos contributions sur libre.pedagosite.net\" class=\"ttip\">Pédagosite</a></li>
1329
              <li><a href=\"http://docs.abuledu.org/\" id=\"navbar_doc\" title=\"Toute la documentation d'AbulÉdu est disponible sur ce site internet\" class=\"ttip\">Documentation</a></li>
1330

1331
              <li><a href=\"http://forum.abuledu.org/\" id=\"navbar_forum\" title=\"Les forums\" class=\"ttip\">Forums</a></li>
1332
              <li><a href=\"http://planete.abuledu.org/\" id=\"navbar_actu\" title=\"Suivez toute l'actualité du projet AbulÉdu sur la planète\" class=\"ttip\">Planète</a></li>
1333
              <li><a href=\"http://www.abuledu.com/\" id=\"navbar_aepro\" title=\"AbulEdu.PRO vous propose un certain nombre de services professionnels.\" class=\"ttip\">Services PRO</a></li>
1334
              <li id=\"active\"><a href=\"http://www.abuledu.net/\" id=\"navbar_anet\" title=\"AbulEdu.NET vous permet de gérer vos demandes d'interventions ou de superviser votre parc de serveurs. Ce service n'est disponible qu'aux abonnés au service AbulEdu.NET\" class=\"ttip\">AbulEdu.NET</a></li>
1335
              <li><a href=\"http://servecole.abuledu.info/admin.php\" id=\"navbar_webadmin\" title=\"Administration de votre serveur AbulÉdu. Attention, Cet outil n'est accessible que si vous êtes à l'interieur d'un réseau AbulÉdu !\" class=\"ttip\">WebAdmin</a></li>
1336
                </ul>
1337
                <p>&nbsp;</p>
1338
            </div>
1339

1340
                <div id=\"navigation\">
1341
                <div id=\"navWiki\">
1342
                        <h2>Liens rapides</h2>
1343
                                <ul>
1344
" . ryxeo_fastlinks() . "
1345
                                </ul>
1346
                        </div>
1347
<div id=\"nav_connexion\">
1348
<h2>Connexion</h2>
1349
                        <div id=\"user_top_bar\">
1350
                                <div id=\"box_unlogged\" class=\"identification_box\">
1351

1352
                                </div>
1353
                        </div>
1354
</div>
1355
</div>
1356
<div id=\"main\">\n";        
1357

    
1358
        // Main Headline
1359
        echo "<div id='header'>";
1360
        echo "<div id='c_logo' ><a href=\"".$CFG_GLPI["root_doc"]."/front/helpdesk.public.php\" accesskey=\"0\"  title=\"".$LANG["central"][5]."\"><span class='invisible'>Logo</span></a></div>";
1361

    
1362
        // Les préférences + lien déconnexion 
1363
        echo "<div id='c_preference' >";
1364
        echo "<div class='sep'></div>\n"; 
1365
        echo "</div>\n"; 
1366
        //-- Le moteur de recherche -->
1367
        echo "<div id='c_recherche' >\n"; 
1368
        /*
1369
        echo "<form id='recherche' action=''>\n"; 
1370
        echo "        <div id='boutonRecherche'><input type='submit' value='OK' /></div>\n"; 
1371
        echo "        <div id='champRecherche'><input type='text' value='Recherche' /></div>        \n";                 
1372
        echo "</form>\n"; 
1373
        */
1374
        echo "<div class='sep'></div>\n"; 
1375
        echo "</div>";
1376

    
1377
        //<!-- Le menu principal -->
1378
        echo "<div id='c_menu'>";
1379
        echo "        <ul id='menu'>";
1380
        
1381
        // Build the navigation-elements
1382
        if (count($links)){
1383
                $i=1;
1384
                foreach ($links as $name => $link){
1385
                        echo "        <li id='menu$i' >";
1386
                        echo "<a href=\"$link\" title=\"".$name."\"   class='itemP'>".$name."</a>";
1387
                        echo "</li>";        
1388
                        $i++;
1389
                }
1390
        }
1391
                        
1392
        echo "</ul>";                
1393
        echo "</div>";
1394
        // End navigation bar
1395
        
1396
        // End headline
1397
                
1398
        ///Le sous menu contextuel 1
1399
        echo "<div id='c_ssmenu1' >";
1400
        echo "</div>";
1401

    
1402
        //  Le fil d arianne 
1403
        echo "<div id='c_ssmenu2' >";
1404
        echo "        </div>";
1405
                
1406
        echo "</div>\n"; // fin header
1407

    
1408
        echo "<div  id='page' >";
1409

    
1410
        // call function callcron() every 5min
1411
        if (isset($_SESSION["glpicrontimer"])){
1412
                if (($_SESSION["glpicrontimer"]-time())>300){
1413
                        callCron();
1414
                        $_SESSION["glpicrontimer"]=time();
1415
                }
1416
        } else $_SESSION["glpicrontimer"]=time();
1417

    
1418
//        displayMessageAfterRedirect();
1419
}
1420

    
1421

    
1422
/**
1423
 * Print a nice HTML head with no controls
1424
 *
1425
 *
1426
 * @param $title title of the page
1427
 * @param $url not used anymore.
1428
 **/
1429
function nullHeader($title,$url='') {
1430
        global $CFG_GLPI,$HEADER_LOADED,$LANG ;
1431
        if ($HEADER_LOADED) return;
1432
        $HEADER_LOADED=true;
1433
        // Print a nice HTML-head with no controls
1434

    
1435
        // Detect root_doc in case of error
1436
        if (!isset($CFG_GLPI["root_doc"])){
1437
                if ( !isset($_SERVER['REQUEST_URI']) ) {
1438
                        $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
1439
                }
1440
                $currentdir=getcwd();
1441
                chdir(GLPI_ROOT);
1442
                $glpidir=str_replace(str_replace('\\', '/',getcwd()),"",str_replace('\\', '/',$currentdir));
1443
                chdir($currentdir);
1444
                        
1445
                $globaldir=preg_replace("/\/[0-9a-zA-Z\.\-\_]+\.php/","",$_SERVER['REQUEST_URI']);
1446
                $globaldir=preg_replace("/\?.*/","",$globaldir);
1447
                $CFG_GLPI["root_doc"]=str_replace($glpidir,"",$globaldir);
1448
                $CFG_GLPI["root_doc"]=preg_replace("/\/$/","",$CFG_GLPI["root_doc"]);
1449
                $CFG_GLPI["logotxt"]="";
1450
        }
1451

    
1452
        // Send UTF8 Headers
1453
        header("Content-Type: text/html; charset=UTF-8");
1454

    
1455
        // Override list-limit if choosen
1456
        if (isset($_POST['list_limit'])) {
1457
                $_SESSION['glpilist_limit']=$_POST['list_limit'];
1458
        }
1459

    
1460
        // Send extra expires header if configured
1461
        if (!empty($CFG_GLPI["sendexpire"])) {
1462
                header_nocache();
1463
        }
1464

    
1465
        if (isCommandLine()){
1466
                return true;
1467
        }
1468

    
1469

    
1470
        includeCommonHtmlHeader($title);
1471

    
1472
        // Body with configured stuff
1473
//        echo "<body>";
1474
//ryxeo
1475
echo "                <div id=\"page\">
1476
                        <div id=\"top\">
1477
                                <a href=\"/index\"
1478
                                   title=\"Retouner directement à la page d'accueil\"
1479
                                   id=\"link_home\"><h1>AbulÉdu.net</h1></a>
1480
                        </div>
1481
                <div id=\"navbar\">
1482
                <ul>
1483
              <li><a href=\"http://www.abuledu.org\" id=\"navbar_www\" title=\"Le projet AbulÉdu\" class=\"ttip\">AbulÉdu</a></li>
1484
              <li><a href=\"http://www.abuledu.org/leterrier/\" id=\"navbar_leterrier\" title=\"Les logiciels libres pédagogiques fait par des enseignants dans le cadre du projet AbulÉdu\" class=\"ttip\">LeTerrier</a></li>
1485
              <li><a href=\"http://libre.pedagosite.net/\" id=\"navbar_pedagosite\" title=\"Consultez les ressources pédagogiques réalisées par des enseignants et participez en envoyant vos contributions sur libre.pedagosite.net\" class=\"ttip\">Pédagosite</a></li>
1486
              <li><a href=\"http://docs.abuledu.org/\" id=\"navbar_doc\" title=\"Toute la documentation d'AbulÉdu est disponible sur ce site internet\" class=\"ttip\">Documentation</a></li>
1487

1488
              <li><a href=\"http://forum.abuledu.org/\" id=\"navbar_forum\" title=\"Les forums\" class=\"ttip\">Forums</a></li>
1489
              <li><a href=\"http://planete.abuledu.org/\" id=\"navbar_actu\" title=\"Suivez toute l'actualité du projet AbulÉdu sur la planète\" class=\"ttip\">Planète</a></li>
1490
              <li><a href=\"http://www.abuledu.com/\" id=\"navbar_aepro\" title=\"AbulEdu.PRO vous propose un certain nombre de services professionnels.\" class=\"ttip\">Services PRO</a></li>
1491
              <li id=\"active\"><a href=\"http://www.abuledu.net/\" id=\"navbar_anet\" title=\"AbulEdu.NET vous permet de gérer vos demandes d'interventions ou de superviser votre parc de serveurs. Ce service n'est disponible qu'aux abonnés au service AbulEdu.NET\" class=\"ttip\">AbulEdu.NET</a></li>
1492
              <li><a href=\"http://servecole.abuledu.info/admin.php\" id=\"navbar_webadmin\" title=\"Administration de votre serveur AbulÉdu. Attention, Cet outil n'est accessible que si vous êtes à l'interieur d'un réseau AbulÉdu !\" class=\"ttip\">WebAdmin</a></li>
1493
                </ul>
1494
                <p>&nbsp;</p>
1495
            </div>
1496

1497
                <div id=\"navigation\">
1498
                <div id=\"navWiki\">
1499
                        <h2>Liens rapides</h2>
1500
                                <ul>
1501
" . ryxeo_fastlinks() . "
1502
                                </ul>
1503
                        </div>
1504
<div id=\"nav_connexion\">
1505
<h2>Connexion</h2>
1506
                        <div id=\"user_top_bar\">
1507
                                <div id=\"box_unlogged\" class=\"identification_box\">
1508

1509
                                </div>
1510
                        </div>
1511
</div>
1512
</div>
1513
<div id=\"main\">\n";
1514

    
1515

    
1516
        echo "<div id='contenu-nullHeader'>";
1517

    
1518
        echo "<div id='text-nullHeader'>";
1519
}
1520

    
1521
/**
1522
 * Print a nice HTML head for popup window (nothing to display)
1523
 *
1524
 *
1525
 * @param $title title of the page
1526
 * @param $url not used anymore.
1527
 **/
1528
function popHeader($title,$url='')
1529
{
1530
        // Print a nice HTML-head for every page
1531

    
1532
        global $CFG_GLPI,$LANG,$PLUGIN_HOOKS,$HEADER_LOADED ;
1533

    
1534
        if ($HEADER_LOADED) return;
1535
        $HEADER_LOADED=true;
1536

    
1537

    
1538
        // Override list-limit if choosen
1539
        if (isset($_POST['list_limit'])) {
1540
                $_SESSION['glpilist_limit']=$_POST['list_limit'];
1541
        }
1542

    
1543
        includeCommonHtmlHeader($title);        // Body 
1544

    
1545
        echo "<body>";
1546

    
1547
        displayMessageAfterRedirect();
1548
}
1549

    
1550
/**
1551
 * Print footer for a popup window
1552
 *
1553
 *
1554
 **/
1555
function popFooter() {
1556
        global $FOOTER_LOADED;
1557

    
1558
        if ($FOOTER_LOADED) return;
1559
        $FOOTER_LOADED=true;
1560

    
1561
        // Print foot 
1562

    
1563
        echo "</body></html>";
1564
}
1565

    
1566

    
1567

    
1568

    
1569

    
1570

    
1571

    
1572

    
1573

    
1574

    
1575

    
1576
/**
1577
 * Print footer for every page
1578
 *
1579
 * @param $keepDB booleen, closeDBConnections if false
1580
 *
1581
 **/
1582
function commonFooter($keepDB=false) {
1583
        // Print foot for every page
1584

    
1585
        global $LANG,$CFG_GLPI,$DEBUG_SQL,$TIMER_DEBUG,$SQL_TOTAL_TIMER,$SQL_TOTAL_REQUEST,$FOOTER_LOADED;
1586

    
1587
        if ($FOOTER_LOADED) return;
1588
        $FOOTER_LOADED=true;
1589

    
1590
        echo "</div>"; // fin de la div id ='page' initiée dans la fonction header
1591
        
1592
        echo "<div id='footer' >";
1593
        echo "<table width='100%'><tr><td class='left'><span class='copyright'>";
1594
        echo $TIMER_DEBUG->Get_Time()."s - ";
1595
        if (function_exists("memory_get_usage")){
1596
                echo memory_get_usage();
1597
        }
1598
        echo "</span></td>";
1599

    
1600
        if (!empty($CFG_GLPI["founded_new_version"]))
1601
                echo "<td class='copyright'>".$LANG["setup"][301]." ".$CFG_GLPI["founded_new_version"]."<br>".$LANG["setup"][302]."</td>";
1602

    
1603
        echo "<td class='right'>";
1604
        echo "<a href=\"http://glpi-project.org/\">";
1605
        echo "<span class='copyright'>GLPI ".$CFG_GLPI["version"]." Copyright (C) 2003-".date("Y")." by the INDEPNET Development Team.</span>";
1606
        echo "</a>";
1607

    
1608
        echo "</td></tr>";
1609
        echo "</table></div>";
1610

    
1611

    
1612

    
1613
        if ($CFG_GLPI["debug"]==1){ // debug mode traduction
1614

    
1615
                echo "<div id='debug-float'>";                
1616
                echo "<a href='#see_debug'>GLPI MODE TRANSLATION</a>";
1617
                echo "</div>";
1618
        }
1619

    
1620
        if ($CFG_GLPI["debug"]==2){ // mode debug 
1621

    
1622
                echo "<div id='debug-float'>";                
1623
                echo "<a href='#see_debug'>GLPI MODE DEBUG</a>";
1624
                echo "</div>";
1625

    
1626

    
1627

    
1628
                echo "<div id='debug'>";
1629
                echo "<h1><a id='see_debug' name='see_debug'>GLPI MODE DEBUG</a></h1>";
1630
                
1631
                if ($CFG_GLPI["debug_sql"]){        
1632
                        echo "<h2>SQL REQUEST : ";
1633
                        
1634
                        echo $SQL_TOTAL_REQUEST." Queries ";
1635
                        if ($CFG_GLPI["debug_profile"]){
1636
                                echo "took  ".array_sum($DEBUG_SQL['times'])."s  </h2>";
1637
                        }
1638

    
1639
                        echo "<table class='tab_cadre' ><tr><th>N&#176; </th><th>Queries</th><th>Time</th><th>Errors</th></tr>";
1640

    
1641
                        foreach ($DEBUG_SQL['queries'] as $num => $query){
1642
                                echo "<tr class='tab_bg_".(($num%2)+1)."'><td>$num</td><td>";
1643
                                echo eregi_replace("ORDER BY","<br>ORDER BY",eregi_replace("SORT","<br>SORT",eregi_replace("LEFT JOIN","<br>LEFT JOIN",eregi_replace("INNER JOIN","<br>INNER JOIN",eregi_replace("WHERE","<br>WHERE",eregi_replace("FROM","<br>FROM",eregi_replace("UNION","<br>UNION<br>",eregi_replace(">","&gt;",eregi_replace("<","&lt;",$query)))))))));
1644
                                echo "</td><td>";
1645
                                echo $DEBUG_SQL['times'][$num];
1646
                                echo "</td><td>";
1647
                                if (isset($DEBUG_SQL['errors'][$num])){
1648
                                        echo $DEBUG_SQL['errors'][$num];
1649
                                } else {
1650
                                        echo "&nbsp;";
1651
                                }
1652
                                echo "</td></tr>";
1653
                        }
1654
                        echo "</table>";
1655
                        
1656
                        // Reset, as further request will not be displayed
1657
                        $CFG_GLPI["debug_sql"]=false;
1658
                }
1659
                
1660
                
1661
                
1662
                if ($CFG_GLPI["debug_vars"]){
1663
                        echo "<h2>POST VARIABLE</h2>";
1664
                        printCleanArray($_POST);
1665
                        echo "<h2>GET VARIABLE</h2>";
1666
                        printCleanArray($_GET);
1667
                        echo "<h2>SESSION VARIABLE</h2>";
1668
                        printCleanArray($_SESSION);
1669
                }
1670
                
1671
                
1672
                
1673
                echo "</div>";
1674
        }
1675

    
1676
//ryxeo
1677
echo "      </div>
1678
      <p id=\"footer\">
1679
        <a id=\"ryxeo\" href=\"http://www.ryxeo.com\">
1680
          <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/abuledu/logo_ryxeo.png\" alt=\"Hébergé par RyXeo\"/>
1681
        </a>
1682
        <!--
1683
                accueil.txt &middot; Dernière modification: 2007/06/07 19:46 par bafriss &middot;  -->
1684

1685
        <a href=\"http://www.ubuntu-fr.org/\" title=\"Squelette wiki inspire de celui de ubuntu-fr.org\">Squelette wiki inspire de celui de ubuntu-fr.org !</a>
1686
         - Propulsé par AbulEdu.NET
1687
      </div>
1688
    </div>
1689
";
1690

    
1691
        echo "</body></html>";
1692
        
1693
        if (!$keepDB) {
1694
                closeDBConnections();
1695
        }
1696
}
1697

    
1698
/**
1699
 * Print footer for help page
1700
 *
1701
 *
1702
 **/
1703
function helpFooter() {
1704
        // Print foot for help page
1705
        global $CFG_GLPI,$FOOTER_LOADED;
1706

    
1707
        if ($FOOTER_LOADED) return;
1708
        $FOOTER_LOADED=true;
1709
        
1710
        echo "</div>"; // fin de la div id ='page' initiée dans la fonction header
1711

    
1712
        echo "<div id='footer'>";
1713
        echo "<table width='100%'><tr>";
1714
        echo "<td class='right'>";
1715
        echo "<a href=\"http://glpi-project.org/\">";
1716
        echo "<span class='copyright'>GLPI ".$CFG_GLPI["version"]." Copyright (C) 2003-".date("Y")." by the INDEPNET Development Team.</span>";
1717
        echo "</a></tr></table>";
1718
        echo "</div>";
1719

    
1720
//ryxeo
1721
echo "      </div>
1722
      <p id=\"footer\">
1723
        <a id=\"ryxeo\" href=\"http://www.ryxeo.com\">
1724
          <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/abuledu/logo_ryxeo.png\" alt=\"Hébergé par RyXeo\"/>
1725
        </a>
1726
        <!--
1727
                accueil.txt &middot; Dernière modification: 2007/06/07 19:46 par bafriss &middot;  -->
1728

1729
        <a href=\"http://www.ubuntu-fr.org/\" title=\"Squelette wiki inspire de celui de ubuntu-fr.org\">Squelette wiki inspire de celui de ubuntu-fr.org !</a>
1730
         - Propulsé par AbulEdu.NET
1731
      </div>
1732
    </div>
1733
";
1734
        echo "</body></html>";
1735
        closeDBConnections();
1736
}
1737

    
1738
/**
1739
 * Print footer for null page
1740
 *
1741
 *
1742
 **/
1743
function nullFooter() {
1744
        // Print foot for null page
1745
        global $CFG_GLPI,$FOOTER_LOADED;
1746

    
1747
        if ($FOOTER_LOADED) return;
1748
        $FOOTER_LOADED=true;
1749

    
1750
        if (!isCommandLine()){
1751
                echo "</div>";  // fin box text-nullHeader ouvert dans le null header
1752
                echo "</div>"; // fin contenu-nullHeader ouvert dans le null header
1753
                
1754
        
1755
                echo "<div id='footer-login'>";
1756
                echo "<a href=\"http://glpi-project.org/\" title=\"Powered By Indepnet\"  >";
1757
                echo 'GLPI version '.(isset($CFG_GLPI["version"])?$CFG_GLPI["version"]:"").' Copyright (C) 2003-'.date("Y").' INDEPNET Development Team.';
1758
                echo "</a>";
1759
                echo "</div>";
1760
                
1761

    
1762
//ryxeo
1763
echo "      </div>
1764
      <p id=\"footer\">
1765
        <a id=\"ryxeo\" href=\"http://www.ryxeo.com\">
1766
          <img src=\"" . $CFG_GLPI["root_doc"] . "/pics/abuledu/logo_ryxeo.png\" alt=\"Hébergé par RyXeo\"/>
1767
        </a>
1768
        <!--
1769
                accueil.txt &middot; Dernière modification: 2007/06/07 19:46 par bafriss &middot;  -->
1770

1771
        <a href=\"http://www.ubuntu-fr.org/\" title=\"Squelette wiki inspire de celui de ubuntu-fr.org\">Squelette wiki inspire de celui de ubuntu-fr.org !</a>
1772
         - Propulsé par AbulEdu.NET
1773
      </div>
1774
    </div>
1775
";
1776
                echo "</body></html>";
1777
        }
1778
        
1779
        closeDBConnections();
1780
}
1781

    
1782

    
1783
/**
1784
 * Print the helpdesk 
1785
 *
1786
 * @param $ID int : ID of the user who want to display the Helpdesk
1787
 * @param $from_helpdesk int : is display from the helpdesk.php ?
1788
 * @return nothing (print the helpdesk)
1789
 */
1790
function printHelpDesk ($ID,$from_helpdesk) {
1791

    
1792
        global $DB,$CFG_GLPI,$LANG;
1793

    
1794
        if (!haveRight("create_ticket","1")) return false;
1795

    
1796
        $query = "SELECT email,realname,firstname,name FROM glpi_users WHERE (ID = '$ID')";
1797
        $result=$DB->query($query);
1798
        $email = $DB->result($result,0,"email");
1799

    
1800
        // Get saved data from a back system
1801
        $emailupdates = 1;
1802
        if ($email=="") $emailupdates=0;
1803
        $device_type = 0;
1804
        $computer="";
1805
        $contents="";
1806
        $title="";
1807
        $category = 0;
1808
        $priority  = 3;
1809

    
1810

    
1811
        if (isset($_SESSION["helpdeskSaved"]["emailupdates"]))
1812
                $emailupdates = stripslashes($_SESSION["helpdeskSaved"]["emailupdates"]);
1813
        if (isset($_SESSION["helpdeskSaved"]["email"]))
1814
                $email = stripslashes($_SESSION["helpdeskSaved"]["uemail"]);
1815
        if (isset($_SESSION["helpdeskSaved"]["device_type"]))
1816
                $device_type = stripslashes($_SESSION["helpdeskSaved"]["device_type"]);
1817
        if (isset($_SESSION["helpdeskSaved"]["contents"]))
1818
                $contents = stripslashes($_SESSION["helpdeskSaved"]["contents"]);
1819
        if (isset($_SESSION["helpdeskSaved"]["name"]))
1820
                $title = stripslashes($_SESSION["helpdeskSaved"]["name"]);
1821
        if (isset($_SESSION["helpdeskSaved"]["category"]))
1822
                $category = stripslashes($_SESSION["helpdeskSaved"]["category"]);
1823
        if (isset($_SESSION["helpdeskSaved"]["priority"]))
1824
                $priority = stripslashes($_SESSION["helpdeskSaved"]["priority"]);
1825
        unset($_SESSION["helpdeskSaved"]);
1826
        
1827

    
1828
        echo "<form method='post' name=\"helpdeskform\" action=\"".$CFG_GLPI["root_doc"]."/front/tracking.injector.php\"  enctype=\"multipart/form-data\">";
1829
        echo "<input type='hidden' name='_from_helpdesk' value='$from_helpdesk'>";
1830
        echo "<input type='hidden' name='request_type' value='1'>";
1831
        echo "<input type='hidden' name='FK_entities' value='".$_SESSION["glpiactive_entity"]."'>";
1832
        echo "<div class='center'><table  class='tab_cadre'>";
1833

    
1834
        echo "<tr><th colspan='2'>".$LANG["help"][1].": ";
1835
        if (isMultiEntitiesMode()){
1836
                echo "&nbsp;(".getDropdownName("glpi_entities",$_SESSION["glpiactive_entity"]).")";
1837
        }
1838

    
1839
        echo "</th></tr>";
1840
        echo "<tr class='tab_bg_1'>";
1841
        echo "<td>".$LANG["help"][2].": </td>";
1842
        echo "<td>";
1843
        dropdownPriority("priority",$priority);
1844
        echo "</td></tr>";
1845
        if(isAuthorMailingActivatedForHelpdesk()){
1846
                echo "<tr class='tab_bg_1'>";
1847
                echo "<td>".$LANG["help"][8].":</td>";
1848
                echo "<td>";
1849
                dropdownYesNo('emailupdates',$emailupdates);
1850
                echo "</td></tr>";
1851
                echo "<tr class='tab_bg_1'>";
1852
                echo "<td>".$LANG["help"][11].":</td>";
1853
                echo "<td>        <input name='uemail' value=\"$email\" size='50' onchange=\"emailupdates.value='1'\">";
1854
                echo "</td></tr>";
1855
        }
1856

    
1857
        if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"]!=0){
1858
                echo "<tr class='tab_bg_1'>";
1859
                echo "<td>".$LANG["help"][24].": </td>";
1860
                echo "<td class='center'>";
1861
                dropdownMyDevices($_SESSION["glpiID"],$_SESSION["glpiactive_entity"]);
1862
                
1863
                dropdownTrackingAllDevices("device_type",$device_type,0,$_SESSION["glpiactive_entity"]);
1864
                echo "</td></tr>";
1865
        }
1866

    
1867
        echo "<tr class='tab_bg_1'>";
1868
        echo "<td>".$LANG["common"][36].":</td><td>";
1869

    
1870
        dropdownValue("glpi_dropdown_tracking_category","category",$category);
1871
        echo "</td>";
1872
        echo "</tr>";
1873

    
1874
        echo "<tr class='tab_bg_1'>";
1875
        echo "<td colspan='2' align='center'>".$LANG["help"][13].":</td>";
1876
        echo "</tr>";
1877
        echo "<tr class='tab_bg_1'>";
1878
        echo "<td class='center'>".$LANG["common"][57].":</td>";
1879
        echo "<td class='center'><input type='text' maxlength='250' size='80' name='name' value=\"$title\"></td>";
1880
        echo "</tr>";
1881

    
1882
        echo "<tr class='tab_bg_1'>";
1883
        echo "<td colspan='2' align='center'><textarea name='contents' cols='80' rows='14' >$contents</textarea>";
1884
        echo "</td></tr>";
1885

    
1886
        $max_size=return_bytes_from_ini_vars(ini_get("upload_max_filesize"));
1887
        $max_size/=1024*1024;
1888
        $max_size=round($max_size,1);
1889

    
1890
        echo "<tr class='tab_bg_1'><td>".$LANG["document"][2]." (".$max_size." Mb max):        ";
1891
        echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/aide.png\" class='pointer' alt=\"".$LANG["central"][7]."\" onclick=\"window.open('".$CFG_GLPI["root_doc"]."/front/typedoc.list.php','Help','scrollbars=1,resizable=1,width=1000,height=800')\">";
1892
        echo "</td>";
1893
        echo "<td><input type='file' name='filename' value=\"\" size='25'></td>";
1894
        echo "</tr>";
1895

    
1896
        echo "<tr class='tab_bg_1'>";
1897
        echo "<td colspan='2' class='center'> <input type='submit' value=\"".$LANG["help"][14]."\" class='submit'>";
1898
        echo "</td></tr>";
1899

    
1900
        echo "</table>";
1901
        echo "</div>";
1902
        echo "</form>";
1903

    
1904
}
1905

    
1906
/**
1907
 * Display the list_limit combo choice
1908
 * 
1909
 * 
1910
 * @param $action page would be posted when change the value (URL + param)
1911
 * @return nothing (print a combo)
1912
 * 
1913
 */
1914
function printPagerForm ($action) {
1915
        global $LANG;
1916
        
1917
        echo "<form method='POST' action=\"$action\">\n";
1918
        echo "<span>".$LANG["pager"][4]."&nbsp;</span>";
1919
        echo "<select name='list_limit' onChange='submit()'>";
1920

    
1921
        for ($i=5;$i<20;$i+=5) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1922
        for ($i=20;$i<50;$i+=10) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1923
        for ($i=50;$i<250;$i+=50) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1924
        for ($i=250;$i<1000;$i+=250) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1925
        for ($i=1000;$i<5000;$i+=1000) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1926
        for ($i=5000;$i<=10000;$i+=5000) echo "<option value='$i' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==$i)?" selected ":"").">$i</option>\n";
1927
        echo "<option value='9999999' ".((isset($_SESSION["glpilist_limit"])&&$_SESSION["glpilist_limit"]==9999999)?" selected ":"").">9999999</option>\n";        
1928

    
1929
        echo "</select><span>&nbsp;";
1930
        echo $LANG["pager"][5];
1931
        echo "</span>";
1932
        echo "</form>\n";
1933
}
1934

    
1935
/**
1936
 * Print pager for search option (first/previous/next/last)
1937
 *
1938
 *
1939
 *
1940
 * @param $start from witch item we start
1941
 * @param $numrows total items
1942
 * @param $target page would be open when click on the option (last,previous etc)
1943
 * @param $parameters parameters would be passed on the URL.
1944
 * @param $item_type_output item type display - if >0 display export PDF et Sylk form
1945
 * @param $item_type_output_param item type parameter for export
1946
 * @return nothing (print a pager)
1947
 *
1948
 */
1949
function printPager($start,$numrows,$target,$parameters,$item_type_output=0,$item_type_output_param=0) {
1950

    
1951
        global $CFG_GLPI, $LANG,$CFG_GLPI;
1952

    
1953
        // Forward is the next step forward
1954
        $forward = $start+$_SESSION["glpilist_limit"];
1955

    
1956
        // This is the end, my friend        
1957
        $end = $numrows-$_SESSION["glpilist_limit"];
1958

    
1959
        // Human readable count starts here
1960
        $current_start=$start+1;
1961

    
1962
        // And the human is viewing from start to end
1963
        $current_end = $current_start+$_SESSION["glpilist_limit"]-1;
1964
        if ($current_end>$numrows) {
1965
                $current_end = $numrows;
1966
        }
1967

    
1968
        // Backward browsing 
1969
        if ($current_start-$_SESSION["glpilist_limit"]<=0) {
1970
                $back=0;
1971
        } else {
1972
                $back=$start-$_SESSION["glpilist_limit"];
1973
        }
1974

    
1975
        // Print it
1976

    
1977
        echo "<table class='tab_cadre_pager'>\n";
1978
        echo "<tr>\n";
1979

    
1980
        // Back and fast backward button
1981
        if (!$start==0) {
1982
                echo "<th class='left'>";
1983
                echo "<a href=\"$target?$parameters&amp;start=0\">";
1984
                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/first.png\" alt='".$LANG["buttons"][33]."' title='".$LANG["buttons"][33]."'>";
1985

    
1986

    
1987
                echo "</a></th>\n";
1988
                echo "<th class='left'>";
1989
                echo "<a href=\"$target?$parameters&amp;start=$back\">";
1990
                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/left.png\" alt='".$LANG["buttons"][12]."' title='".$LANG["buttons"][12]."'>";
1991
                echo "</a></th>\n";
1992
        }
1993

    
1994
        // Print the "where am I?" 
1995
        echo "<td width='50%'  class='tab_bg_2'>";
1996
        printPagerForm("$target?$parameters&amp;start=$start");
1997
        echo "</td>\n";
1998

    
1999
        if ($item_type_output>0&&isset($_SESSION["glpiactiveprofile"])&&$_SESSION["glpiactiveprofile"]["interface"]=="central"){
2000
                echo "<td class='tab_bg_2' width='30%'>" ;
2001
                echo "<form method='GET' action=\"".$CFG_GLPI["root_doc"]."/front/report.dynamic.php\" target='_blank'>\n";
2002
                echo "<input type='hidden' name='item_type' value='$item_type_output'>";
2003
                if ($item_type_output_param!=0)
2004
                        echo "<input type='hidden' name='item_type_param' value='".serialize($item_type_output_param)."'>";
2005
                $split=split("&amp;",$parameters);
2006
                for ($i=0;$i<count($split);$i++){
2007
                        $pos=strpos($split[$i],'=');
2008
                        echo "<input type='hidden' name=\"".substr($split[$i],0,$pos)."\" value=\"".substr($split[$i],$pos+1)."\">";
2009
                }
2010
                echo "<select name='display_type'>";
2011
                echo "<option value='".PDF_OUTPUT_LANDSCAPE."'>".$LANG["buttons"][27]." ".$LANG["common"][68]."</option>";
2012
                echo "<option value='".PDF_OUTPUT_PORTRAIT."'>".$LANG["buttons"][27]." ".$LANG["common"][69]."</option>";
2013
                echo "<option value='".SYLK_OUTPUT."'>".$LANG["buttons"][28]."</option>";
2014
                echo "<option value='".CSV_OUTPUT."'>".$LANG["buttons"][44]."</option>";
2015
                echo "<option value='-".PDF_OUTPUT_LANDSCAPE."'>".$LANG["buttons"][29]." ".$LANG["common"][68]."</option>";
2016
                echo "<option value='-".PDF_OUTPUT_PORTRAIT."'>".$LANG["buttons"][29]." ".$LANG["common"][69]."</option>";
2017
                echo "<option value='-".SYLK_OUTPUT."'>".$LANG["buttons"][30]."</option>";
2018
                echo "<option value='-".CSV_OUTPUT."'>".$LANG["buttons"][45]."</option>";
2019
                echo "</select>";
2020
                echo "&nbsp;<input type='image' name='export'  src='".$CFG_GLPI["root_doc"]."/pics/greenbutton.png' title='".$LANG["buttons"][31]."' value='".$LANG["buttons"][31]."'>";
2021
                echo "</form>";
2022
                echo "</td>" ;
2023
        }
2024

    
2025
        echo "<td  width='50%'  class='tab_bg_2'><strong>";
2026

    
2027
        echo $LANG["pager"][2]."&nbsp;".$current_start."&nbsp;".$LANG["pager"][1]."&nbsp;".$current_end."&nbsp;".$LANG["pager"][3]."&nbsp;".$numrows."&nbsp;";
2028
        echo "</strong></td>\n";
2029

    
2030
        // Forward and fast forward button
2031
        if ($forward<$numrows) {
2032
                echo "<th class='right'>";
2033
                echo "<a href=\"$target?$parameters&amp;start=$forward\">";
2034
                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/right.png\" alt='".$LANG["buttons"][11]."' title='".$LANG["buttons"][11]."'>";
2035
                echo "</a></th>\n";
2036
                echo "<th class='right'>";
2037
                echo "<a href=\"$target?$parameters&amp;start=$end\">";
2038
                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/last.png\" alt='".$LANG["buttons"][32]."' title='".$LANG["buttons"][32]."'>";
2039
                echo "</a></th>\n";
2040
        }
2041

    
2042
        // End pager
2043
        echo "</tr>\n";
2044
        echo "</table><br>\n";
2045

    
2046
}
2047

    
2048

    
2049
/**
2050
 * Display calendar form
2051
 *
2052
 * @param $form form in which the calendar is display
2053
 * @param $element name of the element
2054
 * @param $value default value to display
2055
 * @param $can_edit could not modify element
2056
 * @param $with_time use datetime format instead of date format ?
2057
 * @param $with_reset do not display reset button
2058
 * @return nothing
2059
 */
2060
function showCalendarForm($form,$element,$value='',$can_edit=true,$with_time=false,$with_reset=true){
2061
        global $LANG,$CFG_GLPI;
2062
        $rand=mt_rand();
2063
        if (empty($value)) {
2064
                if ($with_time) $value=date("Y-m-d H:i");
2065
                else         $value=date("Y-m-d");
2066
        }
2067

    
2068
        $size=10;
2069
        $dvalue=$value;
2070
        if ($with_time) {
2071
                $size=18;
2072
                $dvalue=convDateTime($value);
2073
        } else {
2074
                $dvalue=convDate($value);
2075
        }
2076
        
2077
        echo "<input id='show$rand' type='text' name='____".$element."_show' readonly size='$size' value=\"".$dvalue."\">";
2078
        echo "<input id='data$rand' type='hidden' name='$element' size='$size' value=\"".$value."\">";
2079

    
2080
        if ($can_edit){
2081
                echo "&nbsp;<img id='button$rand' src='".$CFG_GLPI["root_doc"]."/pics/calendar.png' class='calendrier' alt='".$LANG["buttons"][15]."' title='".$LANG["buttons"][15]."'>";
2082

    
2083
                if ($with_reset){
2084
                        echo "&nbsp;<img src='".$CFG_GLPI["root_doc"]."/pics/reset.png' class='calendrier' onclick=\"window.document.getElementById('data$rand').value='0000-00-00".($with_time?" 00:00":"")."';window.document.getElementById('show$rand').value='".($with_time?convDateTime("0000-00-00 00:00"):convDate("0000-00-00"))."'\" alt='Reset' title='Reset'>";        
2085
                }
2086

    
2087
                echo "<script type='text/javascript'>";
2088
                echo "Calendar.setup(";
2089
                echo "{";
2090
                echo "inputField : 'data$rand',"; // ID of the input field
2091
                if ($with_time){
2092
                        echo "ifFormat : '%Y-%m-%d %H:%M',"; // the date format
2093
                        echo "showsTime : true,"; 
2094
                }
2095
                else {
2096
                        echo "ifFormat : '%Y-%m-%d',"; // the datetime format
2097
                }
2098
                echo "button : 'button$rand'"; // ID of the button
2099
                echo "});";
2100
                echo "</script>";
2101

    
2102
                echo "<script type='text/javascript' >\n";
2103
                echo "   new Form.Element.Observer('data$rand', 1, \n";
2104
                echo "      function(element, value) {\n";
2105
                if (!$CFG_GLPI["dateformat"]){
2106
                        echo "window.document.getElementById('show$rand').value=value;";
2107
                } else {
2108
                        if ($with_time){
2109
                                echo "if (value!='0000-00-00 00:00'){";
2110
                                        echo "var d=Date.parseDate(value,'%Y-%m-%d %H:%M');";
2111
                                        echo "window.document.getElementById('show$rand').value=d.print('%d-%m-%Y %H:%M');";
2112
                                echo "}";
2113
                        } else {
2114
                                echo "if (value!='0000-00-00'){";
2115
                                        echo "var d=Date.parseDate(value,'%Y-%m-%d');";
2116
                                        echo "window.document.getElementById('show$rand').value=d.print('%d-%m-%Y');";
2117
                                echo "}";
2118
                        }
2119
                }
2120
                echo "})\n";
2121
                echo "</script>\n";
2122
        }
2123
}
2124

    
2125
/**
2126
 *  show notes for item
2127
 *
2128
 * @param $target target page to update item
2129
 * @param $type item type of the device to display notes
2130
 * @param $id id of the device to display notes
2131
 * @return nothing
2132
 */
2133
function showNotesForm($target,$type,$id){
2134
        global $LANG;
2135

    
2136
        if (!haveRight("notes","r")) return false;
2137
        //new objet
2138
        $ci =new CommonItem;
2139
        //getFromDB
2140
        $ci->getFromDB ($type,$id);
2141

    
2142

    
2143
        echo "<form name='form' method='post' action=\"".$target."\">";
2144
        echo "<div class='center'>";
2145
        echo "<table class='tab_cadre_fixe' >";
2146
        echo "<tr><th align='center' >";
2147
        echo $LANG["title"][37];
2148
        echo "</th></tr>";
2149
        echo "<tr><td valign='middle' align='center' class='tab_bg_1' ><textarea class='textarea_notes' cols='100' rows='35' name='notes' >".$ci->getField('notes')."</textarea></td></tr>";
2150
        echo "<tr><td class='tab_bg_2' align='center' >\n";
2151
        echo "<input type='hidden' name='ID' value=$id>";
2152
        if (haveRight("notes","w"))
2153
                echo "<input type='submit' name='update' value=\"".$LANG["buttons"][7]."\" class='submit'>";
2154
        echo "</td></tr>\n";
2155
        echo "</table></div></form>";
2156
}
2157

    
2158
/**
2159
 * Set page not to use the cache
2160
 *
2161
 *
2162
 **/
2163
function header_nocache(){
2164
        header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
2165
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date du passe
2166
}
2167

    
2168
/**
2169
 * Flush the current displayed items (do not works really fine)
2170
 *
2171
 *
2172
 **/
2173
function glpi_flush(){
2174
        flush();
2175
        if (function_exists("ob_flush") && ob_get_length () !== FALSE) ob_flush();
2176
}
2177

    
2178
/**
2179
 * Display a simple progress bar
2180
 * @param $width Width of the progress bar
2181
 * @param $percent Percent of the progress bar
2182
 * @return nothing
2183
 *
2184
 *
2185
 **/
2186
function displayProgressBar($width,$percent){
2187
        global $LANG;
2188
        $percentwidth=floor($percent*$width/100);
2189
        echo str_pad("<div class='center'><table class='tab_cadre' width='$width'><tr><td width='$width' align='center'> ".$LANG["common"][47]."&nbsp;".$percent."%</td></tr><tr><td><table><tr><td bgcolor='red'  width='$percentwidth' height='20'>&nbsp;</td></tr></table></td></tr></table></div>\n",4096);
2190
        glpi_flush();
2191
}
2192
/**
2193
 * Clean Printing of and array in a table 
2194
 * @param $tab the array to display
2195
 * @param $pad Pad used
2196
 * @return nothing
2197
 *
2198
 *
2199
 **/
2200
function printCleanArray($tab,$pad=0){
2201
        if (count($tab)){
2202
                echo "<table class='tab_cadre'>";
2203
                echo "<tr><th>KEY</th><th>=></th><th>VALUE</th></tr>";
2204
                foreach($tab as $key => $val){
2205
                        echo "<tr class='tab_bg_1'><td valign='top' align='right'>";
2206
                        echo $key;
2207
                        echo "</td><td valign='top'>=></td><td valign='top'  class='tab_bg_1'>";
2208
                        if (is_array($val)){
2209
                                printCleanArray($val,$pad+1);
2210
                        }
2211
                        else echo $val;
2212
                        echo "</td></tr>";
2213
                }
2214
                echo "</table>";
2215
        }
2216
}
2217

    
2218
/**
2219
 * Display a Link to the last page using http_referer if available else use history.back
2220
 *
2221
 *
2222
 **/
2223
function displayBackLink(){
2224
        global $LANG;
2225
        if (isset($_SERVER['HTTP_REFERER'])){
2226
                echo "<a href='".$_SERVER['HTTP_REFERER']."'>".$LANG["buttons"][13]."</a>";
2227
        } else {
2228
                echo "<a href='javascript:history.back();'>".$LANG["buttons"][13]."</a>";
2229
        }
2230
}
2231

    
2232
/**
2233
* Print the form used to select profile if several are available
2234
* @param $target target of the form
2235
* @return nothing
2236
*
2237
*
2238
**/
2239
function showProfileSelecter($target){
2240
        global $CFG_GLPI, $LANG;
2241

    
2242
        //ryxeo patch
2243
        /*
2244
        if (count($_SESSION["glpiprofiles"])>1){
2245
                echo '<li><form name="form" method="post" action="'.$target.'">';
2246
                echo '<select name="newprofile" onChange="submit()">';
2247
                foreach ($_SESSION["glpiprofiles"] as $key => $val){
2248
                        echo '<option value="'.$key.'" '.($_SESSION["glpiactiveprofile"]["ID"]==$key?'selected':'').'>'.$val['name'].'</option>';
2249
                }
2250
                echo '</select>';
2251
                echo '</form>';
2252
                echo "</li>";
2253

2254

2255
        } //else echo "only one profile -> no select to print";
2256
        */
2257
        if (isMultiEntitiesMode()){
2258
                $cpt=0;
2259
                
2260
                foreach ($_SESSION['glpi_entities_tree'] as $key => $tree){
2261
                        $entities = contructListFromTree($tree);
2262
                        $cpt+=count($entities);
2263
                }
2264
        
2265
                $addname="";
2266
                if ($cpt>15){
2267
                        $addname="_long";
2268
                }
2269
                
2270
                echo "<li>";
2271

    
2272

    
2273
                //echo "<a href='".$CFG_GLPI["root_doc"]."/front/entity.select.php?target=$target' id='modal_entity_selection'>".$_SESSION["glpiactive_entity_name"]."</a>";
2274

    
2275
                echo "<a href='#modal_entity_contents' id='modal_entity_selection' title='".str_replace("'","",$_SESSION["glpiactive_entity_name"])."' class='entity_select'>".str_replace("'","",$_SESSION["glpiactive_entity_shortname"])."</a>";
2276
                echo "<div id='modal_entity_contents'>";        
2277
                displayActiveEntities($target,"activeentity");
2278
                echo "</div>";
2279
                
2280
                echo "<script  type='text/javascript'>";
2281
                echo "new Control.Modal('modal_entity_selection',{";
2282
                //echo "iframe: true,";
2283
                //echo "opacity: 0.8, position: 'relative', width:300, height:50";
2284
                echo "opacity: 0.2, fadeDuration: 0.35, width: 500, height: 500";
2285
                echo "});";
2286
                echo "</script>";
2287

    
2288
/*                echo "<a href='#' title=\"".$_SESSION["glpiactive_entity_name"]."\" onclick=\"completecleandisplay('show_entities$addname');\">";
2289
                echo $_SESSION["glpiactive_entity_shortname"];
2290
                echo "</a>";
2291
                echo "<div id='show_entities$addname' onmouseover=\"completecleandisplay('show_entities$addname');\">";        
2292
                
2293
                displayActiveEntities($target,"activeentity");
2294
                
2295
                echo "</div>";
2296
*/
2297
                echo "</li>";
2298
        }
2299

    
2300

    
2301

    
2302
} 
2303

    
2304
/**
2305
 * Create a Dynamic Progress Bar
2306
 *
2307
 * @param $msg initial message (under the bar)
2308
 * @return nothing
2309
 **/
2310
function createProgressBar ($msg="&nbsp;") {
2311
        echo "<div class='doaction_cadre'><div class='doaction_progress' id='doaction_progress'>".
2312
                "<div class='doaction_pourcent' id='doaction_pourcent'>&nbsp;</div></div></div><br />".
2313
                "<div id='doaction_message'>$msg</div>";
2314
}
2315

    
2316
/**
2317
 * Change the Progress Bar Position
2318
 *
2319
 * @param $crt Current Value (less then $max)
2320
 * @param $tot Maximum Value 
2321
 * @param $msg message inside the bar (defaut is %)
2322
 * @return nothing
2323
 **/
2324
function changeProgressBarPosition ($crt, $tot, $msg="") {
2325
        if (!$tot)
2326
                $pct=0;
2327
        else if ($crt>$tot)
2328
                $pct=100;
2329
        else
2330
                $pct = floor($crt*100/$tot);
2331

    
2332
        if (empty($msg)) $msg = $pct." %";
2333

    
2334
        echo "<script type='text/javascript'>action_change_progress(\"$pct%\",\"$msg\")</script>\n";
2335
        glpi_flush();                                                        
2336
}
2337

    
2338
/**
2339
 * Change the Message under the Progress Bar
2340
 *
2341
 * @param $msg message under the bar
2342
 * @return nothing
2343
 **/
2344
function changeProgressBarMessage ($msg="&nbsp;") {
2345
        echo "<script type='text/javascript'>action_change_message(\"$msg\")</script>\n";        
2346
}
2347
?>
Redmine Appliance - Powered by TurnKey Linux