summaryrefslogtreecommitdiffstats
path: root/reports.cgi
diff options
context:
space:
mode:
authorharrison%netscape.com <>1998-10-27 19:43:01 +0100
committerharrison%netscape.com <>1998-10-27 19:43:01 +0100
commit2ce88631c73e8b01bc696cd6187bec7cb9da3851 (patch)
tree9800da8b678f762406d0dd695e3593c9d4aedce7 /reports.cgi
parent7ecfeb862ecffc53e68c321d5e58568c47ac12a7 (diff)
downloadbugzilla-2ce88631c73e8b01bc696cd6187bec7cb9da3851.tar.gz
bugzilla-2ce88631c73e8b01bc696cd6187bec7cb9da3851.tar.xz
security check for legal products in place. bug charts are not
available as an option if collectstats.pl has never been run. added quip support.
Diffstat (limited to 'reports.cgi')
-rwxr-xr-xreports.cgi40
1 files changed, 31 insertions, 9 deletions
diff --git a/reports.cgi b/reports.cgi
index 707de6ac0..1ac1883b3 100755
--- a/reports.cgi
+++ b/reports.cgi
@@ -64,10 +64,7 @@ else
}
ConnectToDatabase();
-
-# $::FORM{'product'} = "Mozilla";
-# &show_chart();
-# exit;
+GetVersionTable();
if (! defined $::FORM{'product'})
{
@@ -112,9 +109,8 @@ FIN
sub choose_product
{
- GetVersionTable();
-
my $product_popup = make_options (\@::legal_product, $::legal_product[0]);
+ my $charts = (-d $dir) ? "<option value=\"show_chart\">Bug Charts" : "";
print <<FIN;
<center>
@@ -134,13 +130,14 @@ $product_popup
<td align=center>
<select name="output">
<option value="most_doomed">Bug Counts
-<option value="show_chart">Bug Charts
+$charts
</select>
<tr>
<td align=center><b>Switches:</b></td>
<td align=left>
<input type=checkbox name=links value=1>&nbsp;Links to Bugs<br>
<input type=checkbox name=nobanner value=1>&nbsp;No Banner<br>
+<input type=checkbox name=quip value=1>&nbsp;Include Quip<br>
</td>
</tr>
<tr>
@@ -196,6 +193,7 @@ FIN
my $c = 0;
+ my $quip = "Summary";
my $bugs_count = 0;
my $bugs_new_this_week = 0;
my $bugs_reopened = 0;
@@ -224,12 +222,26 @@ FIN
$bugs_totals{$who}{$st} ++;
}
+ if ($::FORM{'quip'})
+ {
+ if (open (COMMENTS, "<data/comments"))
+ {
+ my @cdata;
+ while (<COMMENTS>)
+ {
+ push @cdata, $_;
+ }
+ close COMMENTS;
+ $quip = "<i>" . $cdata[int(rand($#cdata + 1))] . "</i>";
+ }
+ }
+
#########################
# start painting report #
#########################
print <<FIN;
-<h1>Summary</h1>
+<h1>$quip</h1>
<table border=1 cellpadding=5>
<tr>
<td align=right><b>New Bugs This Week</b></td>
@@ -363,6 +375,12 @@ FIN
FIN
}
+sub is_legal_product
+ {
+ my $product = shift;
+ return grep { $_ eq $product} @::legal_product;
+ }
+
sub header
{
print <<FIN;
@@ -377,6 +395,11 @@ sub show_chart
{
my $when = localtime (time);
+ if (! is_legal_product ($::FORM{'product'}))
+ {
+ &die_politely ("Unknown product: $::FORM{'product'}");
+ }
+
print <<FIN;
<center>
FIN
@@ -428,7 +451,6 @@ FIN
"title" => "Bug Charts for $::FORM{'product'}",
"x_label" => "Dates",
"y_label" => "Bug Count",
- "grey_background" => 1,
"legend_labels" => \@labels,
);