%# BEGIN LICENSE BLOCK
%#
%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
%#
%# (Except where explictly superceded by other copyright notices)
%#
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%#
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%# General Public License for more details.
%#
%# Unless otherwise specified, all modifications, corrections or
%# extensions to this work which alter its source code become the
%# property of Best Practical Solutions, LLC when submitted for
%# inclusion in the work.
%#
%#
%# END LICENSE BLOCK
<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &>
<& /Ticket/Elements/Tabs,
current_tab => "Search/Results.html".$QueryString,
Title => $title,
Format => $Format,
Query => $Query,
Rows => $ARGS{'Rows'},
OrderBy => $ARGS{'OrderBy'},
Order => $ARGS{'Order'} &>
<hr>
<& /Elements/TicketList,
Query => $Query,
AllowSorting => 1,
OrderBy => $OrderBy,
Order => $Order,
Rows => $Rows,
Page => $Page,
Format => $Format,
BaseURL => $RT::WebPath."/Search/Results.html?"
&>
<div align=right>
<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<%$QueryString%>"><&|/l&>RSS</&></a> |
<a href="<%$RT::WebPath%>/Tools/Offline.html<%$QueryString%>"><&|/l&>Work offline</&></a><br>
</div>
<%INIT>
my ($title, $ticketcount);
$session{'i'}++;
$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'});
$session{'tickets'}->FromSQL($Query) if ($Query);
$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order);
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()) {
$ticketcount = $session{tickets}->CountAll();
$title = loc('Found [quant,_1,ticket]', $ticketcount);
$Query = $session{'tickets'}->Query();
} else {
$title = loc("Find tickets");
}
my $QueryString = "?".$m->comp('/Elements/QueryString',
Query => $Query,
Format => $Format,
Rows => $Rows,
OrderBy => $OrderBy,
Order => $Order,
Page => $Page);
</%INIT>
<%CLEANUP>
$session{'tickets'}->PrepForSerialization();
</%CLEANUP>
<%ARGS>
$Query => undef
$Format => undef
$HideResults => 0
$Rows => 50
$Page => 1
$OrderBy => 'id'
$Order => 'ASC'
</%ARGS>