Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

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

Historique | Voir | Annoter | Télécharger (18,6 ko)

1 1c14bcc4 Eric Seigne
<?php
2
/*
3
 * @version $Id: log.function.php 7908 2009-01-26 19:35:55Z remi $
4
 -------------------------------------------------------------------------
5
 GLPI - Gestionnaire Libre de Parc Informatique
6
 Copyright (C) 2003-2009 by the INDEPNET Development Team.
7

8
 http://indepnet.net/   http://glpi-project.org
9
 -------------------------------------------------------------------------
10

11
 LICENSE
12

13
 This file is part of GLPI.
14

15
 GLPI is free software; you can redistribute it and/or modify
16
 it under the terms of the GNU General Public License as published by
17
 the Free Software Foundation; either version 2 of the License, or
18
 (at your option) any later version.
19

20
 GLPI is distributed in the hope that it will be useful,
21
 but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 GNU General Public License for more details.
24

25
 You should have received a copy of the GNU General Public License
26
 along with GLPI; if not, write to the Free Software
27
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
 --------------------------------------------------------------------------
29
 */
30
31
// ----------------------------------------------------------------------
32
// Original Author of file:
33
// Purpose of file:
34
// ----------------------------------------------------------------------
35
36
if (!defined('GLPI_ROOT')){
37
        die("Sorry. You can't access directly to this file");
38
        }
39
40
41
/**
42
 * Log  history 
43
 *
44
 * 
45
 *
46
 * @param $id_device
47
 * @param $device_type
48
 * @param $changes
49
 * @param $device_internal_type
50
 * @param $linked_action
51
 **/
52
function historyLog ($id_device,$device_type,$changes,$device_internal_type='0',$linked_action='0') {
53
54
        global $DB;
55
56
        $date_mod=$_SESSION["glpi_currenttime"];
57
        
58
        if(!empty($changes)){
59
60
                // créate a query to insert history
61
                $id_search_option=$changes[0];
62
                $old_value=$changes[1];
63
                $new_value=$changes[2];
64
65
                if (isset($_SESSION["glpiID"]))
66
                        $username = getUserName($_SESSION["glpiID"],$link=0);
67
                else
68
                        $username="";
69
70
                // Build query
71
                $query = "INSERT INTO glpi_history (FK_glpi_device,device_type,device_internal_type,linked_action,user_name,date_mod,id_search_option,old_value,new_value)  VALUES ('$id_device','$device_type','$device_internal_type','$linked_action','". addslashes($username)."','$date_mod','$id_search_option','".utf8_substr($old_value,0,250)."','".utf8_substr($new_value,0,250)."');";
72
                $DB->query($query)  or die($DB->error());
73
        }
74
75
}
76
77
/**
78
 * Construct  history for device
79
 *
80
 * 
81
 *
82
 * @param $id_device ID of the device
83
 * @param $device_type ID of the device type
84
 * @param $oldvalues old values updated
85
 * @param $values all values of the item
86
 **/
87
function constructHistory($id_device,$device_type,&$oldvalues,&$values) {
88
89
        global $LINK_ID_TABLE, $LANG ;
90
91
        if (count($oldvalues)){
92
                // needed to have  $SEARCH_OPTION
93
                $SEARCH_OPTION=getSearchOptions();
94
95
                foreach ($oldvalues as $key => $oldval){
96
                        $changes=array();
97
                        // Parsing $SEARCH_OPTIONS to find infocom 
98
                        if ($device_type==INFOCOM_TYPE) {
99
                                $ic=new Infocom();
100
                                if ($ic->getFromDB($values['ID'])){
101
                                        $real_device_type=$ic->fields['device_type'];
102
                                        $id_device=$ic->fields['FK_device'];
103
                                        if (isset($SEARCH_OPTION[$real_device_type])) foreach($SEARCH_OPTION[$real_device_type] as $key2 => $val2){
104
                                                if(($val2["field"]==$key&&ereg('infocoms',$val2['table'])) || 
105
                                                        ($key=='budget'&&$val2['table']=='glpi_dropdown_budget') ||
106
                                                        ($key=='FK_enterprise'&&$val2['table']=='glpi_enterprises_infocoms')) {
107
                                                        $id_search_option=$key2; // Give ID of the $SEARCH_OPTION
108
                                                        if ($val2["table"]=="glpi_infocoms"){
109
                                                                // 1st case : text field -> keep datas
110
                                                                $changes=array($id_search_option, addslashes($oldval),$values[$key]);
111
                                                        } else if ($val2["table"]=="glpi_enterprises_infocoms") {
112
                                                                // 2nd case ; link field -> get data from glpi_enterprises
113
                                                                $changes=array($id_search_option,  addslashes(getDropdownName("glpi_enterprises",$oldval)), addslashes(getDropdownName("glpi_enterprises",$values[$key])));
114
                                                        } else  {
115
                                                                // 3rd case ; link field -> get data from dropdown (budget)
116
                                                                $changes=array($id_search_option,  addslashes(getDropdownName( $val2["table"],$oldval)), addslashes(getDropdownName( $val2["table"],$values[$key])));
117
                                                        }
118
                                                break; // foreach exit
119
                                                }
120
                                        }
121
                                }
122
                        } else {
123
                                $real_device_type=$device_type;
124
                                // Parsing $SEARCH_OPTION, check if an entry exists matching $key
125
                                foreach($SEARCH_OPTION[$device_type] as $key2 => $val2){
126
                        
127
                                        // Linkfield or standard field not massive action enable
128
                                        if($val2["linkfield"]==$key 
129
                                                || ( empty($val2["linkfield"]) && $key == $val2["field"]) ){
130
                                                $id_search_option=$key2; // Give ID of the $SEARCH_OPTION
131
                        
132
                                                if($val2["table"]==$LINK_ID_TABLE[$device_type]){
133
                                                        // 1st case : text field -> keep datas
134
                                                        $changes=array($id_search_option, addslashes($oldval),$values[$key]);
135
                                                }else {
136
                                                        // 2nd case ; link field -> get data from dropdown
137
                                                        $changes=array($id_search_option,  addslashes(getDropdownName( $val2["table"],$oldval)), addslashes(getDropdownName( $val2["table"],$values[$key])));
138
                                                }
139
                                                break;
140
                                        }
141
                                } 
142
                        }
143
                
144
                        if (count($changes)){
145
                                historyLog ($id_device,$real_device_type,$changes);
146
                        }
147
148
                }
149
        }
150
} // function construct_history
151
152
153
154
/**
155
 * Show History
156
 ** 
157
 * Show history for a device 
158
 *
159
 * @param $id_device
160
 * @param $device_type
161
 **/
162
function showHistory($device_type,$id_device){
163
164
        global $DB, $LINK_ID_TABLE,$LANG;        
165
166
        $SEARCH_OPTION=getSearchOptions();
167
168
        $query="SELECT * FROM glpi_history WHERE FK_glpi_device='".$id_device."' AND device_type='".$device_type."' ORDER BY  ID DESC;";
169
170
        //echo $query;
171
172
        // Get results
173
        $result = $DB->query($query);
174
175
        // Number of results
176
        $number = $DB->numrows($result);
177
178
        // No Events in database
179
        if ($number < 1) {
180
                echo "<br><div class='center'>";
181
                echo "<table class='tab_cadre_fixe'>";
182
                echo "<tr><th>".$LANG["event"][20]."</th></tr>";
183
                echo "</table>";
184
                echo "</div><br>";
185
                return;
186
        }
187
188
        // Output events
189
190
        echo "<div class='center'><br><table class='tab_cadre_fixe'>";
191
        echo "<tr><th colspan='5'>".$LANG["title"][38]."</th></tr>";
192
        echo "<tr><th>".$LANG["common"][2]."</th><th>".$LANG["common"][27]."</th><th>".$LANG["common"][34]."</th><th>".$LANG["event"][18]."</th><th>".$LANG["event"][19]."</th></tr>";
193
        while ($data =$DB->fetch_array($result)){ 
194
                $display_history = true;
195
                $ID = $data["ID"];
196
                $date_mod=convDateTime($data["date_mod"]);
197
                $user_name = $data["user_name"];
198
                $field="";
199
                // This is an internal device ?
200
                if($data["linked_action"]){
201
                        // Yes it is an internal device
202
203
                        switch ($data["linked_action"]){
204
205
                                case HISTORY_DELETE_ITEM :
206
                                        $change = $LANG["log"][22];        
207
                                        break;
208
                                case HISTORY_RESTORE_ITEM :
209
                                        $change = $LANG["log"][23];        
210
                                        break;
211
212
                                case HISTORY_ADD_DEVICE :
213
                                        $field=getDictDeviceLabel($data["device_internal_type"]);
214
                                        $change = $LANG["devices"][25]."&nbsp;<strong>:</strong>&nbsp;\"".$data[ "new_value"]."\"";        
215
                                        break;
216
217
                                case HISTORY_UPDATE_DEVICE :
218
                                        $field=getDictDeviceLabel($data["device_internal_type"]);
219
                                        $change = getDeviceSpecifityLabel($data["device_internal_type"])."&nbsp;:&nbsp;\"".$data[ "old_value"]."\"&nbsp;<strong>--></strong>&nbsp;\"".$data[ "new_value"]."\"";        
220
                                        break;
221
222
                                case HISTORY_DELETE_DEVICE :
223
                                        $field=getDictDeviceLabel($data["device_internal_type"]);
224
                                        $change = $LANG["devices"][26]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["old_value"]."\"";        
225
                                        break;
226
                                case HISTORY_INSTALL_SOFTWARE :
227
                                        $field=$LANG["help"][31];
228
                                        $change = $LANG["software"][44]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["new_value"]."\"";        
229
                                        break;                                
230
                                case HISTORY_UNINSTALL_SOFTWARE :
231
                                        $field=$LANG["help"][31];
232
                                        $change = $LANG["software"][45]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["old_value"]."\"";        
233
                                        break;        
234
                                case HISTORY_DISCONNECT_DEVICE:
235
                                        $ci=new CommonItem();
236
                                        $ci->setType($data["device_internal_type"]);
237
                                        $field=$ci->getType();
238
                                        $change = $LANG["central"][6]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["old_value"]."\"";        
239
                                        break;        
240
                                case HISTORY_CONNECT_DEVICE:
241
                                        $ci=new CommonItem();
242
                                        $ci->setType($data["device_internal_type"]);
243
                                        $field=$ci->getType();
244
                                        $change = $LANG["log"][55]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["new_value"]."\"";        
245
                                        break;        
246
                                case HISTORY_OCS_IMPORT:
247
                                        if (haveRight("view_ocsng","r")){
248
                                                $field="";
249
                                                $change = $LANG["ocsng"][7]." ".$LANG["ocsng"][45]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["new_value"]."\"";        
250
                                        } else {
251
                                                $display_history = false;
252
                                        }
253
                                                
254
                                        break;        
255
                                case HISTORY_OCS_DELETE:
256
                                        if (haveRight("view_ocsng","r")){
257
                                                $field="";
258
                                                $change = $LANG["ocsng"][46]." ".$LANG["ocsng"][45]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["old_value"]."\"";        
259
                                        } else {
260
                                                $display_history = false;
261
                                        }
262
263
                                        break;        
264
                                case HISTORY_OCS_LINK:
265
                                        if (haveRight("view_ocsng","r")){
266
                                                $ci=new CommonItem();
267
                                                $ci->setType($data["device_internal_type"]);
268
                                                $field=$ci->getType();
269
                                                $change = $LANG["ocsng"][47]." ".$LANG["ocsng"][45]."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["new_value"]."\"";        
270
                                        } else {
271
                                                $display_history = false;
272
                                        }
273
274
                                        break;        
275
                                case HISTORY_OCS_IDCHANGED:
276
                                        if (haveRight("view_ocsng","r")){
277
                                                $field="";
278
                                                $change = $LANG["ocsng"][48]." "."&nbsp;<strong>:</strong>&nbsp;"."\"".$data["old_value"]."\" --> &nbsp;<strong>:</strong>&nbsp;"."\"".$data["new_value"]."\"";        
279
                                        } else {
280
                                                $display_history = false;
281
                                        }
282
283
                                        break;        
284
                                        
285
                                case HISTORY_LOG_SIMPLE_MESSAGE:
286
                                        $field="";
287
                                        $change = $data["new_value"];        
288
                                        break;                        
289
                        }
290
                }else{
291
                        $fieldname="";
292
                        // It's not an internal device
293
                        foreach($SEARCH_OPTION[$device_type] as $key2 => $val2){
294
295
                                if($key2==$data["id_search_option"]){
296
                                        $field= $val2["name"];
297
                                        $fieldname=$val2["field"];
298
                                }
299
                        }
300
301
                        switch ($fieldname){
302
                                case "comments" : 
303
                                        $change =$LANG["log"][64];
304
                                        break;
305
                                case "notes" : 
306
                                        $change =$LANG["log"][67];
307
                                        break;
308
                                default :
309
                                        $change = "\"".$data[ "old_value"]."\"&nbsp;<strong>--></strong>&nbsp;\"".$data[ "new_value"]."\"";
310
                        }
311
                }// fin du else
312
313
                if ($display_history)
314
                {
315
                        // show line 
316
                        echo "<tr class='tab_bg_2'>";
317
        
318
                        echo "<td>$ID</td><td>$date_mod</td><td>$user_name</td><td>$field</td><td width='60%'>$change</td>"; 
319
                        echo "</tr>";
320
                }
321
        }
322
323
        echo "</table></div>";
324
325
}
326
327
328
329
/**
330
 * Log an event.
331
 *
332
 * Log the event $event on the glpi_event table with all the others args, if
333
 * $level is above or equal to setting from configuration.
334
 *
335
 * @param $item 
336
 * @param $itemtype
337
 * @param $level
338
 * @param $service
339
 * @param $event
340
 **/
341
function logEvent ($item, $itemtype, $level, $service, $event) {
342
        // Logs the event if level is above or equal to setting from configuration
343
        
344
        global $DB,$CFG_GLPI, $LANG;
345
        if ($level <= $CFG_GLPI["event_loglevel"] && !$DB->isSlave()) { 
346
                $query = "INSERT INTO glpi_event_log VALUES (NULL, '".addslashes($item)."', '".addslashes($itemtype)."', '".$_SESSION["glpi_currenttime"]."', '".addslashes($service)."', '".addslashes($level)."', '".addslashes($event)."')";
347
                $result = $DB->query($query);    
348
349
        }
350
}
351
352
/**
353
 * Return arrays for function showEvent et lastEvent
354
 *
355
 **/
356
function logArray(){
357
358
        global $LANG;
359
360
        $logItemtype=array("system"=>$LANG["log"][1],
361
                        "computers"=>$LANG["log"][2],
362
                        "monitors"=>$LANG["log"][3],
363
                        "printers"=>$LANG["log"][4],
364
                        "software"=>$LANG["log"][5],
365
                        "networking"=>$LANG["log"][6],
366
                        "cartridges"=>$LANG["log"][7],
367
                        "peripherals"=>$LANG["log"][8],
368
                        "consumables"=>$LANG["log"][9],
369
                        "tracking"=>$LANG["log"][10],
370
                        "contacts"=>$LANG["log"][11],
371
                        "enterprises"=>$LANG["log"][12],
372
                        "documents"=>$LANG["log"][13],
373
                        "knowbase"=>$LANG["log"][14],
374
                        "users"=>$LANG["log"][15],
375
                        "infocom"=>$LANG["log"][19],
376
                        "devices"=>$LANG["log"][18],
377
                        "links"=>$LANG["log"][38],
378
                        "typedocs"=>$LANG["log"][39],
379
                        "planning"=>$LANG["log"][16],
380
                        "reservation"=>$LANG["log"][42],
381
                        "contracts"=>$LANG["log"][17],
382
                        "phones"=>$LANG["log"][43],
383
                        "dropdown"=>$LANG["log"][44],
384
                        "groups"=>$LANG["log"][47],
385
                        "entity"=>$LANG["log"][63],
386
                        "reminder"=>$LANG["title"][37],
387
                        "rules"=>$LANG["log"][65]);
388
389
390
        $logService=array("inventory"=>$LANG["log"][50],
391
                        "tracking"=>$LANG["log"][51],
392
                        "planning"=>$LANG["Menu"][29],
393
                        "tools"=>$LANG["log"][53],
394
                        "financial"=>$LANG["log"][54],
395
                        "login"=>$LANG["log"][55],
396
                        "setup"=>$LANG["common"][12],
397
                        "security"=>$LANG["log"][66],
398
                        "reservation"=>$LANG["log"][58],
399
                        "cron"=>$LANG["log"][59],
400
                        "document"=>$LANG["Menu"][27],
401
                        "plugin"=>$LANG["common"][29]);
402
403
        return array($logItemtype,$logService);
404
405
}
406
407
function displayItemLogID($itemtype,$item){
408
        global $CFG_GLPI;
409
410
        if ($item=="-1" || $item=="0") {
411
                echo "&nbsp;";//$item;
412
        } else {
413
                if ($itemtype=="infocom"){
414
                        echo "<a href='#' onClick=\"window.open('".$CFG_GLPI["root_doc"]."/front/infocom.show.php?ID=$item','infocoms','location=infocoms,width=1000,height=400,scrollbars=no')\">$item</a>";                                        
415
                } else {
416
                        if ($item=="-1" || $item=="0") {
417
                                echo "&nbsp;";//$item;
418
                        } else {
419
                                switch ($itemtype){
420
                                        case "rules" :
421
                                                echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/rule.generic.form.php?ID=".$item."\">".$item."</a>";
422
                                                break;
423
                                        case "infocom" :
424
                                                echo "<a href='#' onClick=\"window.open('".$CFG_GLPI["root_doc"]."/front/infocom.show.php?ID=$item','infocoms','location=infocoms,width=1000,height=400,scrollbars=no')\">$item</a>";                                        
425
                                                break;
426
                                        case "devices":
427
                                                echo $item;
428
                                                break;
429
                                        case "reservation":
430
                                                echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/reservation.php?show=resa&amp;ID=".$item."\">$item</a>";
431
                                                break;
432
                                        default :
433
                                        if ($itemtype[strlen($itemtype)-1]=='s'){
434
                                                $show=substr($itemtype,0,strlen($itemtype)-1);
435
                                        }else $show=$itemtype;
436
                                                
437
                                        echo "<a href=\"".$CFG_GLPI["root_doc"]."/front/".$show.".form.php?ID=";
438
                                        echo $item;
439
                                        echo "\">$item</a>";
440
                                        break;
441
                                }
442
                        }                        
443
                }
444
        }                        
445
}
446
447
448
/**
449
 * Print a nice tab for last event from inventory section
450
 *
451
 * Print a great tab to present lasts events occured on glpi
452
 *
453
 *
454
 * @param $target where to go when complete
455
 * @param $user
456
 **/
457
function showAddEvents($target,$user="") {
458
        // Show events from $result in table form
459
460
        global $DB,$CFG_GLPI, $LANG;
461
462
        list($logItemtype,$logService)=logArray();
463
464
        $usersearch="%";
465
        if (!empty($user))
466
                $usersearch=$user." ";
467
468
        // Query Database
469
        $query = "SELECT * FROM glpi_event_log WHERE message LIKE '".$usersearch.addslashes($LANG["log"][20])."%' ORDER BY `date` DESC LIMIT 0,".$CFG_GLPI["num_of_events"];
470
471
        // Get results
472
        $result = $DB->query($query);
473
474
475
        // Number of results
476
        $number = $DB->numrows($result);
477
478
        // No Events in database
479
        if ($number < 1) {
480
                echo "<br>";
481
                echo "<table class='tab_cadrehov'>";
482
                echo "<tr><th>".$LANG["central"][4]."</th></tr>";
483
                echo "</table>";
484
                echo "<br>";
485
                return;
486
        }
487
488
        // Output events
489
        $i = 0;
490
491
        echo "<br><table  class='tab_cadrehov'>";
492
        echo "<tr><th colspan='5'><a href=\"".$CFG_GLPI["root_doc"]."/front/log.php\">".$LANG["central"][2]." ".$CFG_GLPI["num_of_events"]." ".$LANG["central"][8]."</a></th></tr>";
493
        echo "<tr>";
494
495
        echo "<th colspan='2'>".$LANG["event"][0]."</th>";
496
        echo "<th><img src='".$CFG_GLPI["root_doc"]."/pics/puce-down.png' alt='' title=''>".$LANG["common"][27]."</a></th>";
497
        echo "<th width='8%'>".$LANG["event"][2]."</th>";
498
        echo "<th width='60%'>".$LANG["event"][4]."</th></tr>";
499
500
        while ($i < $number) {
501
                $ID = $DB->result($result, $i, "ID");
502
                $item = $DB->result($result, $i, "item");
503
                $itemtype = $DB->result($result, $i, "itemtype");
504
                $date = $DB->result($result, $i, "date");
505
                $service = $DB->result($result, $i, "service");
506
                //$level = $DB->result($result, $i, "level");
507
                $message = $DB->result($result, $i, "message");
508
509
                echo "<tr class='tab_bg_2'>";
510
                echo "<td>".$logItemtype[$itemtype].":</td><td class='center'>";
511
512
                displayItemLogID($itemtype,$item);
513
                echo "</td><td  class='center'>".convDateTime($date)."</td><td class='center'>".$logService[$service]."</td><td>$message</td>";
514
                echo "</tr>";
515
516
                $i++; 
517
        }
518
519
        echo "</table><br>";
520
}
521
522
/**
523
 * Print a nice tab for last event
524
 *
525
 * Print a great tab to present lasts events occured on glpi
526
 *
527
 *
528
 * @param $target where to go when complete
529
 * @param $order order by clause occurences (eg: ) 
530
 * @param $sort order by clause occurences (eg: date) 
531
 * @param $start
532
 **/
533
function showEvents($target,$order,$sort,$start=0) {
534
        // Show events from $result in table form
535
536
        global $DB,$CFG_GLPI, $LANG;
537
538
        list($logItemtype,$logService)=logArray();
539
540
        // Columns of the Table
541
        $items = array(
542
                "item"                => array($LANG["event"][0], "colspan='2'"),
543
                "date"                => array($LANG["common"][27], ""),
544
                "service"        => array($LANG["event"][2], "width='8%'"),
545
                "level"                => array($LANG["event"][3], "width='8%'"),
546
                "message"        => array($LANG["event"][4], "width='50%'")
547
                );
548
        // define default sorting
549
550
        if (!isset($items[$sort])) {
551
                $sort = "date";
552
        }
553
        if ($order!="ASC"){
554
                $order = "DESC";
555
        }
556
557
        // Query Database
558
        $query_limit = "SELECT * FROM glpi_event_log ORDER BY `$sort` $order LIMIT ".intval($start).",".intval($_SESSION["glpilist_limit"]);
559
560
        // Number of results
561
        $numrows = countElementsInTable("glpi_event_log");
562
        // Get results
563
        $result = $DB->query($query_limit);
564
        $number = $DB->numrows($result);
565
566
        // No Events in database
567
        if ($number < 1) {
568
                echo "<div class='center'><strong>".$LANG["central"][4]."</strong></div>";
569
                return;
570
        }
571
572
        // Output events
573
        $i = 0;
574
575
        echo "<div class='center'>";
576
        $parameters="sort=$sort&amp;order=$order";
577
        printPager($start,$numrows,$target,$parameters);
578
579
        echo "<table class='tab_cadre_fixe'>";
580
        echo "<tr>";
581
582
        foreach ($items as $field => $args) {
583
                echo "<th ".$args[1].">";
584
                
585
                if ($sort==$field) {
586
                        if ($order=="DESC") {
587
                                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/puce-down.png\" alt='' title=''>";
588
                        } else {
589
                                echo "<img src=\"".$CFG_GLPI["root_doc"]."/pics/puce-up.png\" alt='' title=''>";
590
                        }
591
                }
592
                echo "<a href='$target?sort=$field&amp;order=".($order=="ASC"?"DESC":"ASC")."'>".$args[0]."</a></th>";                
593
        }
594
        echo "</tr>";
595
596
        while ($i < $number) {
597
                $ID = $DB->result($result, $i, "ID");
598
                $item = $DB->result($result, $i, "item");
599
                $itemtype = $DB->result($result, $i, "itemtype");
600
                $date = $DB->result($result, $i, "date");
601
                $service = $DB->result($result, $i, "service");
602
                $level = $DB->result($result, $i, "level");
603
                $message = $DB->result($result, $i, "message");
604
                
605
                echo "<tr class='tab_bg_2'>";
606
                echo "<td>".(isset($logItemtype[$itemtype])?$logItemtype[$itemtype]:"&nbsp;").":</td><td class='center'><strong>"; 
607
                displayItemLogID($itemtype,$item);        
608
                echo "</strong></td><td>".convDateTime($date)."</td><td class='center'>".(isset($logService[$service])?$logService[$service]:$service)."</td><td class='center'>$level</td><td>$message</td>";
609
                echo "</tr>";
610
611
                $i++; 
612
        }
613
614
        echo "</table></div><br>";
615
}
616
617
?>
Redmine Appliance - Powered by TurnKey Linux