[%# 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: # buglistbase: The base query for this table, in URL form # 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. # col_names: array. List of values for the field being plotted as columns. # row_names: array. List of values for the field being plotted as rows. # data: . Data to plot. Only data.$tbl is accessed. # tbl: Name of a hash in data which is the table to be plotted. #%] [% col_field_disp = report_columns.$col_field.title || col_field %] [% row_field_disp = report_columns.$row_field.title || row_field %] [% urlbase = buglistbase; IF row_field; urlbase = urlbase.replace(row_field _ '_type=[^&]*&?', ''); END; IF col_field; urlbase = urlbase.replace(col_field _ '_type=[^&]*&?', ''); END; %] [% IF tbl == "-total-" %] [% urlbase = BLOCK %]buglist.cgi?[% urlbase | html %] [% "&$tbl_vals" IF tbl_vals %][% END %] [% ELSE %] [% urlbase = BLOCK %]buglist.cgi?[% urlbase | html %]& [% tbl_field | url_quote %]=[% tbl | url_quote %][% END %] [% END %] [% IF tbl_field %]

[% tbl_disp FILTER email FILTER html %]

[% END %] [% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %] [% col_idx = 0 %] [% row_idx = 0 %] [% mlist = (measure == 'times' ? [ 'etime', 'wtime', 'rtime' ] : [ measure ]) %] [% IF col_field %] [% FOREACH col = col_names %] [% col_idx = 1 - col_idx %] [% END %] [% IF col_names.size > 1 %] [% END %] [% ELSE %] [% END %] [% col_totals = {} %] [% grand_total = {} %] [% FOREACH row = row_names %] [% row_total = {} %] [% row_idx = 1 - row_idx %] [% col_n = 0 %] [% FOREACH col = col_names %] [% col_idx = 1 - col_idx %] [% FOR m = mlist %] [%# Use numeric keys because fu*king Template::Stash produces double UTF-8 %] [% col_totals.$col_n.$m = col_totals.$col_n.$m + data.$tbl.$col.$row.$m %] [% row_total.$m = row_total.$m + data.$tbl.$col.$row.$m %] [% END %] [% col_n = col_n + 1 %] [% END %] [% IF col_names.size > 1 %] [% FOR m = mlist %] [% END %] [% END %] [% END %] [% row_idx = 1 - row_idx %] [% col_n = 0 %] [% FOREACH col = col_names %] [% FOR m = mlist %] [% END %] [% col_n = col_n + 1 %] [% END %] [% IF col_names.size > 1 %] [% FOR m = mlist %] [% END %] [% END %]
[% col_field_disp FILTER html %]
[% row_field_disp FILTER html %]
[% PROCESS value_display value = col field = col_field %] Total
[% row_field_disp FILTER html %] Total
[% PROCESS value_display value = row field = row_field %] [% IF data.$tbl.$col.$row.$m AND data.$tbl.$col.$row.$m > 0 %] [% data.$tbl.$col.$row.$m %] [% END %] [% row_total.$m %] [% grand_total.$m = grand_total.$m + row_total.$m %]
Total [% col_totals.$col_n.$m %] [% grand_total.$m %]
[% BLOCK value_display %] [% SET disp_value = value %] [% IF field == 'assigned_to' OR field == 'reporter' OR field == 'qa_contact' %] [% disp_value = value FILTER email %] [% END %] [% disp_value FILTER html FILTER replace('^\s*$',' ') %] [% END %] [% BLOCK value_url %] [% IF NOT value %] [% field | url_quote %]_type=regexp&[% field | url_quote %]=[% '^$' | url_quote %] [% ELSE %] [% field | url_quote %]_type=equals&[% field | url_quote %]=[% value | url_quote %] [% END %] [% END %]