]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 329701: Add flag support to QuickSearch - Patch by Teemu Mannermaa <wicked@sci...
authorlpsolit%gmail.com <>
Thu, 19 Jul 2007 17:26:36 +0000 (17:26 +0000)
committerlpsolit%gmail.com <>
Thu, 19 Jul 2007 17:26:36 +0000 (17:26 +0000)
Bugzilla/Search/Quicksearch.pm
template/en/default/pages/quicksearchhack.html.tmpl

index dfab6369877dd753a9bccaf386c601ad28cf7ae4..e8664005cbd679304880888fc4f87d7b61480e71 100644 (file)
@@ -79,6 +79,11 @@ use constant MAPPINGS => {
                 "keywords" => "keywords",    # no change
                 "kw" => "keywords",
                 "group" => "bug_group",
+                "flag" => "flagtypes.name",
+                "requestee" => "requestees.login_name",
+                "req" => "requestees.login_name",
+                "setter" => "setters.login_name",
+                "set" => "setters.login_name",
                 # Attachments
                 "attachment" => "attachments.description",
                 "attachmentdesc" => "attachments.description",
@@ -270,6 +275,12 @@ sub quicksearch {
                         # votes:xx ("at least xx votes")
                         addChart('votes', 'greaterthan', $1, $negate);
                     }
+                    elsif ($or_operand =~ /^([^\?]+\?)([^\?]*)$/) {
+                        # Flag and requestee shortcut
+                        addChart('flagtypes.name', 'substring', $1, $negate);
+                        $chart++; $and = $or = 0; # Next chart for boolean AND
+                        addChart('requestees.login_name', 'substring', $2, $negate);
+                    }
                     elsif ($or_operand =~ /^([^:]+):([^:]+)$/) {
                         # generic field1,field2,field3:value1,value2 notation
                         my @fields = split(/,/, $1);
@@ -428,6 +439,8 @@ sub splitString {
     foreach (@parts) {
         # Remove quotes
         s/"//g;
+        # Protect plus signs from becoming a blank
+        s/\+/%2B/g;
     }
                         
     return @parts;
index 45b1de07b0de00d96322c67527bb6cd1e727c5f7..87493a576fe1dab922e460da46c79a2cd8aa896a 100644 (file)
   <td>&nbsp;</td>
   <td><tt>group</tt></td>
   <td>&nbsp;</td>
-  <td>Group <i>("bug_group")</i></td>
+  <td>Group</td>
+</tr>
+
+<!-- Flags -->
+
+<tr>
+  <td>&nbsp;</td>
+  <td rowspan="2"><i>flag</i><b>?</b><i>requestee</i></td>
+  <td><tt>flag</tt></td>
+  <td>&nbsp;</td>
+  <td>Flag name and status (+, - or ?)</td>
+</tr>
+<tr>
+  <td>&nbsp;</td>
+  <td><tt>requestee</tt></td>
+  <td><tt>req</tt></td>
+  <td>Flag requestee (login)</td>
+</tr>
+<tr>
+  <td>&nbsp;</td>
+  <td>&nbsp;</td>
+  <td><tt>setter</tt></td>
+  <td><tt>set</tt></td>
+  <td>Flag setter (login)</td>
 </tr>
 
 <!-- Attachments -->
   <td><i>[% terms.bugs %] waiting for your help</i></td>
 </tr>
   -->
+<tr>
+  <td><i>flag</i><b>?</b><i>requestee</i></td>
+  <td><b>flag:</b><i>flag?</i> <b>requestee:</b><i>requestee</i></td>
+</tr>
 </table>
 
 <p>