[Rt-commit] r4734 - in rtir/branches/1.9-EXPERIMENTAL:
html/RTIR/Search/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Mon Mar 13 14:56:39 EST 2006
Author: ruz
Date: Mon Mar 13 14:56:37 2006
New Revision: 4734
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ProcessQuery
Log:
r934 at cubic-pc: cubic | 2006-03-13 23:02:00 +0300
r926 at cubic-pc: cubic | 2006-03-13 18:22:20 +0300
* Parse BaseQuery in order to fetch queues list, it's hackish, but
we really need to switch to RT's parser
* queues was put into hash with quotes
* ResultPage arg may contain arguments allready, we should add check that
and use correct separator
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ProcessQuery
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ProcessQuery (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Search/Elements/ProcessQuery Mon Mar 13 14:56:37 2006
@@ -128,6 +128,12 @@
my @options;
$Query = "";
+{ #XXX: Parser BaseQuery to get Queues
+ my $tree;
+ ParseQuery( $BaseQuery, \$tree, [] );
+ build_array( \$BaseQuery, -1, $tree, [], $queues );
+}
+
# Build the optionlist from the tree, so we can do additions and movements based on it
$$optionlist = build_array( \$Query, $ARGS{clauses}, $tree, \@options, $queues );
@@ -329,7 +335,9 @@
$str .= $clause->{Key} . " " . $clause->{Op} . " " . $clause->{Value};
if ( $clause->{Key} eq "Queue" ) {
- $queues->{ $clause->{Value} } = 1;
+ my $queue = $clause->{Value};
+ $queue =~ s/^['"]|['"]$//g;
+ $queues->{ $queue } = 1;
}
} else {
$str = $ea if $_tree->getIndex() > 0;
@@ -656,7 +664,15 @@
# {{{ Show the results, if we were asked.
if ( $ARGS{"DoSearch"} ) {
- $m->comp($ResultPage, Query => $Query, Format => $Format, Order => $Order, OrderBy => $OrderBy, Rows => $RowsPerPage, BaseQuery => $BaseQuery, Queue => $ARGS{'Queue'}, id => $ARGS{'id'});
+ $ResultPage .= $ResultPage =~ /\?/? '&': '?';
+ $ResultPage .= $m->comp('/Elements/QueryString',
+ Query => $Query,
+ Format => $Format,
+ Order => $Order,
+ OrderBy => $OrderBy,
+ Rows => $RowsPerPage,
+ );
+ $m->redirect( RT->Config->Get('WebURL') . $ResultPage );
$m->abort();
}
# }}}
@@ -677,7 +693,6 @@
$Order => undef
$OrderBy => undef
$RowsPerPage => undef
-$HideResults => 0
$queues => undef
$results => undef
$optionlist => undef
@@ -685,5 +700,5 @@
$dirty => 0
$AvailableColumns => undef
$CurrentFormat => undef
-$ResultPage => "../Results.html"
+$ResultPage => "RTIR/Search/Results.html"
</%ARGS>
More information about the Rt-commit
mailing list