[Rt-commit] r13279 - in rt/branches/3.8-TESTING: . lib/RT/Search
elacour at bestpractical.com
elacour at bestpractical.com
Fri Jun 13 08:27:52 EDT 2008
Author: elacour
Date: Fri Jun 13 08:27:52 2008
New Revision: 13279
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm
rt/branches/3.8-TESTING/t/ticket/quicksearch.t
Log:
r9522 at datura: manu | 2008-06-13 14:27:46 +0200
Finnaly, limit on ActiveStatuses for every kind of searches except there is a
filter on statuses.
Modified: rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm (original)
+++ rt/branches/3.8-TESTING/lib/RT/Search/Googleish.pm Fri Jun 13 08:27:52 2008
@@ -139,9 +139,6 @@
and $User->Privileged )
{
push @owner_clauses, "Owner = '" . $User->Name . "'";
- if ( ! @status_clauses ) {
- push @tql_clauses, join( " OR ", map "Status = '$_'", RT::Queue->ActiveStatusArray());
- }
}
# Else, subject must contain $key
@@ -162,7 +159,11 @@
push @tql_clauses, join( " OR ", sort @id_clauses );
push @tql_clauses, join( " OR ", sort @owner_clauses );
- push @tql_clauses, join( " OR ", sort @status_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 @user_clauses );
push @tql_clauses, join( " OR ", sort @queue_clauses );
@tql_clauses = grep { $_ ? $_ = "( $_ )" : undef } @tql_clauses;
Modified: rt/branches/3.8-TESTING/t/ticket/quicksearch.t
==============================================================================
--- rt/branches/3.8-TESTING/t/ticket/quicksearch.t (original)
+++ rt/branches/3.8-TESTING/t/ticket/quicksearch.t Fri Jun 13 08:27:52 2008
@@ -32,10 +32,10 @@
TicketsObj => $tickets);
my @tests = (
"General new open root" => "( Owner = 'root' ) AND ( Queue = 'General' ) AND ( Status = 'new' OR Status = 'open' )",
- "fulltext:jesse" => "( Content LIKE 'jesse' )",
- $queue => "( Queue = '$queue' )",
+ "fulltext:jesse" => "( Content LIKE 'jesse' ) AND ( $active_statuses )",
+ $queue => "( Queue = '$queue' ) AND ( $active_statuses )",
"root $queue" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses )",
- "notauser $queue" => "( Queue = '$queue' ) AND ( Subject LIKE 'notauser' )",
+ "notauser $queue" => "( Queue = '$queue' ) AND ( $active_statuses ) AND ( Subject LIKE 'notauser' )",
"notauser $queue root" => "( Owner = 'root' ) AND ( Queue = '$queue' ) AND ( $active_statuses ) AND ( Subject LIKE 'notauser' )");
while (my ($from, $to) = splice @tests, 0, 2) {
More information about the Rt-commit
mailing list