[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [%# INTERFACE: # 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. # tbl_names: array. List of values for the field being plotted as tables. # time: integer. Seconds since the epoch. # data: . Data to plot. # format: string. Format of the individual reports. # width: integer. For image charts, height of the image. # height: integer. For image charts, width of the image. # imagebase: string. Base URL for chart image. # switchbase: string. Base URL for format switching. # cumulate: boolean. For bar/line charts, whether to cumulate data sets. #%] [% DEFAULT width = 1024 height = 600 %] [% IF min_width AND width < min_width %] [% width = min_width %] [% END %] [%# We ignore row_field for pie charts %] [% IF format == "pie" %] [% row_field = "" %] [% END %] [% 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 %] [% switchbase = switchbase FILTER html %] [% title = BLOCK %] Report: [% IF tbl_field %] [% tbl_field_disp FILTER html %] [% END %] [% " / " IF tbl_field AND (col_field OR row_field) %] [% IF row_field %] [% row_field_disp FILTER html %] [% END %] [% " / " IF col_field AND row_field %] [% col_field_disp FILTER html %] [% END %] [% time = time FILTER time('%Y-%m-%d %H:%M:%S') FILTER html %] [% PROCESS global/header.html.tmpl header_addl_info = time style_urls = ['skins/standard/reports.css'] yui = ['datatable'] %] [% IF debug %]

[% query FILTER html %]

[% END %]
[% FOREACH tbl = tbl_names %] [% IF tbl == "-total-" %] [% tbl_disp = "Total" %] [% ELSE %] [% tbl_disp = tbl %] [% END %] [% IF format == "table" %] [% PROCESS "reports/report-table.html.tmpl" %] [% ELSE %] [% IF tbl %]

[% tbl_disp FILTER email FILTER html %]

[% END %] [% imageurl = BLOCK %]report.cgi?[% imagebase FILTER html %]&format= [% format FILTER uri %]&ctype=png&action=plot& [% IF tbl_field %] [% IF tbl != "-total-" %] [% tbl_field FILTER uri %]=[% tbl FILTER uri %]& [% ELSE %] [% FOREACH tblname = tbl_names %] [% IF tblname != "-total-" %] [% tbl_field FILTER uri %]=[% tblname FILTER uri %]& [% END %] [% END %] [% END %] [% END %]width=[% width %]&height=[% height %] [% END %] Graphical report results [% END %]
[% END %] [% formats = [ { name => "pie", description => "Pie" }, { name => "bar", description => "Bar" }, { name => "line", description => "Line" }, { name => "table", description => "Table" } ] %] [% formaturl = "report.cgi?$switchbase&width=$width&height=$height&action=wrap" %] [% FOREACH other_format = formats %] [% NEXT IF other_format.name == "pie" AND row_field AND col_field %] [% UNLESS other_format.name == format %] [% END %] [% other_format.description FILTER html %] [% "" UNLESS other_format.name == format %] | [% END %] CSV
[% IF format == "table" %] Edit this report [% ELSE %] Edit this report [% END %] | [% IF saved_report_id %] Forget this report [% ELSE %]
as
[% END %]
[% PROCESS global/footer.html.tmpl %]