From 26367637b952a2d27f2145c2a580b4c174cf3d35 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 7 Mar 2017 09:41:17 -0500 Subject: [PATCH] Bug 1343530 - Make the ALL quicksearch keywords show all results --- Bugzilla/Search/Quicksearch.pm | 9 ++++++++- template/en/default/pages/quicksearch.html.tmpl | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index 31d8e2b2a..4f11a3f54 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -350,6 +350,10 @@ sub _handle_status_and_resolution { my (%states, %resolutions); $bug_status_set = 1; + if ($word =~ s/^(ALL|OPEN)\+$/$1/) { + Bugzilla->cgi->param('limit' => 0); + } + if ($word eq 'OPEN') { $states{$_} = 1 foreach BUG_STATE_OPEN; } @@ -620,9 +624,12 @@ sub _matches_phrase { # Expand found prefixes to states or resolutions sub matchPrefixes { my ($hr_states, $hr_resolutions, $word, $ar_check_states) = @_; - return unless $word =~ /^[A-Z_]+(,[A-Z_]+)*$/; + return unless $word =~ /^[A-Z_]+(,[A-Z_]+)*\+?$/; my @ar_prefixes = split(/,/, $word); + if ($ar_prefixes[-1] =~ s/\+$//) { + Bugzilla->cgi->param(limit => 0); + } my $ar_check_resolutions = get_legal_field_values('resolution'); my $foundMatch = 0; diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl index a3359752f..759f4ea8c 100644 --- a/template/en/default/pages/quicksearch.html.tmpl +++ b/template/en/default/pages/quicksearch.html.tmpl @@ -297,7 +297,8 @@ in that status will be searched. ALL is a special shortcut that means "all statuses". OPEN is a special shortcut that means - "all open statuses". + "all open statuses". Adding a '+' to the end of a status name will + set the result limit to 0. @@ -307,7 +308,9 @@ resolution, or even an abbreviation of any resolution, and [%+ terms.bugs %] with that resolution will be searched. For example, making FIX the first word of your search will find all - [%+ terms.bugs %] with a resolution of FIXED . + [%+ terms.bugs %] with a resolution of FIXED. + Adding a '+' to the end of a resolution name will set the result limit + to 0. [% field_descs.priority FILTER html %] -- 2.47.3