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