Commit 94dcd5ed authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 284811 : Remove %FORM from enter_bug.cgi classification code

Patch by Teemu Mannermaa <wicked@etlicon.fi> r=LpSolit a=myk
parent 495cb15f
...@@ -76,10 +76,10 @@ if (!defined $product) { ...@@ -76,10 +76,10 @@ if (!defined $product) {
if ( ! Param('useclassification') ) { if ( ! Param('useclassification') ) {
# just pick the default one # just pick the default one
$::FORM{'classification'}=(keys %::classdesc)[0]; $cgi->param(-name => 'classification', -value => (keys %::classdesc)[0]);
} }
if (!defined $::FORM{'classification'}) { if (!$cgi->param('classification')) {
my %classdesc; my %classdesc;
my %classifications; my %classifications;
...@@ -97,7 +97,7 @@ if (!defined $product) { ...@@ -97,7 +97,7 @@ if (!defined $product) {
$vars->{'classifications'} = \%classifications; $vars->{'classifications'} = \%classifications;
$vars->{'target'} = "enter_bug.cgi"; $vars->{'target'} = "enter_bug.cgi";
$vars->{'format'} = $::FORM{'format'}; $vars->{'format'} = $cgi->param('format');
$vars->{'cloned_bug_id'} = $cgi->param('cloned_bug_id'); $vars->{'cloned_bug_id'} = $cgi->param('cloned_bug_id');
...@@ -106,15 +106,14 @@ if (!defined $product) { ...@@ -106,15 +106,14 @@ if (!defined $product) {
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
$::FORM{'classification'} = (keys %classdesc)[0]; $cgi->param(-name => 'classification', -value => (keys %classdesc)[0]);
$::MFORM{'classification'} = [$::FORM{'classification'}];
} }
my %products; my %products;
foreach my $p (@enterable_products) { foreach my $p (@enterable_products) {
if (CanEnterProduct($p)) { if (CanEnterProduct($p)) {
if (IsInClassification($::FORM{'classification'},$p) || if (IsInClassification(scalar $cgi->param('classification'),$p) ||
$::FORM{'classification'} eq "__all") { $cgi->param('classification') eq "__all") {
$products{$p} = $::proddesc{$p}; $products{$p} = $::proddesc{$p};
} }
} }
...@@ -129,11 +128,11 @@ if (!defined $product) { ...@@ -129,11 +128,11 @@ if (!defined $product) {
if ( ! Param('useclassification') ) { if ( ! Param('useclassification') ) {
@{$classifications{"all"}} = keys %products; @{$classifications{"all"}} = keys %products;
} }
elsif ($::FORM{'classification'} eq "__all") { elsif ($cgi->param('classification') eq "__all") {
%classifications = %::classifications; %classifications = %::classifications;
} else { } else {
$classifications{$::FORM{'classification'}} = $classifications{$cgi->param('classification')} =
$::classifications{$::FORM{'classification'}}; $::classifications{$cgi->param('classification')};
} }
$vars->{'proddesc'} = \%products; $vars->{'proddesc'} = \%products;
$vars->{'classifications'} = \%classifications; $vars->{'classifications'} = \%classifications;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment