From eac17c0469a8e2b84b58f33b8f8aeb2f2addc2a9 Mon Sep 17 00:00:00 2001 From: "cyeh%bluemartini.com" <> Date: Thu, 22 Jun 2000 02:03:45 +0000 Subject: Checkin for Bug 42851 'Use listbox with input for CC management on bug form' contributed by dave@intrec.com (Dave Miller) --- process_bug.cgi | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index 8b1226b3a..7665c1eda 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -20,6 +20,7 @@ # # Contributor(s): Terry Weissman # Dan Mosedale +# Dave Miller use diagnostics; use strict; @@ -391,10 +392,14 @@ my $origCcString; # form of the data it gets from $::FORM{'cc'}, so anything bogus from a # security standpoint should trigger an abort there. # -if (defined $::FORM{'cc'} && defined $::FORM{'id'}) { +if (defined $::FORM{'newcc'} && defined $::FORM{'id'}) { $origCcSet->mergeFromDB("select who from cc where bug_id = $::FORM{'id'}"); + $formCcSet->mergeFromDB("select who from cc where bug_id = $::FORM{'id'}"); $origCcString = $origCcSet->toString(); # cache a copy of the string vers - $formCcSet->mergeFromString($::FORM{'cc'}); + if ((exists $::FORM{'removecc'}) && (exists $::FORM{'cc'})) { + $formCcSet->removeItemsInArray(@{$::MFORM{'cc'}}); + } + $formCcSet->mergeFromString($::FORM{'newcc'}); } if ( Param('strictvaluechecks') ) { @@ -789,7 +794,7 @@ The changes made were: AppendComment($id, $::FORM{'who'}, $::FORM{'comment'}); } - if (defined $::FORM{'cc'} && defined $::FORM{'id'} + if (defined $::FORM{'newcc'} && defined $::FORM{'id'} && ! $origCcSet->isEqual($formCcSet) ) { # update the database to look like the form @@ -802,7 +807,7 @@ The changes made were: my $col = GetFieldID('cc'); my $origq = SqlQuote($origCcString); - my $newq = SqlQuote($::FORM{'cc'}); + my $newq = SqlQuote($formCcSet->toString()); SendSQL("INSERT INTO bugs_activity " . "(bug_id,who,bug_when,fieldid,oldvalue,newvalue) VALUES " . "($id,$whoid,'$timestamp',$col,$origq,$newq)"); -- cgit v1.2.3-24-g4f1b