From dc748a4cbdef5bf47b94ef777fb9ed3d38a76a2a Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 May 2005 03:25:47 +0000 Subject: [PATCH] r144: Added showhistory.php so we can see the history of a bug --- docs/roadmap.txt | 1 - docs/todo.txt | 2 +- showhistory.php | 46 +++++++++++++++++++++++++++++++ templates/default/SHOWREPORT.tpl | 2 +- templates/default/history.tpl | 3 ++ templates/default/history_bit.tpl | 11 ++++++++ 6 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 showhistory.php create mode 100644 templates/default/history.tpl create mode 100644 templates/default/history_bit.tpl diff --git a/docs/roadmap.txt b/docs/roadmap.txt index 5013b43..a1c88ef 100755 --- a/docs/roadmap.txt +++ b/docs/roadmap.txt @@ -12,7 +12,6 @@ BUGTRACK 1.0 - Admin auto-actions (see supplementary documentation) - Custom bug fields - Bug statistics/logging - - Bug history ---------------------------------------- BETA 2 diff --git a/docs/todo.txt b/docs/todo.txt index 23b16c8..2ab3a9e 100755 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -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 index 0000000..65514d2 --- /dev/null +++ b/showhistory.php @@ -0,0 +1,46 @@ +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 diff --git a/templates/default/SHOWREPORT.tpl b/templates/default/SHOWREPORT.tpl index 17bb740..00f7400 100644 --- a/templates/default/SHOWREPORT.tpl +++ b/templates/default/SHOWREPORT.tpl @@ -7,7 +7,7 @@
Priority: $bug[priority]
Assigned to: $bug[assigninfo]
-
[Edit Bug Report]
+
[Show Bug History][ Edit Bug Report]

diff --git a/templates/default/history.tpl b/templates/default/history.tpl new file mode 100644 index 0000000..eff4bb2 --- /dev/null +++ b/templates/default/history.tpl @@ -0,0 +1,3 @@ +

History for $bug[summary] (bugid: $bug[bugid])

+ +$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 index 0000000..88ebd6b --- /dev/null +++ b/templates/default/history_bit.tpl @@ -0,0 +1,11 @@ + + + + + + + + + +
History Entry (entryid: $log[historyid])$log[user]$log[date]
$log[formatted]
+
-- 2.22.5