summaryrefslogtreecommitdiffstats
path: root/request.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-05-30 02:24:53 +0200
committerlpsolit%gmail.com <>2006-05-30 02:24:53 +0200
commitd8f36cac89e6e054e884cbf54fbe130ec7424f9e (patch)
tree1deb3f27119b5a11c292e430ca2ec9813b6a4346 /request.cgi
parent598ce63e0d2acbc3a2060fe13199742945fac342 (diff)
downloadbugzilla-d8f36cac89e6e054e884cbf54fbe130ec7424f9e.tar.gz
bugzilla-d8f36cac89e6e054e884cbf54fbe130ec7424f9e.tar.xz
Bug 337054: Remove get_component_id() and get_component_name() from globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'request.cgi')
-rwxr-xr-xrequest.cgi27
1 files changed, 12 insertions, 15 deletions
diff --git a/request.cgi b/request.cgi
index 5563f32f7..5f90b87cb 100755
--- a/request.cgi
+++ b/request.cgi
@@ -19,6 +19,7 @@
# Rights Reserved.
#
# Contributor(s): Myk Melez <myk@mozilla.org>
+# Frédéric Buclin <LpSolit@gmail.com>
################################################################################
# Script Initialization
@@ -33,6 +34,8 @@ use Bugzilla;
use Bugzilla::Flag;
use Bugzilla::FlagType;
use Bugzilla::User;
+use Bugzilla::Product;
+use Bugzilla::Component;
# Make sure the user is logged in.
my $user = Bugzilla->login();
@@ -174,23 +177,17 @@ sub queue {
# Filter results by exact product or component.
if (defined $cgi->param('product') && $cgi->param('product') ne "") {
- my $product_id = get_product_id($cgi->param('product'));
- if ($product_id) {
- push(@criteria, "bugs.product_id = $product_id");
- push(@excluded_columns, 'product') unless $cgi->param('do_union');
- if (defined $cgi->param('component') && $cgi->param('component') ne "") {
- my $component_id = get_component_id($product_id, $cgi->param('component'));
- if ($component_id) {
- push(@criteria, "bugs.component_id = $component_id");
- push(@excluded_columns, 'component') unless $cgi->param('do_union');
- }
- else { ThrowUserError("component_not_valid", { 'product' => $cgi->param('product'),
- 'name' => $cgi->param('component') }) }
- }
+ my $product = Bugzilla::Product::check_product(scalar $cgi->param('product'));
+ push(@criteria, "bugs.product_id = " . $product->id);
+ push(@excluded_columns, 'product') unless $cgi->param('do_union');
+ if (defined $cgi->param('component') && $cgi->param('component') ne "") {
+ my $component =
+ Bugzilla::Component::check_component($product, scalar $cgi->param('component'));
+ push(@criteria, "bugs.component_id = " . $component->id);
+ push(@excluded_columns, 'component') unless $cgi->param('do_union');
}
- else { ThrowUserError("product_doesnt_exist", { 'product' => $cgi->param('product') }) }
}
-
+
# Filter results by flag types.
my $form_type = $cgi->param('type');
if (defined $form_type && !grep($form_type eq $_, ("", "all"))) {