r144: Added showhistory.php so we can see the history of a bug
[bugdar.git] / showhistory.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 $fetchtemplates = array(
14 'history',
15 'history_bit'
16 );
17
18 require_once('./global.php');
19
20 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . intval($bugsys->in['bugid']));
21 if (!$bug)
22 {
23 echo 'alert: bad bug';
24 exit;
25 }
26
27 // ###################################################################
28
29 $logs = $db->query("SELECT history.*, user.* FROM " . TABLE_PREFIX . "history LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = history.userid) WHERE bugid = $bug[bugid]");
30 while ($log = $db->fetch_array($logs))
31 {
32 $log['formatted'] = call_user_func_array('phrase', array_merge(array($log['language']), unserialize($log['arguments'])));
33 $log['date'] = datelike('standard', $log['dateline']);
34 $log['user'] = construct_user_display($log);
35 eval('$history .= "' . $template->fetch('history_bit') . '";');
36 }
37
38 eval('$template->flush("' . $template->fetch('history') . '");');
39
40 /*=====================================================================*\
41 || ###################################################################
42 || # $HeadURL$
43 || # $Id$
44 || ###################################################################
45 \*=====================================================================*/
46 ?>