diff options
author | lpsolit%gmail.com <> | 2005-10-25 08:11:55 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-10-25 08:11:55 +0200 |
commit | 44de29d04d1ca7e3b047b2a847508dc949c29038 (patch) | |
tree | 934c0ccce39c238b3bf6a0337014e6f1fde9918b /reports.cgi | |
parent | 46aba0e761e99db24b5de10f13bbc108fdc982a4 (diff) | |
download | bugzilla-44de29d04d1ca7e3b047b2a847508dc949c29038.tar.gz bugzilla-44de29d04d1ca7e3b047b2a847508dc949c29038.tar.xz |
Bug 312157: Remove $::template and $::vars from globals.pl - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
Diffstat (limited to 'reports.cgi')
-rwxr-xr-x | reports.cgi | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/reports.cgi b/reports.cgi index c060045eb..5553f2c97 100755 --- a/reports.cgi +++ b/reports.cgi @@ -62,6 +62,7 @@ Bugzilla->switch_to_shadow_db(); my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; +my $vars = {}; # We only want those products that the user has permissions for. my @myproducts; @@ -90,6 +91,7 @@ if (! defined $cgi->param('product')) { print $cgi->header(-Content_Disposition=>'inline; filename=bugzilla_report.html'); $template->put_header("Bug Charts"); + $vars->{'header_done'} = 1; show_chart($product); @@ -116,6 +118,7 @@ sub choose_product { print $cgi->header(); $template->put_header("Bug Charts"); + $vars->{'header_done'} = 1; print <<FIN; <center> @@ -185,7 +188,7 @@ sub show_chart { my ($product) = @_; if (! defined $cgi->param('datasets')) { - ThrowUserError("missing_datasets"); + ThrowUserError("missing_datasets", $vars); } my $datasets = join('', $cgi->param('datasets')); @@ -258,7 +261,8 @@ sub generate_chart { $product = ''; } - ThrowCodeError("chart_data_not_generated", {'product' => $product}); + $vars->{'product'} = $product; + ThrowCodeError("chart_data_not_generated", $vars); } my @fields; @@ -272,15 +276,19 @@ sub generate_chart { if (/^#/) { if (/^# fields?: (.*)\s*$/) { @fields = split /\||\r/, $1; - ThrowCodeError("chart_datafile_corrupt", {file => $data_file}) - unless $fields[0] =~ /date/i; + unless ($fields[0] =~ /date/i) { + $vars->{'file'} = $data_file; + ThrowCodeError("chart_datafile_corrupt", $vars); + } push @labels, grep($datasets{$_}, @fields); } next; } - ThrowCodeError("chart_datafile_corrupt", {file => $data_file}) - unless @fields; + unless (@fields) { + $vars->{'file'} = $data_file; + ThrowCodeError("chart_datafile_corrupt", $vars); + } my @line = split /\|/; my $date = $line[0]; @@ -306,7 +314,7 @@ sub generate_chart { close FILE; if (! @{$data{DATE}}) { - ThrowUserError("insufficient_data_points"); + ThrowUserError("insufficient_data_points", $vars); } my $img = Chart::Lines->new (800, 600); |