Bug 5144: Duplicate holds allowed if patron clicks back button after placing hold
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
10 [% INCLUDE 'masthead.inc' %]
11
12 <div class="main">
13     <ul class="breadcrumb">
14         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15         <li>[% FOREACH BORROWER_INF IN BORROWER_INFO %]<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]</a>[% END %] <span class="divider">&rsaquo;</span></li>
16         <li><a href="#">Your summary</a></li>
17     </ul>
18
19     <div class="container-fluid">
20         <div class="row-fluid">
21             <div class="span2">
22                 <div id="navigation">
23                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
24                 </div>
25             </div>
26             <div class="span10">
27                 <div id="userdetails" class="maincontent">
28                     [% IF ( bor_messages ) %]
29                         <div class="alert alert-info">
30                             <h3>Messages for you</h3>
31                                 <ul>
32                                     [% FOREACH bor_messages_loo IN bor_messages_loop %]
33                                         <li>
34                                         <strong>[% bor_messages_loo.message %]</strong><br>
35                                         &nbsp;&nbsp;&nbsp;<i>Written on [% bor_messages_loo.message_date | $KohaDates %] by [% bor_messages_loo.branchname %]</i>
36                                         </li>
37                                     [% END %]
38
39                                     [% IF ( opacnote ) %]<li>[% opacnote %]</li>[% END %]
40                                 </ul>
41                         </div>
42                     [% END # / IF bor_messages %]
43                     [% FOREACH BORROWER_INF IN BORROWER_INFO %]
44                     <h2>Hello, [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]
45                     </h2>
46
47                     <p><a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here if you're not [% BORROWER_INF.title %] [% INCLUDE 'patron-title.inc' category_type = BORROWER_INF.category_type firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]</a></p>
48
49                     [% IF ( patronupdate ) %]<div class="alert alert-info"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
50
51                     [% IF failed_holds %]
52                         <div class="alert alert-info">
53                             <h3>Notice:</h3>
54                             <p>One or more holds were not placed due to existing holds.</p>
55                         </div>
56                     [% END %]
57
58                     [% IF ( BORROWER_INF.warndeparture ) %]
59                         <div class="alert" id="warndeparture">
60                             <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% BORROWER_INF.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
61                                 [% IF ( BORROWER_INF.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your card expires.</span>[% END %]
62                         </div>
63                     [% END %]
64
65                     [% IF ( BORROWER_INF.warnexpired ) %]
66                         <div class="alert" id="warnexpired">
67                             <strong>Please note: </strong><span>Your account has expired as of [% BORROWER_INF.warnexpired | $KohaDates %]. Please contact the library if you wish to renew your account.</span>
68                         </div>
69                     [% END %]
70
71                     [% IF ( RENEW_ERROR ) %]
72                         <div class="dialog alert">
73                             <strong>Please note:</strong>
74                             <span>
75                                 Your loan renewal failed because of the following reason(s):
76                                 [% FOREACH error IN RENEW_ERROR.split('\|') %]
77                                     [% IF error == 'card_expired' %]
78                                         Your account has expired. Please contact the library for more information.
79                                     [% ELSIF error == 'too_many' %]
80                                         You have renewed this item the maximum number of times allowed.
81                                     [% ELSIF error == 'on_reserve' %]
82                                         This item is on hold for another patron.
83                                     [% END %]
84                                 [% END %]
85                             </span>
86                         </div>
87                     [% END %]
88
89                     [% IF ( patron_flagged ) %]
90                         <div class="alert">
91                             <ul>
92                                 [% IF ( userdebarred ) %]
93                                     <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen[% IF ( BORROWER_INF.userdebarreddate ) %] until <span id="userdebarred_date">[% BORROWER_INF.userdebarreddate | $KohaDates %]</span>[% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment <span id="userdebarred_comment">"[% BORROWER_INF.debarredcomment %]"</span>[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please contact the library.</li>
94                                 [% END %]
95                                 [% IF ( BORROWER_INF.gonenoaddress ) %]
96                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date [% UNLESS ( BORROWER_INF.OPACPatronDetails ) %]<a href="/cgi-bin/koha/opac-userupdate.pl">contact information</a>[% ELSE %]contact information[% END %] on file.  Please contact the library[% IF ( BORROWER_INF.OPACPatronDetails ) %] or use the <a href="/cgi-bin/koha/opac-userupdate.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)[% END %].</li>
97                                 [% END %]
98                                 [% IF ( BORROWER_INF.lost ) %]
99                                     <li id="lost"><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please contact the library.</li>
100                                 [% END %]
101                                 [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %]
102                                     <li id="renewal_blocked_fines"><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">[% IF renewal_blocked_fines != "0.00" %] more than <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines %]</span> in [% END %] fines</a>, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li>
103                                 [% END %]
104                             </ul>
105                         </div>
106                     [% END # / IF patron_flagged %]
107
108                     [% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %]
109                     [% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %]
110
111                     <div id="opac-user-views" class="toptabs">
112                         <ul>
113                             <li><a href="#opac-user-checkouts">Checked out ([% issues_count %])</a></li>
114                             [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %]
115                             [% IF ( OPACFinesTab ) %]
116                                 [% IF ( BORROWER_INF.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INF.amountoutstanding %])</a></li>[% END %]
117                                 [% IF ( BORROWER_INF.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INF.amountoutstanding %])</a></li>[% END %]
118                                 [% IF ( BORROWER_INF.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INF.amountoutstanding %])</a></li>[% END %]
119                             [% END %]
120                             [% IF ( waiting_count ) %][% IF ( BORROWER_INF.atdestination ) %]<li><a href="#opac-user-waiting">Waiting ([% waiting_count %])</a></li>[% END %][% END %]
121                             [% IF ( reserves_count ) %]<li><a href="#opac-user-holds">Holds ([% reserves_count %])</a></li>[% END %]
122                         </ul>
123
124                         <div id="opac-user-checkouts">
125                             [% IF ( issues_count ) %]
126                                 <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
127                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
128                                     <input type="hidden" name="from" value="opac_user" />
129                                     <table id="checkoutst" class="table table-bordered table-striped">
130                                         <caption>[% issues_count %] Item(s) checked out</caption>
131                                         <thead>
132                                             <tr>
133                                                 [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
134                                                 <th class="anti-the">Title</th>
135                                                 <th class="title-string psort">Due</th>
136                                                 [% UNLESS ( item_level_itypes ) %]
137                                                     <th>Item type</th>
138                                                 [% END %]
139                                                 [% IF ( show_barcode ) %]
140                                                     <th>Barcode</th>
141                                                 [% END %]
142                                                     <th>Call No.</th>
143                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
144                                                     <th class="nosort">Renew</th>
145                                                 [% END %]
146                                                 [% IF ( OPACFinesTab ) %]
147                                                     <th>Fines</th>
148                                                 [% END %]
149                                                 [% IF ( OPACMySummaryHTML ) %]
150                                                     <th class="nosort">Links</th>
151                                                 [% END %]
152                                             </tr>
153                                         </thead>
154                                         <tbody>
155                                             [% FOREACH ISSUE IN ISSUES %]
156                                                 [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
157                                                 [% IF ( JacketImages ) %]<td class="jacketcell">
158
159                                                     [% IF ( OPACAmazonCoverImages ) %]
160                                                         [% IF ( ISSUE.normalized_isbn ) %]
161                                                             <a href="http://www.amazon.com/gp/reader/[% ISSUE.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% ISSUE.normalized_isbn %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail"/></a>
162                                                         [% ELSE %]
163                                                             <a href="#"><span class="no-image">No cover image available</span></a>
164                                                         [% END %]
165                                                     [% END %]
166
167                                                     [% IF ( GoogleJackets ) %]
168                                                         [% IF ( ISSUE.normalized_isbn ) %]
169                                                             <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
170                                                         [% ELSE %]
171                                                             <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
172                                                         [% END %]
173                                                     [% END %]
174
175                                                     [% IF ( BakerTaylorEnabled ) %]
176                                                         [% IF ( ISSUE.normalized_isbn ) %]
177                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% ISSUE.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% ISSUE.normalized_isbn %]" /></a>
178                                                         [% ELSE %]
179                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_isbn! -->
180                                                         [% END %]
181                                                     [% END %]
182
183                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
184                                                         [% IF ( using_https ) %]
185                                                             <img src="https://secure.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% ISSUE.normalized_upc %]&amp;oclc=[% ISSUE.normalized_oclc %]" alt="" class="item-thumbnail" />
186                                                         [% ELSE %]
187                                                             <img src="http://www.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% ISSUE.normalized_upc %]&amp;oclc=[% ISSUE.normalized_oclc %]" alt="" class="item-thumbnail" />
188                                                         [% END %]
189                                                     [% END %]
190
191                                                 </td>[% END # / IF JacketImages %]
192
193                                                 <td class="title">
194                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber %]">[% ISSUE.title |html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield %][% END %]</a>
195                                                     <span class="item-details">[% ISSUE.author %]</span>
196                                                 </td>
197                                                 [% IF ( ISSUE.overdue ) %]
198                                                     <td class="date_due overdue">
199                                                         <span title="[% ISSUE.date_due %]">
200                                                             <span class="tdlabel">Date due:</span>
201                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
202                                                         </span>
203                                                     </td>
204                                                 [% ELSE %]
205                                                     <td class="date_due">
206                                                         <span title="[% ISSUE.date_due %]">
207                                                             <span class="tdlabel">Date due:</span>
208                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
209                                                         </span>
210                                                     </td>
211                                                 [% END %]
212                                                 [% UNLESS ( item_level_itypes ) %]
213                                                     <td class="itype">
214                                                         <span class="tdlabel">Item type:</span>
215                                                         [% IF ( ISSUE.imageurl ) %]
216                                                             <img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />
217                                                         [% END %] [% ISSUE.description %]
218                                                     </td>
219                                                 [% END %]
220                                                 [% IF ( show_barcode ) %]
221                                                     <td class="barcode">
222                                                         <span class="tdlabel">Barcode:</span>
223                                                         [% ISSUE.barcode %]
224                                                     </td>
225                                                 [% END %]
226                                                 <td class="call_no">
227                                                     <span class="tdlabel">Call number:</span>
228                                                     [% ISSUE.itemcallnumber %]
229                                                 </td>
230                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
231                                                     <td class="renew">
232                                                     [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
233                                                     [% IF ( ISSUE.status ) %]
234                                                         [% IF ( canrenew ) %]
235                                                             <input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber %]&amp;borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>
236                                                         [% END %]
237                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
238                                                     [% ELSIF ( ISSUE.too_many ) %]
239                                                         Not renewable
240                                                     [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
241                                                         Automatic renewal
242                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
243                                                     [% ELSIF ( ISSUE.too_soon ) %]
244                                                         No renewal before [% ISSUE.soonestrenewdate %]
245                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
246                                                     [% ELSIF ( ISSUE.on_reserve ) %]
247                                                         <span class="renewals">(On hold)</span>
248                                                     [% END %]
249                                                     </td>
250                                                 [% END %]
251                                                 [% IF ( OPACFinesTab ) %]
252                                                     <td class="fines">
253                                                         <span class="tdlabel">Fines:</span>
254                                                         [% IF ( ISSUE.charges ) %]
255                                                             Yes
256                                                         [% ELSE %]
257                                                             No
258                                                         [% END %]
259                                                     </td>
260                                                 [% END %]
261                                                 [% IF ( OPACMySummaryHTML ) %]
262                                                     <td class="links">[% ISSUE.MySummaryHTML %]</td>
263                                                 [% END %]
264                                             </tr>
265                                         [% END # /FOREACH ISSUES %]
266                                     </tbody>
267                                 </table>
268                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
269                                     <input type="submit" class="btn" value="Renew selected" />
270                                 [% END %]
271                                 </form>
272
273                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
274                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
275                                     <input type="hidden" name="from" value="opac_user" />
276                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
277                                     [% FOREACH ISSUE IN ISSUES %]
278                                         <input type="hidden" name="item" value="[% ISSUE.itemnumber %]" />
279                                     [% END %]
280                                     <input type="submit" class="btn" value="Renew all" />
281                                 </form>
282                                 [% END %]
283                             [% ELSE %]
284                                 <table class="table table-bordered table-striped">
285                                     <tr><td>You have nothing checked out</td></tr>
286                                 </table>
287                             [% END # IF issues_count %]
288                         </div> <!-- / .opac-user-checkouts -->
289
290                         [% IF ( OPACFinesTab ) %]
291                             <!-- FINES BOX -->
292                             [% IF ( BORROWER_INF.amountoverfive ) %]
293                                 <div id="opac-user-fines"> <h3>Fines and charges</h3>
294                                     <table class="table table-bordered table-striped">
295                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
296                                         <tbody>
297                                             <tr>
298                                                 <td>You currently owe fines and charges amounting to:</td>
299                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INF.amountoutstanding %]</a></td>
300                                             </tr>
301                                         </tbody>
302                                     </table>
303                                 </div>
304                             [% END %]
305
306                             [% IF ( BORROWER_INF.amountoverzero ) %]
307                                <div id="opac-user-fines"> <h3>Fines and charges</h3>
308                                     <table class="table table-bordered table-striped">
309                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
310                                         <tbody>
311                                             <tr>
312                                                 <td>You currently owe fines and charges amounting to:</td>
313                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INF.amountoutstanding %]</a></td>
314                                             </tr>
315                                         </tbody>
316                                     </table>
317                                 </div>
318                             [% END %]
319
320                             [% IF ( BORROWER_INF.amountlessthanzero ) %]
321                                 <div id="opac-user-fines">  <h3>Credits</h3>
322                                     <table class="table table-bordered table-striped">
323                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
324                                         <tbody>
325                                             <tr>
326                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INF.amountoutstanding %]</a></td>
327                                             </tr>
328                                         </tbody>
329                                     </table>
330                                 </div>
331                             [% END %]
332                         [% END # / OPACFinesTab %]
333
334                     [% END # / FOREACH BORROWER_INFO %]
335
336                         [% IF ( waiting_count && atdestination ) %]
337                             <div id="opac-user-waiting">
338                                 <table id="waitingt" class="table table-bordered table-striped">
339                                     <caption>Holds waiting</caption>
340                                     <thead>
341                                         <tr>
342                                             <th class="anti-the">Title</th>
343                                             <th>Hold date</th>
344                                             <th>Pick up library</th>
345                                         </tr>
346                                     </thead>
347                                     <tbody>
348                                         [% FOREACH WAITIN IN WAITING %]
349                                             <tr>
350                                                 <td><img src="[% themelang %]/images/[% WAITIN.itemtype %].gif" alt="[% WAITIN.itemtype %]" title="[% WAITIN.itemtype %]" /></td>
351                                                 <td>
352                                                     <a class="title" href="opac-detail.pl?biblionumber=[% WAITIN.biblionumber %]">
353                                                         [% WAITIN.waiting_title %] [% FOREACH subtitl IN WAITIN.subtitle %] [% subtitl.subfield %][% END %]
354                                                     </a>
355                                                     <span class="item-details">
356                                                         [% WAITIN.author %]
357                                                     </span></td>
358                                                 <td>
359                                                     <span class="tdlabel">Hold date:</span>
360                                                     [% WAITIN.reservedate | $KohaDates %]</td>
361                                                 <td>
362                                                     [% IF ( WAITIN.atdestination ) %]
363                                                         <strong>Waiting</strong> at [% WAITIN.branch %]
364                                                     [% ELSE %]
365                                                         In transit from [% WAITIN.holdingbranch %] to [% WAITIN.branch %]
366                                                     [% END %]
367                                                 </td>
368                                             </tr>
369                                         [% END %]
370                                     </tbody>
371                                 </table>
372                             </div> <!-- /#opac-user-waiting -->
373                         [% END # waiting_count && atdestination %]
374
375
376                         [% IF ( overdues_count ) %]
377                             <div id="opac-user-overdues">
378                                 <table id="overduest" class="table table-bordered table-striped">
379                                     <caption>Overdues <span class="count">([% overdues_count %] total)</span></caption>
380                                     <!-- OVERDUES TABLE ROWS -->
381                                     <thead>
382                                         <tr>
383                                             [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
384                                             <th class="anti-the">Title</th>
385                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
386                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
387                                             <th>Call no.</th>
388                                             <th class="title-string psort">Due</th>
389                                             [% IF ( OpacRenewalAllowed ) %]
390                                                 <th class="nosort">Renew</th>
391                                             [% END %]
392                                             [% IF ( OPACFinesTab ) %]
393                                                 <th>Fines</th>
394                                             [% END %]
395                                         </tr>
396                                     </thead>
397                                     <tbody>
398                                         [% FOREACH OVERDUE IN OVERDUES %]
399                                             <tr>
400                                                 [% IF ( JacketImages ) %]
401                                                     <td class="jacketcell">
402                                                     [% IF ( OPACAmazonCoverImages ) %]
403                                                         [% IF ( OVERDUE.normalized_isbn ) %]
404                                                             <a href="http://www.amazon.com/gp/reader/[% OVERDUE.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% OVERDUE.normalized_isbn %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail" /></a>
405                                                         [% ELSE %]
406                                                             <a href="#"><span class="no-image">No cover image available</span></a>
407                                                         [% END %]
408                                                     [% END %]
409
410                                                     [% IF ( GoogleJackets ) %]
411                                                         [% IF ( OVERDUE.normalized_isbn ) %]
412                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
413                                                         [% ELSE %]
414                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
415                                                         [% END %]
416                                                     [% END %]
417
418                                                     [% IF ( BakerTaylorEnabled ) %]
419                                                         [% IF ( OVERDUE.normalized_isbn ) %]
420                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% OVERDUE.normalized_isbn %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% OVERDUE.normalized_isbn %]" /></a>
421                                                         [% ELSE %]
422                                                             <!-- BakerTaylor needs normalized_isbn! --><span class="no-image">No cover image available</span>
423                                                         [% END %]
424                                                     [% END %]
425
426                                                     [% IF ( SyndeticsCoverImages ) %]
427                                                         [% IF ( using_https ) %]
428                                                             <img src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;upc=[% OVERDUE.normalized_upc %]&amp;oclc=[% OVERDUE.normalized_oclc %]&amp;type=xw10" alt="" class="item-thumbnail" />
429                                                         [% ELSE %]
430                                                             <img src="http://www.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;upc=[% OVERDUE.normalized_upc %]&amp;oclc=[% OVERDUE.normalized_oclc %]&amp;type=xw10" alt="" class="item-thumbnail" />
431                                                         [% END %]
432                                                     [% END %]
433                                                     </td>
434                                                 [% END # /IF jacketcell %]
435
436                                                 <td>
437                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber %]">[% OVERDUE.title |html %] [% FOREACH subtitl IN OVERDUE.subtitle %] [% subtitl.subfield %][% END %]
438                                                     </a>
439                                                     <span class="item-details">[% OVERDUE.author %]</span></td>
440
441                                                 [% UNLESS ( item_level_itypes ) %]
442                                                     <td>
443                                                         [% IF ( OVERDUE.imageurl ) %]
444                                                             <img src="[% OVERDUE.imageurl %]" title="[% OVERDUE.description %]" alt="[% OVERDUE.description %]" />
445                                                         [% END %] [% OVERDUE.description %]
446                                                     </td>
447                                                 [% END %]
448                                                 [% IF ( show_barcode ) %]
449                                                     <td>
450                                                         <span class="tdlabel">Barcode:</span>
451                                                         [% OVERDUE.barcode %]
452                                                     </td>
453                                                 [% END %]
454                                                 <td>
455                                                     <span class="tdlabel">Call number:</span>
456                                                     [% OVERDUE.itemcallnumber %]
457                                                 </td>
458                                                 <td>
459                                                     <span title="[% OVERDUE.date_due %]">
460                                                         <span class="tdlabel">Date due:</span>
461                                                         [% OVERDUE.date_due_sql | $KohaDates as_due_date => 1 %]
462                                                     </span>
463                                                 </td>
464                                                 [% IF ( OpacRenewalAllowed ) %]
465                                                     <td>
466                                                         [% IF ( OVERDUE.debarred ) %]
467                                                             Account frozen
468                                                         [% ELSIF ( OVERDUE.status ) %]
469                                                             [% IF ( canrenew ) %]
470                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber %]&amp;bornum=[% OVERDUE.borrowernumber %]">Renew</a>
471                                                             [% END %]
472                                                                 <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span>
473                                                         [% ELSIF ( OVERDUE.onreserve ) %]
474                                                             On hold
475                                                         [% ELSE %]
476                                                             No renewals left
477                                                         [% END %]
478                                                     </td>
479                                                 [% END %]
480                                                 [% IF ( OPACFinesTab ) %]
481                                                     <td>
482                                                         <span class="tdlabel">Fines:</span>
483                                                         [% IF ( OVERDUE.charges ) %]
484                                                             Yes
485                                                         [% ELSE %]
486                                                             No
487                                                         [% END %]
488                                                     </td>
489                                                 [% END %]
490                                             </tr>
491                                         [% END %]
492                                     </tbody>
493                                 </table>
494                             </div> <!-- / #opac-user-overdues -->
495                         [% END # /overdues_count %]
496
497
498                         [% IF ( reserves_count ) %]
499                             <div id="opac-user-holds">
500                                 <table id="holdst" class="table table-bordered table-striped">
501                                     <caption>Holds <span class="count">([% reserves_count %] total)</span></caption>
502                                     <!-- RESERVES TABLE ROWS -->
503                                     <thead>
504                                         <tr>
505                                             <th class="anti-the">Title</th>
506                                             <th class="psort">Placed on</th>
507                                             <th>Expires on</th>
508                                             <th>Pick up location</th>
509                                             [% IF ( showpriority ) %]
510                                                 <th>Priority</th>
511                                             [% END %]
512                                             <th>Status</th>
513                                             [% IF SuspendHoldsOpac %]
514                                                  <th class="nosort" >Suspend</th>
515                                             [% END %]
516                                             <th class="nosort">Modify</th>
517                                         </tr>
518                                     </thead>
519                                     <tbody>
520                                     [% FOREACH RESERVE IN RESERVES %]
521                                         [% IF ( RESERVE.wait ) %]
522                                             [% IF ( RESERVE.atdestination ) %]
523                                                 [% IF ( RESERVE.found ) %]
524                                                     <tr class="reserved">
525                                                 [% ELSE %]
526                                                     <tr>
527                                                 [% END %]
528                                             [% ELSE %]
529                                                 <tr class="transfered">
530                                             [% END %]
531                                         [% ELSE %]
532                                             <tr>
533                                         [% END %]
534                                             <td class="title">
535                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
536                                                     [% RESERVE.reserves_title %]
537                                                     [% FOREACH subtitl IN RESERVE.subtitle %]
538                                                         [% subtitl.subfield %]
539                                                     [% END %]
540                                                     [% RESERVE.enumchron %]
541                                                 </a>
542                                                 [% RESERVE.author %]
543                                             </td>
544                                             <td class="reservedate">
545                                                 <span title="[% RESERVE.reservedate %]">
546                                                     <span class="tdlabel">Hold date:</span>
547                                                     [% RESERVE.reservedate | $KohaDates %]
548                                                 </span>
549                                             </td>
550                                             <td class="expirationdate">
551                                                 [% IF ( RESERVE.expirationdate ) %]
552                                                     <span>
553                                                         <span class="tdlabel">Expiration:</span>
554                                                         [% RESERVE.expirationdate | $KohaDates %]
555                                                     </span>
556                                                 [% ELSE %]
557                                                     <span class="tdlabel">Expiration:</span>
558                                                     Never expires
559                                                 [% END %]
560                                             </td>
561                                             <td class="branch">
562                                                 <span class="tdlabel">Pick up location:</span>
563                                                 [% RESERVE.branch %]
564                                             </td>
565                                             [% IF ( showpriority ) %]
566                                                  <td class="priority">
567                                                     <span class="tdlabel">Priority:</span>
568                                                     [% RESERVE.priority %]
569                                                 </td>
570                                             [% END %]
571                                             <td class="status">
572                                                 <span class="tdlabel">Status:</span>
573                                                 [% IF ( RESERVE.wait ) %]
574                                                     [% IF ( RESERVE.atdestination ) %]
575                                                         [% IF ( RESERVE.found ) %]
576                                                             Item waiting at <b> [% RESERVE.wbrname %]</b>[% IF ( RESERVE.waitingdate ) %] since [% RESERVE.waitingdate | $KohaDates %][% END %]
577                                                             <input type="hidden" name="pickup" value="[% RESERVE.wbrcd %]" />
578                                                         [% ELSE %]
579                                                             Item waiting to be pulled from <b> [% RESERVE.wbrname %]</b>
580                                                         [% END %]
581                                                     [% ELSE %]
582                                                         Item in transit to <b> [% RESERVE.wbrname %]</b> <input type="hidden" name="pickup" value="[% RESERVE.wbrcd %]" />
583                                                     [% END %]
584                                                 [% ELSE %]
585                                                     [% IF ( RESERVE.intransit ) %]
586                                                         Item in transit from <b> [% RESERVE.frombranch %]</b> since
587                                                         [% RESERVE.datesent | $KohaDates %]
588                                                     [% ELSIF ( RESERVE.suspend ) %]
589                                                         Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until %] [% END %]
590                                                     [% ELSE %]
591                                                         Pending
592                                                     [% END %]
593                                                 [% END %]
594                                             </td>
595                                             [% IF SuspendHoldsOpac %]
596                                                 <td>
597                                                     [% IF ( RESERVE.cancelable ) %]
598                                                         [% IF RESERVE.suspend %]
599                                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
600                                                                 <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
601                                                                 <button class="btn btn-link" type="submit" name="submit"><i class="icon-play"></i> Resume</button>
602                                                             </form>
603                                                         [% ELSE %]
604                                                             [% IF AutoResumeSuspendedHolds %]
605                                                                 <a class="btn btn-link js-show" href="#suspendModal[% RESERVE.reserve_id %]" role="button" data-toggle="modal"><i class="icon-pause"></i> Suspend</a>
606                                                                 [% # hold suspend modal form %]
607                                                                 <div id="suspendModal[% RESERVE.reserve_id %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% RESERVE.reserve_id %]Label" aria-hidden="true">
608                                                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
609                                                                         <div class="modal-header">
610                                                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
611                                                                             [% IF RESERVE.suspend %]
612                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.reserves_title %]</i></h3>
613                                                                             [% ELSE %]
614                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.reserves_title %]</i></h3>
615                                                                             [% END %]
616                                                                         </div>
617                                                                         <div class="modal-body">
618                                                                             <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
619                                                                             <label for="suspend_until_[% RESERVE.reserve_id %]">Suspend until:</label>
620                                                                             <input name="suspend_until" id="suspend_until_[% RESERVE.reserve_id %]" class="suspend-until" size="10" />
621                                                                             [% INCLUDE 'date-format.inc' %]
622                                                                             <p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% RESERVE.reserve_id %]').value='';return false;">Clear date to suspend indefinitely</a></p>
623                                                                             <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
624                                                                         </div>
625                                                                         <div class="modal-footer">
626                                                                             <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
627                                                                             <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
628                                                                         </div>
629                                                                     </form>
630                                                                 </div>  <!-- /#suspendModal[% RESERVE.reserve_id %] -->
631                                                             [% ELSE %]
632                                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
633                                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
634                                                                     <button class="btn btn-link" type="submit" name="submit"><i class="icon-pause"></i> Suspend</button>
635                                                                 </form>
636                                                             [% END # / IF AutoResumeSuspendedHolds %]
637                                                         [% END # / IF RESERVE.suspend %]
638                                                     [% END # / IF ( RESERVE.cancelable )%]
639                                                 </td>
640                                             [% END # / IF SuspendHoldsOpac %]
641                                             <td class="modify">
642                                                 [% IF ( RESERVE.cancelable ) %]
643                                                     <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
644                                                     <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
645                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
646                                                     <button type="submit" name="submit" class="btn btn-mini btn-danger" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="icon-remove icon-white"></i> Cancel</button></form>
647                                                 [% END %]
648                                             </td>
649                                         </tr>
650                                     [% END # /FOREACH RESERVES %]
651                                 </tbody>
652                             </table>
653
654                             [% IF SuspendHoldsOpac %]
655                                 <div>
656                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
657                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="icon-pause"></i> Suspend all holds</button>
658                                         <input type="hidden" name="suspend" value="1" />
659
660                                         [% IF AutoResumeSuspendedHolds %]
661                                             <label for="suspend_until"> until </label>
662                                             <input name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
663                                             <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
664                                         [% END %]
665                                     </form>
666                                 </div>
667                                 <br/>
668                                 <div>
669                                     <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
670                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_RESUME_HOLDS);"><i class="icon-play"></i> Resume all suspended holds</button>
671                                         <input type="hidden" name="suspend" value="0" />
672                                     </form>
673                                 </div>
674                             [% END %]
675                         </div> <!-- / #opac-user-holds -->
676                         [% END # / #reserves_count %]
677                     </div> <!-- /#opac-user-views -->
678                 </div> <!-- /#userdetails -->
679             </div> <!-- /.span10 -->
680         </div> <!-- /.row-fluid -->
681     </div> <!-- /.container-fluid -->
682 </div> <!-- /#main -->
683
684 [% INCLUDE 'opac-bottom.inc' %]
685
686
687 [% BLOCK jsinclude %]
688     [% INCLUDE 'calendar.inc' %]
689     [% INCLUDE 'datatables.inc' %]
690     <script type="text/JavaScript">
691         //<![CDATA[
692         var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
693         var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
694         var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
695
696         $(document).ready(function(){
697             $('#opac-user-views').tabs();
698             $(".js-show").show();
699             $(".js-hide").hide();
700             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
701             $(".suspend-until").prop("readonly",1);
702             var dTables = $("#checkoutst,#holdst,#overduest");
703             dTables.each(function(){
704                 var thIndex = $(this).find("th.psort").index();
705                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
706                     "aaSorting" : [[ thIndex, 'asc' ]],
707                     "aoColumnDefs": [
708                         { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
709                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
710                         { "sType": "title-string", "aTargets" : [ "title-string" ] }
711                     ]
712                 }));
713             });
714
715             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
716             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
717                 $("#renewselected").submit(function(){
718                     valid = false;
719                     $("input[type=checkbox]").each(function(){
720                         if($(this).is(':checked')){
721                             valid = true;
722                         }
723                     });
724                     if(!valid){
725                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
726                     }
727                     return valid;
728                 });
729                 $("body").on("click","#renewselected_link",function(e){
730                     e.preventDefault();
731                     $("#renewselected").submit();
732                 });
733                 $("body").on("click","#renewall_link",function(e){
734                     e.preventDefault();
735                     $("#renewall").submit();
736                 });
737                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
738                     $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
739                 [% END %]
740             [% END %]
741
742             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
743         });
744         //]]>
745     </script>
746 [% END %]