From 4f6b75a65628b0d86c760309dd81dd03f5c6d308 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Thu, 26 Jun 2003 06:22:50 +0000 Subject: Bug 16009 - generic charting. Patch by gerv; r,a=justdave. --- template/en/default/filterexceptions.pl | 31 +++ template/en/default/global/code-error.html.tmpl | 11 + template/en/default/global/messages.html.tmpl | 23 ++ template/en/default/global/user-error.html.tmpl | 42 ++- template/en/default/reports/chart.csv.tmpl | 40 +++ template/en/default/reports/chart.html.tmpl | 66 +++++ template/en/default/reports/chart.png.tmpl | 56 ++++ template/en/default/reports/create-chart.html.tmpl | 281 +++++++++++++++++++++ template/en/default/reports/edit-series.html.tmpl | 57 +++++ template/en/default/reports/menu.html.tmpl | 6 +- .../en/default/reports/series-common.html.tmpl | 117 +++++++++ template/en/default/reports/series.html.tmpl | 96 +++++++ .../default/search/search-create-series.html.tmpl | 67 +++++ 13 files changed, 890 insertions(+), 3 deletions(-) create mode 100644 template/en/default/reports/chart.csv.tmpl create mode 100644 template/en/default/reports/chart.html.tmpl create mode 100644 template/en/default/reports/chart.png.tmpl create mode 100644 template/en/default/reports/create-chart.html.tmpl create mode 100644 template/en/default/reports/edit-series.html.tmpl create mode 100644 template/en/default/reports/series-common.html.tmpl create mode 100644 template/en/default/reports/series.html.tmpl create mode 100644 template/en/default/search/search-create-series.html.tmpl (limited to 'template') diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index d2abbdadb..6a7217d76 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -197,6 +197,36 @@ 'bug.delta', ], +'reports/chart.html.tmpl' => [ + 'width', + 'height', + 'imageurl', + 'sizeurl', + 'height + 100', + 'height - 100', + 'width + 100', + 'width - 100', +], + +'reports/series-common.html.tmpl' => [ + 'sel.name', + 'sel.accesskey', + '"onchange=\'$sel.onchange\'" IF sel.onchange', +], + +'reports/chart.csv.tmpl' => [ + 'data.$j.$i', +], + +'reports/create-chart.html.tmpl' => [ + 'series.series_id', + 'newidx', +], + +'reports/edit-series.html.tmpl' => [ + 'default.series_id', +], + 'list/change-columns.html.tmpl' => [ 'column', 'field_descs.${column} || column', # @@ -293,6 +323,7 @@ 'old_email', # email address 'new_email', # email address 'message_tag', + 'series.frequency * 2', ], 'global/select-menu.html.tmpl' => [ diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 68f046091..84a5e3259 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -132,6 +132,11 @@ [% title = "Invalid Dimensions" %] The width or height specified is not a positive integer. + [% ELSIF error == "invalid_series_id" %] + [% title = "Invalid Series" %] + The series_id [% series_id FILTER html %] is not valid. It may be that + this series has been deleted. + [% ELSIF error == "mismatched_bug_ids_on_obsolete" %] Attachment [% attach_id FILTER html %] ([% description FILTER html %]) is attached to bug [% attach_bug_id FILTER html %], but you tried to @@ -178,6 +183,12 @@ [% ELSIF error == "missing_bug_id" %] No bug ID was given. + [% ELSIF error == "missing_series_id" %] + Having inserted a series into the database, no series_id was returned for + it. Series: [% series.category FILTER html %] / + [%+ series.subcategory FILTER html %] / + [%+ series.name FILTER html %]. + [% ELSIF error == "no_y_axis_defined" %] No Y axis was defined when creating report. The X axis is optional, but the Y axis is compulsory. diff --git a/template/en/default/global/messages.html.tmpl b/template/en/default/global/messages.html.tmpl index 13136d6cf..6b9612f54 100644 --- a/template/en/default/global/messages.html.tmpl +++ b/template/en/default/global/messages.html.tmpl @@ -131,6 +131,29 @@ Back to flag types.

+ [% ELSIF message_tag == "series_already_exists" %] + [% title = "Series Already Exists" %] + A series [% series.category FILTER html %] / + [%+ series.subcategory FILTER html %] / + [%+ series.name FILTER html %] + already exists. If you want to create this series, you will need to give + it a different name. @@@ subscribe? +

+ Go back or + create another series. + + [% ELSIF message_tag == "series_created" %] + [% title = "Series Created" %] + The series [% series.category FILTER html %] / + [%+ series.subcategory FILTER html %] / + [%+ series.name FILTER html %] + has been created. Note that you may need to wait up to + [% series.frequency * 2 %] days before there will be enough data for a + chart of this series to be produced. +

+ Go back or + create another series. + [% ELSIF message_tag == "shutdown" %] [% title = "Bugzilla is Down" %] [% Param("shutdownhtml") %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index f626c640b..a057ef96b 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -255,7 +255,7 @@ You entered [% value FILTER html %], which isn't. [% ELSIF error == "illegal_date" %] - [% title = "Your Query Makes No Sense" %] + [% title = "Illegal Date" %] '[% date FILTER html %]' is not a legal date. [% ELSIF error == "illegal_email_address" %] @@ -266,6 +266,11 @@ It must also not contain any of these special characters: \ ( ) & < > , ; : " [ ], or any whitespace. + [% ELSIF error == "illegal_frequency" %] + [% title = "Too Frequent" %] + Unless you are an administrator, you may not create series which are + run more often than once every [% minimum FILTER html %] days. + [% ELSIF error == "illegal_group_control_combination" %] [% title = "Your Group Control Combination Is Illegal" %] Your group control combination for group " @@ -282,6 +287,18 @@ The name of your query cannot contain any of the following characters: <, >, &. + [% ELSIF error == "illegal_series_creation" %] + You are not authorised to create series. + + [% ELSIF error == "illegal_series_edit" %] + You are not authorised to edit this series. To do this, you must either + be its creator, or an administrator. + + [% ELSIF error == "insufficient_data" %] + [% title = "Insufficient Data" %] + None of the series you selected have any data associated with them, so a + chart cannot be plotted. + [% ELSIF error == "insufficient_data_points" %] We don't have enough data points to make a graph (yet). @@ -352,10 +369,19 @@ if you are going to accept it. Part of accepting a bug is giving an estimate of when it will be fixed. + [% ELSIF error == "misarranged_dates" %] + [% title = "Misarranged Dates" %] + Your start date ([% datefrom FILTER html %]) is after + your end date ([% dateto FILTER html %]). + [% ELSIF error == "missing_attachment_description" %] [% title = "Missing Attachment Description" %] You must enter a description for the attachment. + [% ELSIF error == "missing_category" %] + [% title = "Missing Category" %] + You did not specify a category for this series. + [% ELSIF error == "missing_content_type" %] [% title = "Missing Content-Type" %] You asked Bugzilla to auto-detect the content type, but @@ -383,14 +409,26 @@ You must specify one or more fields in which to search for [% email FILTER html %]. + [% ELSIF error == "missing_frequency" %] + [% title = "Missing Frequency" %] + You did not specify a valid frequency for this series. + + [% ELSIF error == "missing_name" %] + [% title = "Missing Name" %] + You did not specify a name for this series. + [% ELSIF error == "missing_query" %] [% title = "Missing Query" %] The query named [% queryname FILTER html %] does not exist. + [% ELSIF error == "missing_subcategory" %] + [% title = "Missing Subcategory" %] + You did not specify a subcategory for this series. + [% ELSIF error == "need_component" %] [% title = "Component Required" %] - You must specify a component to help determine the new owner of these bugs. + You must specify a component to help determine the new owner of these bugs. [% ELSIF error == "need_numeric_value" %] [% title = "Numeric Value Required" %] diff --git a/template/en/default/reports/chart.csv.tmpl b/template/en/default/reports/chart.csv.tmpl new file mode 100644 index 000000000..83620bf08 --- /dev/null +++ b/template/en/default/reports/chart.csv.tmpl @@ -0,0 +1,40 @@ +[%# 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 + #%] + +[% data = chart.data %] +Date\Series, +[% FOREACH label = chart.labels %] + [% label FILTER csv %][% "," UNLESS loop.last %] +[% END %] +[%# The data, which is in the correct format for GD, is conceptually the wrong + # way round for CSV output. So, we need to invert it here, which is why + # these loops aren't just plain FOREACH. + #%] +[% i = 0 %] +[% WHILE i < data.0.size %] + [% j = 0 %] + [% WHILE j < data.size %] + [% data.$j.$i %][% "," UNLESS (j == data.size - 1) %] + [% j = j + 1 %] + [% END %] + [% i = i + 1 %] + +[% END %] diff --git a/template/en/default/reports/chart.html.tmpl b/template/en/default/reports/chart.html.tmpl new file mode 100644 index 000000000..95d52d725 --- /dev/null +++ b/template/en/default/reports/chart.html.tmpl @@ -0,0 +1,66 @@ + +[%# 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: + #%] + +[% DEFAULT width = 600 + height = 350 +%] + +[% PROCESS global/header.html.tmpl + title = "Chart" + h3 = time2str("%Y-%m-%d %H:%M:%S", time) +%] + +
+ + [% imageurl = BLOCK %]chart.cgi? + [% imagebase FILTER html %]&ctype=png&action=plot&width= + [% width %]&height=[% height -%] + [% END %] + + Graphical report results +

+ [% sizeurl = BLOCK %]chart.cgi? + [% imagebase FILTER html %]&action=wrap + [% END %] + Taller
+ Thinner * + Fatter    
+ Shorter
+

+ +

+ CSV | + Edit + this chart +

+ +
+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/chart.png.tmpl b/template/en/default/reports/chart.png.tmpl new file mode 100644 index 000000000..43d4e962d --- /dev/null +++ b/template/en/default/reports/chart.png.tmpl @@ -0,0 +1,56 @@ +[%# 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 + #%] + +[% y_label = "Bugs" %] +[% x_label = "Time" %] + +[% IF cumulate %] + [% USE graph = GD.Graph.area(width, height) %] + [% graph.set(cumulate => "true") %] +[% ELSE %] + [% USE graph = GD.Graph.lines(width, height) %] +[% END %] + +[% FILTER null; + x_label_skip = (30 * chart.data.0.size / width); + + graph.set(x_label => x_label, + y_label => y_label, + y_tick_number => 8, + x_label_position => 0.5, + x_labels_vertical => 1, + x_label_skip => x_label_skip, + legend_placement => "RT", + line_width => 2); + + # Workaround for the fact that set_legend won't take chart.labels directly, + # because chart.labels is an array reference rather than an array. + graph.set_legend(chart.labels.0, chart.labels.1, chart.labels.2, + chart.labels.3, chart.labels.4, chart.labels.5, + chart.labels.6, chart.labels.7, chart.labels.8, + chart.labels.9, chart.labels.10, chart.labels.11, + chart.labels.12, chart.labels.13, chart.labels.14, + chart.labels.15); + + graph.plot(chart.data).png | stdout(1); + END; +-%] + diff --git a/template/en/default/reports/create-chart.html.tmpl b/template/en/default/reports/create-chart.html.tmpl new file mode 100644 index 000000000..fe0b4a76c --- /dev/null +++ b/template/en/default/reports/create-chart.html.tmpl @@ -0,0 +1,281 @@ + +[%# 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: + # chart: Chart object representing the currently assembled chart. + # category: hash (keyed by category) of hashes (keyed by subcategory) of + # hashes (keyed by name), with value being the series_id of the + # series. Contains details of all series the user can see. + #%] + +[% PROCESS global/header.html.tmpl + title = "Create Chart" +%] + +[% PROCESS "reports/series-common.html.tmpl" + donames = 1 +%] + + + +[% gttext = "Grand Total" %] + +

Current Data Sets:

+ +
+ [% IF chart.lines.size > 0 %] + + + + + + + + + + + [%# The external loop has two counters; one which keeps track of where we + # are in the old labels array, and one which keeps track of the new + # indexes for the form elements. They are different if chart.lines has + # empty slots in it. + #%] + [% labelidx = 0 %] + [% newidx = 0 %] + + [% FOREACH line = chart.lines %] + [% IF NOT line %] + [%# chart.lines has an empty slot, so chart.labels will too. We + # increment labelidx only to keep the labels in sync with the data. + #%] + [% labelidx = labelidx + 1 %] + [% NEXT %] + [% END %] + + [% FOREACH series = line %] + + [% IF loop.first %] + + + [% END %] + + + + + + + + + + [% END %] + [% labelidx = labelidx + 1 %] + [% newidx = newidx + 1 %] + [% END %] + + [% IF chart.gt %] + + + + + + + + + [% END %] + + + + + + + + + + + + + + + + +
SelectAsData SetSubs
+ + + + + [% "{" IF line.size > 1 %] + + + [% series.category FILTER html %] / + [%+ series.subcategory FILTER html %] / + [%+ series.name FILTER html %] + + + + [% IF series.creator != 0 %] + [% IF series.subscribed %] + + [% ELSE %] + + [% END %] + [% END %] + + [% IF user.userid == series.creator OR UserInGroup("admin") %] + Edit + [% END %] +
+ + + + + + [% gttext FILTER html %] +
 
+
+ +
+ Cumulate: + + + Date Range: + + to + + + + +
+ [% ELSE %] +

None

+ [% END %] + +

Select Data Sets:

+ + + [% IF NOT category OR category.size == 0 %] + + + + [% ELSE %] + + + + + + + + + + + [% PROCESS series_select sel = { name => 'category', + size => 5, + onchange = "catSelected(); + subcatSelected();" } %] + + + + + [% PROCESS series_select sel = { name => 'subcategory', + size => 5, + onchange = "subcatSelected()" } %] + + + + + + + + + [% END %] +
+ You do not have permissions to see any data sets, or none + exist. +
Category:Sub-category:Name:
+
+ + + + + + +
+
+ + +
+ +[% IF UserInGroup('editbugs') %] +

New Data Set

+[% END %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/edit-series.html.tmpl b/template/en/default/reports/edit-series.html.tmpl new file mode 100644 index 000000000..352e5fade --- /dev/null +++ b/template/en/default/reports/edit-series.html.tmpl @@ -0,0 +1,57 @@ + +[%# 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 + #%] + +[% title = "Edit Series" %] +[% h2 = BLOCK %] + [% default.category FILTER html %] / + [%+ default.subcategory FILTER html %] / + [%+ default.name FILTER html %] +[% END %] + +[% PROCESS global/header.html.tmpl %] + +
+ + [% button_name = "Change" %] + + [% PROCESS reports/series.html.tmpl %] + + [% IF default.series_id %] + + [% END %] +
+ +

+ Creator: + [% creator.email FILTER html %] +

+ +

+ View + series search parameters | + Run series search +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/menu.html.tmpl b/template/en/default/reports/menu.html.tmpl index 4e21bf4d6..f28f1f697 100644 --- a/template/en/default/reports/menu.html.tmpl +++ b/template/en/default/reports/menu.html.tmpl @@ -58,10 +58,14 @@
  • - Charts - + Old Charts - plot the status and/or resolution of bugs against time, for each product in your database.
  • +
  • + New Charts - + plot any arbitrary search against time. Far more powerful. +
[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/series-common.html.tmpl b/template/en/default/reports/series-common.html.tmpl new file mode 100644 index 000000000..7fa34c6ec --- /dev/null +++ b/template/en/default/reports/series-common.html.tmpl @@ -0,0 +1,117 @@ + +[%# 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: + # donames: boolean. True if we have a multi-select for names as well as + # categories and subcategories. + # category: hash (keyed by category) of hashes (keyed by subcategory) of + # hashes (keyed by name), with value being the series_id of the + # series. Contains details of all series the user can see. + #%] + +[% subcategory = category.${default.category} %] +[% name = subcategory.${default.subcategory} %] + + + +[%###########################################################################%] +[%# Block for SELECT fields - pinched from search/form.html.tmpl #%] +[%###########################################################################%] + +[% BLOCK series_select %] + + + +[% END %] diff --git a/template/en/default/reports/series.html.tmpl b/template/en/default/reports/series.html.tmpl new file mode 100644 index 000000000..a1474a1cf --- /dev/null +++ b/template/en/default/reports/series.html.tmpl @@ -0,0 +1,96 @@ + +[%# 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: + # default: hash. Defaults for category, subcategory, name etc. + # button_name: string. What the button will say. + # category: hash (keyed by category) of hashes (keyed by subcategory) of + # hashes (keyed by name), with value being the series_id of the + # series. Contains details of all series the user can see. + #%] + +[% PROCESS "reports/series-common.html.tmpl" + newtext = "New (name below)" + %] + + + + + + + + + + + + [% PROCESS series_select sel = { name => 'category', + size => 5, + onchange => "catSelected()" } %] + + + + [% PROCESS series_select sel = { name => 'subcategory', + size => 5, + onchange => "checkNewState()" } %] + + + + + + + + + + + + + +
Category:Sub-category:Name:
+ + + + + Run every   + +  day(s)
+ [% IF UserInGroup('admin') %] + + Visible to all + [% END %] +
+ + + + + +
+ + diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl new file mode 100644 index 000000000..9673a1838 --- /dev/null +++ b/template/en/default/search/search-create-series.html.tmpl @@ -0,0 +1,67 @@ + +[%# 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: + # This template has no interface. However, to use it, you need to fulfill + # the interfaces of search/form.html.tmpl, reports/series.html.tmpl and + # search/boolean-charts.html.tmpl. + #%] + +[% PROCESS global/header.html.tmpl + title = "Create New Data Set" + onload = "selectProduct(document.forms['chartform']);" +%] + +[% button_name = "I'm Feeling Buggy" %] + +
+ +[% PROCESS search/form.html.tmpl %] + + + + + + + + + +
+ +
+ + +
+ + [% INCLUDE reports/series.html.tmpl %] + +
+ +
+ +[% PROCESS "search/boolean-charts.html.tmpl" %] + +
+ +[% PROCESS global/footer.html.tmpl %] -- cgit v1.2.1