From eeec04a1f0a645b3922b2fad4ca76383a2fc8d39 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Fri, 11 Oct 2002 13:27:34 +0000 Subject: Bug 173719 - warnings in report.cgi. Patch by gerv; r=bbaetz. --- report.cgi | 7 +++---- template/en/default/reports/report-table.html.tmpl | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/report.cgi b/report.cgi index 35055110e..9e60c1dc9 100755 --- a/report.cgi +++ b/report.cgi @@ -21,7 +21,6 @@ # Contributor(s): Gervase Markham # -use diagnostics; use strict; use lib "."; @@ -92,8 +91,8 @@ my %names; # Read the bug data and increment the counts. while (MoreSQLData()) { my ($row, $col, $tbl) = FetchSQLData(); - $col = "" if ($col == $columns{''}); - $tbl = "" if ($tbl == $columns{''}); + $col = "" if ($col eq $columns{''}); + $tbl = "" if ($tbl eq $columns{''}); $data{$tbl}{$col}{$row}++; $names{"col"}{$col}++; @@ -118,6 +117,6 @@ $vars->{'buffer'} = $::buffer; # Generate and return the result from the appropriate template. my $format = GetFormat("reports/report", $::FORM{'format'}, $::FORM{'ctype'}); -print "Content-Type: $format->{'contenttype'}\n\n"; +print "Content-Type: $format->{'ctype'}\n\n"; $template->process("$format->{'template'}", $vars) || ThrowTemplateError($template->error()); diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 81ca27866..97dae5b48 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -62,18 +62,21 @@ [% total_name = "Total" %] -[% IF tbl_field %] - [%# Calculate and set up the Total table %] - - [% FOREACH tbl = tbl_names %] - [% FOREACH row = row_names %] - [% FOREACH col = col_names %] +[% FOREACH tbl = tbl_names %] + [% FOREACH row = row_names %] + [% FOREACH col = col_names %] + [% data.$tbl.$col.$row = (data.$tbl.$col.$row || 0) %] + + [% IF tbl_field %] + [%# Calculate values for the Total table %] [% data.$total_name.$col.$row = - data.$total_name.$col.$row + data.$tbl.$col.$row %] + (data.$total_name.$col.$row || 0) + data.$tbl.$col.$row %] [% END %] [% END %] [% END %] +[% END %] +[% IF tbl_field %] [% tbl_names.push(total_name) %] [% END %] @@ -140,8 +143,8 @@ [% FOREACH col = col_names %] [% row_total = row_total + data.$tbl.$col.$row %] - [% col_totals.$col = col_totals.$col + data.$tbl.$col.$row %] [% NEXT IF col == "" %] + [% col_totals.$col = col_totals.$col + data.$tbl.$col.$row %] [% col_idx = 1 - col_idx %] -- cgit v1.2.3-24-g4f1b