summaryrefslogtreecommitdiffstats
path: root/editflagtypes.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-03-16 06:51:34 +0100
committerlpsolit%gmail.com <>2006-03-16 06:51:34 +0100
commit311eb45dbd343068dce41bb44dd8db9f8108cf7e (patch)
tree34c2f43c62b24714389d1ef5a3fa79175cbc593b /editflagtypes.cgi
parentd19c2c5203d27955941e51bf75415c88e611b7b4 (diff)
downloadbugzilla-311eb45dbd343068dce41bb44dd8db9f8108cf7e.tar.gz
bugzilla-311eb45dbd343068dce41bb44dd8db9f8108cf7e.tar.xz
Bug 330521: Remove @::legal_product, @::legal_components and @::legal_target_milestone - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-xeditflagtypes.cgi45
1 files changed, 24 insertions, 21 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index 1851e8b13..29a7467ad 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -38,6 +38,7 @@ use Bugzilla::Flag;
use Bugzilla::FlagType;
use Bugzilla::Group;
use Bugzilla::Util;
+use Bugzilla::Product;
my $template = Bugzilla->template;
my $vars = {};
@@ -49,9 +50,6 @@ $user->in_group('editcomponents')
action => "edit",
object => "flagtypes"});
-# Suppress "used only once" warnings.
-use vars qw(@legal_product @legal_components %components);
-
my $cgi = Bugzilla->cgi;
my $product_id;
my $component_id;
@@ -128,17 +126,18 @@ sub list {
sub edit {
$action eq 'enter' ? validateTargetType() : (my $id = validateID());
my $dbh = Bugzilla->dbh;
-
- # Get this installation's products and components.
- GetVersionTable();
-
- # products and components and the function used to modify the components
- # menu when the products menu changes; used by the template to populate
- # the menus and keep the components menu consistent with the products menu
- $vars->{'products'} = \@::legal_product;
- $vars->{'components'} = \@::legal_components;
- $vars->{'components_by_product'} = \%::components;
-
+
+ my @products = Bugzilla::Product::get_all_products();
+ # We require all unique component names.
+ my %components;
+ foreach my $product (@products) {
+ foreach my $component (@{$product->components}) {
+ $components{$component->name} = 1;
+ }
+ }
+ $vars->{'products'} = \@products;
+ $vars->{'components'} = [sort(keys %components)];
+
$vars->{'last_action'} = $cgi->param('action');
if ($cgi->param('action') eq 'enter' || $cgi->param('action') eq 'copy') {
$vars->{'action'} = "insert";
@@ -216,17 +215,21 @@ sub processCategoryChange {
my %inclusions = clusion_array_to_hash(\@inclusions);
my %exclusions = clusion_array_to_hash(\@exclusions);
- # Get this installation's products and components.
- GetVersionTable();
+ my @products = Bugzilla::Product::get_all_products();
+ # We require all unique component names.
+ my %components;
+ foreach my $product (@products) {
+ foreach my $component (@{$product->components}) {
+ $components{$component->name} = 1;
+ }
+ }
+ $vars->{'products'} = \@products;
+ $vars->{'components'} = [sort(keys %components)];
- # products and components; used by the template to populate the menus
- # and keep the components menu consistent with the products menu
- $vars->{'products'} = \@::legal_product;
- $vars->{'components'} = \@::legal_components;
- $vars->{'components_by_product'} = \%::components;
my @groups = Bugzilla::Group::get_all_groups();
$vars->{'groups'} = \@groups;
$vars->{'action'} = $cgi->param('action');
+
my $type = {};
foreach my $key ($cgi->param()) { $type->{$key} = $cgi->param($key) }
$type->{'inclusions'} = \%inclusions;