From: bbaetz%student.usyd.edu.au <> Date: Wed, 10 Jul 2002 07:05:51 +0000 (+0000) Subject: Bug 150829 - 'My Votes' link missing from footer X-Git-Tag: bugzilla-2.16~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f8b259459404caf11243792cd74e965a70e520d;p=thirdparty%2Fbugzilla.git Bug 150829 - 'My Votes' link missing from footer r=myk, jouni --- diff --git a/bug_form.pl b/bug_form.pl index 755e4464a9..14e9147bac 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -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) { diff --git a/defparams.pl b/defparams.pl index 2ba6a31c53..d5c41dc601 100644 --- a/defparams.pl +++ b/defparams.pl @@ -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 the product edit page.", + "b", + 1); + DefParam("webdotbase", "It is possible to show graphs of dependent bugs. You may set this parameter to any of the following: diff --git a/globals.pl b/globals.pl index ec66fccc86..aeaaca25f6 100644 --- a/globals.pl +++ b/globals.pl @@ -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; diff --git a/sidebar.cgi b/sidebar.cgi index a7e0587f58..2805547cfe 100755 --- a/sidebar.cgi +++ b/sidebar.cgi @@ -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 " . diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 1409fc9a73..cd8b231c3d 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -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 @@ Reports - [% IF user.login AND use_votes %] + [% IF user.login && Param('usevotes') %] | My Votes [% END %] diff --git a/template/en/default/sidebar.xul.tmpl b/template/en/default/sidebar.xul.tmpl index 65af4de4c9..cab1270afa 100644 --- a/template/en/default/sidebar.xul.tmpl +++ b/template/en/default/sidebar.xul.tmpl @@ -93,7 +93,7 @@ function normal_keypress_handler( aEvent ) { [%- IF mybugsurl %] [%- END %] - [%- IF anyvotesallowed %] + [%- IF Param('usevotes') %] [%- END %]