9181f195073457501e5b3f67c43bcd3f80f86c7d
[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     [% SET first_priority = 0 %]
24     [% SET last_priority  = holds.last.priority %]
25
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 %]
46
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 %]
71
72                     <option value="del">del</option>
73                 </select>
74             </td>
75
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 %]
81
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>
86
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>
90
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>
94
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 %]
103
104             <td>
105                 [% INCLUDE 'patron-title.inc' patron=hold.patron hide_patron_infos_if_needed=1 %]
106             </td>
107
108             <td>[% hold.notes | html %]</td>
109             <td>[% hold.date | html %]</td>
110             <td>[% hold.expirationdate | html %]</td>
111
112             <td>
113                 [% IF ( hold.found ) %]
114                     [% IF ( hold.atdestination ) %]
115                         [% IF ( hold.found ) %]
116                             Item waiting at <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" /> since [% hold.waiting_date | $KohaDates %]
117                         [% ELSE %]
118                             Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
119                         [% END %]
120                     [% ELSE %]
121                         Item being transferred to <b> [% hold.wbrname | html %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode | html %]" />
122                     [% END %]
123                 [% ELSE %]
124                     [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
125                         [% Branches.GetName(hold.branchcode) | html %] <input type="hidden" name="pickup" value="[% hold.branchcode | html %]" />
126                     [% ELSE %]
127                         <select name="pickup">
128                             [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode ) %]
129                         </select>
130                     [% END %]
131                 [% END %]
132             </td>
133
134             <td>
135                 [% IF ( hold.found ) %]
136                     <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]">
137                         [% IF ( hold.barcodenumber ) %]
138                             [% hold.barcodenumber | html %]
139                             <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
140                         [% ELSE %]
141                             No barcode
142                         [% END %]
143                     </a>
144                 [% ELSE %]
145                     [% IF ( hold.item_level_hold ) %]
146                         <i>
147                             Only item
148                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]#item[% hold.itemnumber | uri %]">
149                                 [% IF ( hold.barcodenumber ) %]
150                                     [% hold.barcodenumber | html %]
151                                     <input type="hidden" name="itemnumber" value="[% hold.itemnumber | html %]" />
152                                 [% ELSE %]
153                                     No barcode
154                                 [% END %]
155                             </a>
156                         </i>
157                     [% ELSE %]
158                         [% IF hold.itemtype %]
159                             <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) | html %] item</i>
160                         [% ELSE %]
161                             <i>Next available</i>
162                         [% END %]
163
164                         <input type="hidden" name="itemnumber" value="" />
165                     [% END %]
166                 [% END %]
167             </td>
168
169             [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
170                 [% UNLESS hold.found %]
171                     <td>
172                         <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 %]">
173                             [% IF ( hold.lowestPriority ) %]
174                                 <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" />
175                             [% ELSE %]
176                                 <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" />
177                             [% END %]
178                         </a>
179                     </td>
180                 [% ELSE %]
181                     <td></td>
182                 [% END %]
183             [% END %]
184
185             <td>
186                 <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 %]">
187                     <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
188                 </a>
189             </td>
190
191             [% IF SuspendHoldsIntranet %]
192                 <td>
193                     [% UNLESS ( hold.found ) %]
194                         <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()" />
195
196                         [% IF AutoResumeSuspendedHolds %]
197                             <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
198                             <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" />
199                             <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
200                         [% ELSE %]
201                             <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
202                         [% END %]
203
204                     [% ELSE %]
205                         <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 %]'">
206                     [% END %]
207                 </td>
208             [% END # IF SuspendHoldsIntranet %]
209
210         </tr>
211
212     [% END %]
213 </table>