[Rt-commit] r9896 - in rt/branches/3.6-EXPERIMENTAL-ABERDEEN: .
html/Search lib/RT/Search
audreyt at bestpractical.com
audreyt at bestpractical.com
Tue Dec 11 17:55:17 EST 2007
Author: audreyt
Date: Tue Dec 11 17:55:16 2007
New Revision: 9896
Modified:
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/ (props changed)
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Simple.html
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Widgets/SelectionBox
rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Search/Googleish.pm
Log:
r18176 at T (orig r9879): sartak | 2007-12-11 21:13:27 +0800
r48883 at onn: sartak | 2007-12-11 08:13:12 -0500
Add a NoArrows option to selectionbox, for when order doesn't matter
r18179 at T (orig r9882): sartak | 2007-12-11 21:37:35 +0800
r48885 at onn: sartak | 2007-12-11 08:37:30 -0500
Add an optional Clear button to SelectionBox
r18180 at T (orig r9883): sartak | 2007-12-11 21:41:42 +0800
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
r18181 at T (orig r9884): sartak | 2007-12-11 21:58:39 +0800
r48891 at onn: sartak | 2007-12-11 08:58:32 -0500
Add some callbacks to Simple Search
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Simple.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Simple.html (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Search/Simple.html Tue Dec 11 17:55:16 2007
@@ -51,6 +51,8 @@
Title => $title
&>
+<& /Elements/Callback, _CallbackName => 'PreForm', %ARGS &>
+
<div id="SimpleSearchForm">
<form action="Simple.html" method="get">
@@ -64,6 +66,11 @@
<div align="center">
<input name="q" size="60" /><input type="submit" class="button" value="<&|/l&>Search</&>" />
</div>
+
+</form>
+
+<& /Elements/Callback, _CallbackName => 'PostForm', %ARGS &>
+
</div>
<%INIT>
@@ -78,8 +85,15 @@
if ($q =~ /^(\d+)$/) {
RT::Interface::Web::Redirect($RT::WebURL."/Ticket/Display.html?id=".$q);
}
- my $search = RT::Search::Googleish->new(Argument => $q,
- TicketsObj => $tickets);
+
+ my %args = (
+ Argument => $q,
+ TicketsObj => $tickets,
+ );
+
+ $m->comp('/Elements/Callback', %ARGS, _CallbackName => 'SearchArgs', args => \%args);
+
+ my $search = RT::Search::Googleish->new(%args);
$m->comp( "Results.html", Query => $search->QueryToSQL() );
$m->comp( "/Elements/Footer" );
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Widgets/SelectionBox
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Widgets/SelectionBox (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/html/Widgets/SelectionBox Tue Dec 11 17:55:16 2007
@@ -146,6 +146,10 @@
}
}
+ if ($ARGS{clear}) {
+ $current = [];
+ }
+
$self->{Current} = $current;
}
@@ -201,9 +205,14 @@
><% $self->{_item_map}{$_} %></option>
% }
</select>
+% unless ($ARGS{'NoArrows'}) {
<input name="moveup" type="submit" class="button" value=" ↑ " />
<input name="movedown" type="submit" class="button" value=" ↓ " />
+% }
<input name="remove" type="submit" class="button" value="<&|/l&>Delete</&>" />
+% if ($ARGS{'Clear'}) {
+ <input name="clear" type="submit" class="button" value="<&|/l&>Clear</&>" />
+% }
% my $caption = "";
% unless ($self->{'AutoSave'}) {
Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Search/Googleish.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Search/Googleish.pm (original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Search/Googleish.pm Tue Dec 11 17:55:16 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