diff options
Diffstat (limited to 'report.cgi')
-rwxr-xr-x | report.cgi | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/report.cgi b/report.cgi index c73f52b44..7a6093c8c 100755 --- a/report.cgi +++ b/report.cgi @@ -131,13 +131,12 @@ my $search = new Bugzilla::Search( params => scalar $params->Vars, allow_unlimited => 1, ); -my $query = $search->sql; $::SIG{TERM} = 'DEFAULT'; $::SIG{PIPE} = 'DEFAULT'; -my $dbh = Bugzilla->switch_to_shadow_db(); -my $results = $dbh->selectall_arrayref($query); +Bugzilla->switch_to_shadow_db(); +my ($results, $extra_data) = $search->data; # We have a hash of hashes for the data itself, and a hash to hold the # row/col/table names. @@ -224,8 +223,7 @@ if ($width && $formatparam eq "bar") { $vars->{'width'} = $width if $width; $vars->{'height'} = $height if $height; - -$vars->{'query'} = $query; +$vars->{'queries'} = $extra_data; if ($cgi->param('debug') && Bugzilla->params->{debug_group} @@ -282,11 +280,8 @@ my $format = $template->get_format("reports/report", $formatparam, # set debug=1 to always get an HTML content-type, and view the error. $format->{'ctype'} = "text/html" if $cgi->param('debug'); -my @time = localtime(time()); -my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3]; -my $filename = "report-$date.$format->{extension}"; -print $cgi->header(-type => $format->{'ctype'}, - -content_disposition => "inline; filename=$filename"); +$cgi->set_dated_content_disp("inline", "report", $format->{extension}); +print $cgi->header($format->{'ctype'}); # Problems with this CGI are often due to malformed data. Setting debug=1 # prints out both data structures. |