diff options
author | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-02-25 07:53:30 +0100 |
commit | 0bd92669e6bd6cde59e85cbf9e827feb94d2536c (patch) | |
tree | a8fd330947eddfe0b18dbd5e6a1280384821168f /editproducts.cgi | |
parent | 80db88c9d89fe963ab407304849a3cd452fe1bef (diff) | |
download | bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.gz bugzilla-0bd92669e6bd6cde59e85cbf9e827feb94d2536c.tar.xz |
Bug 328449: Remove BugMail::MessageToMTA() from Bug::RemoveVotes() - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'editproducts.cgi')
-rwxr-xr-x | editproducts.cgi | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/editproducts.cgi b/editproducts.cgi index d9ebcedd9..dc288a54b 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -23,7 +23,7 @@ # Dawn Endico <endico@mozilla.org> # Joe Robins <jmrobins@tgix.com> # Gavin Shelley <bugzilla@chimpychompy.org> -# Fr��ic Buclin <LpSolit@gmail.com> +# Frédéric Buclin <LpSolit@gmail.com> # Greg Hendricks <ghendricks@novell.com> # Lance Larsh <lance.larsh@oracle.com> # @@ -39,6 +39,7 @@ require "globals.pl"; use Bugzilla::Bug; use Bugzilla::Series; use Bugzilla::Config qw(:DEFAULT $datadir); +use Bugzilla::BugMail; use Bugzilla::Product; use Bugzilla::Classification; use Bugzilla::Milestone; @@ -899,9 +900,15 @@ if ($action eq 'update') { foreach my $vote (@$votes) { my ($who, $id) = (@$vote); - RemoveVotes($id, $who, "The rules for voting on this product " . - "has changed;\nyou had too many votes " . - "for a single bug."); + # If some votes are removed, RemoveVotes() returns a list + # of messages to send to voters. + my $msgs = + RemoveVotes($id, $who, "The rules for voting on this product " . + "has changed;\nyou had too many votes " . + "for a single bug."); + foreach my $msg (@$msgs) { + Bugzilla::BugMail::MessageToMTA($msg); + } my $name = DBID_to_name($who); push(@toomanyvotes_list, @@ -945,10 +952,16 @@ if ($action eq 'update') { undef, ($product->id, $who)); foreach my $bug_id (@$bug_ids) { - RemoveVotes($bug_id, $who, "The rules for voting on this " . - "product has changed; you had " . - "too many\ntotal votes, so all " . - "votes have been removed."); + # RemoveVotes() returns a list of messages to send + # in case some voters had too many votes. + my $msgs = + RemoveVotes($bug_id, $who, "The rules for voting on this " . + "product has changed; you had " . + "too many\ntotal votes, so all " . + "votes have been removed."); + foreach my $msg (@$msgs) { + Bugzilla::BugMail::MessageToMTA($msg); + } my $name = DBID_to_name($who); push(@toomanytotalvotes_list, |