203 lines
6.8 KiB
Cheetah
203 lines
6.8 KiB
Cheetah
[%# 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.
|
|
# 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.
|
|
#%]
|
|
|
|
[%# 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 %]
|
|
|
|
[% 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
|
|
style = "
|
|
.t1 { background-color: #ffffff } /* white */
|
|
.t2 { background-color: #dfefff } /* light blue */
|
|
.t3 { background-color: #ffffff } /* white */
|
|
.t4 { background-color: #dfefff } /* light blue */
|
|
.ttotal { background-color: #cfffdf } /* light green */
|
|
"
|
|
style_urls = ['skins/standard/reports.css']
|
|
header_addl_info = time
|
|
%]
|
|
|
|
[% IF debug %]
|
|
<p>[% query FILTER html %]</p>
|
|
[% END %]
|
|
|
|
<div>
|
|
|
|
[% 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 email FILTER html %]</h2>
|
|
[% END %]
|
|
|
|
[% imageurl = BLOCK %]report.cgi?[% imagebase FILTER html %]&format=
|
|
[% format FILTER url_quote %]&ctype=png&action=plot&
|
|
[% IF tbl_field %]
|
|
[% IF tbl != "-total-" %]
|
|
[% tbl_field FILTER url_quote %]=[% tbl FILTER url_quote %]&
|
|
[% ELSE %]
|
|
[% FOREACH tblname = tbl_names %]
|
|
[% IF tblname != "-total-" %]
|
|
[% tbl_field FILTER url_quote %]=[% tblname FILTER url_quote %]&
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]width=[% width %]&height=[% height %]
|
|
[% END %]
|
|
|
|
<img alt="Graphical report results" src="[% imageurl %]"
|
|
width="[% width %]" height="[% height %]">
|
|
[% END %]
|
|
<br />
|
|
[% END %]
|
|
|
|
<form method="GET" action="?">
|
|
<input type="hidden" name="action" value="wrap" />
|
|
[% FOR k = switchparams.keys.sort %]
|
|
<input type="hidden" name="[% k | html %]" value="[% switchparams.$k | html %]" />
|
|
[% END %]
|
|
<table class="admin_table">
|
|
<tr>
|
|
<th>
|
|
Format:
|
|
</th>
|
|
<td>
|
|
[% formats = [
|
|
{ name => "pie", description => "Pie" },
|
|
{ name => "bar", description => "Bar" },
|
|
{ name => "line", description => "Line" },
|
|
{ name => "table", description => "Table" }
|
|
] %]
|
|
<select name="format" style="width: 100%; border: 0; margin-top: 2px">
|
|
[% FOR f = formats %]
|
|
<option value="[% f.name | html %]"[% IF f.name == format %] selected="selected"[% END %]>[% f.description | html %]</option>
|
|
[% END %]
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Show:
|
|
</th>
|
|
<td>
|
|
[% measure_descs = {
|
|
rtime => 'Remaining time'
|
|
etime => 'Estimated time'
|
|
wtime => 'Actual time'
|
|
times => 'Estimated/Actual/Remaining'
|
|
count => "Number of $terms.bugs"
|
|
} %]
|
|
<select name="measure" style="width: 100%; border: 0; margin-top: 2px">
|
|
[% FOR m = measure_descs.keys.sort %]
|
|
<option value="[% m %]"[% IF measure == m %] selected="selected"[% END %]>[% measure_descs.$m %]</option>
|
|
[% END %]
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
[% IF format != "table" %]
|
|
<tr>
|
|
<td>
|
|
Width:
|
|
</td>
|
|
<td>
|
|
<input type="text" name="width" value="[% width %]" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Height:
|
|
</td>
|
|
<td>
|
|
<input type="text" name="height" value="[% height %]" />
|
|
</td>
|
|
</tr>
|
|
[% END %]
|
|
<tr>
|
|
<td colspan="2" style="text-align: center">
|
|
<input type="submit" value="Apply Format" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
<div style="margin-top: 1em">
|
|
<input type="button" onclick="window.location.href='query.cgi?[% switchbase | html %]
|
|
[%- IF format == "table" -%]&format=report-table
|
|
[%- ELSE -%]&chart_format=[% format %]&format=report-graph&cumulate=[% cumulate %]
|
|
[%- END -%]'" value="Edit this report" />
|
|
[% IF saved_report_id %]
|
|
| <a href="report.cgi?action=del&saved_report_id=[% saved_report_id FILTER uri %]&token=
|
|
[%~ issue_hash_token(['delete_report', saved_report_id]) FILTER uri %]">Forget this report</a>
|
|
[% ELSE %]
|
|
<form method="get" action="report.cgi" style="display: inline">
|
|
<input type="submit" id="remember" value="Remember report" /> as
|
|
<input type="hidden" name="query" value="[% switchbase %]&format=[% format FILTER html %]&action=wrap" />
|
|
<input type="hidden" name="action" value="add" />
|
|
<input type="hidden" name="token" value="[% issue_hash_token(['save_report']) FILTER html %]" />
|
|
<input type="text" id="name" name="name" size="20" value="" maxlength="64" />
|
|
</form>
|
|
[% END %]
|
|
</div>
|
|
|
|
</div>
|
|
|
|
[% PROCESS global/footer.html.tmpl %]
|