r144: Added showhistory.php so we can see the history of a bug
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 15 May 2005 03:25:47 +0000 (03:25 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 15 May 2005 03:25:47 +0000 (03:25 +0000)
docs/roadmap.txt
docs/todo.txt
showhistory.php [new file with mode: 0644]
templates/default/SHOWREPORT.tpl
templates/default/history.tpl [new file with mode: 0644]
templates/default/history_bit.tpl [new file with mode: 0644]

index 5013b4326fd9a2570ee55916d5d50368a633c6a0..a1c88ef3347e60cfe964b12fa9dac5473fe4e27a 100755 (executable)
@@ -12,7 +12,6 @@ BUGTRACK 1.0
 - Admin auto-actions (see supplementary documentation)
 - Custom bug fields
 - Bug statistics/logging
-       - Bug history
 
 ----------------------------------------
   BETA 2
index 23b16c8900b42a222955f89ef2e2d6c4c7d4eed6..2ab3a9e515e6218c2921cb672b8caf05739808f7 100755 (executable)
@@ -33,7 +33,7 @@ BUGTRACK 1.0
 - Custom bug fields
 - Default templates in the description field
 - Help bubbles detailing each field
-- Bug logging/history
+- Bug logging
 
 ###############################################################################
 BUGTRACK 1.1
diff --git a/showhistory.php b/showhistory.php
new file mode 100644 (file)
index 0000000..65514d2
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/*=====================================================================*\
+|| ################################################################### ||
+|| # BugStrike [#]version[#]
+|| # --------------------------------------------------------------- # ||
+|| # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
+|| # This file may not be reproduced in any way without permission.  # ||
+|| # --------------------------------------------------------------- # ||
+|| # User License Agreement at http://www.iris-studios.com/license/  # ||
+|| ################################################################### ||
+\*=====================================================================*/
+
+$fetchtemplates = array(
+       'history',
+       'history_bit'
+);
+
+require_once('./global.php');
+
+$bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . intval($bugsys->in['bugid']));
+if (!$bug)
+{
+       echo 'alert: bad bug';
+       exit;
+}
+
+// ###################################################################
+
+$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]");
+while ($log = $db->fetch_array($logs))
+{
+       $log['formatted'] = call_user_func_array('phrase', array_merge(array($log['language']), unserialize($log['arguments'])));
+       $log['date'] = datelike('standard', $log['dateline']);
+       $log['user'] = construct_user_display($log);
+       eval('$history .= "' . $template->fetch('history_bit') . '";');
+}
+
+eval('$template->flush("' . $template->fetch('history') . '");');
+
+/*=====================================================================*\
+|| ###################################################################
+|| # $HeadURL$
+|| # $Id$
+|| ###################################################################
+\*=====================================================================*/
+?>
\ No newline at end of file
index 17bb740f206fa25138fb8111660e1e9017d689f3..00f7400f619639b66f41a1e1a622644e5b5c94a1 100644 (file)
@@ -7,7 +7,7 @@
 <div><strong>Priority:</strong> $bug[priority]</div>
 <if condition="$bug['assigninfo']"><div><strong>Assigned to:</strong> $bug[assigninfo]</div></if>
 
-<if condition="$show['editreport']"><div>[<a href="editreport.php?bugid=$bug[bugid]">Edit Bug Report</a>]</div></if>
+<div>[<a href="showhistory.php?bugid=$bug[bugid]">Show Bug History</a>]<if condition="$show['editreport']">[ <a href="editreport.php?bugid=$bug[bugid]">Edit Bug Report</a>]</if></div>
 
 <br />
 
diff --git a/templates/default/history.tpl b/templates/default/history.tpl
new file mode 100644 (file)
index 0000000..eff4bb2
--- /dev/null
@@ -0,0 +1,3 @@
+<h2>History for <em>$bug[summary]</em> (bugid: $bug[bugid])</h2>
+
+$history
\ No newline at end of file
diff --git a/templates/default/history_bit.tpl b/templates/default/history_bit.tpl
new file mode 100644 (file)
index 0000000..88ebd6b
--- /dev/null
@@ -0,0 +1,11 @@
+<table border="1" cellspacing="2" cellpadding="4" width="100%">
+<tr style="background-color: #EEEEEE">
+       <td>History Entry (entryid: $log[historyid])</td>
+       <td>$log[user]</td>
+       <td align="right">$log[date]</td>
+</tr>
+<tr>
+       <td colspan="3">$log[formatted]</td>
+</tr>
+</table>
+<br />