From e5600f8eb6e2009c8063a0e1fc4556ec8bd72d85 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 18 Mar 2007 17:35:45 +0000 Subject: [PATCH] r1499: In editreport.php: - Only set the standard bug fields if we have permission to change them (thus data isn't cleared when we don't have permission to) - When setting the bug data for the NotificationCenter, use array_merge() to combine objdata[] and values[] so it doesn't look like we cleared all the fields if we didn't set them --- editreport.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/editreport.php b/editreport.php index bf79814..7d94f95 100644 --- a/editreport.php +++ b/editreport.php @@ -175,16 +175,19 @@ if ($_POST['do'] == 'update') $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); - $bugapi->set('summary', $bugsys->in['summary']); - $bugapi->set('severity', $bugsys->in['severity']); - $bugapi->set('duplicateof', $bugsys->in['duplicateof']); - $bugapi->set('dependency', $dependencies); - $bugapi->set('hidden', $bugsys->in['hidden']); - - $product = explode(',', $bugsys->in['product']); - $bugapi->set('product', $product[0]); - $bugapi->set('component', $product[1]); - $bugapi->set('version', $product[2]); + if ((can_perform('caneditown', $bug['product']) AND $bugsys->userinfo['userid'] == $bug['userid']) OR (can_perform('caneditother', $bug['product']) AND $bugsys->userinfo['userid'] != $bug['userid'])) + { + $bugapi->set('summary', $bugsys->in['summary']); + $bugapi->set('severity', $bugsys->in['severity']); + $bugapi->set('duplicateof', $bugsys->in['duplicateof']); + $bugapi->set('dependency', $dependencies); + $bugapi->set('hidden', $bugsys->in['hidden']); + + $product = explode(',', $bugsys->in['product']); + $bugapi->set('product', $product[0]); + $bugapi->set('component', $product[1]); + $bugapi->set('version', $product[2]); + } if (can_perform('canchangestatus', $bug['product'])) { @@ -202,7 +205,7 @@ if ($_POST['do'] == 'update') // ------------------------------------------------------------------- // handle logging and perform updates - $notif->set_bug_data($bugapi->objdata, $bugapi->values); + $notif->set_bug_data($bugapi->objdata, array_merge($bugapi->objdata, $bugapi->values)); $log->add_data(false, $bugapi->values, $log->getCommonFields(), true); if (!$message->hasErrors()) -- 2.43.5