diff options
author | terry%mozilla.org <> | 2000-05-09 07:00:38 +0200 |
---|---|---|
committer | terry%mozilla.org <> | 2000-05-09 07:00:38 +0200 |
commit | 685a5a8246df2d80a764600edf5c3f375fe89066 (patch) | |
tree | 3609a8b249dc3c0ee99220936bcea32182fc4239 /process_bug.cgi | |
parent | af0b3b810fce8bf012f086ea4b3702a00c6ac7e5 (diff) | |
download | bugzilla-685a5a8246df2d80a764600edf5c3f375fe89066.tar.gz bugzilla-685a5a8246df2d80a764600edf5c3f375fe89066.tar.xz |
Add a new param, musthavemilestoneonaccept, which requires users to
set the target milestone when accepting a bug.
Diffstat (limited to 'process_bug.cgi')
-rwxr-xr-x | process_bug.cgi | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/process_bug.cgi b/process_bug.cgi index 22dff72e9..8d88ef85c 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -45,6 +45,8 @@ use vars %::versions, my $whoid = confirm_login(); +my $requiremilestone = 0; + print "Content-type: text/html\n\n"; PutHeader ("Bug processed"); @@ -404,6 +406,11 @@ SWITCH: for ($::FORM{'knob'}) { /^accept$/ && CheckonComment( "accept" ) && do { DoConfirm(); ChangeStatus('ASSIGNED'); + if (Param("musthavemilestoneonaccept")) { + if (Param("usetargetmilestone")) { + $requiremilestone = 1; + } + } last SWITCH; }; /^clearresolution$/ && CheckonComment( "clearresolution" ) && do { @@ -611,16 +618,32 @@ foreach my $id (@idlist) { SendSQL("LOCK TABLES bugs $write, bugs_activity $write, cc $write, " . "profiles $write, dependencies $write, votes $write, " . "keywords $write, longdescs $write, fielddefs $write, " . - "keyworddefs READ, groups READ, attachments READ"); + "keyworddefs READ, groups READ, attachments READ, products READ"); my @oldvalues = SnapShotBug($id); + my %oldhash; my $i = 0; foreach my $col (@::log_columns) { + $oldhash{$col} = $oldvalues[$i]; if (exists $::FORM{$col}) { CheckCanChangeField($col, $id, $oldvalues[$i], $::FORM{$col}); } $i++; } - + if ($requiremilestone) { + my $value = $::FORM{'target_milestone'}; + if (!defined $value || $value eq $::dontchange) { + $value = $oldhash{'target_milestone'}; + } + SendSQL("SELECT defaultmilestone FROM products WHERE product = " . + SqlQuote($oldhash{'product'})); + if ($value eq FetchOneColumn()) { + SendSQL("UNLOCK TABLES"); + PuntTryAgain("You must determine a target milestone for bug $id " . + "if you are going to accept it. (Part of " . + "accepting a bug is giving an estimate of when it " . + "will be fixed.)"); + } + } if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) { print " <H1>Mid-air collision detected!</H1> |