diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-06 01:26:09 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-06 01:26:09 +0200 |
commit | d74d76b0730621b09571775902899d7030ca3150 (patch) | |
tree | dfeb8f80dc10cd0e25e0c7ae89f8dd48677db9b6 /extensions/Voting/Extension.pm | |
parent | 3b351275ab6f8090620234dd2b3ee8a9ef72e599 (diff) | |
download | bugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.gz bugzilla-d74d76b0730621b09571775902899d7030ca3150.tar.xz |
Bug 556429: Stop sending bugmail from inside the template
r=LpSolit, a=LpSolit
Diffstat (limited to 'extensions/Voting/Extension.pm')
-rw-r--r-- | extensions/Voting/Extension.pm | 11 |
1 files changed, 10 insertions, 1 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 |