Bug 21608: Add ID and fix filters
[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" && !hold.found %]
30                     <select name="rank-request">
31                 [% ELSE %]
32                     <select name="rank-request" disabled="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                             [% SET ranker = 1 %]
53                             [% FOREACH h IN holds %]
54                                 [% NEXT IF h.found %]
55                                 [% IF ( h.priority == hold.priority ) %]
56                                     <option value="[% h.priority | html %]" selected="selected">[% ranker | html %]</option>
57                                 [% ELSE %]
58                                     <option value="[% h.priority | html %]">[% ranker | html %]</option>
59                                 [% END %]
60                                 [% ranker = ranker + 1 %]
61                             [% END %]
62                         [% END %]
63                     [% ELSIF !hold.found %]
64                         <option value="[% hold.priority | html %]" selected="selected">[% hold.priority | html %]</option>
65                     [% END %]
66
67                     <option value="del">del</option>
68                 </select>
69             </td>
70
71             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
72                 [% SET first_priority = holds.first.priority %]
73                 [% SET last_priority  = holds.last.priority %]
74                 [% SET prev_priority  = loop.prev.priority %]
75                 [% SET next_priority  = loop.next.priority %]
76                 [% holds.index | html %]
77
78                 <td style="white-space:nowrap;">
79                     <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 %]">
80                         <img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
81                     </a>
82
83                     <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 %]">
84                         <img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
85                     </a>
86
87                     <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 %]">
88                         <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
89                     </a>
90
91                     <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 %]">
92                         <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
93                     </a>
94                 </td>
95             [% END %]
96
97             <td>
98                 [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %]
99             </td>
100
101             <td>[% hold.notes | html %]</td>
102             <td>[% hold.date | html %]</td>
103             <td>[% hold.expirationdate | html %]</td>
104
105             <td>
106                 [% IF ( hold.found ) %]
107                     [% IF ( hold.atdestination ) %]
108                         [% IF ( hold.found ) %]
109                             Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
110                         [% ELSE %]
111                             Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
112                         [% END %]
113                     [% ELSE %]
114                         Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
115                     [% END %]
116                 [% ELSE %]
117                     [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
118                         [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" />
119                     [% ELSE %]
120                         <select name="pickup">
121                             [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode ) %]
122                         </select>
123                     [% END %]
124                 [% END %]
125             </td>
126
127             <td>
128                 [% IF ( hold.found ) %]
129                     <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">
130                         [% IF ( hold.barcodenumber ) %]
131                             [% hold.barcodenumber | html %]
132                             <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
133                         [% ELSE %]
134                             No barcode
135                         [% END %]
136                     </a>
137                 [% ELSE %]
138                     [% IF ( hold.item_level_hold ) %]
139                         <i>
140                             Only item
141                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber | uri %]">
142                                 [% IF ( hold.barcodenumber ) %]
143                                     [% hold.barcodenumber | html %]
144                                     <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
145                                 [% ELSE %]
146                                     No barcode
147                                 [% END %]
148                             </a>
149                         </i>
150                     [% ELSE %]
151                         [% IF hold.itemtype %]
152                             <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</i>
153                         [% ELSE %]
154                             <i>Next available</i>
155                         [% END %]
156
157                         <input type="hidden" name="itemnumber" value="" />
158                     [% END %]
159                 [% END %]
160             </td>
161
162             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
163                 <td>
164                     <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 %]">
165                         [% IF ( hold.lowestPriority ) %]
166                             <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
167                         [% ELSE %]
168                             <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
169                         [% END %]
170                     </a>
171                 </td>
172             [% END %]
173
174             <td>
175                 <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 %]">
176                     <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
177                 </a>
178             </td>
179
180             [% IF SuspendHoldsIntranet %]
181                 <td>
182                     [% UNLESS ( hold.found ) %]
183                         <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()" />
184
185                         [% IF AutoResumeSuspendedHolds %]
186                             <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
187                             <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" />
188                             <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
189                         [% ELSE %]
190                             <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
191                         [% END %]
192
193                     [% ELSE %]
194                         <input type="button" id="revert_hold_[% hold.reserve_id | html %]" value="Revert found status" onclick="window.location.href='request.pl?action=move&amp;where=down&amp;first_priority=[% first_priority | uri %]&amp;last_priority=[% last_priority | uri %]&amp;prev_priority=0&amp;next_priority=1&amp;borrowernumber=[% hold.borrowernumber | uri %]&amp;biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]&amp;reserve_id=[% hold.reserve_id | uri %]&amp;date=[% hold.date | uri %]'">
195                     [% END %]
196                 </td>
197             [% END # IF SuspendHoldsIntranet %]
198
199         </tr>
200
201     [% END %]
202 </table>