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/lib | |
parent | 5cb4d011200281328b15ca3e0878c7ecd6f5d0e2 (diff) |
option to include resolved tickets in search, RT#11658
Diffstat (limited to 'rt/lib')
-rw-r--r-- | rt/lib/RT/Search/Googleish.pm | 12 |
1 files changed, 7 insertions, 5 deletions
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; |