Bug 22538: Add a noticeable alert about waiting holds
[koha-equinox.git] / koha-tmpl / opac-tmpl / bootstrap / en / includes / holds-table.inc
1 [% USE Branches %]
2 [% USE ItemTypes %]
3 [% USE KohaDates %]
4
5 [% IF ( HOLDS.count ) %]
6     <div id="opac-user-holds">
7         <table id="holdst" class="table table-bordered table-striped">
8             <caption>Holds <span class="count">([% HOLDS.count | html %] total)</span></caption>
9             <!-- HOLDS TABLE ROWS -->
10             <thead>
11                 <tr>
12                     <th class="anti-the">Title</th>
13                     [% IF ( showpriority ) %]
14                         <th class="title-string">Placed on</th>
15                     [% ELSE %]
16                         <th class="psort title-string">Placed on</th>
17                     [% END %]
18                     <th class="title-string">Expires on</th>
19                     [% UNLESS( singleBranchMode) %]
20                         <th>Pick up location</th>
21                     [% END %]
22                     [% IF ( showpriority ) %]
23                         <th class="psort">Priority</th>
24                     [% END %]
25                     <th>Status</th>
26                     [% IF SuspendHoldsOpac and ! onlyinfo %]
27                             <th class="nosort" >Suspend</th>
28                     [% END %]
29                     [% IF ! onlyinfo %]
30                         <th class="nosort">Modify</th>
31                     [% END %]
32                 </tr>
33             </thead>
34             <tbody>
35                 [% FOREACH HOLD IN HOLDS %]
36                     [% IF ( HOLD.is_waiting ) %]
37                         [% IF ( HOLD.is_at_destination ) %]
38                             [% IF ( HOLD.is_found ) %]
39                                 <tr class="reserved">
40                             [% ELSE %]
41                                 <tr>
42                             [% END %]
43                         [% ELSE %]
44                             <tr class="transfered">
45                         [% END %]
46                     [% ELSE %]
47                         <tr>
48                     [% END %]
49                         <td class="title">
50                             [% IF ! onlyinfo %]
51                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% HOLD.biblionumber | html %]">
52                                     [% HOLD.biblio.title | html %]
53                                     [% FOREACH s IN HOLD.biblio.subtitles %]
54                                         [% s | html %]
55                                     [% END %]
56                                     [% HOLD.item.enumchron | html %]
57                                 </a>
58                             [% ELSE %]
59                                 <strong>
60                                     [% HOLD.biblio.title | html %]
61                                     [% FOREACH s IN HOLD.biblio.subtitles %]
62                                         [% s | html %]
63                                     [% END %]
64                                     [% HOLD.item.enumchron | html %]
65                                 </strong>
66                             [% END %]
67                             [% HOLD.biblio.author | html %]
68                         </td>
69                         <td class="reservedate">
70                             <span title="[% HOLD.reservedate | html %]">
71                                 <span class="tdlabel">Hold date:</span>
72                                 [% HOLD.reservedate | $KohaDates %]
73                             </span>
74                         </td>
75                         <td class="expirationdate">
76                             [% IF ! HOLD.found %]
77                                 [% IF ( HOLD.expirationdate ) %]
78                                     <span title="[% HOLD.expirationdate | html %]">
79                                         <span class="tdlabel">Expiration:</span>
80                                             [% HOLD.expirationdate | $KohaDates %]
81                                     </span>
82                                 [% ELSE %]
83                                     <span title="0000-00-00">
84                                         <span class="tdlabel">Expiration:</span>
85                                         Never expires
86                                     </span>
87                                 [% END %]
88                             [% ELSE %]
89                                 <span title="0000-00-00">-</span>
90                             [% END %]
91                         </td>
92                         [% UNLESS( singleBranchMode) %]
93                             <td class="branch">
94                                 <span class="tdlabel">Pick up location:</span>
95                                 [% HOLD.branch.branchname | html %]
96                             </td>
97                         [% END %]
98                         [% IF ( showpriority ) %]
99                                 <td data-order="[% HOLD.priority | html %]" class="priority">
100                                 <span class="tdlabel">Priority:</span>
101                                 [% HOLD.priority | html %]
102                             </td>
103                         [% END %]
104                         <td class="status">
105                             <span class="tdlabel">Status:</span>
106                             [% IF ( HOLD.is_waiting ) %]
107                                 <i class="fa fa-exclamation-circle text-warning"></i>
108                                 [% IF ( HOLD.is_at_destination ) %]
109                                     [% IF ( HOLD.found ) %]
110                                         Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
111                                         [% IF ( HOLD.waitingdate ) %]
112                                             since [% HOLD.waitingdate | $KohaDates %]
113                                             [% IF HOLD.expirationdate %]
114                                                 until [% HOLD.expirationdate | $KohaDates %]
115                                             [% END %]
116                                         [% END %]
117                                         <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
118                                     [% ELSE %]
119                                         Item waiting to be pulled from <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b>
120                                     [% END %]
121                                 [% ELSE %]
122                                     Item in transit to <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
123                                 [% END %]
124                             [% ELSE %]
125                                 [% IF ( HOLD.is_in_transit ) %]
126                                     [% SET transfer = HOLD.item.get_transfer %]
127                                     Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
128                                     [% transfer.datesent | $KohaDates %]
129                                 [% ELSIF ( HOLD.suspend ) %]
130                                     Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | html %] [% END %]
131                                 [% ELSE %]
132                                     [% IF HOLD.itemtype %]
133                                         Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
134                                     [% ELSE %]
135                                         Pending
136                                     [% END %]
137                                 [% END %]
138                             [% END %]
139                         </td>
140                         [% IF SuspendHoldsOpac and ! onlyinfo %]
141                             <td>
142                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
143                                     [% IF HOLD.suspend %]
144                                         <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
145                                             <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
146                                             <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
147                                         </form>
148                                     [% ELSE %]
149                                         [% IF AutoResumeSuspendedHolds %]
150                                             <a class="btn btn-link js-show" href="#suspendModal[% HOLD.reserve_id | html %]" role="button" data-toggle="modal"><i class="fa fa-pause"></i> Suspend</a>
151                                             [% # hold suspend modal form %]
152                                             <div id="suspendModal[% HOLD.reserve_id | html %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% HOLD.reserve_id | html %]Label" aria-hidden="true">
153                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
154                                                     <div class="modal-header">
155                                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
156                                                         [% IF HOLD.suspend %]
157                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
158                                                         [% ELSE %]
159                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
160                                                         [% END %]
161                                                     </div>
162                                                     <div class="modal-body">
163                                                         <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
164                                                         <label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
165                                                         <input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
166                                                         [% INCLUDE 'date-format.inc' %]
167                                                         <p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% HOLD.reserve_id | html %]').value='';return false;">Clear date to suspend indefinitely</a></p>
168                                                         <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
169                                                     </div>
170                                                     <div class="modal-footer">
171                                                         <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
172                                                         <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
173                                                     </div>
174                                                 </form>
175                                             </div>  <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
176                                         [% ELSE %]
177                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
178                                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
179                                                 <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
180                                             </form>
181                                         [% END # / IF AutoResumeSuspendedHolds %]
182                                     [% END # / IF HOLD.suspend %]
183                                 [% END # / IF ( HOLD.is_cancelable_from_opac )%]
184                             </td>
185                         [% END # / IF SuspendHoldsOpac %]
186                         [% IF ! onlyinfo %]
187                             <td class="modify">
188                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
189                                     <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
190                                     <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
191                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
192                                     <button type="submit" name="submit" class="btn btn-mini btn-danger" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="fa fa-remove"></i> Cancel</button></form>
193                                 [% END %]
194                             </td>
195                         [% END # / IF onlyinfo %]
196                     </tr>
197                 [% END # /FOREACH HOLDS %]
198             </tbody>
199         </table>
200
201         [% IF SuspendHoldsOpac and ! onlyinfo %]
202             <div>
203                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
204                     <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="fa fa-pause"></i> Suspend all holds</button>
205                     <input type="hidden" name="suspend" value="1" />
206
207                     [% IF AutoResumeSuspendedHolds %]
208                         <label for="suspend_until"> until </label>
209                         <input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
210                         <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
211                     [% END %]
212                 </form>
213             </div>
214             <br/>
215             <div>
216                 <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
217                     <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_RESUME_HOLDS);"><i class="fa fa-play"></i> Resume all suspended holds</button>
218                     <input type="hidden" name="suspend" value="0" />
219                 </form>
220             </div>
221         [% END %]
222     </div> <!-- / #opac-user-holds -->
223 [% END # / #HOLDS.count %]