From 6b2eec91f21d4aa28e68f18435c8636f377a4b2a Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Wed, 22 Mar 2000 00:47:04 +0000 Subject: Patch by "Matt Masson" -- allow definition of different target milestones by product. --- process_bug.cgi | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'process_bug.cgi') diff --git a/process_bug.cgi b/process_bug.cgi index f385f13d1..4559af8b3 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -39,6 +39,7 @@ use vars %::versions, %::legal_opsys, %::legal_platform, %::legal_priority, + %::target_milestone, %::legal_severity; my $whoid = confirm_login(); @@ -53,6 +54,11 @@ if ( Param("strictvaluechecks") ) { CheckFormFieldDefined(\%::FORM, 'product'); CheckFormFieldDefined(\%::FORM, 'version'); CheckFormFieldDefined(\%::FORM, 'component'); + + # check if target milestone is defined - matthew@zeroknowledge.com + if ( Param("usetargetmilestone") ) { + CheckFormFieldDefined(\%::FORM, 'target_milestone'); + } } if ($::FORM{'product'} ne $::dontchange) { @@ -71,12 +77,18 @@ if ($::FORM{'product'} ne $::dontchange) { # my $vok = lsearch($::versions{$prod}, $::FORM{'version'}) >= 0; my $cok = lsearch($::components{$prod}, $::FORM{'component'}) >= 0; - if (!$vok || !$cok) { - print "

Changing product means changing version and component.

\n"; - print "You have chosen a new product, and now the version and/or\n"; + + my $mok = 1; # so it won't affect the 'if' statement if milestones aren't used + if ( Param("usetargetmilestone") ) { + $mok = lsearch($::target_milestone{$prod}, $::FORM{'target_milestone'}) >= 0; + } + + if (!$vok || !$cok || !$mok) { + print "

Changing product means changing version, target milestone and component.

\n"; + print "You have chosen a new product, and now the version, target milestone and/or\n"; print "component fields are not correct. (Or, possibly, the bug did\n"; - print "not have a valid component or version field in the first place.)\n"; - print "Anyway, please set the version and component now.

\n"; + print "not have a valid target milestone, component or version field in the first place.)\n"; + print "Anyway, please set the version, target milestone and component now.

\n"; print "

\n"; print "\n"; print "\n"; @@ -86,12 +98,19 @@ if ($::FORM{'product'} ne $::dontchange) { print "\n"; print "\n"; print "\n"; + + if ( Param("usetargetmilestone") ) { + print "\n"; + print "\n"; + print "\n"; + } + print "\n"; print "\n"; print "\n"; print "
Version:" . Version_element($::FORM{'version'}, $prod) . "
Target Milestone:" . Milestone_element($::FORM{'target_milestone'}, $prod) . "
Component:" . Component_element($::FORM{'component'}, $prod) . "
\n"; foreach my $i (keys %::FORM) { - if ($i ne 'version' && $i ne 'component') { + if ($i ne 'version' && $i ne 'component' && $i ne 'target_milestone') { print "\n"; } -- cgit v1.2.3-24-g4f1b