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 <FORM ACTION="Listing.html" METHOD="GET">
25 <INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()|u %>">
26 <& /Elements/TitleBoxStart, title => loc('Refine search')&>
27 <INPUT TYPE=HIDDEN NAME="CompileRestriction" VALUE=1>
30 <li><&|/l&>Owner is</&> <& /Elements/SelectBoolean, Name => "OwnerOp",
34 <& /Elements/SelectOwner, Name => "ValueOfOwner" &>
37 <& /Elements/SelectWatcherType, Name => "WatcherRole", AllowNull => 0 &>
38 <&|/l&>email address</&>
39 <& /Elements/SelectMatch, Name => "WatcherRoleOp" &>
40 <INPUT Name="ValueOfWatcherRole" SIZE=20>
43 <&|/l&>Subject</&> <& /Elements/SelectMatch, Name => "SubjectOp" &>
44 <INPUT Name="ValueOfSubject" SIZE=20>
46 <li><&|/l&>Queue</&> <& /Elements/SelectBoolean, Name => "QueueOp" ,
48 False => loc("isn't"),
51 <& /Elements/SelectQueue, Name => "ValueOfQueue" &>
54 <li><&|/l&>Priority</&> <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
56 <INPUT Name="ValueOfPriority" SIZE=5>
59 <& /Elements/SelectDateType, Name => 'DateType' &>
60 <& /Elements/SelectDateRelation, Name=>"DateOp" &>
61 <& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
63 <li><&|/l&>Ticket attachment</&>
65 <& /Elements/SelectAttachmentField, Name => 'AttachmentField' &>
66 <& /Elements/SelectBoolean, Name => "AttachmentFieldOp",
67 True => loc("matches"),
68 False => loc("does not match"),
70 FalseVal => 'NOT LIKE'
72 <Input Name="ValueOfAttachmentField" Size=20>
75 <& /Elements/SelectBoolean, Name => "StatusOp",
77 False => loc("isn't"),
81 <& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &>
84 % while ( my $CustomField = $CustomFields->Next ) {
86 <li><% $CustomField->Name %>
87 <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id,
89 False => loc("isn't"),
90 TrueVal=> '=', FalseVal => '!=' &>
92 <& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id,
93 CustomField => $CustomField,
99 <& /Elements/TitleBoxEnd &>
101 <& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&>
105 <li><&|/l&>Results per page</&> <& /Elements/SelectResultsPerPage, Name => "RowsPerPage",
106 Default => $session{'tickets_rows_per_page'} || '50'
109 <li><&|/l&>Sort results by</&> <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy",
110 Default => $session{'tickets_sort_by'}
112 <& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &>
114 <li><input type="checkbox" name="HideResults" <%$ARGS{'HideResults'} && 'CHECKED'%>> <&|/l&>Don't show search results</&>
115 <li><& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &>
124 <& /Elements/TitleBoxEnd &>
126 <& /Elements/Submit, Label => loc('Search'), Name => 'Action'&>
132 my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
133 foreach ( $session{'tickets'}->RestrictionValues('Queue') ) {
134 # Gotta load up the $queue object, since queues get stored by name now.
135 my $queue = RT::Queue->new($session{'CurrentUser'});
137 $CustomFields->LimitToQueue($queue->Id);
140 $CustomFields->LimitToGlobal();