Bug 17221: Remove orphan commas in shelf browser
[koha.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                 [% SET all_holds_waiting = 1 %]
36                 [% FOREACH HOLD IN HOLDS %]
37                     [% UNLESS ( HOLD.is_waiting || HOLD.is_in_transit ) %]
38                         [% SET all_holds_waiting = 0 %]
39                     [% END %]
40                     [% IF ( HOLD.is_waiting ) %]
41                         [% IF ( HOLD.is_at_destination ) %]
42                             [% IF ( HOLD.is_found ) %]
43                                 <tr class="reserved">
44                             [% ELSE %]
45                                 <tr>
46                             [% END %]
47                         [% ELSE %]
48                             <tr class="transfered">
49                         [% END %]
50                     [% ELSE %]
51                         <tr>
52                     [% END %]
53                         <td class="title">
54                             [% IF ! onlyinfo %]
55                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% HOLD.biblionumber | html %]">
56                                     [% INCLUDE 'biblio-title.inc' biblio=HOLD.biblio %]
57                                     [% HOLD.item.enumchron | html %]
58                                 </a>
59                             [% ELSE %]
60                                 <strong>
61                                     [% INCLUDE 'biblio-title.inc' biblio=HOLD.biblio %]
62                                     [% HOLD.item.enumchron | html %]
63                                 </strong>
64                             [% END %]
65                             [% HOLD.biblio.author | html %]
66                         </td>
67                         <td class="reservedate">
68                             <span title="[% HOLD.reservedate | html %]">
69                                 <span class="tdlabel">Hold date:</span>
70                                 [% HOLD.reservedate | $KohaDates %]
71                             </span>
72                         </td>
73                         <td class="expirationdate">
74                             [% IF ! HOLD.found %]
75                                 [% IF ( HOLD.expirationdate ) %]
76                                     <span title="[% HOLD.expirationdate | html %]">
77                                         <span class="tdlabel">Expiration:</span>
78                                             [% HOLD.expirationdate | $KohaDates %]
79                                     </span>
80                                 [% ELSE %]
81                                     <span title="0000-00-00">
82                                         <span class="tdlabel">Expiration:</span>
83                                         Never expires
84                                     </span>
85                                 [% END %]
86                             [% ELSE %]
87                                 <span title="0000-00-00">-</span>
88                             [% END %]
89                         </td>
90                         [% UNLESS( singleBranchMode) %]
91                             <td class="branch">
92                                 <span class="tdlabel">Pick up location:</span>
93                                 [% HOLD.branch.branchname | html %]
94                             </td>
95                         [% END %]
96                         [% IF ( showpriority ) %]
97                                 <td data-order="[% HOLD.priority | html %]" class="priority">
98                                 <span class="tdlabel">Priority:</span>
99                                 [% HOLD.priority | html %]
100                             </td>
101                         [% END %]
102                         <td class="status">
103                             <span class="tdlabel">Status:</span>
104                             [% IF ( HOLD.is_waiting ) %]
105                                 <i class="fa fa-exclamation-circle text-warning"></i>
106                                 [% IF ( HOLD.is_at_destination ) %]
107                                     [% IF ( HOLD.found ) %]
108                                         Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
109                                         [% IF ( HOLD.waitingdate ) %]
110                                             since [% HOLD.waitingdate | $KohaDates %]
111                                             [% IF HOLD.expirationdate %]
112                                                 until [% HOLD.expirationdate | $KohaDates %]
113                                             [% END %]
114                                         [% END %]
115                                         <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
116                                     [% ELSE %]
117                                         Item waiting to be pulled from <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b>
118                                     [% END %]
119                                 [% ELSE %]
120                                     Item in transit to <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
121                                 [% END %]
122                             [% ELSE %]
123                                 [% IF ( HOLD.is_in_transit ) %]
124                                     [% SET transfer = HOLD.item.get_transfer %]
125                                     Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
126                                     [% transfer.datesent | $KohaDates %]
127                                 [% ELSIF ( HOLD.suspend ) %]
128                                     Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %]
129                                 [% ELSE %]
130                                     [% IF HOLD.itemtype %]
131                                         Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
132                                     [% ELSE %]
133                                         Pending
134                                     [% END %]
135                                 [% END %]
136                             [% END %]
137                         </td>
138                         [% IF SuspendHoldsOpac and ! onlyinfo %]
139                             <td>
140                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
141                                     [% IF HOLD.suspend %]
142                                         <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
143                                             <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
144                                             <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
145                                         </form>
146                                     [% ELSE %]
147                                         [% IF AutoResumeSuspendedHolds %]
148                                             <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>
149                                             [% # hold suspend modal form %]
150                                             <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">
151                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
152                                                     <div class="modal-header">
153                                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
154                                                         [% IF HOLD.suspend %]
155                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
156                                                         [% ELSE %]
157                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
158                                                         [% END %]
159                                                     </div>
160                                                     <div class="modal-body">
161                                                         <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
162                                                         <label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
163                                                         <input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
164                                                         [% INCLUDE 'date-format.inc' %]
165                                                         <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>
166                                                         <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
167                                                     </div>
168                                                     <div class="modal-footer">
169                                                         <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
170                                                         <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
171                                                     </div>
172                                                 </form>
173                                             </div>  <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
174                                         [% ELSE %]
175                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
176                                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
177                                                 <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
178                                             </form>
179                                         [% END # / IF AutoResumeSuspendedHolds %]
180                                     [% END # / IF HOLD.suspend %]
181                                 [% END # / IF ( HOLD.is_cancelable_from_opac )%]
182                             </td>
183                         [% END # / IF SuspendHoldsOpac %]
184                         [% IF ! onlyinfo %]
185                             <td class="modify">
186                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
187                                     <form id="delete_hold_[% HOLD.reserve_id | html %]" action="/cgi-bin/koha/opac-modrequest.pl" method="post">
188                                     <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
189                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
190                                     <button data-title="[% INCLUDE 'biblio-title-head.inc' biblio=HOLD.biblio %]" data-reserve_id="[% HOLD.reserve_id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-hold"><i class="fa fa-remove"></i> Cancel</button>
191                                 </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             [% UNLESS ( all_holds_waiting ) %]
202                 <div>
203                     <form class="form-inline" id="suspend_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
204                         <button type="submit" id="suspend_all_submit" class="btn"><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 id="resume_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
217                         <button type="submit" id="resume_all_submit" class="btn"><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         [% END %]
223     </div> <!-- / #opac-user-holds -->
224 [% END # / #HOLDS.count %]