Bug 12461 - Add patron clubs feature
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Branches %]
4 [% USE ItemTypes %]
5 [% USE Price %]
6
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
13 [% INCLUDE 'masthead.inc' %]
14
15 <div class="main">
16     <ul class="breadcrumb">
17         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18         <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' category_type = BORROWER_INFO.category_type firstname = BORROWER_INFO.firstname surname = BORROWER_INFO.surname othernames = BORROWER_INFO.othernames cardnumber = BORROWER_INFO.cardnumber %]</a> <span class="divider">&rsaquo;</span></li>
19         <li><a href="#">Your summary</a></li>
20     </ul>
21
22     <div class="container-fluid">
23         <div class="row-fluid">
24             <div class="span2">
25                 <div id="navigation">
26                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
27                 </div>
28             </div>
29             <div class="span10">
30                 <div id="userdetails" class="maincontent">
31
32                     [% IF adminWarning %]
33                         <div id="adminwarning" class="dialog alert">
34                             <p>
35 <strong><i class="fa fa-exclamation-triangle"> </i> Warning:</strong>
36 Using this account is not recommended because some parts of Koha will not function as expected. Instead, please log in with a different account.
37 <a class="btn btn-small" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
38 <i class="fa fa-sign-out"> </i> Log out</a>
39                             </p>
40                         </div>
41                     [% END %]
42
43                     [% INCLUDE 'opac-note.inc' %]
44
45                     <h2>Hello, [% INCLUDE 'patron-title.inc' category_type = BORROWER_INFO.category_type firstname = BORROWER_INFO.firstname surname = BORROWER_INFO.surname othernames = BORROWER_INFO.othernames cardnumber = BORROWER_INFO.cardnumber %]
46                     </h2>
47
48                     <p><a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here if you're not [% BORROWER_INFO.title %] [% INCLUDE 'patron-title.inc' category_type = BORROWER_INFO.category_type firstname = BORROWER_INFO.firstname surname = BORROWER_INFO.surname othernames = BORROWER_INFO.othernames cardnumber = BORROWER_INFO.cardnumber %]</a></p>
49
50                     [% 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 %]
51
52                     [% IF failed_holds %]
53                         <div class="alert alert-info">
54                             <h3>Notice:</h3>
55                             <p>One or more holds were not placed due to existing holds.</p>
56                         </div>
57                     [% END %]
58
59                     [% IF ( BORROWER_INFO.warndeparture ) %]
60                         <div class="alert" id="warndeparture">
61                             <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% BORROWER_INFO.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
62                                 [% IF ( BORROWER_INFO.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your card expires.</span>[% END %]
63                         </div>
64                     [% END %]
65
66                     [% IF ( BORROWER_INFO.warnexpired ) %]
67                         <div class="alert" id="warnexpired">
68                             <strong>Please note: </strong><span>Your account has expired as of [% BORROWER_INFO.warnexpired | $KohaDates %]. Please contact the library if you wish to renew your account.</span>
69                         </div>
70                     [% END %]
71
72                     [% IF ( RENEW_ERROR ) %]
73                         <div class="dialog alert">
74                             <strong>Please note:</strong>
75                             <span>
76                                 Your loan renewal failed because of the following reason(s):
77                                 [% FOREACH error IN RENEW_ERROR.split('\|') %]
78                                     [% IF error == 'card_expired' %]
79                                         Your account has expired. Please contact the library for more information.
80                                     [% ELSIF error == 'too_many' %]
81                                         You have renewed this item the maximum number of times allowed.
82                                     [% ELSIF error == 'too_soon' %]
83                                         It is too soon after the checkout date for this item to be renewed.
84                                     [% ELSIF error == 'on_reserve' %]
85                                         This item is on hold for another borrower.
86                                     [% END %]
87                                 [% END %]
88                             </span>
89                         </div>
90                     [% END %]
91
92                     [% IF ( patron_flagged ) %]
93                         <div class="alert">
94                             <ul>
95                                 [% IF ( userdebarred ) %]
96                                     [% IF ( discharge_available ) %]
97                                         <li id="discharged">
98                                             <strong>Please note:</strong> Your account is frozen because it has been discharged. <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a>
99                                         </li>
100                                     [% ELSE %]
101                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
102                                         [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: <span id="userdebarred_comment">"[% BORROWER_INFO.debarredcomment %]"</span>[% END %]
103                                         [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: <span id="userdebarred_date">[% BORROWER_INFO.userdebarreddate | $KohaDates %]</span>[% END %]
104                                         <em>Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a></li>
105                                     [% END %]
106                                 [% END %]
107                                 [% IF ( BORROWER_INFO.gonenoaddress ) %]
108                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
109                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
110                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
111                                     </li>
112                                 [% END %]
113                                 [% IF ( BORROWER_INFO.lost ) %]
114                                     <li id="lost"><strong>Please note: </strong> Your library card has been marked as lost or stolen. <em>If this is an error, please contact the library.</em></li>
115                                 [% END %]
116                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
117                                     <li id="renewal_blocked_fines"><strong>Please note: </strong>You cannot renew your books online. Reason: [% IF ( renewal_blocked_fines ) > 0  %]Your fines exceed <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines | $Price %]</span>.[% ELSE %]You have fines.[% END %]
118                                 [% END %]
119                             </ul>
120                         </div>
121                     [% END # / IF patron_flagged %]
122
123                     [% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %]
124                     [% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %]
125
126                     <div id="opac-user-views" class="toptabs">
127                         <ul>
128                             <li><a href="#opac-user-checkouts">Checked out ([% issues_count %])</a></li>
129                             [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
130                             [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %]
131                             [% IF ( OPACFinesTab ) %]
132                                 [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
133                                 [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
134                                 [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding | $Price %])</a></li>[% END %]
135                             [% END %]
136
137                             [% IF borrower.get_club_enrollments.size || borrower.get_enrollable_clubs(1).size %]
138                                 <li>
139                                     <a id="opac-user-clubs-tab-link" href="#opac-user-clubs">
140                                         Clubs ([% borrower.get_club_enrollments.size %]/[% borrower.get_enrollable_clubs(1).size || 0 %])
141                                     </a>
142                                 </li>
143                             [% END %]
144
145                             [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
146                             [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% borrower.article_requests_current.count %])</a></li>[% END %]
147                             [% IF ( OverDriveCirculation ) %]
148                             <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
149                             [% END %]
150                         </ul>
151
152                         <div id="opac-user-overdrive">
153                         </div>
154                         <div id="opac-user-checkouts">
155                             [% IF ( issues_count ) %]
156                                 <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
157                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
158                                     <input type="hidden" name="from" value="opac_user" />
159                                     <table id="checkoutst" class="table table-bordered table-striped">
160                                         <caption>[% issues_count %] Item(s) checked out</caption>
161                                         <thead>
162                                             <tr>
163                                                 [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
164                                                 <th class="anti-the">Title</th>
165                                                 <th>Author</th>
166                                                 <th class="title-string psort">Due</th>
167                                                 [% UNLESS ( item_level_itypes ) %]
168                                                     <th>Item type</th>
169                                                 [% END %]
170                                                 [% IF ( show_barcode ) %]
171                                                     <th>Barcode</th>
172                                                 [% END %]
173                                                     <th>Call no.</th>
174                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %]
175                                                     <th class="nosort">Renew</th>
176                                                 [% END %]
177                                                 [% IF ( OPACFinesTab ) %]
178                                                     <th>Fines</th>
179                                                 [% END %]
180                                                 [% IF ( OPACMySummaryHTML ) %]
181                                                     <th class="nosort">Links</th>
182                                                 [% END %]
183                                             </tr>
184                                         </thead>
185                                         <tbody>
186                                             [% FOREACH ISSUE IN ISSUES %]
187                                                 [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
188                                                 [% IF ( JacketImages ) %]<td class="jacketcell">
189
190                                                     [% IF ( OPACAmazonCoverImages ) %]
191                                                         [% IF ( ISSUE.normalized_isbn ) %]
192                                                             <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>
193                                                         [% ELSE %]
194                                                             <a href="#"><span class="no-image">No cover image available</span></a>
195                                                         [% END %]
196                                                     [% END %]
197
198                                                     [% IF ( GoogleJackets ) %]
199                                                         [% IF ( ISSUE.normalized_isbn ) %]
200                                                             <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
201                                                         [% ELSE %]
202                                                             <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
203                                                         [% END %]
204                                                     [% END %]
205
206                                                     [% IF ( BakerTaylorEnabled ) %]
207                                                         [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %]
208                                                         [% IF ( bt_id ) %]
209                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
210                                                         [% ELSE %]
211                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
212                                                         [% END %]
213                                                     [% END %]
214
215                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
216                                                         [% IF ( using_https ) %]
217                                                             <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" />
218                                                         [% ELSE %]
219                                                             <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" />
220                                                         [% END %]
221                                                     [% END %]
222
223                                                 </td>[% END # / IF JacketImages %]
224
225                                                 <td class="title">
226                                                     <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>
227                                                     [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %]
228                                                 </td>
229
230                                                 <td class="author">[% ISSUE.author %]</td>
231                                                 [% IF ( ISSUE.overdue ) %]
232                                                     <td class="date_due overdue">
233                                                         <span title="[% ISSUE.date_due %]">
234                                                             <span class="tdlabel">Date due:</span>
235                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
236                                                         </span>
237                                                     </td>
238                                                 [% ELSE %]
239                                                     <td class="date_due">
240                                                         <span title="[% ISSUE.date_due %]">
241                                                             <span class="tdlabel">Date due:</span>
242                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
243                                                         </span>
244                                                     </td>
245                                                 [% END %]
246                                                 [% UNLESS ( item_level_itypes ) %]
247                                                     <td class="itype">
248                                                         <span class="tdlabel">Item type:</span>
249                                                         [% IF ( ISSUE.imageurl ) %]
250                                                             <img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />
251                                                         [% END %] [% ISSUE.description %]
252                                                     </td>
253                                                 [% END %]
254                                                 [% IF ( show_barcode ) %]
255                                                     <td class="barcode">
256                                                         <span class="tdlabel">Barcode:</span>
257                                                         [% ISSUE.barcode %]
258                                                     </td>
259                                                 [% END %]
260                                                 <td class="call_no">
261                                                     <span class="tdlabel">Call no.:</span>
262                                                     [% ISSUE.itemcallnumber %]
263                                                 </td>
264                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %]
265                                                     <td class="renew">
266                                                     [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
267                                                     [% IF ( ISSUE.status ) %]
268                                                         [% IF ( canrenew ) %]
269                                                             <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>
270                                                         [% END %]
271                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
272                                                     [% ELSIF ( ISSUE.on_reserve ) %]
273                                                         Not renewable <span class="renewals">(on hold)</span>
274                                                     [% ELSIF ( ISSUE.too_many ) %]
275                                                         Not renewable
276                                                     [% ELSIF ( ISSUE.norenew_overdue ) %]
277                                                         Not allowed <span class="renewals">(overdue)</span>
278                                                     [% ELSIF ( ISSUE.auto_too_late ) %]
279                                                         No longer renewable
280                                                     [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
281                                                         Automatic renewal
282                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
283                                                     [% ELSIF ( ISSUE.too_soon ) %]
284                                                         No renewal before [% ISSUE.soonestrenewdate %]
285                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
286                                                     [% END %]
287                                                     </td>
288                                                 [% END %]
289                                                 [% IF ( OPACFinesTab ) %]
290                                                     <td class="fines">
291                                                         <span class="tdlabel">Fines:</span>
292                                                         [% IF ( ISSUE.charges ) %]
293                                                             Yes (Item overdue or lost)
294                                                         [% ELSIF ( ISSUE.rentalfines ) %]
295                                                             Yes (Rental fees)
296                                                         [% ELSE %]
297                                                             No
298                                                         [% END %]
299                                                     </td>
300                                                 [% END %]
301                                                 [% IF ( OPACMySummaryHTML ) %]
302                                                     <td class="links">[% ISSUE.MySummaryHTML %]</td>
303                                                 [% END %]
304                                             </tr>
305                                         [% END # /FOREACH ISSUES %]
306                                     </tbody>
307                                 </table>
308                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %]
309                                     <input type="submit" class="btn" value="Renew selected" />
310                                 [% END %]
311                                 </form>
312
313                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %]
314                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
315                                     <input type="hidden" name="from" value="opac_user" />
316                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
317                                     [% FOREACH ISSUE IN ISSUES %]
318                                         <input type="hidden" name="item" value="[% ISSUE.itemnumber %]" />
319                                     [% END %]
320                                     <input type="submit" class="btn" value="Renew all" />
321                                 </form>
322                                 [% END %]
323                                 <p><a href="opac-ics.pl">Download as iCal/.ics file</a></p>
324                             [% ELSE %]
325                                 <table class="table table-bordered table-striped">
326                                     <tr><td>You have nothing checked out</td></tr>
327                                 </table>
328                             [% END # IF issues_count %]
329                         </div> <!-- / .opac-user-checkouts -->
330
331                         [% IF borrower.get_club_enrollments_count.size || borrower.get_enrollable_clubs(1).size %]
332                             <div id="opac-user-clubs">
333                                 Loading...
334                             </div>
335                         [% END %]
336
337                         [% IF ( OPACFinesTab ) %]
338                             <!-- FINES BOX -->
339                             [% IF BORROWER_INFO.amountoverfive %]
340                                 <div id="opac-user-fines"> <h3>Fines and charges</h3>
341                                     <table class="table table-bordered table-striped">
342                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
343                                         <tbody>
344                                             <tr>
345                                                 <td>You currently owe fines and charges amounting to:</td>
346                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding | $Price %]</a></td>
347                                             </tr>
348                                         </tbody>
349                                     </table>
350                                 </div>
351                             [% END %]
352
353                             [% IF BORROWER_INFO.amountoverzero %]
354                                <div id="opac-user-fines"> <h3>Fines and charges</h3>
355                                     <table class="table table-bordered table-striped">
356                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
357                                         <tbody>
358                                             <tr>
359                                                 <td>You currently owe fines and charges amounting to:</td>
360                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding %]</a></td>
361                                             </tr>
362                                         </tbody>
363                                     </table>
364                                 </div>
365                             [% END %]
366
367                             [% IF BORROWER_INFO.amountlessthanzero %]
368                                 <div id="opac-user-fines">  <h3>Credits</h3>
369                                     <table class="table table-bordered table-striped">
370                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
371                                         <tbody>
372                                             <tr>
373                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding %]</a></td>
374                                             </tr>
375                                         </tbody>
376                                     </table>
377                                 </div>
378                             [% END %]
379                         [% END # / OPACFinesTab %]
380
381                         [% IF relatives %]
382                             <div id="opac-user-relative-issues">
383                                 <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
384                                     <thead>
385                                         <tr>
386                                             <th class="anti-the">Title</th>
387                                             <th>Due</th>
388                                             <th>Barcode</th>
389                                             <th>Call no.</th>
390                                             <th class="psort">Relative</th>
391                                         </tr>
392                                     </thead>
393
394                                     <tbody>
395                                         [% FOREACH r IN relatives %]
396                                             [% FOREACH i IN r.issues %]
397                                                 <tr>
398                                                     <td>
399                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber %]">
400                                                             [% i.item.biblio.title %][% IF ( i.item.enumchron ) %] [% i.item.enumchron %][% END %]
401                                                         </a>
402                                                     </td>
403
404                                                     <td>
405                                                         [% i.date_due | $KohaDates %]
406                                                     </td>
407
408                                                     <td>
409                                                         [% i.item.barcode %]
410                                                     </td>
411
412                                                     <td>
413                                                         [% i.item.itemcallnumber %]
414                                                     </td>
415
416                                                     <td>
417                                                         [% r.firstname %] [% r.surname %]
418                                                     </td>
419                                                 </tr>
420                                             [% END %]
421                                         [% END %]
422                                     </tbody>
423                                 </table>
424                             </div>
425                         [% END %]
426
427                         [% IF ( overdues_count ) %]
428                             <div id="opac-user-overdues">
429                                 <table id="overduest" class="table table-bordered table-striped">
430                                     <caption>Overdues <span class="count">([% overdues_count %] total)</span></caption>
431                                     <!-- OVERDUES TABLE ROWS -->
432                                     <thead>
433                                         <tr>
434                                             [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
435                                             <th class="anti-the">Title</th>
436                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
437                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
438                                             <th>Call no.</th>
439                                             <th class="title-string psort">Due</th>
440                                             [% IF ( OpacRenewalAllowed ) %]
441                                                 <th class="nosort">Renew</th>
442                                             [% END %]
443                                             [% IF ( OPACFinesTab ) %]
444                                                 <th>Fines</th>
445                                             [% END %]
446                                         </tr>
447                                     </thead>
448                                     <tbody>
449                                         [% FOREACH OVERDUE IN OVERDUES %]
450                                             <tr>
451                                                 [% IF ( JacketImages ) %]
452                                                     <td class="jacketcell">
453                                                     [% IF ( OPACAmazonCoverImages ) %]
454                                                         [% IF ( OVERDUE.normalized_isbn ) %]
455                                                             <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>
456                                                         [% ELSE %]
457                                                             <a href="#"><span class="no-image">No cover image available</span></a>
458                                                         [% END %]
459                                                     [% END %]
460
461                                                     [% IF ( GoogleJackets ) %]
462                                                         [% IF ( OVERDUE.normalized_isbn ) %]
463                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
464                                                         [% ELSE %]
465                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
466                                                         [% END %]
467                                                     [% END %]
468
469                                                     [% IF ( BakerTaylorEnabled ) %]
470                                                         [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
471                                                         [% IF ( bt_id ) %]
472                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
473                                                         [% ELSE %]
474                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
475                                                         [% END %]
476                                                     [% END %]
477
478                                                     [% IF ( SyndeticsCoverImages ) %]
479                                                         [% IF ( using_https ) %]
480                                                             <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" />
481                                                         [% ELSE %]
482                                                             <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" />
483                                                         [% END %]
484                                                     [% END %]
485                                                     </td>
486                                                 [% END # /IF jacketcell %]
487
488                                                 <td>
489                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber %]">[% OVERDUE.title |html %] [% FOREACH subtitl IN OVERDUE.subtitle %] [% subtitl.subfield %][% END %]
490                                                     </a>
491                                                     <span class="item-details">[% OVERDUE.author %]</span></td>
492
493                                                 [% UNLESS ( item_level_itypes ) %]
494                                                     <td>
495                                                         [% IF ( OVERDUE.imageurl ) %]
496                                                             <img src="[% OVERDUE.imageurl %]" title="[% OVERDUE.description %]" alt="[% OVERDUE.description %]" />
497                                                         [% END %] [% OVERDUE.description %]
498                                                     </td>
499                                                 [% END %]
500                                                 [% IF ( show_barcode ) %]
501                                                     <td>
502                                                         <span class="tdlabel">Barcode:</span>
503                                                         [% OVERDUE.barcode %]
504                                                     </td>
505                                                 [% END %]
506                                                 <td>
507                                                     <span class="tdlabel">Call no.:</span>
508                                                     [% OVERDUE.itemcallnumber %]
509                                                 </td>
510                                                 <td>
511                                                     <span title="[% OVERDUE.date_due %]">
512                                                         <span class="tdlabel">Date due:</span>
513                                                         [% OVERDUE.date_due_sql | $KohaDates as_due_date => 1 %]
514                                                     </span>
515                                                 </td>
516                                                 [% IF ( OpacRenewalAllowed ) %]
517                                                     <td>
518                                                         [% IF ( OVERDUE.debarred ) %]
519                                                             Account frozen
520                                                         [% ELSIF ( OVERDUE.status ) %]
521                                                             [% IF ( canrenew ) %]
522                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber %]&amp;bornum=[% OVERDUE.borrowernumber %]">Renew</a>
523                                                             [% END %]
524                                                                 <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span>
525                                                         [% ELSIF ( OVERDUE.norenew_overdue ) %]
526                                                             Not allowed<span class="renewals">(overdue)</span>
527                                                         [% ELSIF ( OVERDUE.onreserve ) %]
528                                                             On hold
529                                                         [% ELSE %]
530                                                             No renewals left
531                                                         [% END %]
532                                                     </td>
533                                                 [% END %]
534                                                 [% IF ( OPACFinesTab ) %]
535                                                     <td>
536                                                         <span class="tdlabel">Fines:</span>
537                                                         [% IF ( OVERDUE.charges ) %]
538                                                             Yes
539                                                         [% ELSE %]
540                                                             No
541                                                         [% END %]
542                                                     </td>
543                                                 [% END %]
544                                             </tr>
545                                         [% END %]
546                                     </tbody>
547                                 </table>
548                             </div> <!-- / #opac-user-overdues -->
549                         [% END # /overdues_count %]
550
551
552                         [% IF ( RESERVES.count ) %]
553                             <div id="opac-user-holds">
554                                 <table id="holdst" class="table table-bordered table-striped">
555                                     <caption>Holds <span class="count">([% RESERVES.count %] total)</span></caption>
556                                     <!-- RESERVES TABLE ROWS -->
557                                     <thead>
558                                         <tr>
559                                             <th class="anti-the">Title</th>
560                                             <th class="psort title-string">Placed on</th>
561                                             <th class="title-string">Expires on</th>
562                                             <th>Pick up location</th>
563                                             [% IF ( showpriority ) %]
564                                                 <th>Priority</th>
565                                             [% END %]
566                                             <th>Status</th>
567                                             [% IF SuspendHoldsOpac %]
568                                                  <th class="nosort" >Suspend</th>
569                                             [% END %]
570                                             <th class="nosort">Modify</th>
571                                         </tr>
572                                     </thead>
573                                     <tbody>
574                                     [% FOREACH RESERVE IN RESERVES %]
575                                         [% IF ( RESERVE.is_waiting ) %]
576                                             [% IF ( RESERVE.is_at_destination ) %]
577                                                 [% IF ( RESERVE.is_found ) %]
578                                                     <tr class="reserved">
579                                                 [% ELSE %]
580                                                     <tr>
581                                                 [% END %]
582                                             [% ELSE %]
583                                                 <tr class="transfered">
584                                             [% END %]
585                                         [% ELSE %]
586                                             <tr>
587                                         [% END %]
588                                             <td class="title">
589                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
590                                                     [% RESERVE.biblio.title %]
591                                                     [% FOREACH s IN RESERVE.biblio.subtitles %]
592                                                         [% s %]
593                                                     [% END %]
594                                                     [% RESERVE.item.enumchron %]
595                                                 </a>
596                                                 [% RESERVE.biblio.author %]
597                                             </td>
598                                             <td class="reservedate">
599                                                 <span title="[% RESERVE.reservedate %]">
600                                                     <span class="tdlabel">Hold date:</span>
601                                                     [% RESERVE.reservedate | $KohaDates %]
602                                                 </span>
603                                             </td>
604                                             <td class="expirationdate">
605                                                 [% IF ! RESERVE.found %]
606                                                     [% IF ( RESERVE.expirationdate ) %]
607                                                         <span title="[% RESERVE.expirationdate %]">
608                                                             <span class="tdlabel">Expiration:</span>
609                                                                 [% RESERVE.expirationdate | $KohaDates %]
610                                                         </span>
611                                                     [% ELSE %]
612                                                         <span title="0000-00-00">
613                                                             <span class="tdlabel">Expiration:</span>
614                                                             Never expires
615                                                         </span>
616                                                     [% END %]
617                                                 [% ELSE %]
618                                                     <span title="0000-00-00">-</span>
619                                                 [% END %]
620                                             </td>
621                                             <td class="branch">
622                                                 <span class="tdlabel">Pick up location:</span>
623                                                 [% RESERVE.branch.branchname %]
624                                             </td>
625                                             [% IF ( showpriority ) %]
626                                                  <td class="priority">
627                                                     <span class="tdlabel">Priority:</span>
628                                                     [% RESERVE.priority %]
629                                                 </td>
630                                             [% END %]
631                                             <td class="status">
632                                                 <span class="tdlabel">Status:</span>
633                                                 [% IF ( RESERVE.is_waiting ) %]
634                                                     [% IF ( RESERVE.is_at_destination ) %]
635                                                         [% IF ( RESERVE.found ) %]
636                                                             Item waiting at <b> [% RESERVE.branch.branchname %]</b>
637                                                             [% IF ( RESERVE.waitingdate ) %]
638                                                                 since [% RESERVE.waitingdate | $KohaDates %]
639                                                                 [% IF RESERVE.waiting_expires_on %]
640                                                                     until [% RESERVE.waiting_expires_on | $KohaDates %]
641                                                                 [% END %]
642                                                             [% END %]
643                                                             <input type="hidden" name="pickup" value="[% RESERVE.branchcode %]" />
644                                                         [% ELSE %]
645                                                             Item waiting to be pulled from <b> [% Branches.GetName( RESERVE.branchcode ) %]</b>
646                                                         [% END %]
647                                                     [% ELSE %]
648                                                         Item in transit to <b> [% Branches.GetName( RESERVE.branchcode ) %]</b> <input type="hidden" name="pickup" value="[% RESERVE.branchcode %]" />
649                                                     [% END %]
650                                                 [% ELSE %]
651                                                     [% IF ( RESERVE.is_in_transit ) %]
652                                                         [% SET transfer = RESERVE.item.get_transfer %]
653                                                         Item in transit from <b> [% Branches.GetName( transfer.frombranch ) %]</b> since
654                                                         [% transfer.datesent | $KohaDates %]
655                                                     [% ELSIF ( RESERVE.suspend ) %]
656                                                         Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until %] [% END %]
657                                                     [% ELSE %]
658                                                         [% IF RESERVE.itemtype %]
659                                                             Pending for next available item of item type '[% ItemTypes.GetDescription( RESERVE.itemtype ) %]'
660                                                         [% ELSE %]
661                                                             Pending
662                                                         [% END %]
663                                                     [% END %]
664                                                 [% END %]
665                                             </td>
666                                             [% IF SuspendHoldsOpac %]
667                                                 <td>
668                                                     [% IF ( RESERVE.is_cancelable ) %]
669                                                         [% IF RESERVE.suspend %]
670                                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
671                                                                 <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
672                                                                 <button class="btn btn-link" type="submit" name="submit"><i class="icon-play"></i> Resume</button>
673                                                             </form>
674                                                         [% ELSE %]
675                                                             [% IF AutoResumeSuspendedHolds %]
676                                                                 <a class="btn btn-link js-show" href="#suspendModal[% RESERVE.reserve_id %]" role="button" data-toggle="modal"><i class="icon-pause"></i> Suspend</a>
677                                                                 [% # hold suspend modal form %]
678                                                                 <div id="suspendModal[% RESERVE.reserve_id %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% RESERVE.reserve_id %]Label" aria-hidden="true">
679                                                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
680                                                                         <div class="modal-header">
681                                                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
682                                                                             [% IF RESERVE.suspend %]
683                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.biblio.title %]</i></h3>
684                                                                             [% ELSE %]
685                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.biblio.title %]</i></h3>
686                                                                             [% END %]
687                                                                         </div>
688                                                                         <div class="modal-body">
689                                                                             <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
690                                                                             <label for="suspend_until_[% RESERVE.reserve_id %]">Suspend until:</label>
691                                                                             <input name="suspend_until" id="suspend_until_[% RESERVE.reserve_id %]" class="suspend-until" size="10" />
692                                                                             [% INCLUDE 'date-format.inc' %]
693                                                                             <p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% RESERVE.reserve_id %]').value='';return false;">Clear date to suspend indefinitely</a></p>
694                                                                             <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
695                                                                         </div>
696                                                                         <div class="modal-footer">
697                                                                             <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
698                                                                             <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
699                                                                         </div>
700                                                                     </form>
701                                                                 </div>  <!-- /#suspendModal[% RESERVE.reserve_id %] -->
702                                                             [% ELSE %]
703                                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
704                                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
705                                                                     <button class="btn btn-link" type="submit" name="submit"><i class="icon-pause"></i> Suspend</button>
706                                                                 </form>
707                                                             [% END # / IF AutoResumeSuspendedHolds %]
708                                                         [% END # / IF RESERVE.suspend %]
709                                                     [% END # / IF ( RESERVE.is_cancelable )%]
710                                                 </td>
711                                             [% END # / IF SuspendHoldsOpac %]
712                                             <td class="modify">
713                                                 [% IF ( RESERVE.is_cancelable ) %]
714                                                     <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
715                                                     <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
716                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
717                                                     <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>
718                                                 [% END %]
719                                             </td>
720                                         </tr>
721                                     [% END # /FOREACH RESERVES %]
722                                 </tbody>
723                             </table>
724
725                             [% IF SuspendHoldsOpac %]
726                                 <div>
727                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
728                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="icon-pause"></i> Suspend all holds</button>
729                                         <input type="hidden" name="suspend" value="1" />
730
731                                         [% IF AutoResumeSuspendedHolds %]
732                                             <label for="suspend_until"> until </label>
733                                             <input name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
734                                             <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
735                                         [% END %]
736                                     </form>
737                                 </div>
738                                 <br/>
739                                 <div>
740                                     <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
741                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_RESUME_HOLDS);"><i class="icon-play"></i> Resume all suspended holds</button>
742                                         <input type="hidden" name="suspend" value="0" />
743                                     </form>
744                                 </div>
745                             [% END %]
746                         </div> <!-- / #opac-user-holds -->
747                         [% END # / #RESERVES.count %]
748
749                         [% IF Koha.Preference('ArticleRequests') %]
750                             <div id="opac-user-article-requests">
751                                 [% IF borrower.article_requests_current.count %]
752                                     <table id="article-requests-table" class="table table-bordered table-striped">
753                                         <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
754                                         <thead>
755                                             <tr>
756                                                 <th class="anti-the article-request-record-title">Record title</th>
757                                                 <th class="psort article-request-created-on">Placed on</th>
758                                                 <th class="anti-the article-request-title">Title</th>
759                                                 <th class="article-request-author">Author</th>
760                                                 <th class="article-request-volume">Volume</th>
761                                                 <th class="article-request-issue">Issue</th>
762                                                 <th class="article-request-date">Date</th>
763                                                 <th class="article-request-pages">Pages</th>
764                                                 <th class="article-request-chapters">Chapters</th>
765                                                 <th class="article-request-patron-notes">Notes</th>
766                                                 <th class="article-request-status">Status</th>
767                                                 <th class="article-request-branchcode">Pickup library</th>
768                                                 <th class="nosort article-request-cancel">&nbsp;</th>
769                                             </tr>
770                                         </thead>
771
772                                         <tbody>
773                                         [% FOREACH ar IN borrower.article_requests_current %]
774                                                 <td class="article-request-record-title">
775                                                     <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]">
776                                                         [% ar.biblio.title %]
777                                                         [% ar.item.enumchron %]
778                                                     </a>
779                                                     [% ar.biblio.author %]
780                                                     [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %]
781                                                 </td>
782
783                                                 <td class="article-request-created_on">
784                                                     [% ar.created_on | $KohaDates %]
785                                                 </td>
786
787                                                 <td class="article-request-title">
788                                                     [% ar.title %]
789                                                 </td>
790
791                                                 <td class="article-request-author">
792                                                     [% ar.author %]
793                                                 </td>
794
795                                                 <td class="article-request-volume">
796                                                     [% ar.volume %]
797                                                 </td>
798
799                                                 <td class="article-request-issue">
800                                                     [% ar.issue %]
801                                                 </td>
802
803                                                 <td class="article-request-date">
804                                                     [% ar.date %]
805                                                 </td>
806
807                                                 <td class="article-request-pages">
808                                                     [% ar.pages %]
809                                                 </td>
810
811                                                 <td class="article-request-chapters">
812                                                     [% ar.chapters %]
813                                                 </td>
814
815                                                 <td class="article-request-patron-notes">
816                                                     [% ar.patron_notes %]
817                                                 </td>
818
819                                                 <td class="article-request-status">
820                                                     [% IF ar.status == 'PENDING' %]
821                                                         Pending
822                                                     [% ELSIF ar.status == 'PROCESSING' %]
823                                                         Processing
824                                                     [% ELSIF ar.status == 'COMPLETED' %]
825                                                         Completed
826                                                     [% ELSIF ar.status == 'CANCELED' %]
827                                                         Canceled
828                                                     [% END %]
829                                                 </td>
830
831                                                 <td class="article-request-branchcode">
832                                                     [% ar.branch.branchname %]
833                                                 </td>
834
835                                                 <td class="article-request-cancel">
836                                                     <span class="tdlabel">Cancel:</span>
837                                                     <a class="btn btn-mini btn-danger" href="opac-article-request-cancel.pl?id=[% ar.id %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="icon-remove icon-white"></i> Cancel</a>
838                                                     <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message -->
839                                                 </td>
840                                             </tr>
841                                         [% END %]
842                                     </tbody>
843                                 </table>
844                             [% ELSE %]
845                                 <table class="table table-bordered table-striped">
846                                     <tr><td>You have no article requests currently.</td></tr>
847                                 </table>
848                             [% END # IF article_requests_current.count %]
849                         </div> <!-- / #opac-user-article-requests -->
850                     [% END %]
851
852                     </div> <!-- /#opac-user-views -->
853                 </div> <!-- /#userdetails -->
854             </div> <!-- /.span10 -->
855         </div> <!-- /.row-fluid -->
856     </div> <!-- /.container-fluid -->
857 </div> <!-- /#main -->
858
859 [% IF ( OverDriveCirculation ) %]
860 [% INCLUDE 'overdrive-checkout.inc' %]
861 [% END %]
862
863 [% INCLUDE 'opac-bottom.inc' %]
864
865
866 [% BLOCK jsinclude %]
867     [% INCLUDE 'calendar.inc' %]
868     [% INCLUDE 'datatables.inc' %]
869     <script type="text/JavaScript">
870         //<![CDATA[
871         var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
872         var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
873         var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
874
875         $(document).ready(function(){
876             $('#opac-user-views').tabs();
877             $(".js-show").show();
878             $(".js-hide").hide();
879             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
880             $(".suspend-until").prop("readonly",1);
881
882             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
883             dTables.each(function(){
884                 var thIndex = $(this).find("th.psort").index();
885                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
886                     "aaSorting" : [[ thIndex, 'asc' ]],
887                     "aoColumnDefs": [
888                         { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
889                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
890                         { "sType": "title-string", "aTargets" : [ "title-string" ] }
891                     ]
892                 }));
893             });
894
895             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
896             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
897                 $("#renewselected").submit(function(){
898                     valid = false;
899                     $("input[type=checkbox]").each(function(){
900                         if($(this).is(':checked')){
901                             valid = true;
902                         }
903                     });
904                     if(!valid){
905                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
906                     }
907                     return valid;
908                 });
909                 $("body").on("click","#renewselected_link",function(e){
910                     e.preventDefault();
911                     $("#renewselected").submit();
912                 });
913                 $("body").on("click","#renewall_link",function(e){
914                     e.preventDefault();
915                     $("#renewall").submit();
916                 });
917                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.category.effective_BlockExpiredPatronOpacActions ) ) %]
918                     $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
919                 [% END %]
920             [% END %]
921
922             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
923
924             if ( $('#opac-user-clubs').length ) {
925                 $('#opac-user-clubs-tab-link').on('click', function() {
926                     $('#opac-user-clubs').text(_("Loading..."));
927                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber %]');
928                 });
929             }
930         });
931         //]]>
932     </script>
933     [% IF Koha.Preference('OverDriveCirculation') %]
934     <script type="text/javascript" src="[% interface %]//[% theme %]/js/overdrive.js"></script>
935     <script type="text/JavaScript">
936     $(document).ready(function() {
937         [% IF ( overdrive_error ) %]
938             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote %]");
939         [% END %]
940
941         [% IF ( overdrive_tab ) %]
942             $("#opac-user-views").tabs("select", "#opac-user-overdrive");
943         [% END %]
944
945         $("#opac-user-overdrive").each( function() {
946             KOHA.OverDriveCirculation.display_account_details(this);
947         } );
948     });
949     </script>
950     [% END %]
951 [% END %]