Bug 21772: (QA follow-up) Fix button class on Cancel hold button
[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                             [% IF ( HOLD.is_at_destination ) %]
108                                 [% IF ( HOLD.found ) %]
109                                     Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
110                                     [% IF ( HOLD.waitingdate ) %]
111                                         since [% HOLD.waitingdate | $KohaDates %]
112                                         [% IF HOLD.expirationdate %]
113                                             until [% HOLD.expirationdate | $KohaDates %]
114                                         [% END %]
115                                     [% END %]
116                                     <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
117                                 [% ELSE %]
118                                     Item waiting to be pulled from <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b>
119                                 [% END %]
120                             [% ELSE %]
121                                 Item in transit to <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
122                             [% END %]
123                         [% ELSE %]
124                             [% IF ( HOLD.is_in_transit ) %]
125                                 [% SET transfer = HOLD.item.get_transfer %]
126                                 Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
127                                 [% transfer.datesent | $KohaDates %]
128                             [% ELSIF ( HOLD.suspend ) %]
129                                 Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | html %] [% END %]
130                             [% ELSE %]
131                                 [% IF HOLD.itemtype %]
132                                     Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
133                                 [% ELSE %]
134                                     Pending
135                                 [% END %]
136                             [% END %]
137                         [% END %]
138                     </td>
139                     [% IF SuspendHoldsOpac and ! onlyinfo %]
140                         <td>
141                             [% IF ( HOLD.is_cancelable_from_opac ) %]
142                                 [% IF HOLD.suspend %]
143                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
144                                         <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
145                                         <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
146                                     </form>
147                                 [% ELSE %]
148                                     [% IF AutoResumeSuspendedHolds %]
149                                         <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>
150                                         [% # hold suspend modal form %]
151                                         <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">
152                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
153                                                 <div class="modal-header">
154                                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
155                                                     [% IF HOLD.suspend %]
156                                                         <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
157                                                     [% ELSE %]
158                                                         <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
159                                                     [% END %]
160                                                 </div>
161                                                 <div class="modal-body">
162                                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
163                                                     <label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
164                                                     <input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
165                                                     [% INCLUDE 'date-format.inc' %]
166                                                     <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>
167                                                     <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
168                                                 </div>
169                                                 <div class="modal-footer">
170                                                     <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
171                                                     <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
172                                                 </div>
173                                             </form>
174                                         </div>  <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
175                                     [% ELSE %]
176                                         <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
177                                             <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
178                                             <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
179                                         </form>
180                                     [% END # / IF AutoResumeSuspendedHolds %]
181                                 [% END # / IF HOLD.suspend %]
182                             [% END # / IF ( HOLD.is_cancelable_from_opac )%]
183                         </td>
184                     [% END # / IF SuspendHoldsOpac %]
185                     [% IF ! onlyinfo %]
186                         <td class="modify">
187                             [% IF ( HOLD.is_cancelable_from_opac ) %]
188                                 <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
189                                 <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
190                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
191                                 <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>
192                             [% END %]
193                         </td>
194                     [% END # / IF onlyinfo %]
195                 </tr>
196             [% END # /FOREACH HOLDS %]
197             </tbody>
198         </table>
199
200         [% IF SuspendHoldsOpac and ! onlyinfo %]
201             <div>
202                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
203                     <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="fa fa-pause"></i> Suspend all holds</button>
204                     <input type="hidden" name="suspend" value="1" />
205
206                     [% IF AutoResumeSuspendedHolds %]
207                         <label for="suspend_until"> until </label>
208                         <input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
209                         <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
210                     [% END %]
211                 </form>
212             </div>
213             <br/>
214             <div>
215                 <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
216                     <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>
217                     <input type="hidden" name="suspend" value="0" />
218                 </form>
219             </div>
220         [% END %]
221     </div> <!-- / #opac-user-holds -->
222 [% END # / #HOLDS.count %]