diff options
author | mark <mark> | 2011-02-18 01:24:45 +0000 |
---|---|---|
committer | mark <mark> | 2011-02-18 01:24:45 +0000 |
commit | 393804c70b9ed1e3acac49011e6e07d12988b960 (patch) | |
tree | 12263eec4744c988acb72a236fe8b81437487c3b /rt | |
parent | 5cb4d011200281328b15ca3e0878c7ecd6f5d0e2 (diff) |
option to include resolved tickets in search, RT#11658
Diffstat (limited to 'rt')
-rw-r--r-- | rt/FREESIDE_MODIFIED | 1 | ||||
-rw-r--r-- | rt/etc/RT_Config.pm.in | 10 | ||||
-rw-r--r-- | rt/lib/RT/Search/Googleish.pm | 12 |
3 files changed, 18 insertions, 5 deletions
diff --git a/rt/FREESIDE_MODIFIED b/rt/FREESIDE_MODIFIED index 60f9c0bb9..6bef539be 100644 --- a/rt/FREESIDE_MODIFIED +++ b/rt/FREESIDE_MODIFIED @@ -26,6 +26,7 @@ lib/RT/Interface/Web_Vendor.pm lib/RT/Interface/Web/Handler.pm #freeside comp_root for dashboard emails lib/RT/Record.pm #and customfield date patch #fix transaction custom fields lib/RT/SavedSearches_Local.pm #saved searches +lib/RT/Search/Googleish.pm #option to include resolved tickets lib/RT/SearchBuilder.pm #need DBIx::SearchBuilder >= 1.36 for Pg 8.1+ lib/RT/Transaction_Overlay.pm #fix transaction custom fields lib/RT/Tickets_Overlay.pm #customfield date patch #SearchCustomerFields #this-month condition diff --git a/rt/etc/RT_Config.pm.in b/rt/etc/RT_Config.pm.in index 6b99b61a5..4fa08949e 100644 --- a/rt/etc/RT_Config.pm.in +++ b/rt/etc/RT_Config.pm.in @@ -1559,6 +1559,16 @@ Use this to set the default units for time entry to hours instead of minutes. Set($DefaultTimeUnitsToHours, 0); +=item C<$SimpleSearchIncludeResolved> + +By default, the simple ticket search in the top bar excludes "resolved" tickets +unless a status argument is specified. Set this to a true value to include +them. + +=cut + +Set($SimpleSearchIncludeResolve, 0); + =back =head1 L<Net::Server> (rt-server) Configuration diff --git a/rt/lib/RT/Search/Googleish.pm b/rt/lib/RT/Search/Googleish.pm index 4b73dd707..4232b434b 100644 --- a/rt/lib/RT/Search/Googleish.pm +++ b/rt/lib/RT/Search/Googleish.pm @@ -176,13 +176,15 @@ sub QueryToSQL { push @queue_clauses, "Queue = '$quoted_queue'"; } + if ( ! @status_clauses + and ! RT->Config->Get('SimpleSearchIncludeResolved') ) { + # implicitly exclude resolved status + @status_clauses = map "Status = '$_'", RT::Queue->ActiveStatusArray(); + } + push @tql_clauses, join( " OR ", sort @id_clauses ); push @tql_clauses, join( " OR ", sort @owner_clauses ); - if ( ! @status_clauses ) { - push @tql_clauses, join( " OR ", map "Status = '$_'", RT::Queue->ActiveStatusArray()); - } else { - push @tql_clauses, join( " OR ", sort @status_clauses ); - } + push @tql_clauses, join( " OR ", sort @status_clauses ); push @tql_clauses, join( " OR ", sort @user_clauses ); push @tql_clauses, join( " OR ", sort @queue_clauses ); @tql_clauses = grep { $_ ? $_ = "( $_ )" : undef } @tql_clauses; |