summaryrefslogtreecommitdiff
path: root/rt/html/Search/Results.html
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Search/Results.html')
-rwxr-xr-xrt/html/Search/Results.html30
1 files changed, 14 insertions, 16 deletions
diff --git a/rt/html/Search/Results.html b/rt/html/Search/Results.html
index 5849378a8..dfcc7885c 100755
--- a/rt/html/Search/Results.html
+++ b/rt/html/Search/Results.html
@@ -1,8 +1,8 @@
-%# BEGIN BPS TAGGED BLOCK {{{
+%# {{{ BEGIN BPS TAGGED BLOCK
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# END BPS TAGGED BLOCK }}}
+%# }}} END BPS TAGGED BLOCK
<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &>
<& /Ticket/Elements/Tabs,
current_tab => "Search/Results.html".$QueryString,
@@ -52,6 +52,7 @@
Rows => $Rows,
OrderBy => $OrderBy,
Order => $Order &>
+<hr>
<& /Elements/TicketList,
Query => $Query,
AllowSorting => 1,
@@ -80,26 +81,24 @@
<a href="<%$RT::WebPath%>/Search/Bulk.html<%$QueryString%>"><&|/l&>Update multiple tickets</&></a><br>
<a href="<%$RT::WebPath%>/Search/Results.html<%$QueryString%>"><&|/l&>Bookmarkable link</&></a><br>
<a href="<%$RT::WebPath%>/Search/Results.tsv<%$QueryString%>"><&|/l&>spreadsheet</&></a> |
-<a href="<%$RT::WebPath%>/Search/Results.rdf<%$ShortQueryString%>"><&|/l&>RSS</&></a> |
-<a href="<%$RT::WebPath%>/Tools/Offline.html<%$ShortQueryString%>"><&|/l&>Work offline</&></a><br>
+<a href="<%$RT::WebPath%>/Search/Results.rdf<%$QueryString%>"><&|/l&>RSS</&></a> |
+<a href="<%$RT::WebPath%>/Tools/Offline.html<%$QueryString%>"><&|/l&>Work offline</&></a><br>
<& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&>
</div>
<%INIT>
my ($title, $ticketcount);
$session{'i'}++;
-$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ;
+$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'});
$session{'tickets'}->FromSQL($Query) if ($Query);
$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order);
-
-$session{'CurrentSearchHash'} = {
- Format => $Format,
- Query => $Query,
- Order => $Order,
- OrderBy => $OrderBy,
- RowsPerPage => $Rows
- };
-
+if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'}
+ or $Order ne $session{'CurrentSearchHash'}->{'Order'}) {
+ $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy;
+ $session{'CurrentSearchHash'}->{'Order'} = $Order;
+ # Invalidate the ordering cache
+ undef $session{'tickets'}->{'items_array'};
+}
if ( $session{'tickets'}->Query()) {
@@ -117,7 +116,6 @@ my $QueryString = "?".$m->comp('/Elements/QueryString',
Order => $Order,
Page => $Page);
-my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query);
if ($ARGS{'TicketsRefreshInterval'}) {
$session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'};