From 31aa15f81d4b690e49c6509e7c5a3bef42fab036 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 May 2005 11:05:56 +0000 Subject: [PATCH] r148: Can you say muffining unelelegant? There has GOT to be a better way to do this --- editreport.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/editreport.php b/editreport.php index f0eb109..a94d430 100644 --- a/editreport.php +++ b/editreport.php @@ -83,6 +83,7 @@ if ($_POST['do'] == 'update') SET summary = '" . $bugsys->in['summary'] . "', priority = " . intval($bugsys->in['priority']) . ", status = " . intval($bugsys->in['status']) . ", + severity = " . intval($bugsys->in['severity']) . ", resolution = " . intval($bugsys->in['resolution']) . ", assignedto = " . intval($bugsys->in['assignedto']) . ", productid = " . $pcv['product'] . ", @@ -96,6 +97,41 @@ if ($_POST['do'] == 'update') $diff[0] = array_diff_assoc($hist[0], $hist[1]); $diff[1] = array_diff_assoc($hist[1], $hist[0]); + $lookupindex = array( + 'status' => 'status', + 'severity' => 'severity', + 'priority' => 'priority', + 'versionid' => 'version', + 'assignedto' => 'assignto', + 'resolution' => 'resolution', + 'productid' => 'product', + 'componentid' => 'product' + ); + + foreach ($diff AS $num => $diffs) + { + foreach ($diffs AS $key => $value) + { + $ref = $lookupindex["$key"]; + $temp =& $bugsys->datastore["$ref"]["$value"]; + $thevalue = $temp["$ref"]; + $idbit = ' (id: ' . $temp["$ref" . 'id'] . ')'; + + if ($key == 'assignedto') + { + $thevalue = (($temp['userid']) ? construct_user_display($temp) : ''); + $idbit = ''; + } + else if ($key == 'productid' OR $key == 'componentid') + { + $ref = 'product'; + $thevalue = $temp['title']; + } + + $diff["$num"]["$key"] = (($thevalue) ? $thevalue . $idbit : ''); + } + } + log_action($bug['bugid'], 'log_update_bug', array(), $diff[0], $diff[1]); if (!$bugsys->in['firstcomment']) -- 2.22.5