[%# The contents of this file are subject to the Mozilla Public # License Version 1.1 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or # implied. See the License for the specific language governing # rights and limitations under the License. # # The Original Code is the Bugzilla Bug Tracking System. # # The Initial Developer of the Original Code is Netscape Communications # Corporation. Portions created by Netscape are # Copyright (C) 1998 Netscape Communications Corporation. All # Rights Reserved. # # Contributor(s): Gervase Markham # #%] [%# INTERFACE: # querybase: The base query for this table, in URL form # query: The query for this table, in URL form # data: hash of hash of hash of numbers. Bug counts. # names: hash of hash of strings. Names of tables, rows and columns. # col_field: string. Name of the field being plotted as columns. # row_field: string. Name of the field being plotted as rows. # tbl_field: string. Name of the field being plotted as tables. #%] [% PROCESS "global/field-descs.html.tmpl" %] [% tbl_field_disp = field_descs.$tbl_field || tbl_field %] [% col_field_disp = field_descs.$col_field || col_field %] [% row_field_disp = field_descs.$row_field || row_field %] [% title = BLOCK %] Report: [% "$tbl_field_disp / " IF tbl_field %] [% "$col_field_disp / " IF col_field %] [% row_field_disp %] [% END %] [% PROCESS global/header.html.tmpl style = " .t1 { background-color: #ffffff } /* white */ .t2 { background-color: #dfefff } /* light blue */ .t3 { background-color: #dddddd } /* grey */ .t4 { background-color: #c3d3ed } /* darker blue */ .ttotal { background-color: #cfffdf } /* light green */ " %]
[% time2str("%Y-%m-%d %H:%M:%S", time) %]
[% tbl_names = names.tbl.keys.sort %] [% col_names = names.col.keys.sort %] [% row_names = names.row.keys.sort %] [% total_name = "Total" %] [% 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 || 0) + data.$tbl.$col.$row %] [% END %] [% END %] [% END %] [% END %] [% IF tbl_field %] [% tbl_names.push(total_name) %] [% END %]
[% FOREACH tbl = tbl_names %] [% IF tbl_field %] [% END %]

[% tbl FILTER html %]

[% col_field_disp FILTER html %]
[% row_field_disp FILTER html %] [% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %] [% col_idx = 0 %] [% row_idx = 0 %] [% grand_total = 0 %] [% IF col_field %] [% FOREACH col = col_names %] [% col_totals.$col = 0 %] [% NEXT IF col == "" %] [% col_idx = 1 - col_idx %] [% END %] [% END %] [% FOREACH row = row_names %] [% row_total = 0 %] [% row_idx = 1 - row_idx %] [% FOREACH col = col_names %] [% row_total = row_total + data.$tbl.$col.$row %] [% NEXT IF col == "" %] [% col_totals.$col = col_totals.$col + data.$tbl.$col.$row %] [% col_idx = 1 - col_idx %] [% END %] [% END %] [% row_idx = 1 - row_idx %] [% FOREACH col = col_names %] [% NEXT IF col == "" %] [% END %]
[% col FILTER html %] Total
[% row FILTER html %] [% IF data.$tbl.$col.$row AND data.$tbl.$col.$row > 0 %] [% data.$tbl.$col.$row %] [% ELSE %] . [% END %] [% row_total %] [% grand_total = grand_total + row_total %]
Total [% col_totals.$col %] [% grand_total %]

[% END %] Edit this report

[% PROCESS global/footer.html.tmpl %]