]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 150829 - 'My Votes' link missing from footer
authorbbaetz%student.usyd.edu.au <>
Wed, 10 Jul 2002 07:05:51 +0000 (07:05 +0000)
committerbbaetz%student.usyd.edu.au <>
Wed, 10 Jul 2002 07:05:51 +0000 (07:05 +0000)
r=myk, jouni

bug_form.pl
defparams.pl
globals.pl
sidebar.cgi
template/en/default/global/useful-links.html.tmpl
template/en/default/sidebar.xul.tmpl

index 755e4464a92ba173c31e364451873f4f92dad2a5..14e9147bac98446b5f67d51c9641daf6cbef4a54 100644 (file)
@@ -157,7 +157,8 @@ sub show_bug {
     $bug{'milestoneurl'} = $::milestoneurl{$bug{'product'}} || 
                            "notargetmilestone.html";
 
-    $vars->{'use_votes'} = $::prodmaxvotes{$bug{'product'}};
+    $vars->{'use_votes'} = Param('usevotes')
+                           && $::prodmaxvotes{$bug{'product'}} > 0;
 
     # Add additional, calculated fields to the bug hash
     if (@::legal_keywords) {
index 2ba6a31c5323a6c94361bac7acf11dfcd61a56b0..d5c41dc601f820419d53424ef68c1cc9239fc3c0 100644 (file)
@@ -400,6 +400,11 @@ DefParam("usedependencies",
          "b",
          1);
 
+DefParam("usevotes",
+         "Do you wish to allow users to vote for bugs? Note that in order for this to be effective, you will have to change the maximum votes allowed in a product to be non-zero in <a href=\"editproducts.cgi\">the product edit page</a>.",
+         "b",
+         1);
+
 DefParam("webdotbase",
          "It is possible to show graphs of dependent bugs. You may set this parameter to
 any of the following:
index ec66fccc867b9deacf72e2d4571b10740f70e757..aeaaca25f6f562a8506fd0f6da03d3260b8f0a91 100644 (file)
@@ -470,7 +470,6 @@ sub GenerateVersionTable {
 
     my $mpart = $dotargetmilestone ? ", milestoneurl" : "";
     SendSQL("select product, description, votesperuser, disallownew$mpart from products ORDER BY product");
-    $::anyvotesallowed = 0;
     while (@line = FetchSQLData()) {
         my ($p, $d, $votesperuser, $dis, $u) = (@line);
         $::proddesc{$p} = $d;
@@ -481,9 +480,6 @@ sub GenerateVersionTable {
             $::milestoneurl{$p} = $u;
         }
         $::prodmaxvotes{$p} = $votesperuser;
-        if ($votesperuser > 0) {
-            $::anyvotesallowed = 1;
-        }
     }
             
     my $cols = LearnAboutColumns("bugs");
@@ -552,7 +548,6 @@ sub GenerateVersionTable {
     print FID GenerateCode('%::proddesc');
     print FID GenerateCode('@::enterable_products');
     print FID GenerateCode('%::prodmaxvotes');
-    print FID GenerateCode('$::anyvotesallowed');
 
     if ($dotargetmilestone) {
         # reading target milestones in from the database - matthew@zeroknowledge.com
@@ -1765,8 +1760,6 @@ $::vars =
     
     # User Agent - useful for detecting in templates
     'user_agent' => $ENV{'HTTP_USER_AGENT'} ,
-    
-    'use_votes' => $::anyvotesallowed,
   };
 
 1;
index a7e0587f58d3d44264ee6b6cd1020c378379de96..2805547cfeb7ac06f8ff919d9fec7e8f1f8f09c3 100755 (executable)
@@ -23,7 +23,6 @@ require "CGI.pl";
 
 # Shut up "Used Only Once" errors
 use vars qw(
-  $anyvotesallowed
   $template
   $vars
 );
@@ -31,15 +30,11 @@ use vars qw(
 ConnectToDatabase();
 quietly_check_login();
 
-# Needed for $::anyvotesallowed
-GetVersionTable();
-
 ###############################################################################
 # Main Body Execution
 ###############################################################################
 
 $vars->{'username'} = $::COOKIE{'Bugzilla_login'} || '';
-$vars->{'anyvotesallowed'} = $::anyvotesallowed;
 
 if (defined $::COOKIE{'Bugzilla_login'}) {
     SendSQL("SELECT mybugslink, userid, blessgroupset FROM profiles " .
index 1409fc9a73ed080bdaa1a98d4a8eef8835886eb0..cd8b231c3d909cbcc343a6604b5f545e09b830f5 100644 (file)
@@ -30,7 +30,6 @@
   #     The keys used in this template are
   #     tweakparams, editcomponents, creategroups, editkeywords, confirm,
   #     editbugs, editusers. 
-  # use_votes: boolean. True if we are using votes.
   #%]
 
 [%# Migration note: this whole file corresponds to the old %commandmenu% 
@@ -52,7 +51,7 @@
         
         <a href="reports.cgi">Reports</a> 
        
-        [% IF user.login AND use_votes %]
+        [% IF user.login && Param('usevotes') %]
           | <a href="votes.cgi?action=show_user">My Votes</a>
         [% END %]      
       </td>
index 65af4de4c951eac8d91ba668d600c1c881d43e3f..cab1270afadcf370027e6221f0e7d2b3daad0c5b 100644 (file)
@@ -93,7 +93,7 @@ function normal_keypress_handler( aEvent ) {
   [%- IF mybugsurl %]
       <text class="text-link" onclick="load_relative_url('[% mybugsurl FILTER html %]')" value="my bugs"/>
   [%- END %]
-  [%- IF anyvotesallowed %]
+  [%- IF Param('usevotes') %]
       <text class="text-link" onclick="load_relative_url('votes.cgi?action=show_user')" value="my votes"/>
   [%- END %]