Commit ca924726 authored by terry%mozilla.org's avatar terry%mozilla.org

New email code wasn't sending to people who had voted for a bug.

Added "My votes" link to footer. Other minor voting-related fixes.
parent a240c91d
...@@ -846,6 +846,12 @@ sub GetCommandMenu { ...@@ -846,6 +846,12 @@ sub GetCommandMenu {
my $mybugstemplate = Param("mybugstemplate"); my $mybugstemplate = Param("mybugstemplate");
my %substs; my %substs;
$substs{'userid'} = $::COOKIE{"Bugzilla_login"}; $substs{'userid'} = $::COOKIE{"Bugzilla_login"};
if (!defined $::anyvotesallowed) {
GetVersionTable();
}
if ($::anyvotesallowed) {
$html .= qq{ | <A HREF="showvotes.cgi">My votes</A>};
}
my $mybugsurl = PerformSubsts($mybugstemplate, \%substs); my $mybugsurl = PerformSubsts($mybugstemplate, \%substs);
$html = $html . " | <a href='$mybugsurl'>My bugs</a>"; $html = $html . " | <a href='$mybugsurl'>My bugs</a>";
} }
......
...@@ -22,10 +22,18 @@ ...@@ -22,10 +22,18 @@
require "CGI.pl"; require "CGI.pl";
sub sillyness {
my $zz;
$zz = $::anyvotesallowed;
}
confirm_login(); confirm_login();
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
GetVersionTable();
if (! defined $::FORM{'pwd1'}) { if (! defined $::FORM{'pwd1'}) {
PutHeader("Preferences", "Change your password and<br>other preferences", PutHeader("Preferences", "Change your password and<br>other preferences",
$::COOKIE{'Bugzilla_login'}); $::COOKIE{'Bugzilla_login'});
...@@ -98,10 +106,10 @@ risk any bugs), check here.</td> ...@@ -98,10 +106,10 @@ risk any bugs), check here.</td>
<hr> <hr>
<input type=submit value=Submit> <input type=submit value=Submit>
</form> </form>
<hr> <hr>";
<a href=\"showvotes.cgi\">Review your votes</a> if ($::anyvotesallowed) {
<hr> print qq{<a href="showvotes.cgi">Review your votes</a><hr>\n};
"; }
PutFooter(); PutFooter();
exit; exit;
} }
......
...@@ -689,9 +689,9 @@ if ($action eq 'update') { ...@@ -689,9 +689,9 @@ if ($action eq 'update') {
SET program='$product' SET program='$product'
WHERE program=" . SqlQuote($productold)); WHERE program=" . SqlQuote($productold));
unlink "data/versioncache";
print "Updated product name.<BR>\n"; print "Updated product name.<BR>\n";
} }
unlink "data/versioncache";
SendSQL("UNLOCK TABLES"); SendSQL("UNLOCK TABLES");
PutTrailer($localtrailer); PutTrailer($localtrailer);
......
...@@ -280,6 +280,7 @@ sub GenerateVersionTable { ...@@ -280,6 +280,7 @@ sub GenerateVersionTable {
my $mpart = $dotargetmilestone ? ", milestoneurl" : ""; my $mpart = $dotargetmilestone ? ", milestoneurl" : "";
SendSQL("select product, description, votesperuser, disallownew$mpart from products"); SendSQL("select product, description, votesperuser, disallownew$mpart from products");
$::anyvotesallowed = 0;
while (@line = FetchSQLData()) { while (@line = FetchSQLData()) {
my ($p, $d, $votesperuser, $dis, $u) = (@line); my ($p, $d, $votesperuser, $dis, $u) = (@line);
$::proddesc{$p} = $d; $::proddesc{$p} = $d;
...@@ -293,6 +294,9 @@ sub GenerateVersionTable { ...@@ -293,6 +294,9 @@ sub GenerateVersionTable {
$::milestoneurl{$p} = $u; $::milestoneurl{$p} = $u;
} }
$::prodmaxvotes{$p} = $votesperuser; $::prodmaxvotes{$p} = $votesperuser;
if ($votesperuser > 0) {
$::anyvotesallowed = 1;
}
} }
...@@ -345,6 +349,7 @@ sub GenerateVersionTable { ...@@ -345,6 +349,7 @@ sub GenerateVersionTable {
} }
print FID GenerateCode('%::proddesc'); print FID GenerateCode('%::proddesc');
print FID GenerateCode('%::prodmaxvotes'); print FID GenerateCode('%::prodmaxvotes');
print FID GenerateCode('$::anyvotesallowed');
if ($dotargetmilestone) { if ($dotargetmilestone) {
my $last = Param("nummilestones"); my $last = Param("nummilestones");
......
...@@ -358,6 +358,12 @@ sub NewProcessOneBug { ...@@ -358,6 +358,12 @@ sub NewProcessOneBug {
my ($start, $end) = (@row); my ($start, $end) = (@row);
$values{'cc'} = ShowCcList($id); $values{'cc'} = ShowCcList($id);
my @voterlist;
SendSQL("SELECT profiles.login_name FROM votes, profiles " .
"WHERE votes.bug_id = $id AND profiles.userid = votes.who");
while (MoreSQLData()) {
push(@voterlist, FetchOneColumn());
}
$values{'assigned_to'} = DBID_to_name($values{'assigned_to'}); $values{'assigned_to'} = DBID_to_name($values{'assigned_to'});
$values{'reporter'} = DBID_to_name($values{'reporter'}); $values{'reporter'} = DBID_to_name($values{'reporter'});
...@@ -453,6 +459,7 @@ sub NewProcessOneBug { ...@@ -453,6 +459,7 @@ sub NewProcessOneBug {
my $count = 0; my $count = 0;
for my $person ($values{'assigned_to'}, $values{'reporter'}, for my $person ($values{'assigned_to'}, $values{'reporter'},
split(/,/, $values{'cc'}), split(/,/, $values{'cc'}),
@voterlist,
@forcecc) { @forcecc) {
$count++; $count++;
if ($seen{$person}) { if ($seen{$person}) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment