summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>1999-10-08 08:54:47 +0200
committerterry%mozilla.org <>1999-10-08 08:54:47 +0200
commitc6f80310afc00cf7d5114e638cbaaefde3914da0 (patch)
tree6bdaf2497180648d821f3a91e320b6c80b29de23 /globals.pl
parent12d85f8fa42b7130608531ea61b287e9fa822125 (diff)
downloadbugzilla-c6f80310afc00cf7d5114e638cbaaefde3914da0.tar.gz
bugzilla-c6f80310afc00cf7d5114e638cbaaefde3914da0.tar.xz
Added the ability for users to "vote" on which bugs they think should
be fixed.
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl29
1 files changed, 27 insertions, 2 deletions
diff --git a/globals.pl b/globals.pl
index 4f5b9a226..ccb0e8167 100644
--- a/globals.pl
+++ b/globals.pl
@@ -236,9 +236,9 @@ sub GenerateVersionTable {
my $dotargetmilestone = Param("usetargetmilestone");
my $mpart = $dotargetmilestone ? ", milestoneurl" : "";
- SendSQL("select product, description, disallownew$mpart from products");
+ SendSQL("select product, description, votesperuser, disallownew$mpart from products");
while (@line = FetchSQLData()) {
- my ($p, $d, $dis, $u) = (@line);
+ my ($p, $d, $votesperuser, $dis, $u) = (@line);
$::proddesc{$p} = $d;
if ($dis) {
# Special hack. Stomp on the description and make it "0" if we're
@@ -249,6 +249,7 @@ sub GenerateVersionTable {
if ($dotargetmilestone) {
$::milestoneurl{$p} = $u;
}
+ $::prodmaxvotes{$p} = $votesperuser;
}
@@ -300,6 +301,7 @@ sub GenerateVersionTable {
print FID GenerateCode('@::legal_' . $i);
}
print FID GenerateCode('%::proddesc');
+ print FID GenerateCode('%::prodmaxvotes');
if ($dotargetmilestone) {
my $last = Param("nummilestones");
@@ -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 {
my ($value) = (@_);
if (defined $::param{$value}) {