summaryrefslogtreecommitdiffstats
path: root/reports.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
committerbbaetz%student.usyd.edu.au <>2002-08-12 14:42:42 +0200
commit61ddf0a32846fdf2607043d94af1a0a86b80f6fc (patch)
tree714517b4c6b9e33b10a12aa5a4b99641bcafefef /reports.cgi
parent17b301e76d886afd5be8f4e9919afb4446e49405 (diff)
downloadbugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.gz
bugzilla-61ddf0a32846fdf2607043d94af1a0a86b80f6fc.tar.xz
Bug 43600 - Convert products/components to use ids instead of names.
Initial attempt by jake@bugzilla.org, updated by me r=joel, preed
Diffstat (limited to 'reports.cgi')
-rwxr-xr-xreports.cgi14
1 files changed, 8 insertions, 6 deletions
diff --git a/reports.cgi b/reports.cgi
index e04a9fd6d..ac77c89fd 100755
--- a/reports.cgi
+++ b/reports.cgi
@@ -263,6 +263,7 @@ $when<p>
FIN
# Build up $query string
+ my $prod_table = ($FORM{'product'} ne "-All-") ? ", products" : "";
my $query;
$query = <<FIN;
select
@@ -272,12 +273,13 @@ select
unix_timestamp(date_format(bugs.creation_ts, '%Y-%m-%d %h:%m:%s'))
from bugs,
- profiles assign
+ profiles assign $prod_table
where bugs.assigned_to = assign.userid
FIN
if ($FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product=".SqlQuote($FORM{'product'});
+ $query .= "and products.id = bugs.product_id\n";
+ $query .= "and products.name=".SqlQuote($FORM{'product'});
}
$query .= "AND bugs.bug_status IN ('NEW', 'ASSIGNED', 'REOPENED')";
@@ -641,11 +643,11 @@ sub bybugs {
sub most_doomed_for_milestone {
my $when = localtime (time);
my $ms = "M" . Param("curmilestone");
+ my $product_id = get_product_id($FORM{'product'}) unless $FORM{'product'} eq '-All-';
print "<center>\n<h1>";
if( $FORM{'product'} ne "-All-" ) {
- SendSQL("SELECT defaultmilestone FROM products WHERE product = " .
- SqlQuote($FORM{'product'}));
+ SendSQL("SELECT defaultmilestone FROM products WHERE id = $product_id");
$ms = FetchOneColumn();
print "Most Doomed for $ms ($FORM{'product'})";
} else {
@@ -661,7 +663,7 @@ sub most_doomed_for_milestone {
my $query;
$query = "select distinct assigned_to from bugs where target_milestone=\"$ms\"";
if ($FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product=".SqlQuote($FORM{'product'});
+ $query .= "and bugs.product_id=$product_id ";
}
$query .= <<FIN;
and
@@ -687,7 +689,7 @@ FIN
foreach $person (@people) {
my $query = "select count(bug_id) from bugs,profiles where target_milestone=\"$ms\" and userid=assigned_to and userid=\"$person\"";
if( $FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product=".SqlQuote($FORM{'product'});
+ $query .= "and bugs.product_id=$product_id ";
}
$query .= <<FIN;
and