[Rt-commit] r9883 - in rt/branches/3.6-RELEASE: .
sartak at bestpractical.com
sartak at bestpractical.com
Tue Dec 11 08:41:42 EST 2007
Author: sartak
Date: Tue Dec 11 08:41:42 2007
New Revision: 9883
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT/Search/Googleish.pm
Log:
r48889 at onn: sartak | 2007-12-11 08:41:35 -0500
Allow the caller of Googleish searches to choose what queues go into the query
Modified: rt/branches/3.6-RELEASE/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Search/Googleish.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/Search/Googleish.pm Tue Dec 11 08:41:42 2007
@@ -74,6 +74,16 @@
use base qw(RT::Search::Generic);
+# sub _Init {{{
+sub _Init {
+ my $self = shift;
+ my %args = @_;
+
+ $self->{'Queues'} = delete($args{'Queues'}) || [];
+ $self->SUPER::_Init(%args);
+}
+# }}}
+
# {{{ sub Describe
sub Describe {
my $self = shift;
@@ -141,6 +151,13 @@
}
}
+ # restrict to any queues requested by the caller
+ for my $queue (@{ $self->{'Queues'} }) {
+ my $QueueObj = RT::Queue->new($self->TicketsObj->CurrentUser);
+ $QueueObj->Load($queue) or next;
+ push @queue_clauses, "Queue = '" . $QueueObj->Name . "'";
+ }
+
push @tql_clauses, join( " OR ", sort @id_clauses );
push @tql_clauses, join( " OR ", sort @owner_clauses );
push @tql_clauses, join( " OR ", sort @status_clauses );
More information about the Rt-commit
mailing list