summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-06 01:26:09 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-06 01:26:09 +0200
commitd74d76b0730621b09571775902899d7030ca3150 (patch)
treedfeb8f80dc10cd0e25e0c7ae89f8dd48677db9b6 /extensions
parent3b351275ab6f8090620234dd2b3ee8a9ef72e599 (diff)
downloadbugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.gz
bugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.xz
Bug 556429: Stop sending bugmail from inside the template
r=LpSolit, a=LpSolit
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Voting/Extension.pm11
-rw-r--r--extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl2
2 files changed, 11 insertions, 2 deletions
diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm
index 5a1cc518e..5d455ad36 100644
--- a/extensions/Voting/Extension.pm
+++ b/extensions/Voting/Extension.pm
@@ -29,6 +29,7 @@ use strict;
use base qw(Bugzilla::Extension);
use Bugzilla::Bug;
+use Bugzilla::BugMail;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Field;
@@ -614,10 +615,12 @@ sub _update_votes {
$dbh->bz_commit_transaction();
$vars->{'type'} = "votes";
- $vars->{'mailrecipients'} = { 'changer' => $user->login };
$vars->{'title_tag'} = 'change_votes';
foreach my $bug_id (@updated_bugs) {
$vars->{'id'} = $bug_id;
+ $vars->{'sent_bugmail'} =
+ Bugzilla::BugMail::Send($bug_id, { 'changer' => $user->login });
+
$template->process("bug/process/results.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
# Set header_done to 1 only after the first bug.
@@ -723,6 +726,12 @@ sub _modify_bug_votes {
foreach my $msg (@msgs) {
MessageToMTA($msg);
}
+ # And send out emails about changed bugs
+ foreach my $bug_id (@updated_bugs) {
+ my $sent_bugmail = Bugzilla::BugMail::Send(
+ $bug_id, { changer => Bugzilla->user->login });
+ $changes->{'confirmed_bugs_sent_bugmail'}->{$bug_id} = $sent_bugmail;
+ }
}
# If a bug is moved to a product which allows less votes per bug
diff --git a/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl
index 876c51187..139fc641b 100644
--- a/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl
+++ b/extensions/Voting/template/en/default/hook/admin/products/updated-changes.html.tmpl
@@ -89,8 +89,8 @@
overwritten, which happens otherwise %]
[% INCLUDE bug/process/results.html.tmpl
type = 'votes'
- mailrecipients = { 'changer' => user.login }
header_done = 1
+ sent_bugmail = changes.confirmed_bugs_sent_bugmail.$id
id = id
%]
[% END %]