Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Trouble editing whine.txt.tmpl - What variables can I use?

6 views
Skip to first unread message

Clyde Jones

unread,
Jun 23, 2009, 7:30:16 PM6/23/09
to support-...@lists.mozilla.org
Hi
I am trying to modify the whine template
(en\default\email\whine.txt.tmpl ) to add the product to the listing of
new bugs, but I cannot seem to find the variable to use. I tried the
suggestion in
http://www.archivum.info/mozilla.support.bugzilla/2007-11/msg00261.html
. I tried [% product %] and a few other variations.

With this as a template

===========================================


[% PROCESS "global/field-descs.none.tmpl" %]
From: [% Param("mailfrom") %]
To: [% email %][% Param("emailsuffix") %]
Subject: [[% terms.Bugzilla %] ] You have [% get_status("NEW") %] or [%
get_status("REOPENED") %] [%+ terms.bug %]
X-Bugzilla-Type: whine

[This e-mail has been automatically generated.]

All of these [% terms.bugs %] are in the [% get_status("NEW") %] or
[% get_status("REOPENED") %] state, and have not been
touched in [% Param("whinedays") %] days or more.

Please mark your [% terms.bug %](s) [% get_resolution("INVALID") %],
reassign it or use the "Accept [% terms.bug %]" command.

A current list of your [% terms.bug %] is here:

[% urlbase
%]buglist.cgi?bug_status=NEW&bug_status=REOPENED&assigned_to=[% email %]

Below are the URLs for [% get_status("NEW") %] [%+ terms.bugs %]
that haven't been touched for [% Param("whinedays") %] days or more.

You will get this message once a day until you've dealt with these [%
terms.bugs %]!

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = =

Product - Bug ID - Summary - Link
[% FOREACH bug = bugs %]

------------------------------------------------------------------------
----------
|
| [% bug.id %] - [% bug.product %] - [% bug.summary %] -- [% urlbase
%]show_bug.cgi?id=[% bug.id %]
|
[% END %]

------------------------------------------------------------------------
----------
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = =

Thank You
The Management :)


===========================================
I get this

Below are the URLs for NEW bugs that haven't been touched for 7 days or
more.

You will get this message once a day until you've dealt with these bugs!

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = =

Product - Bug ID - Summary - Link

------------------------------------------------------------------------
----------
|
| 101 - - Be able to set protocols as unconfigured --
http://bug/show_bug.cgi?id=101
|

------------------------------------------------------------------------
----------
|
| 373 - - Exclusion of an individual compound/batch result --
http://bug/show_bug.cgi?id=373
|

--
Clyde Jones
R&D Informatics
Senior Operations Developer
cjo...@exelixis.com
Exelixis Inc
650 837 7085 Office
650 228 4699 Cell

This email (including any attachments) may contain material
that is confidential and privileged and is for the sole use of
the intended recipient. Any review, reliance or distribution by
others or forwarding without express permission is strictly
prohibited. If you are not the intended recipient, please
contact the sender and delete all copies.
Exelixis, Inc. reserves the right, to the extent and under
circumstances permitted by applicable law, to retain, monitor
and intercept e-mail messages to and from its systems.

Tosh, Michael J

unread,
Jun 24, 2009, 10:33:03 AM6/24/09
to Clyde Jones, support-...@lists.mozilla.org
Clyde Jones wrote:
> Hi
> I am trying to modify the whine template
> (en\default\email\whine.txt.tmpl ) to add the product to the listing
of
> new bugs, but I cannot seem to find the variable to use. I tried the
> suggestion in
>
http://www.archivum.info/mozilla.support.bugzilla/2007-11/msg00261.html
> . I tried [% product %] and a few other variations.


Take a look here at line 43, it defines which fields are actually
retrieved from the db.
http://mxr.mozilla.org/bugzilla3.2/source/whineatnews.pl#43

You have two options, 1: add a join to products to select product name.
You will then need to grab the product down in the foreach statement at
line 80 or so.

SELECT bug_id, short_desc, login_name
+++ , p.name AS product
FROM bugs
INNER JOIN profiles
ON userid = assigned_to
+++ INNER JOIN products AS p
+++ ON bugs.product_id = p.id
WHERE ...

Option 2: Convert the bugids to bug objects down a little further,
around line 83:

72 foreach my $email (sort (keys %bugs)) {
73 my $user = new Bugzilla::User({name => $email});
74 next if $user->email_disabled;
75
76 my $vars = {'email' => $email};
77
++ my @bugids = map($_->id, @{$bugs{$email}});
78 my @bugs = Bugzilla::Bug->new_from_list($@bugids);
--
-- (remove this whole foreach statement to line 84)
--
--
--
--
85 $vars->{'bugs'} = \@bugs;


I'd prefer option 2.

0 new messages