Bug 22922: Use jQuery datepicker instead of <input type="date">
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / holds_table.inc
blob5a2ef15272038792f75cc45ffba8efe5730f8ae5
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         <th>&nbsp;</th>
21     </tr>
23     [% SET first_priority = 0 %]
24     [% SET last_priority  = holds.last.priority %]
26     [% FOREACH hold IN holds %]
27     [% IF !hold.found && first_priority == 0 %][% first_priority = hold.priority %][% END %]
28         <tr>
29             <td>
30                 <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" />
31                 <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" />
32                 <input type="hidden" name="biblionumber" value="[% hold.biblionumber | html %]" />
33                 [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %]
34                     <select name="rank-request">
35                 [% ELSE %]
36                     <input type="hidden" name="rank-request" value="[% hold.priority | html %]">
37                     <select name="rank-request" disabled="disabled">
38                 [% END %]
39                     [% IF ( hold.found ) %]
40                         [% IF ( hold.intransit ) %]
41                             <option value="T" selected="selected">In transit</option>
42                         [% ELSE %]
43                             <option value="W" selected="selected">Waiting</option>
44                         [% END %]
45                     [% END %]
47                     [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
48                         [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %]
49                             [% FOREACH optionloo IN hold.optionloop %]
50                                 [% IF ( optionloo.selected ) %]
51                                     <option value="[% optionloo.num | html %]" selected="selected">[% optionloo.num | html %]</option>
52                                 [% ELSE %]
53                                     <option value="[% optionloo.num | html %]">[% optionloo.num | html %]</option>
54                                 [% END %]
55                             [% END %]
56                         [% ELSE %]
57                             [% SET ranker = 1 %]
58                             [% FOREACH h IN holds %]
59                                 [% NEXT IF h.found %]
60                                 [% IF ( h.priority == hold.priority ) %]
61                                     <option value="[% h.priority | html %]" selected="selected">[% ranker | html %]</option>
62                                 [% ELSE %]
63                                     <option value="[% h.priority | html %]">[% ranker | html %]</option>
64                                 [% END %]
65                                 [% ranker = ranker + 1 %]
66                             [% END %]
67                         [% END %]
68                     [% ELSIF !hold.found %]
69                         <option value="[% hold.priority | html %]" selected="selected">[% hold.priority | html %]</option>
70                     [% END %]
72                     <option value="del">del</option>
73                 </select>
74             </td>
76             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
77             [% UNLESS hold.found %]
78                     [% SET prev_priority  = loop.prev.priority %]
79                     [% SET next_priority  = loop.next.priority %]
80                     [% holds.index | html %]
82                     <td style="white-space:nowrap;">
83                         <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 %]">
84                             <img src="[% interface | html %]/[% theme | html %]/img/go-up.png" alt="Go up" />
85                         </a>
87                         <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 %]">
88                             <img src="[% interface | html %]/[% theme | html %]/img/go-top.png" alt="Go top" />
89                         </a>
91                         <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 %]">
92                             <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" />
93                         </a>
95                         <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 %]">
96                             <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" />
97                         </a>
98                     </td>
99         [% ELSE %]
100             <td></td>
101         [% END %]
102             [% END %]
104             <td>
105                 [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %]
106             </td>
108             <td>[% hold.notes | html %]</td>
109             <td>
110                 [% IF Koha.Preference('AllowHoldDateInFuture') %]
111                     <input type="text" class="datepicker" value="[% hold.date | $KohaDates %]" required name="reservedate">
112                 [% ELSE %]
113                     [% hold.date | $KohaDates %]
114                 [% END %]
115             </td>
116             <td><input type="text" class="datepicker" value="[% hold.expirationdate | $KohaDates %]" name="expirationdate"></td>
118             <td>
119                 [% IF ( hold.found ) %]
120                     [% IF ( hold.atdestination ) %]
121                         [% IF ( hold.found ) %]
122                             Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
123                         [% ELSE %]
124                             Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
125                         [% END %]
126                     [% ELSE %]
127                         Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
128                     [% END %]
129                 [% ELSE %]
130                     [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
131                         [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" />
132                     [% ELSE %]
133                         <select name="pickup">
134                             [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode, search_params => { "-or" => { pickup_location => 1, branchcode => hold.branchcode } } ) %]
135                         </select>
136                     [% END %]
137                 [% END %]
138             </td>
140             <td>
141                 [% IF ( hold.found ) %]
142                     <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]">
143                         [% IF ( hold.barcodenumber ) %]
144                             [% hold.barcodenumber | html %]
145                             <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
146                         [% ELSE %]
147                             No barcode
148                         [% END %]
149                     </a>
150                 [% ELSE %]
151                     [% IF ( hold.item_level_hold ) %]
152                         <i>
153                             Only item
154                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]">
155                                 [% IF ( hold.barcodenumber ) %]
156                                     [% hold.barcodenumber | html %]
157                                     <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
158                                 [% ELSE %]
159                                     No barcode
160                                 [% END %]
161                             </a>
162                         </i>
163                     [% ELSE %]
164                         [% IF hold.itemtype %]
165                             <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</i>
166                         [% ELSE %]
167                             <i>Next available</i>
168                         [% END %]
170                         <input type="hidden" name="itemnumber" value="" />
171                     [% END %]
172                 [% END %]
173             </td>
175             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
176             [% UNLESS hold.found %]
177                     <td>
178                         <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 %]">
179                             [% IF ( hold.lowestPriority ) %]
180                                 <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
181                             [% ELSE %]
182                                 <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
183                             [% END %]
184                         </a>
185                     </td>
186         [% ELSE %]
187             <td></td>
188         [% END %]
189             [% END %]
191             <td>
192                 <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 %]">
193                     <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
194                 </a>
195             </td>
197             <td>
198                 [% IF Koha.Preference('SuspendHoldsIntranet') %]
199                     [% UNLESS ( hold.found ) %]
200                         <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()" />
202                         [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
203                             <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
204                             <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" />
205                             <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
206                         [% ELSE %]
207                             <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
208                         [% END %]
209                     [% END %]
210                 [% END # IF SuspendHoldsIntranet %]
212                 [% IF ( hold.found ) %]
213                     <input type="button" id="revert_hold_[% hold.reserve_id | html %]" value="[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]" 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 %]'">
214                 [% END %]
215             </td>
217         </tr>
219     [% END %]
220 </table>