]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Added ability to query by votes.
authorterry%mozilla.org <>
Fri, 8 Oct 1999 21:41:17 +0000 (21:41 +0000)
committerterry%mozilla.org <>
Fri, 8 Oct 1999 21:41:17 +0000 (21:41 +0000)
buglist.cgi
query.cgi

index 29c05a0ac3835ff42feaa775df1ba1f3b1c4976b..43cdea377e3e83df39bc23f4c22f9b68f4919d00 100755 (executable)
@@ -182,6 +182,26 @@ if (defined $::COOKIE{'COLUMNLIST'}) {
     @collist = @::default_column_list;
 }
 
+my $minvotes;
+my $votecolnum;
+if (defined $::FORM{'votes'}) {
+    my $c = trim($::FORM{'votes'});
+    if ($c ne "") {
+        if ($c !~ /^[0-9]*$/) {
+            print "\n\n<P>The 'At least ___ votes' field must be a simple ";
+            print "number. You entered \"$c\", which doesn't cut it.";
+            print "<P>Please click the <B>Back</B> button and try again.\n";
+            exit;
+        }
+        $minvotes = $c;
+        if (! (grep {/^votes$/} @collist)) {
+            push(@collist, 'votes');
+        }
+        $votecolnum = lsearch(\@collist, 'votes');
+    }
+}
+
+
 my $dotweak = defined $::FORM{'tweak'};
 
 if ($dotweak) {
@@ -346,6 +366,7 @@ if (defined $::FORM{'changedin'}) {
     }
 }
 
+
 my $ref = $::MFORM{'chfield'};
 
 
@@ -531,6 +552,11 @@ while (@row = FetchSQLData()) {
                                 # the same group.  If they don't, we leave
                                 # it alone.
     }
+    if (defined $minvotes) {
+        if ($row[$votecolnum] < $minvotes) {
+            next;
+        }
+    }
     if (!defined $seen{$bug_id}) {
         $seen{$bug_id} = 1;
         $count++;
index 5f8d362149b6be52d4fef22ef9818b5815715e5b..b35cdf433abb74353d55abf2ab857e538ec05321 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -68,7 +68,7 @@ foreach my $name ("bug_status", "resolution", "assigned_to", "rep_platform",
                   "emailassigned_to1", "emailcc1", "emailqa_contact1",
                   "email2", "emailtype2", "emailreporter2",
                   "emailassigned_to2", "emailcc2", "emailqa_contact2",
-                  "changedin", "short_desc", "short_desc_type",
+                  "changedin", "votes", "short_desc", "short_desc_type",
                   "long_desc", "long_desc_type", "bug_file_loc",
                   "bug_file_loc_type", "status_whiteboard",
                   "status_whiteboard_type") {
@@ -407,12 +407,22 @@ print "
 </table>
 
 <p>
+
+<table>
+<tr><td colspan=2>
 $emailinput1<p>
+</td></tr><tr><td colspan=2>
 $emailinput2<p>
-
-
-
+</td></tr>
+<tr>
+<td>
 Changed in the <NOBR>last <INPUT NAME=changedin SIZE=2 VALUE=\"$default{'changedin'}\"> days.</NOBR>
+</td>
+<td align=right>
+At <NOBR>least <INPUT NAME=votes SIZE=3 VALUE=\"$default{'votes'}\"> votes.</NOBR>
+</tr>
+</table>
+
 
 <table>
 <tr>