Commit 33f63df5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 329701: Add flag support to QuickSearch - Patch by Teemu Mannermaa <wicked@sci.fi> r/a=LpSolit

parent d1579114
......@@ -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;
......
......@@ -242,7 +242,30 @@
<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 -->
......@@ -373,6 +396,10 @@
<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>
......
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