Create a summary report for "-All-" bugs. Default links on. Switch sense of

banner flag. Add commented-out line to enable showing SQL line.
parent f5b07da0
...@@ -31,7 +31,10 @@ require "globals.pl"; ...@@ -31,7 +31,10 @@ require "globals.pl";
ConnectToDatabase(); ConnectToDatabase();
GetVersionTable(); GetVersionTable();
foreach (@::legal_product) { my @myproducts;
push( @myproducts, "-All-", @::legal_product );
foreach (@myproducts) {
my $dir = "data/mining"; my $dir = "data/mining";
&check_data_dir ($dir); &check_data_dir ($dir);
...@@ -61,7 +64,11 @@ sub collect_stats { ...@@ -61,7 +64,11 @@ sub collect_stats {
push my @row, &today; push my @row, &today;
foreach my $status ('NEW', 'ASSIGNED', 'REOPENED') { foreach my $status ('NEW', 'ASSIGNED', 'REOPENED') {
SendSQL("select count(bug_status) from bugs where bug_status='$status' and product='$product'"); if( $product eq "-All-" ) {
SendSQL("select count(bug_status) from bugs where bug_status='$status'");
} else {
SendSQL("select count(bug_status) from bugs where bug_status='$status' and product='$product'");
}
push @row, FetchOneColumn(); push @row, FetchOneColumn();
} }
......
...@@ -18,7 +18,11 @@ ...@@ -18,7 +18,11 @@
# Netscape Communications Corporation. All Rights Reserved. # Netscape Communications Corporation. All Rights Reserved.
# #
# Contributor(s): Harrison Page <harrison@netscape.com>, # Contributor(s): Harrison Page <harrison@netscape.com>,
# Terry Weissman <terry@mozilla.org> # Terry Weissman <terry@mozilla.org>,
# Bryce Nesbitt <bryce@nextbus.COM>
# Added -All- report, change "nobanner" to "banner" (it is strange to have a
# list with 2 positive and 1 negative choice), default links on, add show
# sql comment.
use diagnostics; use diagnostics;
use strict; use strict;
...@@ -42,30 +46,24 @@ my %reports = ...@@ -42,30 +46,24 @@ my %reports =
"show_chart" => \&show_chart, "show_chart" => \&show_chart,
); );
# patch from Sam Ziegler <sam@ziegler.org>:
#
# "reports.cgi currently has it's own idea of what
# the header should be. This patch sets it to the
# system wide header."
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
if (defined $::FORM{'nobanner'}) # If we're here for the first time, give a banner. Else respect the banner flag.
{ if ( (!defined $::FORM{'product'}) || ($::FORM{'banner'}) )
print <<FIN; {
<html> PutHeader ("Bug Reports")
<head><title>Bug Reports</title></head> }
<body bgcolor="#FFFFFF">
FIN
}
else else
{ {
PutHeader ("Bug Reports") unless (defined $::FORM{'nobanner'}); print("<html><head><title>Bug Reports</title></head><body bgcolor=\"#FFFFFF\">");
} }
ConnectToDatabase(); ConnectToDatabase();
GetVersionTable(); GetVersionTable();
my @myproducts;
push( @myproducts, "-All-", @::legal_product );
$::FORM{'output'} = $::FORM{'output'} || "most_doomed"; # a reasonable default $::FORM{'output'} = $::FORM{'output'} || "most_doomed"; # a reasonable default
if (! defined $::FORM{'product'}) if (! defined $::FORM{'product'})
...@@ -111,7 +109,7 @@ FIN ...@@ -111,7 +109,7 @@ FIN
sub choose_product sub choose_product
{ {
my $product_popup = make_options (\@::legal_product, $::legal_product[0]); my $product_popup = make_options (\@myproducts, $myproducts[0]);
my $charts = (-d $dir) ? "<option value=\"show_chart\">Bug Charts" : ""; my $charts = (-d $dir) ? "<option value=\"show_chart\">Bug Charts" : "";
print <<FIN; print <<FIN;
...@@ -137,9 +135,9 @@ $charts ...@@ -137,9 +135,9 @@ $charts
<tr> <tr>
<td align=center><b>Switches:</b></td> <td align=center><b>Switches:</b></td>
<td align=left> <td align=left>
<input type=checkbox name=links value=1>&nbsp;Links to Bugs<br> <input type=checkbox name=links checked value=1>&nbsp;Links to Bugs<br>
<input type=checkbox name=nobanner value=1>&nbsp;No Banner<br> <input type=checkbox name=banner checked value=1>&nbsp;Banner<br>
<input type=checkbox name=quip value=1>&nbsp;Include Quip<br> <input type=checkbox name=quip value=1>&nbsp;Quip<br>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -151,6 +149,8 @@ $charts ...@@ -151,6 +149,8 @@ $charts
</form> </form>
<p> <p>
FIN FIN
#Add this above to get a control for showing the SQL query:
#<input type=checkbox name=showsql value=1>&nbsp;Show SQL<br>
} }
sub most_doomed sub most_doomed
...@@ -165,7 +165,9 @@ Bug Report for $::FORM{'product'} ...@@ -165,7 +165,9 @@ Bug Report for $::FORM{'product'}
$when<p> $when<p>
FIN FIN
my $query = <<FIN; # Build up $query string
my $query;
$query = <<FIN;
select select
bugs.bug_id, bugs.assigned_to, bugs.bug_severity, bugs.bug_id, bugs.assigned_to, bugs.bug_severity,
bugs.bug_status, bugs.product, bugs.bug_status, bugs.product,
...@@ -179,7 +181,13 @@ from bugs, ...@@ -179,7 +181,13 @@ from bugs,
versions projector versions projector
where bugs.assigned_to = assign.userid where bugs.assigned_to = assign.userid
and bugs.reporter = report.userid and bugs.reporter = report.userid
and bugs.product='$::FORM{'product'}' FIN
if( $::FORM{'product'} ne "-All-" ) {
$query .= "and bugs.product='$::FORM{'product'}'";
}
$query .= <<FIN;
and and
( (
bugs.bug_status = 'NEW' or bugs.bug_status = 'NEW' or
...@@ -187,6 +195,7 @@ and ...@@ -187,6 +195,7 @@ and
bugs.bug_status = 'REOPENED' bugs.bug_status = 'REOPENED'
) )
FIN FIN
# End build up $query string
print "<font color=purple><tt>$query</tt></font><p>\n" print "<font color=purple><tt>$query</tt></font><p>\n"
unless (! exists $::FORM{'showsql'}); unless (! exists $::FORM{'showsql'});
...@@ -380,7 +389,7 @@ FIN ...@@ -380,7 +389,7 @@ FIN
sub is_legal_product sub is_legal_product
{ {
my $product = shift; my $product = shift;
return grep { $_ eq $product} @::legal_product; return grep { $_ eq $product} @myproducts;
} }
sub header sub header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment