From 311eb45dbd343068dce41bb44dd8db9f8108cf7e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 16 Mar 2006 05:51:34 +0000 Subject: Bug 330521: Remove @::legal_product, @::legal_components and @::legal_target_milestone - Patch by Frédéric Buclin r=mkanat a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- globals.pl | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'globals.pl') diff --git a/globals.pl b/globals.pl index 018260959..8ac08846a 100644 --- a/globals.pl +++ b/globals.pl @@ -38,6 +38,7 @@ use Bugzilla::Util; use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir); use Bugzilla::User; use Bugzilla::Error; +use Bugzilla::Product; # Shut up misguided -w warnings about "used only once". For some reason, # "use vars" chokes on me when I try it here. @@ -46,13 +47,10 @@ sub globals_pl_sillyness { my $zz; $zz = @main::enterable_products; $zz = @main::legal_bug_status; - $zz = @main::legal_components; $zz = @main::legal_opsys; $zz = @main::legal_platform; $zz = @main::legal_priority; - $zz = @main::legal_product; $zz = @main::legal_severity; - $zz = @main::legal_target_milestone; $zz = @main::milestoneurl; $zz = @main::prodmaxvotes; } @@ -104,7 +102,7 @@ $::SIG{PIPE} = 'IGNORE'; sub GenerateVersionTable { my $dbh = Bugzilla->dbh; - my (@line, %carray); + my @line; SendSQL("SELECT components.name, products.name " . "FROM components, products " . "WHERE products.id = components.product_id " . @@ -116,7 +114,6 @@ sub GenerateVersionTable { } my $ref = $::components{$p}; push @$ref, $c; - $carray{$c} = 1; } SendSQL("SELECT products.name, classifications.name " . @@ -185,8 +182,6 @@ sub GenerateVersionTable { splice(@::settable_resolution, $z, 1); } - @::legal_product = map($_->name, Bugzilla::Product::get_all_products()); - require File::Temp; my ($fh, $tmpname) = File::Temp::tempfile("versioncache.XXXXX", DIR => "$datadir"); @@ -202,21 +197,19 @@ sub GenerateVersionTable { print $fh (Data::Dumper->Dump([\@::log_columns], ['*::log_columns'])); - foreach my $i (@::legal_product) { + my @legal_products = map($_->name, Bugzilla::Product::get_all_products()); + foreach my $i (@legal_products) { if (!defined $::components{$i}) { $::components{$i} = []; } } print $fh (Data::Dumper->Dump([\%::components], ['*::components'])); - @::legal_components = sort {uc($a) cmp uc($b)} keys(%carray); - print $fh (Data::Dumper->Dump([\@::legal_components, \@::legal_product, - \@::legal_priority, \@::legal_severity, + print $fh (Data::Dumper->Dump([\@::legal_priority, \@::legal_severity, \@::legal_platform, \@::legal_opsys, \@::legal_bug_status, \@::legal_resolution], - ['*::legal_components', '*::legal_product', - '*::legal_priority', '*::legal_severity', + ['*::legal_priority', '*::legal_severity', '*::legal_platform', '*::legal_opsys', '*::legal_bug_status', '*::legal_resolution'])); @@ -234,25 +227,17 @@ sub GenerateVersionTable { "WHERE products.id = milestones.product_id " . "ORDER BY milestones.sortkey, milestones.value"); my @line; - my %tmarray; - @::legal_target_milestone = (); while(@line = FetchSQLData()) { my ($tm, $pr) = (@line); if (!defined $::target_milestone{$pr}) { $::target_milestone{$pr} = []; } push @{$::target_milestone{$pr}}, $tm; - if (!exists $tmarray{$tm}) { - $tmarray{$tm} = 1; - push(@::legal_target_milestone, $tm); - } } print $fh (Data::Dumper->Dump([\%::target_milestone, - \@::legal_target_milestone, \%::milestoneurl], ['*::target_milestone', - '*::legal_target_milestone', '*::milestoneurl'])); } -- cgit v1.2.3-24-g4f1b