summaryrefslogtreecommitdiffstats
path: root/template/en/default/reports/report.html.tmpl
diff options
context:
space:
mode:
authorgerv%gerv.net <>2002-10-29 16:43:57 +0100
committergerv%gerv.net <>2002-10-29 16:43:57 +0100
commitdad297316ae335ccc20e5d0546525d1c117131c0 (patch)
tree32ee0d8e77eb8ae137396c894926d25af6255c95 /template/en/default/reports/report.html.tmpl
parent5b6b45ec09591f41c42ce66bbd3b2ad4c41dc014 (diff)
downloadbugzilla-dad297316ae335ccc20e5d0546525d1c117131c0.tar.gz
bugzilla-dad297316ae335ccc20e5d0546525d1c117131c0.tar.xz
Bug 173005 - Add bar charts, pie charts etc. to reporting. Patch by gerv; 2xr=joel.
Diffstat (limited to 'template/en/default/reports/report.html.tmpl')
-rw-r--r--template/en/default/reports/report.html.tmpl156
1 files changed, 156 insertions, 0 deletions
diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl
new file mode 100644
index 000000000..c4a3edd56
--- /dev/null
+++ b/template/en/default/reports/report.html.tmpl
@@ -0,0 +1,156 @@
+ <!-- 1.0@bugzilla.org -->
+[%# 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 <gerv@gerv.net>
+ #%]
+
+[%# 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: <depends on format>. 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.
+ # switchbase: string. Base URL for format switching.
+ # cumulate: boolean. For bar/line charts, whether to cumulate data sets.
+ #%]
+
+[% DEFAULT width = 600
+ height = 350
+%]
+
+[%# We ignore row_field for pie charts %]
+[% IF format == "pie" %]
+ [% row_field = "" %]
+[% END %]
+
+[% 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 %]
+ [% " / " IF tbl_field AND (col_field OR row_field) %]
+ [% row_field_disp IF row_field %]
+ [% " / " IF col_field AND row_field %]
+ [% col_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 */
+ "
+ h3 = time2str("%Y-%m-%d %H:%M:%S", time)
+%]
+
+[% IF debug %]
+ <p>[% query FILTER html %]</p>
+[% END %]
+
+<div align="center">
+
+ [% 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 %]
+ <h2>[% tbl_disp FILTER html %]</h2>
+ [% END %]
+
+ [% imageurl = BLOCK %]report.cgi?[% imagebase %]&amp;format=
+ [% format FILTER url_quote %]&amp;ctype=png&amp;action=plot&amp;
+ [% IF tbl_field AND tbl != "-total-" %]
+ [% tbl_field FILTER url_quote %]=[% tbl FILTER url_quote %]&amp;
+ [% END %]width=[% width %]&amp;height=[% height %]
+ [% END %]
+
+ <img src="[% imageurl %]" width="[% width %]" height="[% height %]">
+ [% END %]
+ <br>
+ [% END %]
+
+ <table>
+ <tr>
+ <td>
+ [% 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 %]
+ [% UNLESS other_format.name == format %]
+ <a href="[% formaturl %]&format=[% other_format.name %]">
+ [% END %]
+ [% other_format.description %]
+ [% "</a>" UNLESS other_format.name == format %] |
+ [% END %]
+ <a href="[% formaturl %]&ctype=csv">CSV</a>
+ </td>
+
+ [% IF format != "table" %]
+ <td>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </td>
+
+ [% sizeurl = "report.cgi?$switchbase&action=wrap&format=$format" %]
+ <td align="center">
+ <a href="[% sizeurl %]&width=[% width %]&height=
+ [% height + 100 %]">Taller</a><br>
+ <a href="[% sizeurl %]&width=[% width - 100 %]&height=
+ [% height %]">Thinner</a> *
+ <a href="[% sizeurl %]&width=[% width + 100 %]&height=
+ [% height %]">Fatter</a>&nbsp;&nbsp;&nbsp;&nbsp;<br>
+ <a href="[% sizeurl %]&width=[% width %]&height=
+ [% height - 100 %]">Shorter</a><br>
+ </td>
+ [% END %]
+ <tr>
+ </table>
+
+ <p>
+ [% IF format == "table" %]
+ <a href="query.cgi?[% switchbase %]&format=report-table">Edit
+ this report</a>
+ [% ELSE %]
+ <a href="query.cgi?[% switchbase %]&format=report-graph&chart_format=
+ [% format %]&cumulate=[% cumulate %]">Edit this report</a>
+ [% END %]
+ </p>
+
+</div>
+
+[% PROCESS global/footer.html.tmpl %]