From f6c796ad212c7cc62687cd02e3808245a993f6b1 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Thu, 5 Aug 2004 04:36:23 +0000 Subject: Bug 185090: Add revamped whining system patch by: Erik r=joel r=jouni a=justdave --- .../default/account/prefs/saved-searches.html.tmpl | 8 +- template/en/default/filterexceptions.pl | 13 + .../en/default/global/site-navigation.html.tmpl | 2 + template/en/default/global/useful-links.html.tmpl | 2 + template/en/default/global/user-error.html.tmpl | 5 + template/en/default/whine/mail.html.tmpl | 96 +++++ template/en/default/whine/mail.txt.tmpl | 69 ++++ template/en/default/whine/multipart-mime.txt.tmpl | 52 +++ template/en/default/whine/schedule.html.tmpl | 406 +++++++++++++++++++++ 9 files changed, 651 insertions(+), 2 deletions(-) create mode 100644 template/en/default/whine/mail.html.tmpl create mode 100644 template/en/default/whine/mail.txt.tmpl create mode 100644 template/en/default/whine/multipart-mime.txt.tmpl create mode 100644 template/en/default/whine/schedule.html.tmpl (limited to 'template/en/default') diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index 5055565e3..cd251d542 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -70,8 +70,12 @@ Edit - Forget + [% IF q.usedinwhine %] + Remove from whining first + [% ELSE %] + Forget + [% END %] [ + 'event.key', + 'query.id', + 'query.sort', + 'schedule.id', + 'option.0', + 'option.1', +], + +'whine/mail.html.tmpl' => [ + 'bug.bug_id', +], + 'sidebar.xul.tmpl' => [ 'template_version', ], diff --git a/template/en/default/global/site-navigation.html.tmpl b/template/en/default/global/site-navigation.html.tmpl index 189d596fc..95a7ef423 100644 --- a/template/en/default/global/site-navigation.html.tmpl +++ b/template/en/default/global/site-navigation.html.tmpl @@ -104,6 +104,8 @@ href="editgroups.cgi">' IF user.groups.creategroups %] [% '' IF user.groups.editkeywords %] + [% '' IF user.groups.bz_canusewhines %] [% '' IF user.groups.tweakparams %] [% END %] diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index f148d7d2f..c04b60dd6 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -81,6 +81,8 @@ IF user.groups.creategroups %] [% ' | Keywords' IF user.groups.editkeywords %] + [% ' | Whining' + IF user.groups.bz_canusewhines %] [% END %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 28002581a..964832db6 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -846,6 +846,11 @@ Value is out of range for field [% field_descs.$field FILTER html %]. + [% ELSIF error == "whine_access_denied" %] + [% title = "Access Denied" %] + Sorry, you aren't a member of the 'bz_canusewhines' group, and so + you aren't allowed to schedule whine reports. + [% ELSIF error == "zero_length_file" %] [% title = "File Is Empty" %] The file you are trying to attach is empty! diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl new file mode 100644 index 000000000..9d85c0962 --- /dev/null +++ b/template/en/default/whine/mail.html.tmpl @@ -0,0 +1,96 @@ +[%# 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): Erik Stambaugh + #%] + +[%# INTERFACE: + # subject: subject line of message + # body: message body, shown before the query tables + # queries: array of hashes containing: + # bugs: array containing hashes of fieldnames->values for each bug + # title: the title given in the whine scheduling mechanism + # author: user object for the person who scheduled this whine + # recipient: user object for the intended recipient of the message + #%] + +[% PROCESS global/variables.none.tmpl %] + +[%# assignee_login_string is a literal string used for getting the + # assignee's name out of the bug data %] +[% SET assignee_login_string="map_assigned_to.login_name" %] + + + + + + [[% terms.Bugzilla %]] [% subject FILTER html %] + + + + +

+ [% body FILTER html %] +

+ +

+ [% IF author.login == recipient.login %] + Click + here to edit your whine schedule + [% ELSE %] + This search was scheduled by [% author.login FILTER html %]. + [% END %] +

+ + +[% FOREACH query=queries %] + +

[%+ query.title FILTER html %]

+ + + + + + + + + + + + + + [% FOREACH bug=query.bugs %] + + + + + + + + + + + [% END %] +
IDSevPriPltAssigneeStatusResolutionSummary
[% bug.bug_id %][% bug.bug_severity FILTER html %][% bug.priority FILTER html %][% bug.rep_platform FILTER html %][% bug.$assignee_login_string FILTER html %][% bug.bug_status FILTER html %][% bug.resolution FILTER html %][% bug.short_desc FILTER html %]
+[% END %] + + + + + diff --git a/template/en/default/whine/mail.txt.tmpl b/template/en/default/whine/mail.txt.tmpl new file mode 100644 index 000000000..1694203c1 --- /dev/null +++ b/template/en/default/whine/mail.txt.tmpl @@ -0,0 +1,69 @@ +[%# 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): Erik Stambaugh + #%] + +[%# INTERFACE: + # subject: subject line of message + # body: message body, shown before the query tables + # queries: array of hashes containing: + # bugs: array containing hashes of fieldnames->values for each bug + # title: the title given in the whine scheduling mechanism + # author: user object for the person who scheduled this whine + # recipient: user object for the intended recipient of the message + #%] + +[% PROCESS global/variables.none.tmpl %] + +[%# assignee_login_string is a literal string used for getting the + # assignee's name out of the bug data %] +[% SET assignee_login_string="map_assigned_to.login_name" %] + +[% body %] + +[% IF author.login == recipient.login %] + To edit your whine schedule, visit the following URL: + [%+ Param('urlbase') %]editwhines.cgi +[% ELSE %] + This search was scheduled by [% author.login %]. +[% END %] + + +[% FOREACH query=queries %] + +[%+ query.title +%] +[%+ "-" FILTER repeat(query.title.length) %] + + [% FOREACH bug=query.bugs %] + [% terms.Bug +%] [%+ bug.bug_id %]: + [%+ Param('urlbase') %]show_bug.cgi?id=[% bug.bug_id +%] + Priority: [%+ bug.priority -%] + Severity: [%+ bug.bug_severity -%] + Platform: [%+ bug.rep_platform %] + Assignee: [%+ bug.$assignee_login_string %] + Status: [%+ bug.bug_status %] + [%- IF bug.resolution -%] Resolution: [% bug.resolution -%] + [%- END %] + Summary: [% bug.short_desc %] + + [% END %] + +[% END %] + + diff --git a/template/en/default/whine/multipart-mime.txt.tmpl b/template/en/default/whine/multipart-mime.txt.tmpl new file mode 100644 index 000000000..7d5334d04 --- /dev/null +++ b/template/en/default/whine/multipart-mime.txt.tmpl @@ -0,0 +1,52 @@ +[%# 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): Erik Stambaugh + #%] + +[%# INTERFACE: + # subject: subject line of message + # alternatives: array of hashes containing: + # type: MIME type + # content: verbatim content + # boundary: a string that has been generated to be a unique boundary + # recipient: user object for the intended recipient of the message + # from: Bugzilla system email address + #%] + +[% PROCESS global/variables.none.tmpl %] + +From: [% from %] +To: [% recipient.login %] +Subject: [[% terms.Bugzilla %]] [% subject %] +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary="[% boundary %]" + + +This is a MIME multipart message. It is possible that your mail program +doesn't quite handle these properly. Some or all of the information in this +message may be unreadable. + + +[% FOREACH part=alternatives %] + +--[% boundary %] +Content-type: [% part.type +%] + +[%+ part.content %] +[%+ END %] diff --git a/template/en/default/whine/schedule.html.tmpl b/template/en/default/whine/schedule.html.tmpl new file mode 100644 index 000000000..60c0f3cd8 --- /dev/null +++ b/template/en/default/whine/schedule.html.tmpl @@ -0,0 +1,406 @@ +[%# 1.0@bugzilla.org %] +[%# -*- mode: html -*- %] +[%# 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): Erik Stambaugh + #%] + +[%# INTERFACE: + # events: hash, keyed by event_id number. Values are anonymous hashes of: + # schedule: array of hashes containing schedule info: + # day: value in day column + # time: value selected in time column + # mailto: recipient's email address + # queries: as with schedule, an anonymous array containing hashes of: + # name: the named query's name + # title: title to be displayed on the results + # sort: integer that sets execution order on named queries + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% title = "Set up whining" %] +[% PROCESS global/header.html.tmpl %] + +

+ "Whining" is when [% terms.Bugzilla %] executes a saved query at a regular interval + and sends the resulting list of [% terms.bugs %] via email. +

+ +

+ To set up a new whine event, click "Add a new event." Enter a subject line + for the message that will be sent, along with a block of text that will + accompany the [% terms.bug %] list in the body of the message. +

+ +

+ Schedules are added to an event by clicking on "Add a new schedule." A schedule + consists of a day, a time of day or interval of times + (e.g., every 15 minutes), and a target email address that may or may not be + alterable, depending on your privileges. Events may have more than one schedule + in order to run at multiple times or for different users. +

+ +

+ Queries come from saved searches, which are created by executing a search, then telling [% terms.Bugzilla %] to remember + the search under a particular name. Add a query by clicking "Add a new + query", and select the desired saved search name under "Search" and add a + title for the [% terms.bug %] table. The optional number entered under + "Sort" will determine the execution order (lowest to highest) if multiple + queries are listed. If you check "One message per [% terms.bug %]," each [% + terms.bug %] that matches the search will be sent in its own email message. +

+ +
+[%# This hidden submit button must be here to set default behavior when + the user presses return on a form input field #%] + + + +[% FOREACH event = events %] + + + + + + + + + + + + + + + + + + [% IF event.value.schedule.size == 0 %] + + + + + + + [% ELSE %] + + + + + + + + [% END %] + + [% IF event.value.queries.size == 0 %] + + + + + + + + [% ELSE %] + + + + + + + + [% END %] + +
+ Event: + + +
+ Email subject line: + + +
+ Descriptive text sent within whine message: + + +
+ Schedule: + + Not scheduled to run
+ +
+ Schedule: + + + + + + [% IF mail_others %] + + [% END %] + + [% FOREACH schedule = event.value.schedule %] + + + + + + [% END %] + + + + + +
+ Interval + + Mail to +
+ + [%# these hidden fields allow us to compare old values instead + of reading the database to tell if a field has changed %] + + + + [% PROCESS day_field val=schedule.day %] + [% PROCESS time_field val=schedule.time %] + + [% IF mail_others %] + + + [% END %] + + +
+ +
+ +
+ Queries: + + No queries
+ +
+ +
+ Queries: + + + + + + + + + + [% FOREACH query = event.value.queries %] + + + + + + + + + + [% END %] + + + + + +
SortSearchTitle
+ + + + + [% PROCESS query_field thisquery=query.name %] + + + + + + + One message per [% terms.bug %] + + +
+ +
+ +
+ +
+ +[% END %] + +

+ +

+ +
+ +[% PROCESS global/footer.html.tmpl %] + +[% BLOCK query_field +%] + + [% IF available_queries.size > 0 %] + + + + [% ELSE %] + Please visit the Search page and save a query + [% END %] + +[%+ END %] + +[% BLOCK day_field +%] + +[%+ END %] + +[% BLOCK time_field +%] + + +[%+ END %] + -- cgit v1.2.3-24-g4f1b