3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 %# (Except where explictly superceded by other copyright notices)
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 %# General Public License for more details.
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
24 <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &>
25 <& /Ticket/Elements/Tabs,
26 current_tab => 'Search/Listing.html',
29 %if ($ticketcount && ! $ARGS{'HideResults'}) {
30 <TABLE WIDTH=100% border=0 cellpadding=2 CELLSPACING=0>
31 <& Elements/TicketHeader, %ARGS &>
33 %while (my $Ticket = $session{'tickets'}->Next) {
35 <& Elements/TicketRow, Ticket => $Ticket, i=> $i, %ARGS &>
40 <a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=1"><&|/l&>First page</&></a>
42 % if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) {
43 <a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Prev"><<&|/l&>Previous page</&></a>
46 % if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) {
47 <a href="<%$RT::WebPath%>/Search/Listing.html?GotoPage=Next"><&|/l&>Next page</&>></a>
49 %# <form method=get action="<%$RT::WebPath%>/Search/Listing.html"><&|/l&>Goto page</&> <input name=GotoPage size=2></form>
52 <!--<div align=right>-->
53 <table width="100%" border=0 cellpadding=3 CELLSPACING=1>
56 (<&|/l, ($session{'tickets'}->FirstRow+1), ($session{'tickets'}->FirstRow() + $session{'tickets'}->RowsPerPage() ) &>[_1] - [_2] shown</&>)
60 <a href="<%$RT::WebPath%>/Search/Bulk.html"><&|/l&>Update all these tickets at once</&></a>
70 <& /Elements/TitleBoxStart, title => loc('Current search criteria')&>
72 %my %restrictions=$session{'tickets'}->DescribeRestrictions();
73 %foreach my $row (keys %restrictions){
74 <%$restrictions{"$row"}%> <A HREF="<% $RT::WebPath %>/Search/Listing.html?DeleteRestriction=<%$row%>">[<&|/l&>delete</&>]</a><br>
78 <A HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|nu%>&TicketsSortBy=<%$session{'tickets_sort_by'}%>&TicketsSortOrder=<%$session{'tickets_sort_order'}%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"><&|/l&>Bookmarkable URL for this search</&></a>
79 <& /Elements/TitleBoxEnd&>
83 <& Elements/PickRestriction, %ARGS &>
91 my ($title, $ticketcount);
93 if ($session{'tickets'}) {
94 if ($ARGS{'DeleteRestriction'}) {
95 $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'});
97 if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) {
98 $session{'tickets'}->ClearRestrictions;
99 $session{'tickets'}->CleanSlate;
102 ProcessSearchQuery(ARGS=>\%ARGS);
103 $session{'tickets'}->RedoSearch();
104 if ( $session{'tickets'}->DescribeRestrictions()) {
105 $ticketcount = $session{tickets}->CountAll();
106 $title = loc('Found [quant,_1,ticket]', $ticketcount);
108 $title = loc("Find tickets");
112 $session{'tickets'}->PrepForSerialization();