Bug 22010: Check preferences for ebook integration
[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                                     [% HOLD.biblio.title | html %]
57                                     [% FOREACH s IN HOLD.biblio.subtitles %]
58                                         [% s | html %]
59                                     [% END %]
60                                     [% HOLD.item.enumchron | html %]
61                                 </a>
62                             [% ELSE %]
63                                 <strong>
64                                     [% HOLD.biblio.title | html %]
65                                     [% FOREACH s IN HOLD.biblio.subtitles %]
66                                         [% s | html %]
67                                     [% END %]
68                                     [% HOLD.item.enumchron | html %]
69                                 </strong>
70                             [% END %]
71                             [% HOLD.biblio.author | html %]
72                         </td>
73                         <td class="reservedate">
74                             <span title="[% HOLD.reservedate | html %]">
75                                 <span class="tdlabel">Hold date:</span>
76                                 [% HOLD.reservedate | $KohaDates %]
77                             </span>
78                         </td>
79                         <td class="expirationdate">
80                             [% IF ! HOLD.found %]
81                                 [% IF ( HOLD.expirationdate ) %]
82                                     <span title="[% HOLD.expirationdate | html %]">
83                                         <span class="tdlabel">Expiration:</span>
84                                             [% HOLD.expirationdate | $KohaDates %]
85                                     </span>
86                                 [% ELSE %]
87                                     <span title="0000-00-00">
88                                         <span class="tdlabel">Expiration:</span>
89                                         Never expires
90                                     </span>
91                                 [% END %]
92                             [% ELSE %]
93                                 <span title="0000-00-00">-</span>
94                             [% END %]
95                         </td>
96                         [% UNLESS( singleBranchMode) %]
97                             <td class="branch">
98                                 <span class="tdlabel">Pick up location:</span>
99                                 [% HOLD.branch.branchname | html %]
100                             </td>
101                         [% END %]
102                         [% IF ( showpriority ) %]
103                                 <td data-order="[% HOLD.priority | html %]" class="priority">
104                                 <span class="tdlabel">Priority:</span>
105                                 [% HOLD.priority | html %]
106                             </td>
107                         [% END %]
108                         <td class="status">
109                             <span class="tdlabel">Status:</span>
110                             [% IF ( HOLD.is_waiting ) %]
111                                 <i class="fa fa-exclamation-circle text-warning"></i>
112                                 [% IF ( HOLD.is_at_destination ) %]
113                                     [% IF ( HOLD.found ) %]
114                                         Item waiting at <b> [% HOLD.branch.branchname | html %]</b>
115                                         [% IF ( HOLD.waitingdate ) %]
116                                             since [% HOLD.waitingdate | $KohaDates %]
117                                             [% IF HOLD.expirationdate %]
118                                                 until [% HOLD.expirationdate | $KohaDates %]
119                                             [% END %]
120                                         [% END %]
121                                         <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
122                                     [% ELSE %]
123                                         Item waiting to be pulled from <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b>
124                                     [% END %]
125                                 [% ELSE %]
126                                     Item in transit to <b> [% Branches.GetName( HOLD.branchcode ) | html %]</b> <input type="hidden" name="pickup" value="[% HOLD.branchcode | html %]" />
127                                 [% END %]
128                             [% ELSE %]
129                                 [% IF ( HOLD.is_in_transit ) %]
130                                     [% SET transfer = HOLD.item.get_transfer %]
131                                     Item in transit from <b> [% Branches.GetName( transfer.frombranch ) | html %]</b> since
132                                     [% transfer.datesent | $KohaDates %]
133                                 [% ELSIF ( HOLD.suspend ) %]
134                                     Suspended [% IF ( HOLD.suspend_until ) %] until [% HOLD.suspend_until | $KohaDates %] [% END %]
135                                 [% ELSE %]
136                                     [% IF HOLD.itemtype %]
137                                         Pending for next available item of item type '[% ItemTypes.GetDescription( HOLD.itemtype ) | html %]'
138                                     [% ELSE %]
139                                         Pending
140                                     [% END %]
141                                 [% END %]
142                             [% END %]
143                         </td>
144                         [% IF SuspendHoldsOpac and ! onlyinfo %]
145                             <td>
146                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
147                                     [% IF HOLD.suspend %]
148                                         <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
149                                             <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
150                                             <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-play"></i> Resume</button>
151                                         </form>
152                                     [% ELSE %]
153                                         [% IF AutoResumeSuspendedHolds %]
154                                             <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>
155                                             [% # hold suspend modal form %]
156                                             <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">
157                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
158                                                     <div class="modal-header">
159                                                         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
160                                                         [% IF HOLD.suspend %]
161                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Resume your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
162                                                         [% ELSE %]
163                                                             <h3 id="suspendModal[% HOLD.reserve_id | html %]Label">Suspend your hold on <i>[% HOLD.biblio.title | html %]</i></h3>
164                                                         [% END %]
165                                                     </div>
166                                                     <div class="modal-body">
167                                                         <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
168                                                         <label for="suspend_until_[% HOLD.reserve_id | html %]">Suspend until:</label>
169                                                         <input type="text" name="suspend_until" id="suspend_until_[% HOLD.reserve_id | html %]" class="suspend-until" size="10" />
170                                                         [% INCLUDE 'date-format.inc' %]
171                                                         <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>
172                                                         <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
173                                                     </div>
174                                                     <div class="modal-footer">
175                                                         <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
176                                                         <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
177                                                     </div>
178                                                 </form>
179                                             </div>  <!-- /#suspendModal[% HOLD.reserve_id | html %] -->
180                                         [% ELSE %]
181                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
182                                                 <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
183                                                 <button class="btn btn-link" type="submit" name="submit"><i class="fa fa-pause"></i> Suspend</button>
184                                             </form>
185                                         [% END # / IF AutoResumeSuspendedHolds %]
186                                     [% END # / IF HOLD.suspend %]
187                                 [% END # / IF ( HOLD.is_cancelable_from_opac )%]
188                             </td>
189                         [% END # / IF SuspendHoldsOpac %]
190                         [% IF ! onlyinfo %]
191                             <td class="modify">
192                                 [% IF ( HOLD.is_cancelable_from_opac ) %]
193                                     <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
194                                     <input type="hidden" name="biblionumber" value="[% HOLD.biblionumber | html %]" />
195                                     <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" />
196                                     <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>
197                                 [% END %]
198                             </td>
199                         [% END # / IF onlyinfo %]
200                     </tr>
201                 [% END # /FOREACH HOLDS %]
202             </tbody>
203         </table>
204
205         [% IF SuspendHoldsOpac and ! onlyinfo %]
206             [% UNLESS ( all_holds_waiting ) %]
207                 <div>
208                     <form class="form-inline" id="suspend_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
209                         <button type="submit" id="suspend_all_submit" class="btn"><i class="fa fa-pause"></i> Suspend all holds</button>
210                         <input type="hidden" name="suspend" value="1" />
211
212                         [% IF AutoResumeSuspendedHolds %]
213                             <label for="suspend_until"> until </label>
214                             <input type="text" name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
215                             <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
216                         [% END %]
217                     </form>
218                 </div>
219                 <br/>
220                 <div>
221                     <form id="resume_all_holds" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
222                         <button type="submit" id="resume_all_submit" class="btn"><i class="fa fa-play"></i> Resume all suspended holds</button>
223                         <input type="hidden" name="suspend" value="0" />
224                     </form>
225                 </div>
226             [% END %]
227         [% END %]
228     </div> <!-- / #opac-user-holds -->
229 [% END # / #HOLDS.count %]