Bug 13557: Add hint for on-site checkouts to list of current checkouts in OPAC
[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                                                     [% IF ( ISSUE.onsite_checkout ) %] <i class="onsite_checkout">(On-site checkout)</i>[% END %]
298                                                 </td>
299
300                                                 <td class="author">[% ISSUE.author | html %]</td>
301                                                 [% IF ( ISSUE.overdue ) %]
302                                                     <td class="date_due overdue">
303                                                         <span title="[% ISSUE.date_due | html %]">
304                                                             <span class="tdlabel">Date due:</span>
305                                                             [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
306                                                         </span>
307                                                     </td>
308                                                 [% ELSE %]
309                                                     <td class="date_due">
310                                                         <span title="[% ISSUE.date_due | html %]">
311                                                             <span class="tdlabel">Date due:</span>
312                                                             [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
313                                                         </span>
314                                                     </td>
315                                                 [% END %]
316                                                 [% UNLESS ( item_level_itypes ) %]
317                                                     <td class="itype">
318                                                         <span class="tdlabel">Item type:</span>
319                                                         [% IF ( ISSUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
320                                                             <img src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" />
321                                                         [% END %] [% ISSUE.description | html %]
322                                                     </td>
323                                                 [% END %]
324                                                 [% IF ( show_barcode ) %]
325                                                     <td class="barcode">
326                                                         <span class="tdlabel">Barcode:</span>
327                                                         [% ISSUE.barcode | html %]
328                                                     </td>
329                                                 [% END %]
330                                                 <td class="call_no">
331                                                     <span class="tdlabel">Call no.:</span>
332                                                     [% ISSUE.itemcallnumber | html %]
333                                                 </td>
334                                                 [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
335                                                     <td class="renew">
336                                                     [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
337                                                     [% IF ( ISSUE.status ) %]
338                                                         [% IF ( canrenew ) %]
339                                                             <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>
340                                                         [% END %]
341                                                         [% IF ISSUE.renewalfee > 0 %]
342                                                             <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
343                                                         [% END %]
344                                                         [% IF ISSUE.itemtype_object.rentalcharge_daily > 0 %]
345                                                             <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_daily | $Price %] per day</span>
346                                                         [% END %]
347                                                         [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
348                                                             <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
349                                                         [% END %]
350                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
351                                                     [% ELSIF ( ISSUE.on_reserve ) %]
352                                                         Not renewable <span class="renewals">(on hold)</span>
353                                                     [% ELSIF ( ISSUE.too_many ) %]
354                                                         Not renewable
355                                                     [% ELSIF ( ISSUE.norenew_overdue ) %]
356                                                         Not allowed <span class="renewals">(overdue)</span>
357                                                     [% ELSIF ( ISSUE.auto_too_late ) %]
358                                                         No longer renewable
359                                                     [% ELSIF ISSUE.auto_too_much_oweing %]
360                                                         Automatic renewal failed, you have unpaid fines.
361                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
362                                                     [% ELSIF ISSUE.auto_account_expired %]
363                                                         Automatic renewal failed, your account is expired.
364                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
365                                                     [% ELSIF ( ISSUE.too_soon ) %]
366                                                         No renewal before [% ISSUE.soonestrenewdate | html %]
367                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
368                                                     [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
369                                                         Automatic renewal
370                                                         <span class="renewals">([% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining)</span>
371                                                     [% ELSIF ( ISSUE.item_denied_renewal ) %]
372                                                         Renewal not allowed
373                                                     [% END %]
374                                                     </td>
375                                                 [% END %]
376                                                 [% IF ( OPACFinesTab ) %]
377                                                     <td class="fines">
378                                                         <span class="tdlabel">Fines:</span>
379                                                         [% IF ( ISSUE.charges ) %]
380                                                             Yes (Item overdue or lost)
381                                                         [% ELSIF ( ISSUE.rentalfines ) %]
382                                                             Yes (Rental fees)
383                                                         [% ELSE %]
384                                                             No
385                                                         [% END %]
386                                                     </td>
387                                                 [% END %]
388                                                 [% IF ( OPACMySummaryHTML ) %]
389                                                     <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
390                                                 [% END %]
391                                                 [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
392                                                     <td class="note">
393                                                         <input type="text" name="note" data-issue_id="[% ISSUE.issue_id | html %]" data-origvalue="[% ISSUE.note | html %]" value="[% ISSUE.note | html %]" readonly>
394                                                         <a class="btn js_submitnote" id="save_[% ISSUE.issue_id | html %]" style="display:none;">Submit note</a>
395                                                         <a class="btn nonjs_submitnote" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | url %]">Edit / Create note</a>
396                                                     </td>
397                                                 [% END %]
398                                             </tr>
399                                         [% END # /FOREACH ISSUES %]
400                                     </tbody>
401                                 </table>
402                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
403                                     <input type="submit" class="btn" value="Renew selected" />
404                                 [% END %]
405                                 </form>
406
407                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
408                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
409                                     <input type="hidden" name="from" value="opac_user" />
410                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
411                                     [% FOREACH ISSUE IN ISSUES %]
412                                         <input type="hidden" name="item" value="[% ISSUE.itemnumber | html %]" />
413                                     [% END %]
414                                     <input type="submit" class="btn" value="Renew all" />
415                                 </form>
416                                 [% END %]
417                                 <p><a href="opac-ics.pl">Download as iCal/.ics file</a></p>
418                             [% ELSE %]
419                                 <table class="table table-bordered table-striped">
420                                     <tr><td>You have nothing checked out</td></tr>
421                                 </table>
422                             [% END # IF issues_count %]
423                         </div> <!-- / .opac-user-checkouts -->
424
425                         [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
426                             <div id="opac-user-clubs">
427                                 Loading...
428                             </div>
429                         [% END %]
430
431                         [% IF ( OPACFinesTab ) %]
432                             <!-- FINES BOX -->
433                             [% IF ( amountoutstanding > 0 ) %]
434                                 <div id="opac-user-fines"> <h3>Charges</h3>
435                                     <table class="table table-bordered table-striped">
436                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
437                                         <tbody>
438                                             <tr>
439                                                 <td>You currently owe fines and charges amounting to:</td>
440                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding | $Price %]</a></td>
441                                             </tr>
442                                         </tbody>
443                                     </table>
444                                 </div>
445                             [% END %]
446
447                             [% IF ( amountoutstanding < 0 ) %]
448                                 <div id="opac-user-fines">  <h3>Credits</h3>
449                                     <table class="table table-bordered table-striped">
450                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
451                                         <tbody>
452                                             <tr>
453                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding * -1 | $Price %]</a></td>
454                                             </tr>
455                                         </tbody>
456                                     </table>
457                                 </div>
458                             [% END %]
459
460                             [% IF relatives_with_fines %]
461                                <div id="opac-user-relative-fines"> <h3>Fines and charges</h3>
462                                     <table class="table table-bordered table-striped">
463                                         <thead>
464                                             <tr>
465                                                 <th colspan="2">Amount</th>
466                                             </tr>
467                                         </thead>
468                                         <tbody>
469                                             [% FOREACH r IN relatives_with_fines %]
470                                             <tr>
471                                                 <td>[% r.firstname | html %] [% r.surname | html %] currently owes fines and charges amounting to:</td>
472                                                 <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id | uri %]">[% r.account.balance | $Price %]</a></td>
473                                             </tr>
474                                             [% END %]
475                                         </tbody>
476                                     </table>
477                                 </div>
478                             [% END %]
479                         [% END # / OPACFinesTab %]
480
481                         [% IF relatives %]
482                             <div id="opac-user-relative-issues">
483                                 <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
484                                     <thead>
485                                         <tr>
486                                             <th class="anti-the">Title</th>
487                                             <th>Due</th>
488                                             <th>Barcode</th>
489                                             <th>Call no.</th>
490                                             <th class="psort">Relative</th>
491                                         </tr>
492                                     </thead>
493
494                                     <tbody>
495                                         [% FOREACH r IN relatives %]
496                                             [% FOREACH c IN r.checkouts %]
497                                                 <tr>
498                                                     <td>
499                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber | uri %]">
500                                                             [% i.item.biblio.title | html %][% IF ( i.item.enumchron ) %] [% i.item.enumchron | html %][% END %]
501                                                         </a>
502                                                     </td>
503
504                                                     <td>
505                                                         [% c.date_due | $KohaDates %]
506                                                     </td>
507
508                                                     <td>
509                                                         [% c.item.barcode | html %]
510                                                     </td>
511
512                                                     <td>
513                                                         [% c.item.itemcallnumber | html %]
514                                                     </td>
515
516                                                     <td>
517                                                         [% r.firstname | html %] [% r.surname | html %]
518                                                     </td>
519                                                 </tr>
520                                             [% END %]
521                                         [% END %]
522                                     </tbody>
523                                 </table>
524                             </div>
525                         [% END %]
526
527                         [% IF ( overdues_count ) %]
528                             <div id="opac-user-overdues">
529                                 <table id="overduest" class="table table-bordered table-striped">
530                                     <caption>Overdues <span class="count">([% overdues_count | html %] total)</span></caption>
531                                     <!-- OVERDUES TABLE ROWS -->
532                                     <thead>
533                                         <tr>
534                                             [% IF ( JacketImages || AdlibrisEnabled ) %]<th class="nosort">&nbsp;</th>[% END %]
535                                             <th class="anti-the">Title</th>
536                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
537                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
538                                             <th>Call no.</th>
539                                             <th class="title-string psort">Due</th>
540                                             [% IF ( OpacRenewalAllowed ) %]
541                                                 <th class="nosort">Renew</th>
542                                             [% END %]
543                                             [% IF ( OPACFinesTab ) %]
544                                                 <th>Fines</th>
545                                             [% END %]
546                                         </tr>
547                                     </thead>
548                                     <tbody>
549                                         [% FOREACH OVERDUE IN OVERDUES %]
550                                             <tr>
551                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]
552                                                     <td class="jacketcell">
553                                                     [% IF ( AdlibrisEnabled && OVERDUE.normalized_isbn ) %]
554                                                         <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>
555                                                     [% END %]
556                                                     [% IF ( OPACAmazonCoverImages ) %]
557                                                         [% IF ( OVERDUE.normalized_isbn ) %]
558                                                             <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>
559                                                         [% ELSE %]
560                                                             <a href="#"><span class="no-image">No cover image available</span></a>
561                                                         [% END %]
562                                                     [% END %]
563
564                                                     [% IF ( GoogleJackets ) %]
565                                                         [% IF ( OVERDUE.normalized_isbn ) %]
566                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
567                                                         [% ELSE %]
568                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
569                                                         [% END %]
570                                                     [% END %]
571
572                                                     [% IF ( BakerTaylorEnabled ) %]
573                                                         [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
574                                                         [% IF ( bt_id ) %]
575                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
576                                                         [% ELSE %]
577                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
578                                                         [% END %]
579                                                     [% END %]
580
581                                                     [% IF ( SyndeticsCoverImages ) %]
582                                                         <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" />
583                                                     [% END %]
584                                                     </td>
585                                                 [% END # /IF jacketcell %]
586
587                                                 <td>
588                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber | html %]">[% INCLUDE 'biblio-title.inc' biblio=OVERDUE %]</a>
589                                                     <span class="item-details">[% OVERDUE.author | html %]</span>
590                                                 </td>
591
592                                                 [% UNLESS ( item_level_itypes ) %]
593                                                     <td>
594                                                         [% IF ( OVERDUE.imageurl  && !Koha.Preference('OpacNoItemTypeImages') ) %]
595                                                             <img src="[% OVERDUE.imageurl | html %]" title="[% OVERDUE.description | html %]" alt="[% OVERDUE.description | html %]" />
596                                                         [% END %] [% OVERDUE.description | html %]
597                                                     </td>
598                                                 [% END %]
599                                                 [% IF ( show_barcode ) %]
600                                                     <td>
601                                                         <span class="tdlabel">Barcode:</span>
602                                                         [% OVERDUE.barcode | html %]
603                                                     </td>
604                                                 [% END %]
605                                                 <td>
606                                                     <span class="tdlabel">Call no.:</span>
607                                                     [% OVERDUE.itemcallnumber | html %]
608                                                 </td>
609                                                 <td>
610                                                     <span title="[% OVERDUE.date_due | html %]">
611                                                         <span class="tdlabel">Date due:</span>
612                                                         [% OVERDUE.date_due | $KohaDates  as_due_date => 1 %]
613                                                     </span>
614                                                 </td>
615                                                 [% IF ( OpacRenewalAllowed ) %]
616                                                     <td>
617                                                         [% IF ( OVERDUE.debarred ) %]
618                                                             Account frozen
619                                                         [% ELSIF ( OVERDUE.status ) %]
620                                                             [% IF ( canrenew ) %]
621                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
622                                                             [% END %]
623                                                                 <span class="renewals">([% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining)</span>
624                                                         [% ELSIF ( OVERDUE.norenew_overdue ) %]
625                                                             Not allowed<span class="renewals">(overdue)</span>
626                                                         [% ELSIF ( OVERDUE.onreserve ) %]
627                                                             On hold
628                                                         [% ELSE %]
629                                                             No renewals left
630                                                         [% END %]
631                                                     </td>
632                                                 [% END %]
633                                                 [% IF ( OPACFinesTab ) %]
634                                                     <td>
635                                                         <span class="tdlabel">Fines:</span>
636                                                         [% IF ( OVERDUE.charges ) %]
637                                                             Yes
638                                                         [% ELSE %]
639                                                             No
640                                                         [% END %]
641                                                     </td>
642                                                 [% END %]
643                                             </tr>
644                                         [% END %]
645                                     </tbody>
646                                 </table>
647                             </div> <!-- / #opac-user-overdues -->
648                         [% END # /overdues_count %]
649
650                         [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
651
652                         [% IF Koha.Preference('ArticleRequests') %]
653                             <div id="opac-user-article-requests">
654                                 [% IF logged_in_user.article_requests_current.count %]
655                                     <table id="article-requests-table" class="table table-bordered table-striped">
656                                         <caption>Article requests <span class="count">([% logged_in_user.article_requests_current.count | html %] total)</span></caption>
657                                         <thead>
658                                             <tr>
659                                                 <th class="anti-the article-request-record-title">Record title</th>
660                                                 <th class="psort article-request-created-on">Placed on</th>
661                                                 <th class="anti-the article-request-title">Title</th>
662                                                 <th class="article-request-author">Author</th>
663                                                 <th class="article-request-volume">Volume</th>
664                                                 <th class="article-request-issue">Issue</th>
665                                                 <th class="article-request-date">Date</th>
666                                                 <th class="article-request-pages">Pages</th>
667                                                 <th class="article-request-chapters">Chapters</th>
668                                                 <th class="article-request-patron-notes">Notes</th>
669                                                 <th class="article-request-status">Status</th>
670                                                 <th class="article-request-branchcode">Pickup library</th>
671                                                 <th class="nosort article-request-cancel">&nbsp;</th>
672                                             </tr>
673                                         </thead>
674
675                                         <tbody>
676                                         [% FOREACH ar IN logged_in_user.article_requests_current %]
677                                                 <td class="article-request-record-title">
678                                                     <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber | html %]">
679                                                         [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
680                                                         [% ar.item.enumchron | html %]
681                                                     </a>
682                                                     [% ar.biblio.author | html %]
683                                                     [% IF ar.itemnumber %] <i>(only [% ar.item.barcode | html %])</i>[% END %]
684                                                 </td>
685
686                                                 <td class="article-request-created_on">
687                                                     [% ar.created_on | $KohaDates %]
688                                                 </td>
689
690                                                 <td class="article-request-title">
691                                                     [% ar.title | html %]
692                                                 </td>
693
694                                                 <td class="article-request-author">
695                                                     [% ar.author | html %]
696                                                 </td>
697
698                                                 <td class="article-request-volume">
699                                                     [% ar.volume | html %]
700                                                 </td>
701
702                                                 <td class="article-request-issue">
703                                                     [% ar.issue | html %]
704                                                 </td>
705
706                                                 <td class="article-request-date">
707                                                     [% ar.date | html %]
708                                                 </td>
709
710                                                 <td class="article-request-pages">
711                                                     [% ar.pages | html %]
712                                                 </td>
713
714                                                 <td class="article-request-chapters">
715                                                     [% ar.chapters | html %]
716                                                 </td>
717
718                                                 <td class="article-request-patron-notes">
719                                                     [% ar.patron_notes | html %]
720                                                 </td>
721
722                                                 <td class="article-request-status">
723                                                     [% IF ar.status == 'PENDING' %]
724                                                         Pending
725                                                     [% ELSIF ar.status == 'PROCESSING' %]
726                                                         Processing
727                                                     [% ELSIF ar.status == 'COMPLETED' %]
728                                                         Completed
729                                                     [% ELSIF ar.status == 'CANCELED' %]
730                                                         Canceled
731                                                     [% END %]
732                                                 </td>
733
734                                                 <td class="article-request-branchcode">
735                                                     [% ar.branch.branchname | html %]
736                                                 </td>
737
738                                                 <td class="article-request-cancel">
739                                                     <span class="tdlabel">Cancel:</span>
740                                                     <form action="/cgi-bin/koha/opac-article-request-cancel.pl" id="delete_article_request_[% ar.id | html %]">
741                                                         <input type="hidden" name="id" value="[% ar.id | html %]" />
742                                                         <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>
743                                                     </form>
744                                                 </td>
745                                             </tr>
746                                         [% END %]
747                                     </tbody>
748                                 </table>
749                             [% ELSE %]
750                                 <table class="table table-bordered table-striped">
751                                     <tr><td>You have no article requests currently.</td></tr>
752                                 </table>
753                             [% END # IF article_requests_current.count %]
754                         </div> <!-- / #opac-user-article-requests -->
755                     [% END %]
756
757                     </div> <!-- /#opac-user-views -->
758                 </div> <!-- /#userdetails -->
759             </div> <!-- /.span10 -->
760         </div> <!-- /.row-fluid -->
761     </div> <!-- /.container-fluid -->
762 </div> <!-- /#main -->
763
764 [% IF ( OverDriveCirculation ) %]
765     [% INCLUDE 'overdrive-checkout.inc' %]
766     [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %]
767         [% INCLUDE 'overdrive-login.inc' %]
768     [% END %]
769 [% END %]
770 [% IF ( RecordedBooksCirculation ) %]
771 [% INCLUDE 'recordedbooks-checkout.inc' %]
772 [% END %]
773
774 [% INCLUDE 'opac-bottom.inc' %]
775 [% BLOCK jsinclude %]
776     [% INCLUDE 'calendar.inc' %]
777     [% INCLUDE 'datatables.inc' %]
778     <script>
779
780         $(document).ready(function(){
781             $('#opac-user-views').tabs();
782             $(".js-show").show();
783             $(".js-hide").hide();
784             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
785             $(".suspend-until").prop("readonly",1);
786
787             $(".btn-delete-hold").on("click", function(e){
788                 e.preventDefault();
789                 var hold_title = $(this).data("title");
790                 var reserve_id = $(this).data("reserve_id");
791                 confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
792                         if( result ){
793                             $("#delete_hold_" + reserve_id ).submit();
794                         }
795                     }
796                 );
797             });
798
799             $(".btn-delete-article-request").on("click", function(e){
800                 e.preventDefault();
801                 var article_request = $(this).data("title");
802                 var article_request_id = $(this).data("article-request_id");
803                 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 ){
804                         if( result ){
805                             $("#delete_article_request_" + article_request_id ).submit();
806                         }
807                     }
808                 );
809             });
810
811             $("#suspend_all_submit").on("click", function(e){
812                 e.preventDefault();
813                 var title = _("Are you sure you want to suspend all holds?");
814                 var body = _("All holds will be suspended.");
815                 confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
816                         if( result ){
817                             $("#suspend_all_holds").submit();
818                         }
819                     }
820                 );
821             });
822
823             $("#resume_all_submit").on("click", function(e){
824                 e.preventDefault();
825                 var title = _("Are you sure you want to resume all suspended holds?");
826                 var body = _("All holds will resume.");
827                 confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
828                         if( result ){
829                             $("#resume_all_holds").submit();
830                         }
831                     }
832                 );
833             });
834
835             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
836             dTables.each(function(){
837                 var thIndex = $(this).find("th.psort").index();
838                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
839                     "sorting" : [[ thIndex, 'asc' ]],
840                     "columnDefs": [
841                         { "targets": [ "nosort" ],"sortable": false,"searchable": false },
842                         { "type": "anti-the", "targets" : [ "anti-the" ] },
843                         { "type": "title-string", "targets" : [ "title-string" ] }
844                     ]
845                 }));
846             });
847
848             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
849             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
850                 $("#renewselected").submit(function(){
851                     valid = false;
852                     $("input[type=checkbox]").each(function(){
853                         if($(this).is(':checked')){
854                             valid = true;
855                         }
856                     });
857                     if(!valid){
858                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
859                     }
860                     return valid;
861                 });
862                 $("body").on("click","#renewselected_link",function(e){
863                     e.preventDefault();
864                     $("#renewselected").submit();
865                 });
866                 $("body").on("click","#renewall_link",function(e){
867                     e.preventDefault();
868                     $("#renewall").submit();
869                 });
870                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
871                     $("#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>");
872                 [% END %]
873             [% END %]
874
875             [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
876
877                 /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
878                 $(".nonjs_submitnote").hide();
879
880                 $("input[name='note']").prop('readonly', false);
881                 $("input[name='note']").keypress(function(e){
882                     /* prevent submitting of renewselected form */
883                     if(e.which == 13)
884                         e.preventDefault();
885                 });
886
887                 $("input[name='note']").keyup(function(e){
888                     var $btn_save = $('#save_'+$(this).data('issue_id'));
889                     var origvalue = $(this).data('origvalue');
890                     var value = $(this).val();
891
892                     if(origvalue != value) {
893                         if(origvalue != "")
894                             $btn_save.text(_("Submit changes"));
895                         else
896                             $btn_save.text(_("Submit note"));
897                         $btn_save.show();
898                     } else {
899                         $btn_save.hide();
900                     }
901                 });
902
903                 $(".js_submitnote").click(function(e){
904                     var $self = $(this);
905                     var title = $(this).parent().siblings('.title').html();
906                     var $noteinput = $(this).siblings('input[name="note"]').first();
907
908                     var ajaxData = {
909                         'action': 'issuenote',
910                         'issue_id': $noteinput.data('issue_id'),
911                         'note': $noteinput.val(),
912                     };
913
914                     $.ajax({
915                         url: '/cgi-bin/koha/svc/checkout_notes/',
916                         type: 'POST',
917                         dataType: 'json',
918                         data: ajaxData,
919                     })
920                     .done(function(data) {
921                         var message = "";
922                         if(data.status == 'saved') {
923                             $("#notesaved").removeClass("alert-error");
924                             $("#notesaved").addClass("alert-info");
925                             $noteinput.data('origvalue', data.note);
926                             $noteinput.val(data.note);
927                             message = "<p>" + _("Your note about %s has been saved and sent to the library.").format(title) + "</p>";
928                             message += "<p style=\"font-style:italic;\">" + data.note + "</p>";
929                             $self.hide();
930                         } else if(data.status == 'removed') {
931                             $("#notesaved").removeClass("alert-error");
932                             $("#notesaved").addClass("alert-info");
933                             $noteinput.data('origvalue', "");
934                             $noteinput.val("");
935                             message = "<p>" + _("Your note about %s was removed.").format(title) + "</p>";
936                             $self.hide();
937                         } else {
938                             $("#notesaved").removeClass("alert-info");
939                             $("#notesaved").addClass("alert-error");
940                             message =  "<p>" + _("Your note about %s could not be saved.").format(title) + "</p>";
941                             message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
942                         }
943                         $("#notesaved").html(message);
944                     })
945                     .fail(function(data) {
946                         $("#notesaved").removeClass("alert-info");
947                         $("#notesaved").addClass("alert-error");
948                         var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
949                         $("#notesaved").html(message);
950                     })
951                     .always(function() {
952                         $("#notesaved").show();
953                     });
954                 });
955             [% END %]
956
957             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
958
959             if ( $('#opac-user-clubs').length ) {
960                 $('#opac-user-clubs-tab-link').on('click', function() {
961                     $('#opac-user-clubs').text(_("Loading..."));
962                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
963                 });
964             }
965         });
966         //]]>
967     </script>
968     [% IF Koha.Preference('OverDriveCirculation') %]
969     [% Asset.js("js/overdrive.js") | $raw %]
970     <script>
971     var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %];
972     $(document).ready(function() {
973         [% IF ( overdrive_error ) %]
974             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]");
975         [% END %]
976
977         [% IF ( overdrive_tab ) %]
978             $("#opac-user-views").tabs("select", "#opac-user-overdrive");
979         [% END %]
980
981         $("#opac-user-overdrive").each( function() {
982             KOHA.OverDriveCirculation.display_account_details(this);
983         } );
984     });
985     </script>
986     [% END %]
987     [% IF RecordedBooksCirculation %]
988         [% Asset.js("js/recordedbooks.js") | $raw %]
989         <script type="text/JavaScript">
990             $(document).ready(function() {
991                 [% IF ( recordedbooks_error ) %]
992                     KOHA.RecordedBooks.display_error("#opac-user-recordedbooks", "[% recordedbooks_error.dquote | html %]");
993                 [% END %]
994                 [% IF ( recordedbooks_tab ) %]
995                     $("#opac-user-views").tabs("select", "#opac-user-recordedbooks");
996                 [% END %]
997                 $("#opac-user-recordedbooks").each( function() {
998                     KOHA.RecordedBooks.display_account_details(this);
999                 } );
1000             });
1001         </script>
1002     [% END %]
1003 [% END %]