diff options
author | Byron Jones <glob@mozilla.com> | 2015-05-28 08:34:27 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-05-28 08:34:27 +0200 |
commit | 236be0474b114ea15a57d61d3be5931a612fb155 (patch) | |
tree | 7f5d7f2da7c5a184d79deb2d01a5bf69db582a09 /extensions | |
parent | 0b80f6942caf44670ef7c22e074b185720521db5 (diff) | |
download | bugzilla-236be0474b114ea15a57d61d3be5931a612fb155.tar.gz bugzilla-236be0474b114ea15a57d61d3be5931a612fb155.tar.xz |
Bug 1168826: only include requests someone is waiting on in the manager's "watching" emails
Diffstat (limited to 'extensions')
4 files changed, 9 insertions, 40 deletions
diff --git a/extensions/RequestNagger/bin/send-request-nags.pl b/extensions/RequestNagger/bin/send-request-nags.pl index e2d746f78..ae8d8fd3f 100755 --- a/extensions/RequestNagger/bin/send-request-nags.pl +++ b/extensions/RequestNagger/bin/send-request-nags.pl @@ -57,6 +57,7 @@ Bugzilla->switch_to_shadow_db(); # send nags to requestees send_nags( + reports => [ 'requestee' ], requestee_sql => REQUESTEE_NAG_SQL, setter_sql => SETTER_NAG_SQL, template => 'user', @@ -65,6 +66,7 @@ send_nags( # send nags to watchers send_nags( + reports => [ 'requestee', 'setter' ], requestee_sql => WATCHING_REQUESTEE_NAG_SQL, setter_sql => WATCHING_SETTER_NAG_SQL, template => 'watching', @@ -73,12 +75,11 @@ send_nags( sub send_nags { my (%args) = @_; - my @reports = qw( requestee setter ); my $requests = {}; # get requests - foreach my $report (@reports) { + foreach my $report (@{ $args{reports} }) { # collate requests my $rows = $dbh->selectall_arrayref($args{$report . '_sql'}, { Slice => {} }); @@ -140,6 +141,7 @@ sub send_nags { recipient_id => $recipient_id, template => $args{template}, date => $args{date}, + reports => $args{reports}, requests => $requests->{$recipient_id}, }; my ($fh, $filename) = tempfile(); @@ -184,7 +186,7 @@ sub _include_request { sub _send_email { my ($params) = @_; - my @reports = qw( requestee setter ); + my @reports = @{ $params->{reports} }; my $recipient_id = $params->{recipient_id}; my $requests = $params->{requests}; my $watching = $params->{template} eq 'watching'; diff --git a/extensions/RequestNagger/template/en/default/email/request_nagging-user-header.txt.tmpl b/extensions/RequestNagger/template/en/default/email/request_nagging-user-header.txt.tmpl index 6bb9e997b..199d03d66 100644 --- a/extensions/RequestNagger/template/en/default/email/request_nagging-user-header.txt.tmpl +++ b/extensions/RequestNagger/template/en/default/email/request_nagging-user-header.txt.tmpl @@ -14,12 +14,6 @@ From: [% Param('mailfrom') %] To: [% recipient.email %] -Subject: [[% terms.Bugzilla %]] Overdue Requests - [% IF summary.requestee %] - (Of you: [% summary.requestee %]) - [% END %] - [% IF summary.setter %] - (By you: [% summary.setter %]) - [% END %] +Subject: [[% terms.Bugzilla %]] Overdue Requests ([% summary.requestee %]) Date: [% date %] X-Bugzilla-Type: nag diff --git a/extensions/RequestNagger/template/en/default/email/request_nagging-user.html.tmpl b/extensions/RequestNagger/template/en/default/email/request_nagging-user.html.tmpl index 9aeb73f61..976d78be5 100644 --- a/extensions/RequestNagger/template/en/default/email/request_nagging-user.html.tmpl +++ b/extensions/RequestNagger/template/en/default/email/request_nagging-user.html.tmpl @@ -9,7 +9,6 @@ [% PROCESS "global/field-descs.none.tmpl"; requestee = requests.item(recipient.login).requestee; - setter = requests.item(recipient.login).setter; summary = requests.item(recipient.login).summary; types = requests.item(recipient.login).types; %] @@ -23,21 +22,9 @@ <body bgcolor="#ffffff"> -[% IF requestee.size %] - <h3>Overdue requests requiring action from you:</h3> - <div>[% summary.requestee FILTER html %]</div> - [% PROCESS requests report="requestee" requests=requestee %] -[% END %] - -[% IF requestee.size && setter.size %] - <hr> -[% END %] - -[% IF setter.size %] - <h3>Overdue requests you have requested:</h3> - <div>[% summary.setter FILTER html %]</div> - [% PROCESS requests report="setter" requests=setter %] -[% END %] +<h3>Overdue requests requiring action from you:</h3> +<div>[% summary.requestee FILTER html %]</div> +[% PROCESS requests report="requestee" requests=requestee %] [% BLOCK requests %] [% FOREACH type IN types.item(report) %] diff --git a/extensions/RequestNagger/template/en/default/email/request_nagging-user.txt.tmpl b/extensions/RequestNagger/template/en/default/email/request_nagging-user.txt.tmpl index 5138f5f00..87121216d 100644 --- a/extensions/RequestNagger/template/en/default/email/request_nagging-user.txt.tmpl +++ b/extensions/RequestNagger/template/en/default/email/request_nagging-user.txt.tmpl @@ -9,28 +9,14 @@ [% PROCESS "global/field-descs.none.tmpl"; requestee = requests.item(recipient.login).requestee; - setter = requests.item(recipient.login).setter; summary = requests.item(recipient.login).summary; types = requests.item(recipient.login).types; %] -[% IF requestee.size %] Overdue requests requiring action from you: [%+ summary.requestee %] [%+ PROCESS requests report="requestee" request_list=requestee %] -[% END %] - -[% IF requestee.size && setter.size %] -- -[% END %] - -[% IF setter.size %] -Overdue requests you have requested: -[%+ summary.setter %] - -[%+ PROCESS requests report="setter" request_list=setter %] -[% END %] [% BLOCK requests %] [% FOREACH type IN types.item(report) %] |