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