From 802a312d6c1f6e2d6760612237b7ca379eebe8ae Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 29 May 2005 20:27:41 +0000 Subject: [PATCH] r204: We now diff and log custom bug fields. This page is getting really query heavy... --- editreport.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/editreport.php b/editreport.php index dd445ab..113f408 100644 --- a/editreport.php +++ b/editreport.php @@ -80,6 +80,7 @@ if ($_POST['do'] == 'update') } $hist[0] = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[bugid]"); + $hist2[0] = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = $bug[bugid]"); process_custom_fields($bug['bugid']); @@ -97,7 +98,11 @@ if ($_POST['do'] == 'update') WHERE bugid = $bug[bugid]" ); + // ------------------------------------------------------------------- + // do diff history + $hist[1] = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[bugid]"); + $hist2[1] = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = $bug[bugid]"); $diff[0] = array_diff_assoc($hist[0], $hist[1]); $diff[1] = array_diff_assoc($hist[1], $hist[0]); @@ -149,6 +154,17 @@ if ($_POST['do'] == 'update') $log->log($log->diff($key, $diff[0]["$key"], $diff[1]["$key"])); } + $diff2[0] = array_diff_assoc($hist2[0], $hist2[1]); + $diff2[1] = array_diff_assoc($hist2[1], $hist2[0]); + + foreach ($diff2[1] AS $key => $value) + { + $log->log($log->diff('custom_' . $key, $diff2[0]["$key"], $diff2[1]["$key"])); + } + + // ------------------------------------------------------------------- + // process comment stuff + if (!$bugsys->in['firstcomment']) { $message->error('you need to enter some text in the first comment'); -- 2.22.5