import rt 3.0.12
[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="<%$RT::WebPath%>/Search/Listing.html" METHOD="GET">
25 <INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()%>">
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 <& /Elements/SelectWatcherType, Name => "WatcherRole", AllowNull => 0 &>
38 <&|/l&>email address</&> 
39 <& /Elements/SelectMatch, Name => "WatcherRoleOp" &>
40 <INPUT Name="ValueOfWatcherRole" SIZE=20>
41
42 <li>
43 <&|/l&>Subject</&> <& /Elements/SelectMatch, Name => "SubjectOp" &> 
44 <INPUT Name="ValueOfSubject" SIZE=20>
45
46 <li><&|/l&>Queue</&>  <& /Elements/SelectBoolean,  Name => "QueueOp" , 
47                                         True => loc("is"), 
48                                         False => loc("isn't"), 
49                                         TrueVal=> '=', 
50                                         FalseVal => '!=' &>
51 <& /Elements/SelectQueue, Name => "ValueOfQueue" &>
52
53
54 <li><&|/l&>Priority</&> <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
55
56 <INPUT Name="ValueOfPriority" SIZE=5>
57
58 <li>
59 <& /Elements/SelectDateType, Name => 'DateType' &>
60 <& /Elements/SelectDateRelation, Name=>"DateOp" &>
61 <& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
62
63 <li><&|/l&>Ticket attachment</&> 
64
65 <& /Elements/SelectAttachmentField, Name => 'AttachmentField' &>
66 <& /Elements/SelectBoolean, Name => "AttachmentFieldOp", 
67                             True => loc("matches"), 
68                             False => loc("does not match"), 
69                             TrueVal => 'LIKE', 
70                             FalseVal => 'NOT LIKE' 
71 &> 
72 <Input Name="ValueOfAttachmentField" Size=20>
73
74 <li><&|/l&>Status</&> 
75 <& /Elements/SelectBoolean, Name => "StatusOp", 
76                             True => loc("is"), 
77                             False => loc("isn't"), 
78                             TrueVal=> '=', 
79                             FalseVal => '!=' 
80 &>  
81 <& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &>
82
83
84 % while ( my $CustomField = $CustomFields->Next ) {
85
86 <li><% $CustomField->Name %> 
87         <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id, 
88                                     True => loc("is"), 
89                                     False => loc("isn't"), 
90                                     TrueVal=> '=', FalseVal => '!=' &>
91
92 <& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id,
93                             CustomField => $CustomField,
94                             &>
95 % }
96
97 </UL>
98
99 <& /Elements/TitleBoxEnd &>
100
101 <& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&>
102
103 <UL>
104
105 <li><&|/l&>Results per page</&> <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", 
106                                                         Default => $session{'tickets_rows_per_page'} || '50'
107 &>
108
109 <li><&|/l&>Sort results by</&> <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", 
110                                                      Default => $session{'tickets_sort_by'} 
111 &> 
112 <& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &>
113
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'} &>
116
117 </UL>
118
119
120 </DIV>
121
122
123
124 <& /Elements/TitleBoxEnd &>
125
126 <& /Elements/Submit, Label => loc('Search'), Name => 'Action'&>
127
128 </FORM>
129
130
131  <%INIT>
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'});
136         $queue->Load($_);
137         $CustomFields->LimitToQueue($queue->Id);
138  }
139
140  $CustomFields->LimitToGlobal();
141
142 </%INIT>