a6911df5ad31174b06372eb02e1f755b039dcf3c
[freeside.git] / rt / html / Search / Elements / PickRestriction
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
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
10 %# from www.gnu.org.
11 %# 
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.
16 %# 
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.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
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>
28
29 <ul>
30 <li><&|/l&>Owner is</&>  <& /Elements/SelectBoolean, Name => "OwnerOp", 
31                                           TrueVal=> '=', 
32                                           FalseVal => '!=' 
33 &> 
34 <& /Elements/SelectOwner, Name => "ValueOfOwner" &>
35
36 <li>
37 <&|/l&>Requestor email address</&> 
38 <& /Elements/SelectMatch, Name => "RequestorOp" &>
39 <INPUT Name="ValueOfRequestor" SIZE=20>
40
41 <li>
42 <&|/l&>Subject</&> <& /Elements/SelectMatch, Name => "SubjectOp" &> 
43 <INPUT Name="ValueOfSubject" SIZE=20>
44
45 <li><&|/l&>Queue</&>  <& /Elements/SelectBoolean,  Name => "QueueOp" , 
46                                         True => loc("is"), 
47                                         False => loc("isn't"), 
48                                         TrueVal=> '=', 
49                                         FalseVal => '!=' &>
50 <& /Elements/SelectQueue, Name => loc("ValueOfQueue") &>
51
52
53 <li><&|/l&>Priority</&> <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
54
55 <INPUT Name="ValueOfPriority" SIZE=5>
56
57 <li>
58 <& /Elements/SelectDateType, Name => 'DateType' &>
59 <& /Elements/SelectDateRelation, Name=>"DateOp" &>
60 <& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
61
62 <li><&|/l&>Ticket attachment</&> 
63
64 <& /Elements/SelectAttachmentField, Name => 'AttachmentField' &>
65 <& /Elements/SelectBoolean, Name => "AttachmentFieldOp", 
66                             True => loc("matches"), 
67                             False => loc("does not match"), 
68                             TrueVal => 'LIKE', 
69                             FalseVal => 'NOT LIKE' 
70 &> 
71 <Input Name="ValueOfAttachmentField" Size=20>
72
73 <li><&|/l&>Status</&> 
74 <& /Elements/SelectBoolean, Name => "StatusOp", 
75                             True => loc("is"), 
76                             False => loc("isn't"), 
77                             TrueVal=> '=', 
78                             FalseVal => '!=' 
79 &>  
80 <& /Elements/SelectStatus, Name => "ValueOfStatus" &>
81
82
83 % while ( my $CustomField = $CustomFields->Next ) {
84
85 <li><% $CustomField->Name %> 
86         <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id, 
87                                     True => loc("is"), 
88                                     False => loc("isn't"), 
89                                     TrueVal=> '=', FalseVal => '!=' &>
90
91 <& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id,
92                             CustomField => $CustomField,
93                             &>
94 % }
95
96 </UL>
97
98 <& /Elements/TitleBoxEnd &>
99
100 <& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&>
101
102 <UL>
103
104 <li><&|/l&>Results per page</&> <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", 
105                                                         Default => $session{'tickets_rows_per_page'} || '50'
106 &>
107
108 <li><&|/l&>Sort results by</&> <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", 
109                                                      Default => $session{'tickets_sort_by'} 
110 &> 
111 <& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &>
112
113 <li><input type="checkbox" name="HideResults" <%$ARGS{'HideResults'} && 'CHECKED'%>> <&|/l&>Don't show search results</&>
114 <li><& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &>
115
116 </UL>
117
118
119 </DIV>
120
121
122
123 <& /Elements/TitleBoxEnd &>
124
125 <& /Elements/Submit, Label => loc('Search'), Name => 'Action'&>
126
127 </FORM>
128
129
130  <%INIT>
131 my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
132  foreach ( $session{'tickets'}->RestrictionValues('Queue') ) {
133         # Gotta load up the $queue object, since queues get stored by name now.
134         my $queue = RT::Queue->new($session{'CurrentUser'});
135         $queue->Load($_);
136         $CustomFields->LimitToQueue($queue->Id);
137  }
138
139  $CustomFields->LimitToGlobal();
140
141 </%INIT>