summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Product.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-07-29 23:14:40 +0200
committerlpsolit%gmail.com <>2005-07-29 23:14:40 +0200
commitab199bf568703d0c287d0f21ce1816e44183aa02 (patch)
tree41e9ffb1230afed4f0bfff0d463a3e9e025c26e4 /Bugzilla/Product.pm
parent966c262164d7dd68686862fa827d0dfde2132b69 (diff)
downloadbugzilla-ab199bf568703d0c287d0f21ce1816e44183aa02.tar.gz
bugzilla-ab199bf568703d0c287d0f21ce1816e44183aa02.tar.xz
Bug 286294: cleanup editclassifications.cgi and migrate the existent code to use Classification.pm - Patch by Tiago R. Mello <timello@gmail.com> r=LpSolit a=myk
Diffstat (limited to 'Bugzilla/Product.pm')
-rw-r--r--Bugzilla/Product.pm14
1 files changed, 6 insertions, 8 deletions
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<get_all_products()>