]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
New email code wasn't sending to people who had voted for a bug.
authorterry%mozilla.org <>
Mon, 24 Jan 2000 13:41:36 +0000 (13:41 +0000)
committerterry%mozilla.org <>
Mon, 24 Jan 2000 13:41:36 +0000 (13:41 +0000)
Added "My votes" link to footer.  Other minor voting-related fixes.

CGI.pl
changepassword.cgi
editproducts.cgi
globals.pl
processmail

diff --git a/CGI.pl b/CGI.pl
index 8770da7489d368d40f4b96a2fb8030cb99bb7371..93c5d544f0405c3f76b8521349d7f678ba2ed65b 100644 (file)
--- 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{ | <A HREF="showvotes.cgi">My votes</A>};
+        }
         my $mybugsurl = PerformSubsts($mybugstemplate, \%substs);
         $html = $html . " | <a href='$mybugsurl'>My bugs</a>";
     }
index 5922a1e03a1a65a9ef8b211411a35b6ef9048533..ca533b1eeb17c12bc11059c2cd1ea9557c9aa137 100755 (executable)
 
 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<br>other preferences",
               $::COOKIE{'Bugzilla_login'});
@@ -98,10 +106,10 @@ risk any bugs), check here.</td>
 <hr>
 <input type=submit value=Submit>
 </form>
-<hr>
-<a href=\"showvotes.cgi\">Review your votes</a>
-<hr>
-";
+<hr>";
+    if ($::anyvotesallowed) {
+        print qq{<a href="showvotes.cgi">Review your votes</a><hr>\n};
+    }
     PutFooter();
     exit;
 }
index f3c1bbabd8916dbc08ca1aab8a883c40a3ffab6b..e9c5f9f354a06c14b4faae3809059b3a4a7e7b48 100755 (executable)
@@ -689,9 +689,9 @@ if ($action eq 'update') {
                  SET program='$product'
                  WHERE program=" . SqlQuote($productold));
 
-        unlink "data/versioncache";
         print "Updated product name.<BR>\n";
     }
+    unlink "data/versioncache";
     SendSQL("UNLOCK TABLES");
 
     PutTrailer($localtrailer);
index 0eab73d63d8f6ab98d2d5be95fa6f0e2f6a4f787..b8f390537bbb16043c0fc6542536566e632bae58 100644 (file)
@@ -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");
index 7441232efe2ccfd0a767c25a86abd938a8f7c2bd..d814107083a99a388fbfcde6b3dd4aa35c6f4ac7 100755 (executable)
@@ -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}) {