summaryrefslogtreecommitdiffstats
path: root/editclassifications.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-10-14 08:42:32 +0200
committerlpsolit%gmail.com <>2005-10-14 08:42:32 +0200
commit4587cba89586ff3e00ed863748857ecf56a41532 (patch)
tree44a8f86ab9f4a9a3e8f47426de2ce334a66ca9d7 /editclassifications.cgi
parent727410cca17ff168ba4337de42782d496b9679fc (diff)
downloadbugzilla-4587cba89586ff3e00ed863748857ecf56a41532.tar.gz
bugzilla-4587cba89586ff3e00ed863748857ecf56a41532.tar.xz
Bug 306601: Bugzilla::Classification needs a products() method - Patch by André Batosti <batosti@async.com.br> r=LpSolit a=justdave
Diffstat (limited to 'editclassifications.cgi')
-rwxr-xr-xeditclassifications.cgi38
1 files changed, 9 insertions, 29 deletions
diff --git a/editclassifications.cgi b/editclassifications.cgi
index e70d256c1..352d7816b 100755
--- a/editclassifications.cgi
+++ b/editclassifications.cgi
@@ -29,7 +29,6 @@ use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Config qw($datadir);
use Bugzilla::Classification;
-use Bugzilla::Product;
require "globals.pl";
@@ -119,6 +118,8 @@ if ($action eq 'new') {
# Make versioncache flush
unlink "$datadir/versioncache";
+ $vars->{'classification'} = $class_name;
+
LoadTemplate($action);
}
@@ -141,8 +142,7 @@ if ($action eq 'del') {
ThrowUserError("classification_has_products");
}
- $vars->{'description'} = $classification->description;
- $vars->{'classification'} = $classification->name;
+ $vars->{'classification'} = $classification;
LoadTemplate($action);
}
@@ -175,7 +175,7 @@ if ($action eq 'delete') {
unlink "$datadir/versioncache";
- $vars->{'classification'} = $classification->name;
+ $vars->{'classification'} = $classification;
LoadTemplate($action);
}
@@ -191,13 +191,7 @@ if ($action eq 'edit') {
my $classification =
Bugzilla::Classification::check_classification($class_name);
- my @products =
- Bugzilla::Product::get_products_by_classification(
- $classification->id);
-
- $vars->{'description'} = $classification->description;
- $vars->{'classification'} = $classification->name;
- $vars->{'products'} = \@products;
+ $vars->{'classification'} = $classification;
LoadTemplate($action);
}
@@ -259,8 +253,6 @@ if ($action eq 'reclassify') {
my $classification =
Bugzilla::Classification::check_classification($class_name);
- $vars->{'description'} = $classification->description;
-
my $sth = $dbh->prepare("UPDATE products SET classification_id = ?
WHERE name = ?");
@@ -280,22 +272,10 @@ if ($action eq 'reclassify') {
}
}
- my @selected_products = ();
- my @unselected_products = ();
-
- my @products = Bugzilla::Product::get_all_products();
-
- foreach my $product (@products) {
- if ($product->classification_id == $classification->id) {
- push @selected_products, $product;
- } else {
- push @unselected_products, $product;
- }
- }
-
- $vars->{'selected_products'} = \@selected_products;
- $vars->{'unselected_products'} = \@unselected_products;
- $vars->{'classification'} = $classification->name;
+ my @classifications =
+ Bugzilla::Classification::get_all_classifications;
+ $vars->{'classifications'} = \@classifications;
+ $vars->{'classification'} = $classification;
LoadTemplate($action);
}