diff options
author | bbaetz%student.usyd.edu.au <> | 2002-07-10 09:05:34 +0200 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-07-10 09:05:34 +0200 |
commit | fd4ff1a62c3c65dcb88589e708dc3be5738f7890 (patch) | |
tree | ef53ec9b3be5bf6e5f83f6eb786f29e0b7b8650d | |
parent | 2a609ad58ffde7e3b03b3fb576c0012e99beba55 (diff) | |
download | bugzilla-fd4ff1a62c3c65dcb88589e708dc3be5738f7890.tar.gz bugzilla-fd4ff1a62c3c65dcb88589e708dc3be5738f7890.tar.xz |
Bug 150829 - 'My Votes' link missing from footer
r=myk, jouni
-rw-r--r-- | bug_form.pl | 3 | ||||
-rw-r--r-- | defparams.pl | 5 | ||||
-rw-r--r-- | globals.pl | 7 | ||||
-rwxr-xr-x | sidebar.cgi | 5 | ||||
-rw-r--r-- | template/en/default/global/useful-links.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/sidebar.xul.tmpl | 2 |
6 files changed, 9 insertions, 16 deletions
diff --git a/bug_form.pl b/bug_form.pl index db09d8d58..65c7b41c1 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 9fe4c186e..5ce6ea203 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 <a href=\"editproducts.cgi\">the product edit page</a>.", + "b", + 1); + DefParam("usebugaliases", "Do you wish to use bug aliases, which allow you to assign bugs an easy-to-remember name by which you can refer to them?", diff --git a/globals.pl b/globals.pl index a2b4e68be..31bed4f06 100644 --- a/globals.pl +++ b/globals.pl @@ -469,7 +469,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; @@ -480,9 +479,6 @@ sub GenerateVersionTable { $::milestoneurl{$p} = $u; } $::prodmaxvotes{$p} = $votesperuser; - if ($votesperuser > 0) { - $::anyvotesallowed = 1; - } } my $cols = LearnAboutColumns("bugs"); @@ -551,7 +547,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 @@ -1763,8 +1758,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 a7e0587f5..2805547cf 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 6027dc503..987ca370b 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 @@ <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> diff --git a/template/en/default/sidebar.xul.tmpl b/template/en/default/sidebar.xul.tmpl index 65af4de4c..cab1270af 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 %] <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 %] |