Commit c6f80310 authored by terry%mozilla.org's avatar terry%mozilla.org

Added the ability for users to "vote" on which bugs they think should

be fixed.
parent 12d85f8f
...@@ -10,6 +10,13 @@ query the CVS tree. For example, ...@@ -10,6 +10,13 @@ query the CVS tree. For example,
will tell you what has been changed in the last week. will tell you what has been changed in the last week.
10/7/99 Added voting ability. You must run the new script
"makevotestable.sh". You must also feed the following to mysql:
alter table products add column votesperuser smallint not null;
9/15/99 Apparently, newer alphas of MySQL won't allow you to have 9/15/99 Apparently, newer alphas of MySQL won't allow you to have
"when" as a column name. So, I have had to rename a column in the "when" as a column name. So, I have had to rename a column in the
bugs_activity table. You must feed the below to mysql or you won't bugs_activity table. You must feed the below to mysql or you won't
......
...@@ -282,6 +282,7 @@ command. Order does not matter, but this one is fine: ...@@ -282,6 +282,7 @@ command. Order does not matter, but this one is fine:
./makeproducttable.sh ./makeproducttable.sh
./makeprofilestable.sh ./makeprofilestable.sh
./makeversiontable.sh ./makeversiontable.sh
./makevotestable.sh
You may want to edit the scripts; once bugs are entered it gets very hard to You may want to edit the scripts; once bugs are entered it gets very hard to
make changes. Think carefully about how you want database users to describe bugs. Here's one make changes. Think carefully about how you want database users to describe bugs. Here's one
......
...@@ -111,7 +111,7 @@ my $id = $::FORM{'id'}; ...@@ -111,7 +111,7 @@ my $id = $::FORM{'id'};
my $query = " my $query = "
select select
bug_id, bugs.bug_id,
product, product,
version, version,
rep_platform, rep_platform,
...@@ -130,10 +130,12 @@ select ...@@ -130,10 +130,12 @@ select
status_whiteboard, status_whiteboard,
date_format(creation_ts,'Y-m-d'), date_format(creation_ts,'Y-m-d'),
groupset, groupset,
delta_ts delta_ts,
from bugs sum(votes.count)
where bug_id = $id from bugs left join votes using(bug_id)
and bugs.groupset & $::usergroupset = bugs.groupset"; where bugs.bug_id = $id
and bugs.groupset & $::usergroupset = bugs.groupset
group by bugs.bug_id";
SendSQL($query); SendSQL($query);
my %bug; my %bug;
...@@ -145,7 +147,7 @@ if (@row = FetchSQLData()) { ...@@ -145,7 +147,7 @@ if (@row = FetchSQLData()) {
"bug_severity", "component", "assigned_to", "reporter", "bug_severity", "component", "assigned_to", "reporter",
"bug_file_loc", "short_desc", "target_milestone", "bug_file_loc", "short_desc", "target_milestone",
"qa_contact", "status_whiteboard", "creation_ts", "qa_contact", "status_whiteboard", "creation_ts",
"groupset", "delta_ts") { "groupset", "delta_ts", "votes") {
$bug{$field} = shift @row; $bug{$field} = shift @row;
if (!defined $bug{$field}) { if (!defined $bug{$field}) {
$bug{$field} = ""; $bug{$field} = "";
...@@ -368,6 +370,16 @@ if (Param("usedependencies")) { ...@@ -368,6 +370,16 @@ if (Param("usedependencies")) {
print "</tr></table>\n"; print "</tr></table>\n";
} }
if ($::prodmaxvotes{$bug{'product'}}) {
print qq{
<table><tr>
<th><a href="votehelp.html">Votes</a> for bug $id:</th><td>
<a href="showvotes.cgi?bug_id=$id">$bug{'votes'}</a>
&nbsp;&nbsp;&nbsp;<a href="showvotes.cgi?voteon=$id">Vote for this bug</a>
</td></tr></table>
};
}
print " print "
<br> <br>
<B>Additional Comments:</B> <B>Additional Comments:</B>
......
...@@ -173,6 +173,7 @@ DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version"); ...@@ -173,6 +173,7 @@ DefCol("version", "substring(bugs.version, 1, 5)", "Vers", "bugs.version");
DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys"); DefCol("os", "substring(bugs.op_sys, 1, 4)", "OS", "bugs.op_sys");
DefCol("target_milestone", "bugs.target_milestone", "TargetM", DefCol("target_milestone", "bugs.target_milestone", "TargetM",
"bugs.target_milestone"); "bugs.target_milestone");
DefCol("votes", "sum(votes.count)", "Votes", "sum(votes.count)");
my @collist; my @collist;
if (defined $::COOKIE{'COLUMNLIST'}) { if (defined $::COOKIE{'COLUMNLIST'}) {
...@@ -208,11 +209,12 @@ bugs.bug_status"; ...@@ -208,11 +209,12 @@ bugs.bug_status";
$query .= " $query .= "
from bugs, from bugs left join votes using(bug_id),
profiles assign, profiles assign,
profiles report profiles report
left join profiles qacont on bugs.qa_contact = qacont.userid, left join profiles qacont on bugs.qa_contact = qacont.userid,
versions projector versions projector
where bugs.assigned_to = assign.userid where bugs.assigned_to = assign.userid
and bugs.reporter = report.userid and bugs.reporter = report.userid
and bugs.product = projector.program and bugs.product = projector.program
...@@ -226,7 +228,7 @@ if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) || ...@@ -226,7 +228,7 @@ if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) ||
# We need to poke into the CC table. Do weird SQL left join stuff so that # We need to poke into the CC table. Do weird SQL left join stuff so that
# we can look in the CC table, but won't reject any bugs that don't have # we can look in the CC table, but won't reject any bugs that don't have
# any CC fields. # any CC fields.
$query =~ s/bugs,/bugs left join cc using (bug_id) left join profiles ccname on cc.who = ccname.userid,/; $query =~ s/bugs left join,/bugs left join cc using (bug_id) left join profiles ccname on cc.who = ccname.userid left join,/;
} }
if (defined $::FORM{'sql'}) { if (defined $::FORM{'sql'}) {
...@@ -431,6 +433,8 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc", ...@@ -431,6 +433,8 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc",
} }
$query .= "group by bugs.bug_id\n";
if (defined $::FORM{'order'} && $::FORM{'order'} ne "") { if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
$query .= "order by "; $query .= "order by ";
ORDER: for ($::FORM{'order'}) { ORDER: for ($::FORM{'order'}) {
......
...@@ -83,6 +83,8 @@ On which of these bugs would you like email notification of changes?</td> ...@@ -83,6 +83,8 @@ On which of these bugs would you like email notification of changes?</td>
<input type=submit value=Submit> <input type=submit value=Submit>
</form> </form>
<hr> <hr>
<a href=\"showvotes.cgi\">Review your votes</a>
<hr>
"; ";
navigation_header(); navigation_header();
exit; exit;
......
...@@ -31,7 +31,7 @@ print "Content-type: text/html\n"; ...@@ -31,7 +31,7 @@ print "Content-type: text/html\n";
my @masterlist = ("opendate", "changeddate", "severity", "priority", my @masterlist = ("opendate", "changeddate", "severity", "priority",
"platform", "owner", "reporter", "status", "resolution", "platform", "owner", "reporter", "status", "resolution",
"component", "product", "version", "project", "os"); "component", "product", "version", "project", "os", "votes");
if (Param("usetargetmilestone")) { if (Param("usetargetmilestone")) {
push(@masterlist, "target_milestone"); push(@masterlist, "target_milestone");
......
...@@ -339,5 +339,20 @@ DefParam("emailsuffix", ...@@ -339,5 +339,20 @@ DefParam("emailsuffix",
""); "");
DefParam("voteremovedmail",
q{This is a mail message to send to anyone who gets a vote removed from a bug for any reason. %to% gets replaced by a comma-separated list of people who used to be voting for this bug. %bugid% gets replaced by the bug number. %reason% gets replaced by a short reason describing why the vote was removed. %<i>anythingelse</i>% gets replaced by the definition of thatparameter (as defined on this page).},
"l",
"From: bugzilla-daemon
To: %to%
Subject: [Bug %bugid%] Your vote has been removed from this bug
You used to have a vote on bug %bugid%, but it has been removed.
Reason: %reason%
%urlbase%show_bug.cgi?id=%bugid%
");
1; 1;
...@@ -96,12 +96,12 @@ GetVersionTable(); ...@@ -96,12 +96,12 @@ GetVersionTable();
my $prodcode = "P000"; my $prodcode = "P000";
foreach my $product (@::legal_product) { foreach my $product (@::legal_product) {
SendSQL("select description, milestoneurl, disallownew from products where product='$product'"); SendSQL("select description, milestoneurl, disallownew, votesperuser from products where product='$product'");
my @row = FetchSQLData(); my @row = FetchSQLData();
if (!@row) { if (!@row) {
next; next;
} }
my ($description, $milestoneurl, $disallownew) = (@row); my ($description, $milestoneurl, $disallownew, $votesperuser) = (@row);
$prodcode++; $prodcode++;
Check($product, $::FORM{"prodcode-$prodcode"}); Check($product, $::FORM{"prodcode-$prodcode"});
...@@ -111,6 +111,7 @@ foreach my $product (@::legal_product) { ...@@ -111,6 +111,7 @@ foreach my $product (@::legal_product) {
DoOne($milestoneurl, "$prodcode-milestoneurl", $where); DoOne($milestoneurl, "$prodcode-milestoneurl", $where);
} }
DoOne($disallownew, "$prodcode-disallownew", $where); DoOne($disallownew, "$prodcode-disallownew", $where);
DoOne($votesperuser, "$prodcode-votesperuser", $where);
SendSQL("select value, initialowner, initialqacontact, description from components where program=" . SqlQuote($product) . " order by value"); SendSQL("select value, initialowner, initialqacontact, description from components where program=" . SqlQuote($product) . " order by value");
my $c = 0; my $c = 0;
......
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
require "CGI.pl";
confirm_login();
print "Content-type: text/html\n\n";
ConnectToDatabase();
GetVersionTable();
my $who = DBNameToIdAndCheck($::COOKIE{'Bugzilla_login'});
if ($who ne $::FORM{'who'}) {
PutHeader("Wrong login.");
print "The login info got confused. If you want to adjust the votes\n";
print "for <tt>$::COOKIE{'Bugzilla_login'}</tt>, then please\n";
print "<a href=showvotes.cgi?user=$who>click here</a>.<hr>\n";
navigation_header();
exit();
}
my @buglist = grep {/^\d+$/} keys(%::FORM);
if (0 == @buglist) {
PutHeader("Oops?");
print "Something got confused. Please click <b>Back</b> and try again.";
navigation_header();
exit();
}
foreach my $id (@buglist) {
$::FORM{$id} = trim($::FORM{$id});
if ($::FORM{$id} !~ /\d+/ || $::FORM{$id} < 0) {
PutHeader("Numbers only, please");
print "Only use numeric values for your bug votes.\n";
print "Please click <b>Back</b> and try again.<hr>\n";
navigation_header();
exit();
}
}
SendSQL("select bug_id, product from bugs where bug_id = " .
join(" or bug_id = ", @buglist));
my %prodcount;
while (MoreSQLData()) {
my ($id, $prod) = (FetchSQLData());
if (!defined $prodcount{$prod}) {
$prodcount{$prod} = 0;
}
$prodcount{$prod} += $::FORM{$id};
}
foreach my $prod (keys(%prodcount)) {
if ($prodcount{$prod} > $::prodmaxvotes{$prod}) {
PutHeader("Don't overstuff!", "Illegal vote");
print "You may only use $::prodmaxvotes{$prod} votes for bugs in the\n";
print "<tt>$prod</tt> product, but you are using $prodcount{$prod}.\n";
print "Please click <b>Back</b> and try again.<hr>\n";
navigation_header();
exit();
}
}
SendSQL("delete from votes where who = $who");
foreach my $id (@buglist) {
if ($::FORM{$id} > 0) {
SendSQL("insert into votes (who, bug_id, count) values ($who, $id, $::FORM{$id})");
}
}
PutHeader("Voting tabulated", "Voting tabulated", $::COOKIE{'Bugzilla_login'});
print "Your votes have been recorded.\n";
print qq{<p><a href="showvotes.cgi?user=$who">Review your votes</a><hr>\n};
navigation_header();
exit();
...@@ -59,12 +59,12 @@ GetVersionTable(); ...@@ -59,12 +59,12 @@ GetVersionTable();
my $prodcode = "P000"; my $prodcode = "P000";
foreach my $product (@::legal_product) { foreach my $product (@::legal_product) {
SendSQL("select description, milestoneurl, disallownew from products where product='$product'"); SendSQL("select description, milestoneurl, disallownew, votesperuser from products where product='$product'");
my @row = FetchSQLData(); my @row = FetchSQLData();
if (!@row) { if (!@row) {
next; next;
} }
my ($description, $milestoneurl, $disallownew) = (@row); my ($description, $milestoneurl, $disallownew, $votesperuser) = (@row);
$prodcode++; $prodcode++;
print "<input type=hidden name=prodcode-$prodcode value=\"" . print "<input type=hidden name=prodcode-$prodcode value=\"" .
value_quote($product) . "\">\n"; value_quote($product) . "\">\n";
...@@ -77,6 +77,9 @@ foreach my $product (@::legal_product) { ...@@ -77,6 +77,9 @@ foreach my $product (@::legal_product) {
print "<td><input size=80 name=$prodcode-milestoneurl value=\"" . print "<td><input size=80 name=$prodcode-milestoneurl value=\"" .
value_quote($milestoneurl) . "\"></td></tr>\n"; value_quote($milestoneurl) . "\"></td></tr>\n";
} }
print qq{<tr><th align=right>Maximum votes per user:</th><td>\n};
print qq{<input size=10 name=$prodcode-votesperuser value=$votesperuser>};
print qq{</td></tr>\n};
my $check0 = !$disallownew ? " SELECTED" : ""; my $check0 = !$disallownew ? " SELECTED" : "";
my $check1 = $disallownew ? " SELECTED" : ""; my $check1 = $disallownew ? " SELECTED" : "";
print "<tr><td colspan=2><select name=$prodcode-disallownew>\n"; print "<tr><td colspan=2><select name=$prodcode-disallownew>\n";
......
...@@ -236,9 +236,9 @@ sub GenerateVersionTable { ...@@ -236,9 +236,9 @@ sub GenerateVersionTable {
my $dotargetmilestone = Param("usetargetmilestone"); my $dotargetmilestone = Param("usetargetmilestone");
my $mpart = $dotargetmilestone ? ", milestoneurl" : ""; my $mpart = $dotargetmilestone ? ", milestoneurl" : "";
SendSQL("select product, description, disallownew$mpart from products"); SendSQL("select product, description, votesperuser, disallownew$mpart from products");
while (@line = FetchSQLData()) { while (@line = FetchSQLData()) {
my ($p, $d, $dis, $u) = (@line); my ($p, $d, $votesperuser, $dis, $u) = (@line);
$::proddesc{$p} = $d; $::proddesc{$p} = $d;
if ($dis) { if ($dis) {
# Special hack. Stomp on the description and make it "0" if we're # Special hack. Stomp on the description and make it "0" if we're
...@@ -249,6 +249,7 @@ sub GenerateVersionTable { ...@@ -249,6 +249,7 @@ sub GenerateVersionTable {
if ($dotargetmilestone) { if ($dotargetmilestone) {
$::milestoneurl{$p} = $u; $::milestoneurl{$p} = $u;
} }
$::prodmaxvotes{$p} = $votesperuser;
} }
...@@ -300,6 +301,7 @@ sub GenerateVersionTable { ...@@ -300,6 +301,7 @@ sub GenerateVersionTable {
print FID GenerateCode('@::legal_' . $i); print FID GenerateCode('@::legal_' . $i);
} }
print FID GenerateCode('%::proddesc'); print FID GenerateCode('%::proddesc');
print FID GenerateCode('%::prodmaxvotes');
if ($dotargetmilestone) { if ($dotargetmilestone) {
my $last = Param("nummilestones"); my $last = Param("nummilestones");
...@@ -515,6 +517,29 @@ sub UserInGroup { ...@@ -515,6 +517,29 @@ sub UserInGroup {
} }
sub RemoveVotes {
my ($id, $reason) = (@_);
ConnectToDatabase();
SendSQL("select profiles.login_name from votes, profiles where votes.bug_id = $id and profiles.userid = votes.who");
my @list;
while (MoreSQLData()) {
push(@list, FetchOneColumn());
}
if (0 < @list) {
if (open(SENDMAIL, "|/usr/lib/sendmail -t")) {
my %substs;
$substs{"to"} = join(',', @list);
$substs{"bugid"} = $id;
$substs{"reason"} = $reason;
print SENDMAIL PerformSubsts(Param("voteremovedmail"), \%substs);
close SENDMAIL;
}
SendSQL("delete from votes where bug_id = $id");
}
}
sub Param { sub Param {
my ($value) = (@_); my ($value) = (@_);
if (defined $::param{$value}) { if (defined $::param{$value}) {
......
...@@ -31,7 +31,8 @@ create table products ( ...@@ -31,7 +31,8 @@ create table products (
product tinytext, product tinytext,
description mediumtext, description mediumtext,
milestoneurl tinytext not null, milestoneurl tinytext not null,
disallownew tinyint not null disallownew tinyint not null,
votesperuser smallint not null
); );
......
#!/bin/sh
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
use bugs;
drop table votes;
OK_ALL_DONE
mysql << OK_ALL_DONE
use bugs;
create table votes (
who mediumint not null,
bug_id mediumint not null,
count smallint not null,
index(who),
index(bug_id)
);
...@@ -303,7 +303,7 @@ sub LogDependencyActivity { ...@@ -303,7 +303,7 @@ sub LogDependencyActivity {
foreach my $id (@idlist) { foreach my $id (@idlist) {
my %dependencychanged; my %dependencychanged;
SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write"); SendSQL("lock tables bugs write, bugs_activity write, cc write, profiles write, dependencies write, votes write");
my @oldvalues = SnapShotBug($id); my @oldvalues = SnapShotBug($id);
if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) { if (defined $::FORM{'delta_ts'} && $::FORM{'delta_ts'} ne $delta_ts) {
...@@ -490,6 +490,10 @@ The changes made were: ...@@ -490,6 +490,10 @@ The changes made were:
$old = DBID_to_name($old) if $old != 0; $old = DBID_to_name($old) if $old != 0;
$new = DBID_to_name($new) if $new != 0; $new = DBID_to_name($new) if $new != 0;
} }
if ($col eq 'product') {
RemoveVotes($id,
"This bug has been moved to a different product");
}
$col = SqlQuote($col); $col = SqlQuote($col);
$old = SqlQuote($old); $old = SqlQuote($old);
$new = SqlQuote($new); $new = SqlQuote($new);
......
...@@ -190,6 +190,10 @@ sub GetBugText { ...@@ -190,6 +190,10 @@ sub GetBugText {
my @cclist; my @cclist;
@cclist = split(/,/, ShowCcList($id)); @cclist = split(/,/, ShowCcList($id));
SendSQL("select profiles.login_name from votes, profiles where votes.bug_id = $id and profiles.userid = votes.who");
while (MoreSQLData()) {
push(@cclist, FetchOneColumn());
}
$::bug{'cclist'} = \@cclist; $::bug{'cclist'} = \@cclist;
......
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are Copyright (C) 1998
# Netscape Communications Corporation. All Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
use diagnostics;
use strict;
require "CGI.pl";
if (defined $::FORM{'voteon'} || (!defined $::FORM{'bug_id'} &&
!defined $::FORM{'user'})) {
confirm_login();
ConnectToDatabase();
$::FORM{'user'} = DBNameToIdAndCheck($::COOKIE{'Bugzilla_login'});
}
print "Content-type: text/html\n\n";
if (defined $::FORM{'bug_id'}) {
my $id = $::FORM{'bug_id'};
my $linkedid = qq{<a href="show_bug.cgi?id=$id">$id</a>};
PutHeader("Show votes", "Show votes", "Bug $linkedid");
ConnectToDatabase();
SendSQL("select profiles.login_name, votes.who, votes.count from votes, profiles where votes.bug_id = " . SqlQuote($id) . " and profiles.userid = votes.who");
print "<table>\n";
print "<tr><th>Who</th><th>Number of votes</th></tr>\n";
my $sum = 0;
while (MoreSQLData()) {
my ($name, $userid, $count) = (FetchSQLData());
print qq{<tr><td><a href="showvotes.cgi?user=$userid">$name</a></td><td align=right>$count</td></tr>\n};
$sum += $count;
}
print "</table>";
print "<p>Total votes: $sum<p>\n";
} elsif (defined $::FORM{'user'}) {
ConnectToDatabase();
quietly_check_login();
GetVersionTable();
my $who = $::FORM{'user'};
my $name = DBID_to_name($who);
PutHeader("Show votes", "Show votes", $name);
print qq{<form action="doeditvotes.cgi">\n};
print "<table><tr><td></td><th>Bug \#</th><th>Summary</th><th>Votes</th></tr>\n";
SendSQL("lock tables bugs read, votes write");
if (defined($::FORM{'voteon'})) {
# Oh, boy, what a hack. Make sure there is an entry for this bug
# in the vote table, just so that things display right.
# Yuck yuck yuck.###
SendSQL("select votes.count from votes where votes.bug_id = $::FORM{'voteon'} and votes.who = $who");
if (!MoreSQLData()) {
SendSQL("insert into votes (who, bug_id, count) values ($who, $::FORM{'voteon'}, 0)");
}
}
my $canedit = (defined $::COOKIE{'Bugzilla_login'} &&
$::COOKIE{'Bugzilla_login'} eq $name);
foreach my $product (sort(keys(%::prodmaxvotes))) {
if ($::prodmaxvotes{$product} <= 0) {
next;
}
my $qprod = value_quote($product);
SendSQL("select votes.bug_id, votes.count, bugs.short_desc, bugs.bug_status from votes, bugs where votes.who = $who and votes.bug_id = bugs.bug_id and bugs.product = " . SqlQuote($product) . "order by votes.bug_id");
my $sum = 0;
print "<tr><th>$product</th></tr>";
while (MoreSQLData()) {
my ($id, $count, $summary, $status) = (FetchSQLData());
my $opened = ($status eq "NEW" || $status eq "ASSIGNED" ||
$status eq "REOPENED");
my $strike = $opened ? "" : "<strike>";
my $endstrike = $opened ? "" : "</strike>";
$summary = html_quote($summary);
$sum += $count;
if ($canedit) {
$count = "<input name=$id value=$count size=5>";
}
print qq{
<tr>
<td></td>
<td><a href="showvotes.cgi?bug_id=$id">$id</a></td>
<td><a href="show_bug.cgi?id=$id">$strike$summary$endstrike</a></td>
<td align=right>$count</td>
</tr>
};
}
my $plural = (($sum == 1) ? "" : "s");
print "<td colspan=3>$sum vote$plural used out of\n";
print "$::prodmaxvotes{$product} allowed.</td>\n";
}
print "</table>\n";
if ($canedit) {
print qq{<input type=submit value="Submit">\n};
print "<br>To change your votes, type in new numbers (using zero to\n";
print "mean no votes), and then click <b>Submit</b>.\n";
}
print "<input type=hidden name=who value=$who>";
print "</form>\n";
SendSQL("delete from votes where count <= 0");
SendSQL("unlock tables");
}
print qq{<a href="votehelp.html">Help! I don't understand this voting stuff</a>};
navigation_header();
...@@ -48,5 +48,10 @@ To vote for a bug: ...@@ -48,5 +48,10 @@ To vote for a bug:
may rebalance your votes as necessary. may rebalance your votes as necessary.
</ul> </ul>
You will automatically get email notifying you of any changes that
occur on bugs you vote for.
<p>
You may review your votes at any time by clicking on the "Change your You may review your votes at any time by clicking on the "Change your
password or preferences" link at the bottom of the query page. password or preferences" link at the bottom of the query page.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment