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