Bug 21526: Remove duplicated USE raw statement
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / holds_table.inc
1 [% USE Koha %]
2 <table>
3     <tr>
4         [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
5             <th>Priority</th>
6             <th>&nbsp;</th>
7         [% ELSE %]
8             <th>Delete?</th>
9         [% END %]
10         <th>Patron</th>
11         <th>Notes</th>
12         <th>Date</th>
13         <th>Expiration</th>
14         <th>Pickup library</th>
15         <th>Details</th>
16         [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
17             <th><img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
18         [% END %]
19         <th>&nbsp;</th>
20         [% IF SuspendHoldsIntranet %]<th>&nbsp;</th><!-- Suspend Holds Column Header -->[% END %]
21     </tr>
22
23     [% FOREACH hold IN holds %]
24         <tr>
25             <td>
26                 <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" />
27                 <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" />
28                 <input type="hidden" name="biblionumber" value="[% hold.biblionumber | html %]" />
29                 [% IF Koha.Preference('HoldsSplitQueue') == "nothing" %]
30                     <select name="rank-request">
31                 [% ELSE %]
32                     <select name="rank-request" disabled>
33                 [% END %]
34                     [% IF ( hold.found ) %]
35                         [% IF ( hold.intransit ) %]
36                             <option value="T" selected="selected">In transit</option>
37                         [% ELSE %]
38                             <option value="W" selected="selected">Waiting</option>
39                         [% END %]
40                     [% END %]
41
42                     [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
43                         [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %]
44                             [% FOREACH optionloo IN hold.optionloop %]
45                                 [% IF ( optionloo.selected ) %]
46                                     <option value="[% optionloo.num | html %]" selected="selected">[% optionloo.num | html %]</option>
47                                 [% ELSE %]
48                                     <option value="[% optionloo.num | html %]">[% optionloo.num | html %]</option>
49                                 [% END %]
50                             [% END %]
51                         [% ELSE %]
52                             [% FOREACH h IN holds %]
53                                 [% IF ( h.priority == hold.priority ) %]
54                                     <option value="[% h.priority | html %]" selected="selected">[% loop.index + 1 | html %]</option>
55                                 [% ELSE %]
56                                     <option value="[% h.priority | html %]">[% loop.index + 1 | html %]</option>
57                                 [% END %]
58                             [% END %]
59                         [% END %]
60                     [% ELSIF !hold.found %]
61                         <option value="[% hold.priority | html %]" selected="selected">[% hold.priority | html %]</option>
62                     [% END %]
63
64                     <option value="del">del</option>
65                 </select>
66             </td>
67
68             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
69                 [% SET first_priority = holds.first.priority %]
70                 [% SET last_priority  = holds.last.priority %]
71                 [% SET prev_priority  = loop.prev.priority %]
72                 [% SET next_priority  = loop.next.priority %]
73                 [% holds.index | html %]
74
75                 <td style="white-space:nowrap;">
76                     <a title="Move hold up" href="request.pl?action=move&amp;where=up&amp;first_priority=[% first_priority | html %]&amp;last_priority=[% last_priority | html %]&amp;prev_priority=[% prev_priority | html %]&amp;next_priority=[% next_priority | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
77                         <img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
78                     </a>
79
80                     <a title="Move hold to top" href="request.pl?action=move&amp;where=top&amp;first_priority=[% first_priority | html %]&amp;last_priority=[% last_priority | html %]&amp;prev_priority=[% prev_priority | html %]&amp;next_priority=[% next_priority | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
81                         <img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
82                     </a>
83
84                     <a title="Move hold to bottom" href="request.pl?action=move&amp;where=bottom&amp;first_priority=[% first_priority | html %]&amp;last_priority=[% last_priority | html %]&amp;prev_priority=[% prev_priority | html %]&amp;next_priority=[% next_priority | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
85                         <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
86                     </a>
87
88                     <a title="Move hold down" href="request.pl?action=move&amp;where=down&amp;first_priority=[% first_priority | html %]&amp;last_priority=[% last_priority | html %]&amp;prev_priority=[% prev_priority | html %]&amp;next_priority=[% next_priority | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
89                         <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
90                     </a>
91                 </td>
92             [% END %]
93
94             <td>
95                 [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %]
96             </td>
97
98             <td>[% hold.notes | html %]</td>
99             <td>[% hold.date | html %]</td>
100             <td>[% hold.expirationdate | html %]</td>
101
102             <td>
103                 [% IF ( hold.found ) %]
104                     [% IF ( hold.atdestination ) %]
105                         [% IF ( hold.found ) %]
106                             Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
107                         [% ELSE %]
108                             Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
109                         [% END %]
110                     [% ELSE %]
111                         Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
112                     [% END %]
113                 [% ELSE %]
114                     [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
115                         [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" />
116                     [% ELSE %]
117                         <select name="pickup">
118                             [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode ) %]
119                         </select>
120                     [% END %]
121                 [% END %]
122             </td>
123
124             <td>
125                 [% IF ( hold.found ) %]
126                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">
127                         [% IF ( hold.barcodenumber ) %]
128                             [% hold.barcodenumber | html %]
129                             <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
130                         [% ELSE %]
131                             No barcode
132                         [% END %]
133                     </a>
134                 [% ELSE %]
135                     [% IF ( hold.item_level_hold ) %]
136                         <i>
137                             Only item
138                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">
139                                 [% IF ( hold.barcodenumber ) %]
140                                     [% hold.barcodenumber | html %]
141                                     <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
142                                 [% ELSE %]
143                                     No barcode
144                                 [% END %]
145                             </a>
146                         </i>
147                     [% ELSE %]
148                         [% IF hold.itemtype %]
149                             <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</i>
150                         [% ELSE %]
151                             <i>Next available</i>
152                         [% END %]
153
154                         <input type="hidden" name="itemnumber" value="" />
155                     [% END %]
156                 [% END %]
157             </td>
158
159             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
160                 <td>
161                     <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
162                         [% IF ( hold.lowestPriority ) %]
163                             <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
164                         [% ELSE %]
165                             <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
166                         [% END %]
167                     </a>
168                 </td>
169             [% END %]
170
171             <td>
172                 <a class="cancel-hold" title="Cancel hold" href="request.pl?action=cancel&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
173                     <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
174                 </a>
175             </td>
176
177             [% IF SuspendHoldsIntranet %]
178                 <td>
179                     [% UNLESS ( hold.found ) %]
180                         <input type="button" value="[% IF ( hold.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;reserve_id=[% hold.reserve_id | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;date=[% hold.date | html %]&amp;suspend_until=' + $('#suspend_until_[% hold.reserve_id | html %]').val()" />
181
182                         [% IF AutoResumeSuspendedHolds %]
183                             <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
184                             <input type="text" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
185                             <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
186                         [% ELSE %]
187                             <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
188                         [% END %]
189
190                     [% ELSE %]
191                         <input type="hidden" name="suspend_until" value="" />
192                     [% END %]
193                 </td>
194             [% END # IF SuspendHoldsIntranet %]
195
196         </tr>
197
198     [% END %]
199 </table>