From ca924726d8e692458088267aa5fb36848654fabd Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Mon, 24 Jan 2000 13:41:36 +0000 Subject: 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. --- CGI.pl | 6 ++++++ changepassword.cgi | 16 ++++++++++++---- editproducts.cgi | 2 +- globals.pl | 5 +++++ processmail | 9 ++++++++- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/CGI.pl b/CGI.pl index 8770da748..93c5d544f 100644 --- a/CGI.pl +++ b/CGI.pl @@ -846,6 +846,12 @@ sub GetCommandMenu { my $mybugstemplate = Param("mybugstemplate"); my %substs; $substs{'userid'} = $::COOKIE{"Bugzilla_login"}; + if (!defined $::anyvotesallowed) { + GetVersionTable(); + } + if ($::anyvotesallowed) { + $html .= qq{ | My votes}; + } my $mybugsurl = PerformSubsts($mybugstemplate, \%substs); $html = $html . " | My bugs"; } diff --git a/changepassword.cgi b/changepassword.cgi index 5922a1e03..ca533b1ee 100755 --- a/changepassword.cgi +++ b/changepassword.cgi @@ -22,10 +22,18 @@ require "CGI.pl"; + +sub sillyness { + my $zz; + $zz = $::anyvotesallowed; +} + confirm_login(); print "Content-type: text/html\n\n"; +GetVersionTable(); + if (! defined $::FORM{'pwd1'}) { PutHeader("Preferences", "Change your password and
other preferences", $::COOKIE{'Bugzilla_login'}); @@ -98,10 +106,10 @@ risk any bugs), check here.
-
-Review your votes -
-"; +
"; + if ($::anyvotesallowed) { + print qq{Review your votes
\n}; + } PutFooter(); exit; } diff --git a/editproducts.cgi b/editproducts.cgi index f3c1bbabd..e9c5f9f35 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -689,9 +689,9 @@ if ($action eq 'update') { SET program='$product' WHERE program=" . SqlQuote($productold)); - unlink "data/versioncache"; print "Updated product name.
\n"; } + unlink "data/versioncache"; SendSQL("UNLOCK TABLES"); PutTrailer($localtrailer); diff --git a/globals.pl b/globals.pl index 0eab73d63..b8f390537 100644 --- a/globals.pl +++ b/globals.pl @@ -280,6 +280,7 @@ sub GenerateVersionTable { my $mpart = $dotargetmilestone ? ", milestoneurl" : ""; SendSQL("select product, description, votesperuser, disallownew$mpart from products"); + $::anyvotesallowed = 0; while (@line = FetchSQLData()) { my ($p, $d, $votesperuser, $dis, $u) = (@line); $::proddesc{$p} = $d; @@ -293,6 +294,9 @@ sub GenerateVersionTable { $::milestoneurl{$p} = $u; } $::prodmaxvotes{$p} = $votesperuser; + if ($votesperuser > 0) { + $::anyvotesallowed = 1; + } } @@ -345,6 +349,7 @@ sub GenerateVersionTable { } print FID GenerateCode('%::proddesc'); print FID GenerateCode('%::prodmaxvotes'); + print FID GenerateCode('$::anyvotesallowed'); if ($dotargetmilestone) { my $last = Param("nummilestones"); diff --git a/processmail b/processmail index 7441232ef..d81410708 100755 --- a/processmail +++ b/processmail @@ -357,7 +357,13 @@ sub NewProcessOneBug { } my ($start, $end) = (@row); $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{'reporter'} = DBID_to_name($values{'reporter'}); @@ -453,6 +459,7 @@ sub NewProcessOneBug { my $count = 0; for my $person ($values{'assigned_to'}, $values{'reporter'}, split(/,/, $values{'cc'}), + @voterlist, @forcecc) { $count++; if ($seen{$person}) { -- cgit v1.2.3-24-g4f1b