From ab199bf568703d0c287d0f21ce1816e44183aa02 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 29 Jul 2005 21:14:40 +0000 Subject: Bug 286294: cleanup editclassifications.cgi and migrate the existent code to use Classification.pm - Patch by Tiago R. Mello r=LpSolit a=myk --- Bugzilla/Product.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Product.pm') diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index 37ef86a62..26c80103f 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -196,13 +196,13 @@ sub get_products_by_classification ($) { my $ids = $dbh->selectcol_arrayref(q{ SELECT id FROM products - WHERE classification_id = ?}, undef, $class_id); + WHERE classification_id = ? ORDER by name}, undef, $class_id); - my $products; + my @products; foreach my $id (@$ids) { - $products->{$id} = new Bugzilla::Product($id); + push @products, new Bugzilla::Product($id); } - return $products; + return @products; } sub get_all_products () { @@ -265,8 +265,7 @@ Bugzilla::Product - Bugzilla product class. my $defaultmilestone = $product->default_milestone; my $classificationid = $product->classification_id; - my $hash_ref = Bugzilla::Product::get_products_by_classification(1); - my $product = $hash_ref->{1}; + my @products = Bugzilla::Product::get_products_by_classification(1); =head1 DESCRIPTION @@ -355,8 +354,7 @@ Product.pm represents a product object. Params: $class_id - Integer with classification id. - Returns: A hash with product id as key and a Bugzilla::Product - object as value. + Returns: Bugzilla::Product object list. =item C -- cgit v1.2.3-24-g4f1b