[Rt-commit] r13286 - in rt/branches/3.8-TESTING: share/html/Search
elacour at bestpractical.com
elacour at bestpractical.com
Fri Jun 13 14:57:59 EDT 2008
Author: elacour
Date: Fri Jun 13 14:57:58 2008
New Revision: 13286
Modified:
rt/branches/3.8-TESTING/ (props changed)
rt/branches/3.8-TESTING/share/html/Search/Results.html
rt/branches/3.8-TESTING/share/html/Search/Results.rdf
Log:
r9530 at datura: manu | 2008-06-13 20:57:53 +0200
RT-Ticket: 7648
RT-Status: resolved
RT-Update: correspond
Pass Order/OrderBy to RSS feed.
Modified: rt/branches/3.8-TESTING/share/html/Search/Results.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Search/Results.html (original)
+++ rt/branches/3.8-TESTING/share/html/Search/Results.html Fri Jun 13 14:57:58 2008
@@ -156,7 +156,8 @@
Order => $Order,
Page => $Page);
my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query);
-my $RSSFeedURL = RT->Config->Get('WebPath')."/Search/Results.rdf$ShortQueryString";
+my $RSSQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query, Order => $Order, OrderBy => $OrderBy);
+my $RSSFeedURL = RT->Config->Get('WebPath')."/Search/Results.rdf$RSSQueryString";
if ($ARGS{'TicketsRefreshInterval'}) {
$session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'};
Modified: rt/branches/3.8-TESTING/share/html/Search/Results.rdf
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Search/Results.rdf (original)
+++ rt/branches/3.8-TESTING/share/html/Search/Results.rdf Fri Jun 13 14:57:58 2008
@@ -49,6 +49,16 @@
my $Tickets = RT::Tickets->new($session{'CurrentUser'});
$Tickets->FromSQL($ARGS{'Query'});
+if ($OrderBy =~ /\|/) {
+ # Multiple Sorts
+ my @OrderBy = split /\|/,$OrderBy;
+ my @Order = split /\|/,$Order;
+ $Tickets->OrderByCols(
+ map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0
+ .. $#OrderBy ) );;
+} else {
+ $Tickets->OrderBy(FIELD => $OrderBy, ORDER => $Order);
+}
$r->content_type('application/rss+xml');
@@ -86,3 +96,7 @@
$m->out($rss->as_string);
$m->abort();
</%INIT>
+<%ARGS>
+$OrderBy => 'Created'
+$Order => 'ASC'
+</%ARGS>
More information about the Rt-commit
mailing list