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