Bug 24476: (QA follow-up) Move new option below warnings and messages in OPAC account
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE Price %]
8 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
9 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
10
11 [% SET borrower_club_enrollments =  logged_in_user.get_club_enrollments(1) %]
12 [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1,1) %]
13
14 [% INCLUDE 'doc-head-open.inc' %]
15 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home</title>
16 [% INCLUDE 'doc-head-close.inc' %]
17 [% BLOCK cssinclude %][% END %]
18 </head>
19 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
20 [% INCLUDE 'masthead.inc' %]
21
22 [% IF Koha.Preference('AmazonAssocTag') %]
23     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
24 [% ELSE %]
25     [% AmazonAssocTag = '' %]
26 [% END %]
27
28 <div class="main">
29     <ul class="breadcrumb">
30         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
31         <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
32         <li><a href="#">Your summary</a></li>
33     </ul>
34
35     <div class="container-fluid">
36         <div class="row-fluid">
37             <div class="span2">
38                 <div id="navigation">
39                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
40                 </div>
41             </div>
42             <div class="span10">
43                 <div id="userdetails" class="maincontent">
44
45                     [% INCLUDE 'opac-note.inc' %]
46
47                     <h2>Hello, [% INCLUDE 'patron-title.inc' patron = logged_in_user %]
48                     </h2>
49
50                     <p><a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here if you're not [% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></p>
51
52                     [% 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 %]
53
54                     [% IF failed_holds %]
55                         <div class="alert alert-info">
56                             <h3>Notice:</h3>
57                             <p>One or more holds were not placed due to existing holds.</p>
58                         </div>
59                     [% END %]
60
61                     [% IF ( borrower.blockedonfines ) %]
62                         <div class="alert" id="blockedonfines">
63                             <strong>Please note:</strong><span> Your account has outstanding fees & charges of [% amountoutstanding | $Price %]. Holds are blocked because your fine balance is over the limit.</span>
64                         </div>
65                     [% END %]
66
67                     [% IF ( borrower.warndeparture ) %]
68                         <div class="alert" id="warndeparture">
69                             <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% borrower.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
70                                 [% IF ( borrower.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your card expires.</span>[% END %]
71                         </div>
72                     [% END %]
73
74                     [% IF ( borrower.warnexpired ) %]
75                         <div class="alert" id="warnexpired">
76                             <strong>Please note: </strong><span>Your account has expired as of [% borrower.warnexpired | $KohaDates %]. Please contact the library if you wish to renew your account.</span>
77                         </div>
78                     [% END %]
79
80                     [% IF ( RENEW_ERROR ) %]
81                         <div class="dialog alert">
82                             <strong>Please note:</strong>
83                                 Your loan renewal failed because of the following reason(s):
84                                 <ul>
85                                     [% FOREACH error IN RENEW_ERROR.split('\|') %]
86                                         [% IF error == 'card_expired' %]
87                                             <li>Your account has expired. Please contact the library for more information.</li>
88                                         [% ELSIF error == 'too_many' %]
89                                             <li>You have renewed this item the maximum number of times allowed.</li>
90                                         [% ELSIF error == 'too_soon' %]
91                                             <li>It is too soon after the checkout date for this item to be renewed.</li>
92                                         [% ELSIF error == 'on_reserve' %]
93                                             <li>This item is on hold for another borrower.</li>
94                                         [% ELSIF error == 'item_denied_renewal' %]
95                                             <li>Item renewal is not allowed.</li>
96                                         [% END %]
97                                     [% END %]
98                                 </ul>
99                         </div>
100                     [% END %]
101
102                     [% IF ( patron_flagged ) %]
103                         <div class="alert">
104                             <ul>
105                                 [% IF ( userdebarred ) %]
106                                     [% IF ( discharge_available ) %]
107                                         <li id="discharged">
108                                             <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>
109                                         </li>
110                                     [% ELSE %]
111                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
112                                         [% IF ( borrower.debarredcomment ) %]
113                                             Comment:
114                                             <span id="userdebarred_comment">
115                                                 <strong>
116                                                     [% IF borrower.debarredcomment.search('OVERDUES_PROCESS') %]
117                                                         Restriction added by overdues process [% borrower.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
118                                                     [% ELSE %]
119                                                         [% borrower.debarredcomment | html_line_break %]
120                                                     [% END %]
121                                                 </strong>
122                                             </span>
123                                         [% END %]
124                                         [% IF ( borrower.userdebarreddate && debarred_date != '9999-12-31' ) %]
125                                             End date:
126                                             <span id="userdebarred_date">[% borrower.userdebarreddate | $KohaDates %]</span>
127                                         [% END %]
128
129                                         <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>
130                                     [% END %]
131                                 [% END %]
132                                 [% IF ( borrower.gonenoaddress ) %]
133                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
134                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
135                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
136                                     </li>
137                                 [% END %]
138                                 [% IF ( borrower.lost ) %]
139                                     <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>
140                                 [% END %]
141                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
142                                     <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 %]
143                                 [% END %]
144                             </ul>
145                         </div>
146                     [% END # / IF patron_flagged %]
147
148                     <div class="alert alert-info" id="notesaved" style="display:none;"></div>
149
150                     [% IF Koha.Preference('OPACMySummaryNote') %]
151                         <div id="opac-my-summary-note">[% Koha.Preference('OPACMySummaryNote') | $raw %]</div>
152                     [% END %]
153
154                     [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
155                     <form id="autorenewal_option" action="/cgi-bin/koha/opac-user.pl" method="post">
156                             <label for="yes-autorenew_checkouts">
157                                 Allow auto renewal:
158                             </label>
159                                 [% IF ( borrower.autorenew_checkouts ) %]
160                                     <label class="radio inline" for="yes-autorenew_checkouts">
161                                         Yes
162                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" checked="checked" />
163                                     </label>
164
165                                     <label class="radio inline" for="no-autorenew_checkouts">
166                                         No
167                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" />
168                                     </label>
169                                 [% ELSE %]
170                                     <label class="radio inline" for="yes-autorenew_checkouts">
171                                         Yes
172                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" />
173                                     </label>
174                                     <label class="radio inline" for="no-autorenew_checkouts">
175                                         No
176                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" checked="checked" />
177                                     </label>
178                                 [% END %]
179                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
180                         <input type="hidden" name="update_arc" value="1" />
181                         <input type="submit" value="Update auto renewal preference" />
182                     </form>
183                     [% END %]
184
185                     <div id="opac-user-views" class="toptabs">
186                         <ul>
187                             <li><a href="#opac-user-checkouts">Checked out ([% issues_count | html %])</a></li>
188                             [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
189                             [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count | html %])</a></li>[% END %]
190                             [% IF ( OPACFinesTab ) %]
191                             [% IF ( amountoutstanding > 0 ) %]<li><a href="#opac-user-fines">Charges ([% amountoutstanding | $Price %])</a></li>[% END %]
192                                 [% IF ( amountoutstanding < 0 ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding * -1 | $Price %])</a></li>[% END %]
193                                 [% IF relatives_with_fines %]<li><a href="#opac-user-relative-fines">Relatives' fines</a></li>[% END %]
194                             [% END %]
195
196                             [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
197                                 <li>
198                                     <a id="opac-user-clubs-tab-link" href="#opac-user-clubs">
199                                         Clubs ([% borrower_club_enrollments.count || 0 | html %]/[% borrower_enrollable_clubs.count || 0 | html %])
200                                     </a>
201                                 </li>
202                             [% END %]
203
204                             [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
205                             [% IF Koha.Preference('ArticleRequests') && logged_in_user.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% logged_in_user.article_requests_current.count | html %])</a></li>[% END %]
206                             [% IF ( OverDriveCirculation ) %]
207                             <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
208                             [% END %]
209                             [% IF ( RecordedBooksCirculation ) %]
210                             <li><a href="#opac-user-recordedbooks">RecordedBooks Account</a></li>
211                             [% END %]
212                         </ul>
213
214                         <div id="opac-user-overdrive">
215                         </div>
216                         <div id="opac-user-recordedbooks">
217                         </div>
218                         <div id="opac-user-checkouts">
219                             [% IF ( issues_count ) %]
220                                 <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
221                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]">
222                                     <input type="hidden" name="from" value="opac_user" />
223                                     <table id="checkoutst" class="table table-bordered table-striped">
224                                         <caption>[% issues_count | html %] Item(s) checked out</caption>
225                                         <thead>
226                                             <tr>
227                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]<th class="nosort">&nbsp;</th>[% END %]
228                                                 <th class="anti-the">Title</th>
229                                                 <th>Author</th>
230                                                 <th class="title-string psort">Due</th>
231                                                 [% UNLESS ( item_level_itypes ) %]
232                                                     <th>Item type</th>
233                                                 [% END %]
234                                                 [% IF ( show_barcode ) %]
235                                                     <th>Barcode</th>
236                                                 [% END %]
237                                                     <th>Call no.</th>
238                                                 [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
239                                                     <th class="nosort">Renew</th>
240                                                 [% END %]
241                                                 [% IF ( OPACFinesTab ) %]
242                                                     <th>Fines</th>
243                                                 [% END %]
244                                                 [% IF ( OPACMySummaryHTML ) %]
245                                                     <th class="nosort">Links</th>
246                                                 [% END %]
247                                                 [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
248                                                     <th class="nosort">Note</th>
249                                                 [% END %]
250                                             </tr>
251                                         </thead>
252                                         <tbody>
253                                             [% FOREACH ISSUE IN ISSUES %]
254                                                 [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
255                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]<td class="jacketcell">
256                                                     [% IF ( AdlibrisEnabled && ISSUE.normalized_isbn ) %]
257                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% ISSUE.normalized_isbn | uri %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
258                                                     [% END %]
259                                                     [% IF ( OPACAmazonCoverImages ) %]
260                                                         [% IF ( ISSUE.normalized_isbn ) %]
261                                                             <a href="http://www.amazon.com/gp/reader/[% ISSUE.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% ISSUE.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail"/></a>
262                                                         [% ELSE %]
263                                                             <a href="#"><span class="no-image">No cover image available</span></a>
264                                                         [% END %]
265                                                     [% END %]
266
267                                                     [% IF ( GoogleJackets ) %]
268                                                         [% IF ( ISSUE.normalized_isbn ) %]
269                                                             <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
270                                                         [% ELSE %]
271                                                             <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
272                                                         [% END %]
273                                                     [% END %]
274
275                                                     [% IF ( BakerTaylorEnabled ) %]
276                                                         [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %]
277                                                         [% IF ( bt_id ) %]
278                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
279                                                         [% ELSE %]
280                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
281                                                         [% END %]
282                                                     [% END %]
283
284                                                     [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
285                                                         <a class="custom_cover_image" href="[% ISSUE.biblio_object.custom_cover_image_url | url %]"><img alt="Cover image" src="[% ISSUE.biblio_object.custom_cover_image_url | url %]" /></a>
286                                                     [% END %]
287
288                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
289                                                         <img src="https://secure.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% ISSUE.normalized_upc | html %]&amp;oclc=[% ISSUE.normalized_oclc | html %]" alt="" class="item-thumbnail" />
290                                                     [% END %]
291
292                                                 </td>[% END # / IF JacketImages %]
293
294                                                 <td class="title">
295                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% INCLUDE 'biblio-title.inc' biblio=ISSUE %]</a>
296                                                     [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
297                                                 </td>
298
299                                                 <td class="author">[% ISSUE.author | html %]</td>
300                                                 [% IF ( ISSUE.overdue ) %]
301                                                     <td class="date_due overdue">
302                                                         <span title="[% ISSUE.date_due | html %]">
303                                                             <span class="tdlabel">Date due:</span>
304                                                             [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
305                                                         </span>
306                                                     </td>
307                                                 [% ELSE %]
308                                                     <td class="date_due">
309                                                         <span title="[% ISSUE.date_due | html %]">
310                                                             <span class="tdlabel">Date due:</span>
311                                                             [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
312                                                         </span>
313                                                     </td>
314                                                 [% END %]
315                                                 [% UNLESS ( item_level_itypes ) %]
316                                                     <td class="itype">
317                                                         <span class="tdlabel">Item type:</span>
318                                                         [% IF ( ISSUE.imageurl ) %]
319                                                             <img src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" />
320                                                         [% END %] [% ISSUE.description | html %]
321                                                     </td>
322                                                 [% END %]
323                                                 [% IF ( show_barcode ) %]
324                                                     <td class="barcode">
325                                                         <span class="tdlabel">Barcode:</span>
326                                                         [% ISSUE.barcode | html %]
327                                                     </td>
328                                                 [% END %]
329                                                 <td class="call_no">
330                                                     <span class="tdlabel">Call no.:</span>
331                                                     [% ISSUE.itemcallnumber | html %]
332                                                 </td>
333                                                 [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
334                                                     <td class="renew">
335                                                     [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
336                                                     [% IF ( ISSUE.status ) %]
337                                                         [% IF ( canrenew ) %]
338                                                             <input type="checkbox" name="item" value="[% ISSUE.itemnumber | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% ISSUE.itemnumber | uri %]&amp;borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
339                                                         [% END %]
340                                                         [% IF ISSUE.renewalfee > 0 %]
341                                                             <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
342                                                         [% END %]
343                                                         [% IF ISSUE.itemtype_object.rentalcharge_daily > 0 %]
344                                                             <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_daily | $Price %] per day</span>
345                                                         [% END %]
346                                                         [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
347                                                             <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
348                                                         [% END %]
349                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
350                                                     [% ELSIF ( ISSUE.on_reserve ) %]
351                                                         Not renewable <span class="renewals">(on hold)</span>
352                                                     [% ELSIF ( ISSUE.too_many ) %]
353                                                         Not renewable
354                                                     [% ELSIF ( ISSUE.norenew_overdue ) %]
355                                                         Not allowed <span class="renewals">(overdue)</span>
356                                                     [% ELSIF ( ISSUE.auto_too_late ) %]
357                                                         No longer renewable
358                                                     [% ELSIF ISSUE.auto_too_much_oweing %]
359                                                         Automatic renewal failed, you have unpaid fines.
360                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
361                                                     [% ELSIF ISSUE.auto_account_expired %]
362                                                         Automatic renewal failed, your account is expired.
363                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
364                                                     [% ELSIF ( ISSUE.too_soon ) %]
365                                                         No renewal before [% ISSUE.soonestrenewdate | html %]
366                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
367                                                     [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
368                                                         Automatic renewal
369                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
370                                                     [% ELSIF ( ISSUE.item_denied_renewal ) %]
371                                                         Renewal not allowed
372                                                     [% END %]
373                                                     </td>
374                                                 [% END %]
375                                                 [% IF ( OPACFinesTab ) %]
376                                                     <td class="fines">
377                                                         <span class="tdlabel">Fines:</span>
378                                                         [% IF ( ISSUE.charges ) %]
379                                                             Yes (Item overdue or lost)
380                                                         [% ELSIF ( ISSUE.rentalfines ) %]
381                                                             Yes (Rental fees)
382                                                         [% ELSE %]
383                                                             No
384                                                         [% END %]
385                                                     </td>
386                                                 [% END %]
387                                                 [% IF ( OPACMySummaryHTML ) %]
388                                                     <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
389                                                 [% END %]
390                                                 [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
391                                                     <td class="note">
392                                                         <input type="text" name="note" data-issue_id="[% ISSUE.issue_id | html %]" data-origvalue="[% ISSUE.note | html %]" value="[% ISSUE.note | html %]" readonly>
393                                                         <a class="btn js_submitnote" id="save_[% ISSUE.issue_id | html %]" style="display:none;">Submit note</a>
394                                                         <a class="btn nonjs_submitnote" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | url %]">Edit / Create note</a>
395                                                     </td>
396                                                 [% END %]
397                                             </tr>
398                                         [% END # /FOREACH ISSUES %]
399                                     </tbody>
400                                 </table>
401                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
402                                     <input type="submit" class="btn" value="Renew selected" />
403                                 [% END %]
404                                 </form>
405
406                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
407                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
408                                     <input type="hidden" name="from" value="opac_user" />
409                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
410                                     [% FOREACH ISSUE IN ISSUES %]
411                                         <input type="hidden" name="item" value="[% ISSUE.itemnumber | html %]" />
412                                     [% END %]
413                                     <input type="submit" class="btn" value="Renew all" />
414                                 </form>
415                                 [% END %]
416                                 <p><a href="opac-ics.pl">Download as iCal/.ics file</a></p>
417                             [% ELSE %]
418                                 <table class="table table-bordered table-striped">
419                                     <tr><td>You have nothing checked out</td></tr>
420                                 </table>
421                             [% END # IF issues_count %]
422                         </div> <!-- / .opac-user-checkouts -->
423
424                         [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
425                             <div id="opac-user-clubs">
426                                 Loading...
427                             </div>
428                         [% END %]
429
430                         [% IF ( OPACFinesTab ) %]
431                             <!-- FINES BOX -->
432                             [% IF ( amountoutstanding > 0 ) %]
433                                 <div id="opac-user-fines"> <h3>Charges</h3>
434                                     <table class="table table-bordered table-striped">
435                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
436                                         <tbody>
437                                             <tr>
438                                                 <td>You currently owe fines and charges amounting to:</td>
439                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding | $Price %]</a></td>
440                                             </tr>
441                                         </tbody>
442                                     </table>
443                                 </div>
444                             [% END %]
445
446                             [% IF ( amountoutstanding < 0 ) %]
447                                 <div id="opac-user-fines">  <h3>Credits</h3>
448                                     <table class="table table-bordered table-striped">
449                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
450                                         <tbody>
451                                             <tr>
452                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding * -1 | $Price %]</a></td>
453                                             </tr>
454                                         </tbody>
455                                     </table>
456                                 </div>
457                             [% END %]
458
459                             [% IF relatives_with_fines %]
460                                <div id="opac-user-relative-fines"> <h3>Fines and charges</h3>
461                                     <table class="table table-bordered table-striped">
462                                         <thead>
463                                             <tr>
464                                                 <th colspan="2">Amount</th>
465                                             </tr>
466                                         </thead>
467                                         <tbody>
468                                             [% FOREACH r IN relatives_with_fines %]
469                                             <tr>
470                                                 <td>[% r.firstname | html %] [% r.surname | html %] currently owes fines and charges amounting to:</td>
471                                                 <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id | uri %]">[% r.account.balance | $Price %]</a></td>
472                                             </tr>
473                                             [% END %]
474                                         </tbody>
475                                     </table>
476                                 </div>
477                             [% END %]
478                         [% END # / OPACFinesTab %]
479
480                         [% IF relatives %]
481                             <div id="opac-user-relative-issues">
482                                 <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
483                                     <thead>
484                                         <tr>
485                                             <th class="anti-the">Title</th>
486                                             <th>Due</th>
487                                             <th>Barcode</th>
488                                             <th>Call no.</th>
489                                             <th class="psort">Relative</th>
490                                         </tr>
491                                     </thead>
492
493                                     <tbody>
494                                         [% FOREACH r IN relatives %]
495                                             [% FOREACH c IN r.checkouts %]
496                                                 <tr>
497                                                     <td>
498                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber | uri %]">
499                                                             [% i.item.biblio.title | html %][% IF ( i.item.enumchron ) %] [% i.item.enumchron | html %][% END %]
500                                                         </a>
501                                                     </td>
502
503                                                     <td>
504                                                         [% c.date_due | $KohaDates %]
505                                                     </td>
506
507                                                     <td>
508                                                         [% c.item.barcode | html %]
509                                                     </td>
510
511                                                     <td>
512                                                         [% c.item.itemcallnumber | html %]
513                                                     </td>
514
515                                                     <td>
516                                                         [% r.firstname | html %] [% r.surname | html %]
517                                                     </td>
518                                                 </tr>
519                                             [% END %]
520                                         [% END %]
521                                     </tbody>
522                                 </table>
523                             </div>
524                         [% END %]
525
526                         [% IF ( overdues_count ) %]
527                             <div id="opac-user-overdues">
528                                 <table id="overduest" class="table table-bordered table-striped">
529                                     <caption>Overdues <span class="count">([% overdues_count | html %] total)</span></caption>
530                                     <!-- OVERDUES TABLE ROWS -->
531                                     <thead>
532                                         <tr>
533                                             [% IF ( JacketImages || AdlibrisEnabled ) %]<th class="nosort">&nbsp;</th>[% END %]
534                                             <th class="anti-the">Title</th>
535                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
536                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
537                                             <th>Call no.</th>
538                                             <th class="title-string psort">Due</th>
539                                             [% IF ( OpacRenewalAllowed ) %]
540                                                 <th class="nosort">Renew</th>
541                                             [% END %]
542                                             [% IF ( OPACFinesTab ) %]
543                                                 <th>Fines</th>
544                                             [% END %]
545                                         </tr>
546                                     </thead>
547                                     <tbody>
548                                         [% FOREACH OVERDUE IN OVERDUES %]
549                                             <tr>
550                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]
551                                                     <td class="jacketcell">
552                                                     [% IF ( AdlibrisEnabled && OVERDUE.normalized_isbn ) %]
553                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% OVERDUE.biblionumber | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% OVERDUE.normalized_isbn | uri %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
554                                                     [% END %]
555                                                     [% IF ( OPACAmazonCoverImages ) %]
556                                                         [% IF ( OVERDUE.normalized_isbn ) %]
557                                                             <a href="http://www.amazon.com/gp/reader/[% OVERDUE.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link" title="View on Amazon.com"><img src="https://images-na.ssl-images-amazon.com/images/P/[% OVERDUE.normalized_isbn | html %].01.THUMBZZZ.jpg" alt="View on Amazon.com" class="item-thumbnail" /></a>
558                                                         [% ELSE %]
559                                                             <a href="#"><span class="no-image">No cover image available</span></a>
560                                                         [% END %]
561                                                     [% END %]
562
563                                                     [% IF ( GoogleJackets ) %]
564                                                         [% IF ( OVERDUE.normalized_isbn ) %]
565                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
566                                                         [% ELSE %]
567                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
568                                                         [% END %]
569                                                     [% END %]
570
571                                                     [% IF ( BakerTaylorEnabled ) %]
572                                                         [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
573                                                         [% IF ( bt_id ) %]
574                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
575                                                         [% ELSE %]
576                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
577                                                         [% END %]
578                                                     [% END %]
579
580                                                     [% IF ( SyndeticsCoverImages ) %]
581                                                         <img src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;upc=[% OVERDUE.normalized_upc | html %]&amp;oclc=[% OVERDUE.normalized_oclc | html %]&amp;type=xw10" alt="" class="item-thumbnail" />
582                                                     [% END %]
583                                                     </td>
584                                                 [% END # /IF jacketcell %]
585
586                                                 <td>
587                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber | html %]">[% INCLUDE 'biblio-title.inc' biblio=OVERDUE %]</a>
588                                                     <span class="item-details">[% OVERDUE.author | html %]</span>
589                                                 </td>
590
591                                                 [% UNLESS ( item_level_itypes ) %]
592                                                     <td>
593                                                         [% IF ( OVERDUE.imageurl ) %]
594                                                             <img src="[% OVERDUE.imageurl | html %]" title="[% OVERDUE.description | html %]" alt="[% OVERDUE.description | html %]" />
595                                                         [% END %] [% OVERDUE.description | html %]
596                                                     </td>
597                                                 [% END %]
598                                                 [% IF ( show_barcode ) %]
599                                                     <td>
600                                                         <span class="tdlabel">Barcode:</span>
601                                                         [% OVERDUE.barcode | html %]
602                                                     </td>
603                                                 [% END %]
604                                                 <td>
605                                                     <span class="tdlabel">Call no.:</span>
606                                                     [% OVERDUE.itemcallnumber | html %]
607                                                 </td>
608                                                 <td>
609                                                     <span title="[% OVERDUE.date_due | html %]">
610                                                         <span class="tdlabel">Date due:</span>
611                                                         [% OVERDUE.date_due | $KohaDates  as_due_date => 1 %]
612                                                     </span>
613                                                 </td>
614                                                 [% IF ( OpacRenewalAllowed ) %]
615                                                     <td>
616                                                         [% IF ( OVERDUE.debarred ) %]
617                                                             Account frozen
618                                                         [% ELSIF ( OVERDUE.status ) %]
619                                                             [% IF ( canrenew ) %]
620                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
621                                                             [% END %]
622                                                                 <span class="renewals">([% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining)</span>
623                                                         [% ELSIF ( OVERDUE.norenew_overdue ) %]
624                                                             Not allowed<span class="renewals">(overdue)</span>
625                                                         [% ELSIF ( OVERDUE.onreserve ) %]
626                                                             On hold
627                                                         [% ELSE %]
628                                                             No renewals left
629                                                         [% END %]
630                                                     </td>
631                                                 [% END %]
632                                                 [% IF ( OPACFinesTab ) %]
633                                                     <td>
634                                                         <span class="tdlabel">Fines:</span>
635                                                         [% IF ( OVERDUE.charges ) %]
636                                                             Yes
637                                                         [% ELSE %]
638                                                             No
639                                                         [% END %]
640                                                     </td>
641                                                 [% END %]
642                                             </tr>
643                                         [% END %]
644                                     </tbody>
645                                 </table>
646                             </div> <!-- / #opac-user-overdues -->
647                         [% END # /overdues_count %]
648
649                         [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
650
651                         [% IF Koha.Preference('ArticleRequests') %]
652                             <div id="opac-user-article-requests">
653                                 [% IF logged_in_user.article_requests_current.count %]
654                                     <table id="article-requests-table" class="table table-bordered table-striped">
655                                         <caption>Article requests <span class="count">([% logged_in_user.article_requests_current.count | html %] total)</span></caption>
656                                         <thead>
657                                             <tr>
658                                                 <th class="anti-the article-request-record-title">Record title</th>
659                                                 <th class="psort article-request-created-on">Placed on</th>
660                                                 <th class="anti-the article-request-title">Title</th>
661                                                 <th class="article-request-author">Author</th>
662                                                 <th class="article-request-volume">Volume</th>
663                                                 <th class="article-request-issue">Issue</th>
664                                                 <th class="article-request-date">Date</th>
665                                                 <th class="article-request-pages">Pages</th>
666                                                 <th class="article-request-chapters">Chapters</th>
667                                                 <th class="article-request-patron-notes">Notes</th>
668                                                 <th class="article-request-status">Status</th>
669                                                 <th class="article-request-branchcode">Pickup library</th>
670                                                 <th class="nosort article-request-cancel">&nbsp;</th>
671                                             </tr>
672                                         </thead>
673
674                                         <tbody>
675                                         [% FOREACH ar IN logged_in_user.article_requests_current %]
676                                                 <td class="article-request-record-title">
677                                                     <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber | html %]">
678                                                         [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
679                                                         [% ar.item.enumchron | html %]
680                                                     </a>
681                                                     [% ar.biblio.author | html %]
682                                                     [% IF ar.itemnumber %] <i>(only [% ar.item.barcode | html %])</i>[% END %]
683                                                 </td>
684
685                                                 <td class="article-request-created_on">
686                                                     [% ar.created_on | $KohaDates %]
687                                                 </td>
688
689                                                 <td class="article-request-title">
690                                                     [% ar.title | html %]
691                                                 </td>
692
693                                                 <td class="article-request-author">
694                                                     [% ar.author | html %]
695                                                 </td>
696
697                                                 <td class="article-request-volume">
698                                                     [% ar.volume | html %]
699                                                 </td>
700
701                                                 <td class="article-request-issue">
702                                                     [% ar.issue | html %]
703                                                 </td>
704
705                                                 <td class="article-request-date">
706                                                     [% ar.date | html %]
707                                                 </td>
708
709                                                 <td class="article-request-pages">
710                                                     [% ar.pages | html %]
711                                                 </td>
712
713                                                 <td class="article-request-chapters">
714                                                     [% ar.chapters | html %]
715                                                 </td>
716
717                                                 <td class="article-request-patron-notes">
718                                                     [% ar.patron_notes | html %]
719                                                 </td>
720
721                                                 <td class="article-request-status">
722                                                     [% IF ar.status == 'PENDING' %]
723                                                         Pending
724                                                     [% ELSIF ar.status == 'PROCESSING' %]
725                                                         Processing
726                                                     [% ELSIF ar.status == 'COMPLETED' %]
727                                                         Completed
728                                                     [% ELSIF ar.status == 'CANCELED' %]
729                                                         Canceled
730                                                     [% END %]
731                                                 </td>
732
733                                                 <td class="article-request-branchcode">
734                                                     [% ar.branch.branchname | html %]
735                                                 </td>
736
737                                                 <td class="article-request-cancel">
738                                                     <span class="tdlabel">Cancel:</span>
739                                                     <form action="/cgi-bin/koha/opac-article-request-cancel.pl" id="delete_article_request_[% ar.id | html %]">
740                                                         <input type="hidden" name="id" value="[% ar.id | html %]" />
741                                                         <button data-title="[% ar.biblio.title | html %] [% ar.item.enumchron | html %]" data-article-request_id="[% ar.id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-article-request"><i class="fa fa-remove"></i> Cancel</button>
742                                                     </form>
743                                                 </td>
744                                             </tr>
745                                         [% END %]
746                                     </tbody>
747                                 </table>
748                             [% ELSE %]
749                                 <table class="table table-bordered table-striped">
750                                     <tr><td>You have no article requests currently.</td></tr>
751                                 </table>
752                             [% END # IF article_requests_current.count %]
753                         </div> <!-- / #opac-user-article-requests -->
754                     [% END %]
755
756                     </div> <!-- /#opac-user-views -->
757                 </div> <!-- /#userdetails -->
758             </div> <!-- /.span10 -->
759         </div> <!-- /.row-fluid -->
760     </div> <!-- /.container-fluid -->
761 </div> <!-- /#main -->
762
763 [% IF ( OverDriveCirculation ) %]
764     [% INCLUDE 'overdrive-checkout.inc' %]
765     [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %]
766         [% INCLUDE 'overdrive-login.inc' %]
767     [% END %]
768 [% END %]
769 [% IF ( RecordedBooksCirculation ) %]
770 [% INCLUDE 'recordedbooks-checkout.inc' %]
771 [% END %]
772
773 [% INCLUDE 'opac-bottom.inc' %]
774 [% BLOCK jsinclude %]
775     [% INCLUDE 'calendar.inc' %]
776     [% INCLUDE 'datatables.inc' %]
777     <script>
778
779         $(document).ready(function(){
780             $('#opac-user-views').tabs();
781             $(".js-show").show();
782             $(".js-hide").hide();
783             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
784             $(".suspend-until").prop("readonly",1);
785
786             $(".btn-delete-hold").on("click", function(e){
787                 e.preventDefault();
788                 var hold_title = $(this).data("title");
789                 var reserve_id = $(this).data("reserve_id");
790                 confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
791                         if( result ){
792                             $("#delete_hold_" + reserve_id ).submit();
793                         }
794                     }
795                 );
796             });
797
798             $(".btn-delete-article-request").on("click", function(e){
799                 e.preventDefault();
800                 var article_request = $(this).data("title");
801                 var article_request_id = $(this).data("article-request_id");
802                 confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), function( result ){
803                         if( result ){
804                             $("#delete_article_request_" + article_request_id ).submit();
805                         }
806                     }
807                 );
808             });
809
810             $("#suspend_all_submit").on("click", function(e){
811                 e.preventDefault();
812                 var title = _("Are you sure you want to suspend all holds?");
813                 var body = _("All holds will be suspended.");
814                 confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
815                         if( result ){
816                             $("#suspend_all_holds").submit();
817                         }
818                     }
819                 );
820             });
821
822             $("#resume_all_submit").on("click", function(e){
823                 e.preventDefault();
824                 var title = _("Are you sure you want to resume all suspended holds?");
825                 var body = _("All holds will resume.");
826                 confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
827                         if( result ){
828                             $("#resume_all_holds").submit();
829                         }
830                     }
831                 );
832             });
833
834             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
835             dTables.each(function(){
836                 var thIndex = $(this).find("th.psort").index();
837                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
838                     "sorting" : [[ thIndex, 'asc' ]],
839                     "columnDefs": [
840                         { "targets": [ "nosort" ],"sortable": false,"searchable": false },
841                         { "type": "anti-the", "targets" : [ "anti-the" ] },
842                         { "type": "title-string", "targets" : [ "title-string" ] }
843                     ]
844                 }));
845             });
846
847             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
848             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
849                 $("#renewselected").submit(function(){
850                     valid = false;
851                     $("input[type=checkbox]").each(function(){
852                         if($(this).is(':checked')){
853                             valid = true;
854                         }
855                     });
856                     if(!valid){
857                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
858                     }
859                     return valid;
860                 });
861                 $("body").on("click","#renewselected_link",function(e){
862                     e.preventDefault();
863                     $("#renewselected").submit();
864                 });
865                 $("body").on("click","#renewall_link",function(e){
866                     e.preventDefault();
867                     $("#renewall").submit();
868                 });
869                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
870                     $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" class=\"btn btn-link\" href=\"#\"><i class=\"fa fa-check\"></i> "+_("Renew selected")+"</a> <a id=\"renewall_link\" class=\"btn btn-link\" href=\"#\"><span class=\"fa-stack\"><i class=\"fa fa-check fa-stack-1x\"></i><i class=\"fa fa-check fa-stack-1x\"></i></span> "+_("Renew all")+"</a></div>");
871                 [% END %]
872             [% END %]
873
874             [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
875
876                 /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
877                 $(".nonjs_submitnote").hide();
878
879                 $("input[name='note']").prop('readonly', false);
880                 $("input[name='note']").keypress(function(e){
881                     /* prevent submitting of renewselected form */
882                     if(e.which == 13)
883                         e.preventDefault();
884                 });
885
886                 $("input[name='note']").keyup(function(e){
887                     var $btn_save = $('#save_'+$(this).data('issue_id'));
888                     var origvalue = $(this).data('origvalue');
889                     var value = $(this).val();
890
891                     if(origvalue != value) {
892                         if(origvalue != "")
893                             $btn_save.text(_("Submit changes"));
894                         else
895                             $btn_save.text(_("Submit note"));
896                         $btn_save.show();
897                     } else {
898                         $btn_save.hide();
899                     }
900                 });
901
902                 $(".js_submitnote").click(function(e){
903                     var $self = $(this);
904                     var title = $(this).parent().siblings('.title').html();
905                     var $noteinput = $(this).siblings('input[name="note"]').first();
906
907                     var ajaxData = {
908                         'action': 'issuenote',
909                         'issue_id': $noteinput.data('issue_id'),
910                         'note': $noteinput.val(),
911                     };
912
913                     $.ajax({
914                         url: '/cgi-bin/koha/svc/checkout_notes/',
915                         type: 'POST',
916                         dataType: 'json',
917                         data: ajaxData,
918                     })
919                     .done(function(data) {
920                         var message = "";
921                         if(data.status == 'saved') {
922                             $("#notesaved").removeClass("alert-error");
923                             $("#notesaved").addClass("alert-info");
924                             $noteinput.data('origvalue', data.note);
925                             $noteinput.val(data.note);
926                             message = "<p>" + _("Your note about %s has been saved and sent to the library.").format(title) + "</p>";
927                             message += "<p style=\"font-style:italic;\">" + data.note + "</p>";
928                             $self.hide();
929                         } else if(data.status == 'removed') {
930                             $("#notesaved").removeClass("alert-error");
931                             $("#notesaved").addClass("alert-info");
932                             $noteinput.data('origvalue', "");
933                             $noteinput.val("");
934                             message = "<p>" + _("Your note about %s was removed.").format(title) + "</p>";
935                             $self.hide();
936                         } else {
937                             $("#notesaved").removeClass("alert-info");
938                             $("#notesaved").addClass("alert-error");
939                             message =  "<p>" + _("Your note about %s could not be saved.").format(title) + "</p>";
940                             message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
941                         }
942                         $("#notesaved").html(message);
943                     })
944                     .fail(function(data) {
945                         $("#notesaved").removeClass("alert-info");
946                         $("#notesaved").addClass("alert-error");
947                         var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
948                         $("#notesaved").html(message);
949                     })
950                     .always(function() {
951                         $("#notesaved").show();
952                     });
953                 });
954             [% END %]
955
956             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
957
958             if ( $('#opac-user-clubs').length ) {
959                 $('#opac-user-clubs-tab-link').on('click', function() {
960                     $('#opac-user-clubs').text(_("Loading..."));
961                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
962                 });
963             }
964         });
965         //]]>
966     </script>
967     [% IF Koha.Preference('OverDriveCirculation') %]
968     [% Asset.js("js/overdrive.js") | $raw %]
969     <script>
970     var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %];
971     $(document).ready(function() {
972         [% IF ( overdrive_error ) %]
973             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]");
974         [% END %]
975
976         [% IF ( overdrive_tab ) %]
977             $("#opac-user-views").tabs("select", "#opac-user-overdrive");
978         [% END %]
979
980         $("#opac-user-overdrive").each( function() {
981             KOHA.OverDriveCirculation.display_account_details(this);
982         } );
983     });
984     </script>
985     [% END %]
986     [% IF RecordedBooksCirculation %]
987         [% Asset.js("js/recordedbooks.js") | $raw %]
988         <script type="text/JavaScript">
989             $(document).ready(function() {
990                 [% IF ( recordedbooks_error ) %]
991                     KOHA.RecordedBooks.display_error("#opac-user-recordedbooks", "[% recordedbooks_error.dquote | html %]");
992                 [% END %]
993                 [% IF ( recordedbooks_tab ) %]
994                     $("#opac-user-views").tabs("select", "#opac-user-recordedbooks");
995                 [% END %]
996                 $("#opac-user-recordedbooks").each( function() {
997                     KOHA.RecordedBooks.display_account_details(this);
998                 } );
999             });
1000         </script>
1001     [% END %]
1002 [% END %]