Bug 34015: Terminology: Relative issues should be Relative's checkouts
[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 [% USE AuthorisedValues %]
9 [% USE AdditionalContents %]
10 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12 [% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %]
13
14 [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
15 [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
16
17 [% INCLUDE 'doc-head-open.inc' %]
18 <title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 [% Asset.css("css/overdrive.css") | $raw %]
21 [% BLOCK cssinclude %][% END %]
22 </head>
23 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
24 [% INCLUDE 'masthead.inc' %]
25
26 [% IF Koha.Preference('AmazonAssocTag') %]
27     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
28 [% ELSE %]
29     [% AmazonAssocTag = '' %]
30 [% END %]
31
32 <div class="main">
33     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
34         <ol class="breadcrumb">
35             <li class="breadcrumb-item">
36                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
37             </li>
38             <li class="breadcrumb-item">
39                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
40             </li>
41             <li class="breadcrumb-item active">
42                 <a href="#" aria-current="page">Your summary</a>
43             </li>
44         </ol>
45     </nav> <!-- /#breadcrumbs -->
46
47     <div class="container-fluid">
48         <div class="row">
49             <div class="col col-lg-2 order-2 order-lg-1">
50                 <div id="navigation">
51                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
52                 </div>
53             </div>
54             <div class="col-md-12 col-lg-10 order-1 order-lg-2">
55                 <div id="userdetails" class="maincontent">
56
57                     <h1>Your summary</h1>
58
59                     [% INCLUDE 'opac-note.inc' %]
60
61                     <p>Hello, [% INCLUDE 'patron-title.inc' patron = logged_in_user %]
62                     <br />
63                     <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>
64
65                     [% IF ( patronupdate ) %]<div class="alert alert-info"><h2>Thank you!</h2><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
66
67                     [% IF failed_holds %]
68                         <div class="alert alert-info">
69                             <h2>Notice:</h2>
70                             <p>One or more holds were not placed due to following errors:</p>
71                             <ul>
72                             [% FOREACH fail IN failed_holds.split('\|') %]
73                                 <li>
74                                 [% SWITCH fail %]
75                                 [% CASE 'damaged' %]
76                                     <span>Item is damaged</span>
77                                 [% CASE 'ageRestricted' %]
78                                     <span>The record and its items are age restricted</span>
79                                 [% CASE 'tooManyHoldsForThisRecord' %]
80                                     <span>You have exceeded the number of concurrent holds for this record</span>
81                                 [% CASE 'tooManyReservesToday' %]
82                                     <span>You've reached your daily holds limit</span>
83                                 [% CASE 'tooManyReserves' %]
84                                     <span>You have too many holds already</span>
85                                 [% CASE 'notReservable' %]
86                                     <span>Not holdable</span>
87                                 [% CASE 'cannotReserveFromOtherBranches' %]
88                                     <span>You are from a different library</span>
89                                 [% CASE 'branchNotInHoldGroup' %]
90                                     <span>Holds are not allowed from your library</span>
91                                 [% CASE 'itemAlreadyOnHold' %]
92                                     <span>You already have a hold for this item</span>
93                                 [% CASE 'cannotBeTransferred' %]
94                                     <span>Cannot be transferred to pickup library</span>
95                                 [% CASE 'pickupNotInHoldGroup' %]
96                                     <span>The chosen pickup location is not allowed</span>
97                                 [% CASE 'noReservesAllowed' %]
98                                     <span>No holds are allowed on this item</span>
99                                 [% CASE 'libraryNotPickupLocation' %]
100                                     <span>Library is not a valid pickup location</span>
101                                 [% CASE 'no_valid_pickup_location' %]
102                                     <span>No valid pickup location</span>
103                                 [% CASE 'notforloan' %]
104                                     <span>Not for loan</span>
105                                 [% CASE 'items_available' %]
106                                     <span>There are items available in the library, please visit to check them out</span>
107                                 [% CASE 'not_placed' %]
108                                     <span>Error when placing hold, please report this to the library</span>
109                                 [% CASE %]
110                                     <span>Error: [% fail | html %]</span>
111                                 [% END %]
112                                 </li>
113                             [% END %]
114                             </ul>
115                         </div>
116                     [% END %]
117
118                     [% IF ( borrower.blockedonfines && Koha.Preference('OPACHoldRequests') ) %]
119                         <div class="alert alert-warning" id="blockedonfines">
120                             <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>
121                         </div>
122                     [% END %]
123
124                     [% IF ( borrower.warndeparture ) %]
125                         <div class="alert alert-warning" id="warndeparture">
126                             <strong>Please note:</strong><span> Your library card will expire on <span id="warndeparture_date">[% borrower.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
127                                 [% IF ( borrower.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your library card expires.</span>[% END %]
128                         </div>
129                     [% END %]
130
131                     [% IF ( borrower.warnexpired ) %]
132                         <div class="alert alert-warning" id="warnexpired">
133                             <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>
134                         </div>
135                     [% END %]
136
137                     [% IF ( RENEW_ERROR ) %]
138                         <div class="alert alert-warning">
139                             <strong>Please note:</strong>
140                                 Your loan renewal failed because of the following reason(s):
141                                 <ul>
142                                     [% FOREACH error IN RENEW_ERROR.split('\|') %]
143                                         [% IF error == 'card_expired' %]
144                                             <li>Your account has expired. Please contact the library for more information.</li>
145                                         [% ELSIF error == 'too_many' %]
146                                             <li>You have renewed this item the maximum number of times allowed.</li>
147                                         [% ELSIF error == 'too_unseen' %]
148                                             <li>You have renewed this item the maximum number of consecutive times without it being seen by the library.</li>
149                                         [% ELSIF error == 'too_soon' %]
150                                             <li>It is too soon after the checkout date for this item to be renewed.</li>
151                                         [% ELSIF error == 'on_reserve' %]
152                                             <li>This item is on hold for another borrower.</li>
153                                         [% ELSIF error == 'item_denied_renewal' %]
154                                             <li>Item renewal is not allowed.</li>
155                                         [% ELSIF error == 'item_issued_to_other_patron'%]
156                                             <li>Item already issued to other borrower.</li>
157                                         [% ELSIF error == 'auto_too_soon' %]
158                                             <li>This item is scheduled for auto renewal.</li>
159                                         [% END %]
160                                     [% END %]
161                                 </ul>
162                         </div>
163                     [% END %]
164
165                     [% IF ( patron_flagged ) %]
166                         <div class="alert alert-warning">
167                             <ul>
168                                 [% IF ( userdebarred ) %]
169                                     [% IF ( discharge_available ) %]
170                                         <li id="discharged">
171                                             <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>
172                                         </li>
173                                     [% ELSE %]
174                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
175                                         [% IF ( borrower.debarredcomment ) %]
176                                             Comment:
177                                             <span id="userdebarred_comment">
178                                                 <strong>
179                                                     [% IF borrower.debarredcomment.search('OVERDUES_PROCESS') %]
180                                                         Restriction added by overdues process [% borrower.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
181                                                     [% ELSE %]
182                                                         [% borrower.debarredcomment | html_line_break %]
183                                                     [% END %]
184                                                 </strong>
185                                             </span>
186                                         [% END %]
187                                         [% IF ( borrower.userdebarreddate && debarred_date != '9999-12-31' ) %]
188                                             End date:
189                                             <span id="userdebarred_date">[% borrower.userdebarreddate | $KohaDates %]</span>
190                                         [% END %]
191
192                                         <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>
193                                     [% END %]
194                                 [% END %]
195                                 [% IF ( borrower.gonenoaddress ) %]
196                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
197                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]<span>Update your contact information</span>[% ELSE %]<span>Go to your contact information</span>[% END %]</a>
198                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
199                                     </li>
200                                 [% END %]
201                                 [% IF ( borrower.lost ) %]
202                                     <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>
203                                 [% END %]
204                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
205                                     <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 %]
206                                 [% END %]
207                             </ul>
208                         </div>
209                     [% END # / IF patron_flagged %]
210
211                     [% IF savings %]
212                         <div class="alert alert-info" id="savings">
213                             Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library.
214                         </div>
215                     [% END %]
216
217                     <div class="alert alert-info" id="notesaved" style="display:none;"></div>
218                     [% IF ( OpacMySummaryNote ) %]
219                         [% PROCESS koha_news_block news => OpacMySummaryNote %]
220                     [% END %]
221
222                     [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
223                     <form id="autorenewal_option" action="/cgi-bin/koha/opac-user.pl" method="post">
224                         <legend class="sr-only">Auto-renewal</legend>
225                             <label for="yes-autorenew_checkouts">
226                                 Allow auto-renewal:
227                             </label>
228                                 [% IF ( borrower.autorenew_checkouts ) %]
229                                     <label class="radio inline" for="yes-autorenew_checkouts">
230                                         Yes
231                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" checked="checked" />
232                                     </label>
233
234                                     <label class="radio inline" for="no-autorenew_checkouts">
235                                         No
236                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" />
237                                     </label>
238                                 [% ELSE %]
239                                     <label class="radio inline" for="yes-autorenew_checkouts">
240                                         Yes
241                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" />
242                                     </label>
243                                     <label class="radio inline" for="no-autorenew_checkouts">
244                                         No
245                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" checked="checked" />
246                                     </label>
247                                 [% END %]
248                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
249                         <input type="hidden" name="update_arc" value="1" />
250                         <input type="submit" value="Update auto-renewal preference" />
251                     </form>
252                     [% END %]
253
254                     <div id="opac-user-views" class="toptabs">
255                         <ul class="nav nav-tabs" role="tablist">
256                             <li class="nav-item" role="presentation">
257                                 <a class="nav-link active" id="opac-user-checkouts-tab" data-toggle="tab" role="tab" aria-controls="opac-user-checkouts" aria-selected="true"  href="#opac-user-checkouts">Checked out ([% issues_count | html %])</a>
258                             </li>
259                             [% IF relatives %]
260                                 <li class="nav-item" role="presentation">
261                                     <a class="nav-link" id="opac-user-relative-issues-tab" data-toggle="tab" role="tab" aria-controls="opac-user-relative-issues" aria-selected="false" href="#opac-user-relative-issues">Relatives' checkouts</a>
262                                 </li>
263                             [% END %]
264                             [% IF ( overdues_count ) %]
265                                 <li class="nav-item" role="presentation">
266                                     <a class="nav-link" id="opac-user-overdues-tab" data-toggle="tab" role="tab" aria-controls="opac-user-overdues" aria-selected="false" href="#opac-user-overdues">Overdue ([% overdues_count | html %])</a>
267                                 </li>
268                             [% END %]
269                             [% IF ( OPACFinesTab ) %]
270                                 [% IF ( amountoutstanding > 0 ) %]
271                                     <li class="nav-item" role="presentation">
272                                         <a class="nav-link" id="opac-user-fines-tab" data-toggle="tab" role="tab" aria-controls="opac-user-fines" aria-selected="false" href="#opac-user-fines">Charges ([% amountoutstanding | $Price %])</a>
273                                     </li>
274                                 [% END %]
275                                 [% IF ( amountoutstanding < 0 ) %]
276                                     <li class="nav-item" role="presentation">
277                                         <a class="nav-link" id="opac-user-fines-tab" data-toggle="tab" role="tab" aria-controls="opac-user-fines" aria-selected="false" href="#opac-user-fines">Credits ([% amountoutstanding * -1 | $Price %])</a>
278                                     </li>
279                                 [% END %]
280                                 [% IF relatives_with_fines %]
281                                     <li class="nav-item" role="presentation">
282                                         <a class="nav-link" id="opac-user-relative-fines-tab" data-toggle="tab" role="tab" aria-controls="opac-user-relative-fines" aria-selected="false" href="#opac-user-relative-fines">Relatives' charges</a>
283                                     </li>
284                                 [% END %]
285                             [% END %]
286
287                             [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
288                                 <li class="nav-item" role="presentation">
289                                     <a class="nav-link" data-toggle="tab" role="tab" aria-controls="opac-user-clubs" aria-selected="false" id="opac-user-clubs-tab-link" href="#opac-user-clubs">
290                                         Clubs ([% borrower_club_enrollments.count || 0 | html %]/[% borrower_enrollable_clubs.count || 0 | html %])
291                                     </a>
292                                 </li>
293                             [% END %]
294
295                             [% IF ( RESERVES.count ) %]
296                                 <li class="nav-item" role="presentation">
297                                     <a class="nav-link" id="opac-user-holds-tab" data-toggle="tab" role="tab" aria-controls="opac-user-holds" aria-selected="false" href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a>
298                                 </li>
299                             [% END %]
300                             [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
301                                 <li class="nav-item" role="presentation">
302                                     <a class="nav-link" id="opac-user-recalls-tab" data-toggle="tab" role="tab" aria-controls="opac-user-recalls" aria-selected="false" href="#opac-user-recalls">Recalls ([% RECALLS.count | html %])</a>
303                                 </li>
304                             [% END %]
305                             [% IF Koha.Preference('ArticleRequests') %]
306                                 <li class="nav-item" role="presentation">
307                                     <a class="nav-link" id="opac-user-article-requests-tab" data-toggle="tab" role="tab" aria-controls="opac-user-article-requests" aria-selected="false" href="#opac-user-article-requests">Article requests ([% current_article_requests.size || 0 | html %])</a>
308                                 </li>
309                             [% END %]
310                             [% IF ( OverDriveCirculation ) %]
311                                 <li class="nav-item" role="presentation">
312                                     <a class="nav-link" id="opac-user-overdrive-tab" data-toggle="tab" role="tab" aria-controls="opac-user-overdrive" aria-selected="false" href="#opac-user-overdrive">OverDrive account</a>
313                                 </li>
314                             [% END %]
315                         </ul>
316                         <div class="tab-content">
317
318                             <div id="opac-user-overdrive" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-overdrive-tab">
319                             </div>
320                             <div id="opac-user-checkouts" class="tab-pane active" role="tabpanel" aria-labelledby="opac-user-checkouts-tab">
321                                 [% IF ( issues_count ) %]
322                                     <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
323                                         <legend class="sr-only">Renew selected</legend>
324                                         <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]">
325                                         <input type="hidden" name="from" value="opac_user" />
326                                         <table id="checkoutst" class="table table-bordered table-striped">
327                                             <caption>[% issues_count | html %] Item(s) checked out</caption>
328                                             <thead>
329                                                 <tr>
330                                                     [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
331                                                     <th class="anti-the">Title</th>
332                                                     <th>Author</th>
333                                                     <th class="psort">Due</th>
334                                                     [% UNLESS ( item_level_itypes ) %]
335                                                         <th>Item type</th>
336                                                     [% END %]
337                                                     [% IF ( show_barcode ) %]
338                                                         <th>Barcode</th>
339                                                     [% END %]
340                                                         <th>Call number</th>
341                                                     [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
342                                                         <th>Renew</th>
343                                                     [% END %]
344                                                     [% IF ( OPACFinesTab ) %]
345                                                         <th>Fines</th>
346                                                     [% END %]
347                                                     [% IF ( OPACMySummaryHTML ) %]
348                                                         <th class="nosort">Links</th>
349                                                     [% END %]
350                                                     [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
351                                                         <th class="hidden">Checkout note</th>
352                                                         <th id="checkout-notes" class="nosort noExport" title="Use this to report any problems with your currently checked out items">Report a problem</th>
353                                                     [% END %]
354                                                     <th></th>
355                                                 </tr>
356                                             </thead>
357                                             <tbody>
358                                                 [% FOREACH ISSUE IN ISSUES %]
359                                                     [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
360                                                     [% IF ( JacketImages ) %]
361                                                         <td class="jacketcell">
362                                                             [% IF ( OPACAmazonCoverImages ) %]
363                                                                 [% IF ( ISSUE.normalized_isbn ) %]
364                                                                     <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>
365                                                                 [% ELSE %]
366                                                                     <a href="#"><span class="no-image">No cover image available</span></a>
367                                                                 [% END %]
368                                                             [% END %]
369
370                                                             [% IF ( GoogleJackets ) %]
371                                                                 [% IF ( ISSUE.normalized_isbn ) %]
372                                                                     <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
373                                                                 [% ELSE %]
374                                                                     <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
375                                                                 [% END %]
376                                                             [% END %]
377
378                                                             [% IF ( BakerTaylorEnabled ) %]
379                                                                 [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %]
380                                                                 [% IF ( bt_id ) %]
381                                                                     <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
382                                                                 [% ELSE %]
383                                                                     <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
384                                                                 [% END %]
385                                                             [% END %]
386
387                                                             [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
388                                                                 [% SET custom_cover_image_url = ISSUE.biblio_object.custom_cover_image_url %]
389                                                                 [% IF custom_cover_image_url %]
390                                                                     <a class="custom_cover_image" href="[% custom_cover_image_url | url %]"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
391                                                                 [% END %]
392                                                             [% END %]
393
394                                                             [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
395                                                                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% ISSUE.normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% ISSUE.normalized_upc | html %]&amp;oclc=[% ISSUE.normalized_oclc | html %]" alt="" class="item-thumbnail" />
396                                                             [% END %]
397                                                         </td>
398                                                     [% END # / IF JacketImages %]
399
400                                                     <td class="title">
401                                                         [% INCLUDE 'biblio-title.inc' biblio=ISSUE link=> 1 %]
402                                                         [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
403
404                                                         [% IF ( ISSUE.onsite_checkout ) %] <em class="onsite_checkout">(On-site checkout)</em>[% END %]
405
406                                                         [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
407                                                             [% INCLUDE 'user-star-ratings.inc' item=ISSUE %]
408                                                         [% END %]
409
410                                                         [% IF ( ISSUE.recall ) %]<br><i>This item has been recalled. Please return by the new due date.</i>[% END %]
411                                                     </td>
412
413                                                     <td class="author">[% ISSUE.author | html %]</td>
414                                                     [% IF ( ISSUE.overdue ) %]
415                                                         <td class="date_due overdue" data-order="[% ISSUE.date_due | html %]">
416                                                             <span class="tdlabel">Date due:</span>
417                                                             [% ISSUE.date_due | $KohaDates as_due_date => 1 %]
418                                                         </td>
419                                                     [% ELSE %]
420                                                         <td class="date_due" data-order="[% ISSUE.date_due | html %]">
421                                                             <span class="tdlabel">Date due:</span>
422                                                             [% ISSUE.date_due | $KohaDates as_due_date => 1 %]
423                                                         </td>
424                                                     [% END %]
425                                                     [% UNLESS ( item_level_itypes ) %]
426                                                         <td class="itype">
427                                                             <span class="tdlabel">Item type:</span>
428                                                             [% IF ( ISSUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
429                                                                 <img src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" />
430                                                                 [% END %] <span class="itypetext">[% ISSUE.description | html %]</span>
431                                                         </td>
432                                                     [% END %]
433                                                     [% IF ( show_barcode ) %]
434                                                         <td class="barcode">
435                                                             <span class="tdlabel">Barcode:</span>
436                                                             [% ISSUE.barcode | html %]
437                                                         </td>
438                                                     [% END %]
439                                                     <td class="call_no">
440                                                         <span class="tdlabel">Call number:</span>
441                                                         [% ISSUE.itemcallnumber | html %]
442                                                     </td>
443                                                     [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
444                                                         [% IF ( ISSUE.status && canrenew ) %]
445                                                             <td class="renew" data-order="[% ISSUE.renewsleft | html %]">
446                                                         [% ELSE %]
447                                                             <td class="renew" data-order="0">
448                                                         [% END %]
449                                                         [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
450                                                         [% IF ( ISSUE.status ) %]
451                                                             [% IF ( canrenew ) %]
452                                                                 <input type="checkbox" name="issue" value="[% ISSUE.issue_id | uri %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;issue=[% ISSUE.issue_id | uri %]&amp;borrowernumber=[% ISSUE.borrowernumber | uri %]">Renew</a>
453                                                             [% END %]
454                                                             [% IF ISSUE.renewalfee > 0 %]
455                                                                 <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
456                                                             [% END %]
457                                                             [% IF ISSUE.itemtype_object.rentalcharge_daily > 0 %]
458                                                                 <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_daily | $Price %] per day</span>
459                                                             [% END %]
460                                                             [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
461                                                                 <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
462                                                             [% END %]
463                                                             <span class="renewals">(
464                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
465                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
466                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
467                                                                 [% END %]
468                                                             )</span>
469                                                         [% ELSIF ( ISSUE.on_reserve ) %]
470                                                             <span class="usr-msg no-renew-hold">Not renewable <span class="renewals">(on hold)</span></span>
471                                                         [% ELSIF ( ISSUE.too_many ) %]
472                                                             <span class="usr-msg no-renew-too-many">Not renewable</span>
473                                                         [% ELSIF ( ISSUE.too_unseen ) %]
474                                                             <span class="usr-msg no-renew-unseen">Item must be renewed at the library. [% ISSUE.renewsleft | html %] renewals remaining</span>
475                                                         [% ELSIF ( ISSUE.norenew_overdue ) %]
476                                                             <span class="usr-msg no-renew-overdue">Not allowed <span class="renewals">(overdue)</span></span>
477                                                         [% ELSIF ( ISSUE.auto_too_late ) %]
478                                                             <span class="usr-msg no-renew-too-late">No longer renewable</span>
479                                                         [% ELSIF ISSUE.auto_too_much_oweing %]
480                                                             <span class="usr-msg auto-renew-fines">Automatic renewal failed, you have unpaid fines.</span>
481                                                             <span class="renewals">(
482                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
483                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
484                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
485                                                                 [% END %]
486                                                             )</span>
487                                                         [% ELSIF ISSUE.auto_account_expired %]
488                                                             <span class="usr-msg auto-renew-expired">Automatic renewal failed, your account is expired.</span>
489                                                             <span class="renewals">(
490                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
491                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
492                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
493                                                                 [% END %]
494                                                             )</span>
495                                                         [% ELSIF ( ISSUE.too_soon ) %]
496                                                             <span class="usr-msg no-renewal-before">No renewal before [% ISSUE.soonestrenewdate | $KohaDates  as_due_date => 1 %]</span>
497                                                             <span class="renewals">(
498                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
499                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
500                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
501                                                                 [% END %]
502                                                             )</span>
503                                                         [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
504                                                             <span class="usr-msg automatic-renewal">Automatic renewal</span>
505                                                             <span class="renewals">(
506                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
507                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
508                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
509                                                                 [% END %]
510                                                             )</span>
511                                                         [% ELSIF ( ISSUE.item_denied_renewal ) %]
512                                                             Renewal not allowed
513                                                         [% END %]
514                                                         </td>
515                                                     [% END %]
516                                                     [% IF ( OPACFinesTab ) %]
517                                                         <td class="fines">
518                                                             <span class="tdlabel">Fines:</span>
519                                                             [% IF ( ISSUE.charges ) %]
520                                                                 <span>Yes (Item overdue or lost)</span>
521                                                             [% ELSIF ( ISSUE.rentalfines ) %]
522                                                                 <span>Yes (Rental fees)</span>
523                                                             [% ELSE %]
524                                                                 <span>No</span>
525                                                             [% END %]
526                                                         </td>
527                                                     [% END %]
528                                                     [% IF ( OPACMySummaryHTML ) %]
529                                                         <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
530                                                     [% END %]
531                                                     [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
532                                                         <td>
533                                                             [% ISSUE.note | html %]
534                                                         </td>
535                                                         <td class="note">
536                                                             <div id="viewnote_[% ISSUE.issue_id | html %]">
537                                                                 [% ISSUE.note | html %]
538                                                             </div>
539                                                             <a id="save_[% ISSUE.issue_id | html %]" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | html %]" class="btn btn-primary btn-sm btn-add-note noprint" data-title="[% ISSUE.title | html %] [% FOREACH subtitle IN ISSUE.subtitle.split(' \| ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %][% subtitle | html %][% END %]" data-issueid="[% ISSUE.issue_id | html %]" id="save_[% ISSUE.issue_id | html %]">
540                                                                 [% IF ( ISSUE.note ) -%]
541                                                                     <span>Edit note</span>
542                                                                 [% ELSE -%]
543                                                                     <span>Add note</span>
544                                                                 [% END %]
545                                                             </a>
546                                                             <input type="hidden" id="note_[% ISSUE.issue_id | html %]" name="note" value="[% ISSUE.note | html %]" data-origvalue="[% ISSUE.note | html %]" />
547                                                         </td>
548                                                     [% END %]
549                                                     <td></td>
550                                                     </tr>
551                                                 [% END # /FOREACH ISSUES %]
552                                             </tbody>
553                                         </table>
554                                         [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
555                                             <input type="submit" class="btn btn-primary" value="Renew selected" />
556                                             <button type="button" id="renewall_js" class="btn btn-primary">Renew all</button>
557                                         [% END %]
558                                     </form>
559
560                                     [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
561                                         <form id="renewall" class="js-hide" action="/cgi-bin/koha/opac-renew.pl" method="post">
562                                             <legend class="sr-only">Renew</legend>
563                                             <input type="hidden" name="from" value="opac_user" />
564                                             <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
565                                             [% FOREACH ISSUE IN ISSUES %]
566                                                 [% IF ISSUE.status %]
567                                                     <input type="hidden" name="item" value="[% ISSUE.itemnumber | html %]" />
568                                                 [% END %]
569                                             [% END %]
570                                             <input type="submit" class="btn btn-primary" value="Renew all" />
571                                         </form>
572                                     [% END %]
573                                 [% ELSE %]
574                                     <table class="table table-bordered table-striped">
575                                         <caption class="sr-only">Checked out</caption>
576                                         <tr><td>You have nothing checked out</td></tr>
577                                     </table>
578                                 [% END # IF issues_count %]
579
580                                 <!-- Add note modal -->
581                                 <div class="modal" id="addNoteModal" tabindex="-1" aria-labelledby="addNoteLabel" aria-hidden="true">
582                                     <div class="modal-dialog">
583                                         <form action="#" id="addNoteForm">
584                                             <div class="modal-content">
585                                                 <div class="modal-header">
586                                                     <h5 class="modal-title" id="addNoteLabel">Report a problem</h5>
587                                                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
588                                                         <span aria-hidden="true">&times;</span>
589                                                     </button>
590                                                 </div>
591                                                 <div class="modal-body" id="addNoteBody">
592                                                     <h6 id="addNoteTitle"></h6>
593                                                     <input type="hidden" id="addNoteIssueId" name="issue_id" value="" />
594                                                     <textarea name="note" id="addNote" rows="4"></textarea>
595                                                     <div class="hint">Your note will be shown to the librarian when the item is checked in.</div>
596                                                 </div>
597                                                 <div class="modal-footer">
598                                                     <button type="submit" class="btn btn-primary">Submit note</button>
599                                                     <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
600                                                 </div>
601                                             </div>
602                                         </form>
603                                     </div>
604                                 </div>
605
606                             </div> <!-- / .opac-user-checkouts -->
607
608                             [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
609                                 <div id="opac-user-clubs" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-clubs-tab-link">
610                                     Loading...
611                                 </div>
612                             [% END %]
613
614                             [% IF ( OPACFinesTab ) %]
615                                 <!-- FINES BOX -->
616                                 [% IF ( amountoutstanding > 0 ) %]
617                                     <div id="opac-user-fines" class="tab-pane" id="home" role="tabpanel" aria-labelledby="opac-user-fines-tab">
618                                         <table class="table table-bordered table-striped">
619                                             <caption>Charges</caption>
620                                             <thead><tr><th colspan="2">Amount</th></tr></thead>
621                                             <tbody>
622                                                 <tr>
623                                                     <td>You currently owe fines and charges amounting to:</td>
624                                                     <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding | $Price %]</a></td>
625                                                 </tr>
626                                             </tbody>
627                                         </table>
628                                     </div>
629                                 [% END %]
630
631                                 [% IF ( amountoutstanding < 0 ) %]
632                                     <div id="opac-user-fines" class="tab-pane" id="home" role="tabpanel" aria-labelledby="opac-user-fines-tab">
633                                         <table class="table table-bordered table-striped">
634                                             <caption>Credits</caption>
635                                             <thead><tr><th colspan="2">Amount</th></tr></thead>
636                                             <tbody>
637                                                 <tr>
638                                                     <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding * -1 | $Price %]</a></td>
639                                                 </tr>
640                                             </tbody>
641                                         </table>
642                                     </div>
643                                 [% END %]
644
645                                 [% IF relatives_with_fines %]
646                                     <div id="opac-user-relative-fines" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-relative-fines-tab">
647                                         <table class="table table-bordered table-striped">
648                                             <caption>Fines and charges</caption>
649                                             <thead>
650                                                 <tr>
651                                                     <th colspan="2">Amount</th>
652                                                 </tr>
653                                             </thead>
654                                             <tbody>
655                                                 [% FOREACH r IN relatives_with_fines %]
656                                                 <tr>
657                                                     <td>[% r.firstname | html %] [% r.surname | html %] currently owes fines and charges amounting to:</td>
658                                                     <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id | uri %]">[% r.account.balance | $Price %]</a></td>
659                                                 </tr>
660                                                 [% END %]
661                                             </tbody>
662                                         </table>
663                                     </div>
664                                 [% END %]
665                             [% END # / OPACFinesTab %]
666
667                             [% IF relatives %]
668                                 <div id="opac-user-relative-issues" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-relative-issues-tab">
669                                     <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
670                                         <caption class="sr-only">Relatives' checkouts</caption>
671                                         <thead>
672                                             <tr>
673                                                 <th class="anti-the">Title</th>
674                                                 <th>Due</th>
675                                                 <th>Barcode</th>
676                                                 <th>Call number</th>
677                                                 <th class="psort">Relative</th>
678                                                 <th></th>
679                                             </tr>
680                                         </thead>
681
682                                         <tbody>
683                                             [% FOREACH r IN relatives %]
684                                                 [% FOREACH c IN r.checkouts %]
685                                                     <tr>
686                                                         <td>
687                                                             <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% c.item.biblio.biblionumber | uri %]">
688                                                                 [% c.item.biblio.title | html %][% IF ( c.item.enumchron ) %] [% c.item.enumchron | html %][% END %]
689                                                             </a>
690                                                         </td>
691
692                                                         <td>
693                                                             [% c.date_due | $KohaDates %]
694                                                         </td>
695
696                                                         <td>
697                                                             [% c.item.barcode | html %]
698                                                         </td>
699
700                                                         <td>
701                                                             [% c.item.itemcallnumber | html %]
702                                                         </td>
703
704                                                         <td>
705                                                             [% r.firstname | html %] [% r.surname | html %]
706                                                         </td>
707                                                         <td></td>
708                                                     </tr>
709                                                 [% END %]
710                                             [% END %]
711                                         </tbody>
712                                     </table>
713                                 </div>
714                             [% END %]
715
716                             [% IF ( overdues_count ) %]
717                                 <div id="opac-user-overdues" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-overdues-tab">
718                                     <table id="overduest" class="table table-bordered table-striped">
719                                         <caption>Overdues <span class="count">([% overdues_count | html %] total)</span></caption>
720                                         <!-- OVERDUES TABLE ROWS -->
721                                         <thead>
722                                             <tr>
723                                                 [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
724                                                 <th class="anti-the">Title</th>
725                                                 [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
726                                                 [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
727                                                 <th>Call number</th>
728                                                 <th class="psort">Due</th>
729                                                 [% IF ( OpacRenewalAllowed ) %]
730                                                     <th class="nosort">Renew</th>
731                                                 [% END %]
732                                                 [% IF ( OPACFinesTab ) %]
733                                                     <th>Fines</th>
734                                                 [% END %]
735                                                 <th></th>
736                                             </tr>
737                                         </thead>
738                                         <tbody>
739                                             [% FOREACH OVERDUE IN OVERDUES %]
740                                                 <tr>
741                                                     [% IF ( JacketImages ) %]
742                                                         <td class="jacketcell">
743                                                         [% IF ( OPACAmazonCoverImages ) %]
744                                                             [% IF ( OVERDUE.normalized_isbn ) %]
745                                                                 <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>
746                                                             [% ELSE %]
747                                                                 <a href="#"><span class="no-image">No cover image available</span></a>
748                                                             [% END %]
749                                                         [% END %]
750
751                                                         [% IF ( GoogleJackets ) %]
752                                                             [% IF ( OVERDUE.normalized_isbn ) %]
753                                                                 <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
754                                                             [% ELSE %]
755                                                                 <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
756                                                             [% END %]
757                                                         [% END %]
758
759                                                         [% IF ( BakerTaylorEnabled ) %]
760                                                             [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
761                                                             [% IF ( bt_id ) %]
762                                                                 <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
763                                                             [% ELSE %]
764                                                                 <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
765                                                             [% END %]
766                                                         [% END %]
767
768                                                         [% IF ( SyndeticsCoverImages ) %]
769                                                             <img src="https://secure.syndetics.com/index.aspx?isbn=[% OVERDUE.normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% SyndeticsClientCode | html %]&amp;upc=[% OVERDUE.normalized_upc | html %]&amp;oclc=[% OVERDUE.normalized_oclc | html %]&amp;type=xw10" alt="" class="item-thumbnail" />
770                                                         [% END %]
771                                                         </td>
772                                                     [% END # /IF jacketcell %]
773
774                                                     <td>
775                                                         [% INCLUDE 'biblio-title.inc' biblio=OVERDUE link=> 1 %]
776                                                         <span class="item-details">[% OVERDUE.author | html %]</span>
777                                                     </td>
778
779                                                     [% UNLESS ( item_level_itypes ) %]
780                                                         <td>
781                                                             [% IF ( OVERDUE.imageurl  && !Koha.Preference('OpacNoItemTypeImages') ) %]
782                                                                 <img src="[% OVERDUE.imageurl | html %]" title="[% OVERDUE.description | html %]" alt="[% OVERDUE.description | html %]" />
783                                                             [% END %] [% OVERDUE.description | html %]
784                                                         </td>
785                                                     [% END %]
786                                                     [% IF ( show_barcode ) %]
787                                                         <td>
788                                                             <span class="tdlabel">Barcode:</span>
789                                                             [% OVERDUE.barcode | html %]
790                                                         </td>
791                                                     [% END %]
792                                                     <td>
793                                                         <span class="tdlabel">Call number:</span>
794                                                         [% OVERDUE.itemcallnumber | html %]
795                                                     </td>
796                                                     <td data-order="[% OVERDUE.date_due | html %]">
797                                                         <span class="tdlabel">Date due:</span>
798                                                         [% OVERDUE.date_due | $KohaDates as_due_date => 1 %]
799                                                     </td>
800                                                     [% IF ( OpacRenewalAllowed ) %]
801                                                         <td>
802                                                             [% IF ( OVERDUE.debarred ) %]
803                                                                 Account frozen
804                                                             [% ELSIF ( OVERDUE.status ) %]
805                                                                 [% IF ( canrenew ) %]
806                                                                     <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
807                                                                 [% END %]
808                                                                     <span class="renewals">(
809                                                                         [% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining
810                                                                         [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
811                                                                             / [% OVERDUE.unseenleft | html %] of [% OVERDUE.unseenallowed | html %] renewals left before the item must be seen by the library
812                                                                         [% END %]
813                                                                     )</span>
814                                                             [% ELSIF ( OVERDUE.norenew_overdue ) %]
815                                                                 Not allowed <span class="renewals">(overdue)</span>
816                                                             [% ELSIF ( OVERDUE.onreserve ) %]
817                                                                 <span>On hold</span>
818                                                             [% ELSE %]
819                                                                <span>No renewals left</span>
820                                                             [% END %]
821                                                         </td>
822                                                     [% END %]
823                                                     [% IF ( OPACFinesTab ) %]
824                                                         <td>
825                                                             <span class="tdlabel">Fines:</span>
826                                                             [% IF ( OVERDUE.charges ) %]
827                                                                 <span>Yes</span>
828                                                             [% ELSE %]
829                                                                 <span>No</span>
830                                                             [% END %]
831                                                         </td>
832                                                     [% END %]
833                                                     <td></td>
834                                                 </tr>
835                                             [% END %]
836                                         </tbody>
837                                     </table>
838                                 </div> <!-- / #opac-user-overdues -->
839                             [% END # /overdues_count %]
840
841                             [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
842
843                             [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
844                                 <div id="opac-user-recalls" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-recalls-tab">
845                                     <table id="recalls-table" class="table table-bordered table-striped">
846                                         <caption>Recalls <span class="count">([% RECALLS.count | html %])</span></caption>
847                                         <thead>
848                                             <tr>
849                                                 <th class="anti-the">Title</th>
850                                                 <th class="psort">Placed on</th>
851                                                 <th>Expires on</th>
852                                                 <th>Pickup location</th>
853                                                 <th>Status</th>
854                                                 <th class="nosort">&nbsp;</th>
855                                                 <th></th>
856                                             </tr>
857                                         </thead>
858                                         <tbody>
859                                             [% FOREACH RECALL IN RECALLS %]
860                                             <tr>
861                                                 <td class="title">
862                                                     [% INCLUDE 'biblio-title.inc' biblio=RECALL.biblio link=> 1 %]
863                                                     [% IF RECALL.item_level %]<p class="hint">Item recalled: [% RECALL.item.barcode | html %]</p>[% END %]
864                                                 </td>
865                                                 <td class="recalldate" data-order="[% RECALL.created_date | html %]">
866                                                     <span title="[% RECALL.created_date | html %]">
867                                                         <span class="tdlabel">Recall date:</span>
868                                                         [% RECALL.created_date | $KohaDates %]
869                                                     </span>
870                                                 </td>
871                                                 <td class="expirationdate" data-order="[% RECALL.expiration_date | html %]">
872                                                     [% IF ( RECALL.expiration_date ) %]
873                                                         <span title="[% RECALL.expiration_date | html %]">
874                                                             <span class="tdlabel">Expiration:</span>
875                                                             [% RECALL.expiration_date | $KohaDates %]
876                                                         </span>
877                                                     [% ELSE %]
878                                                         <span title="0000-00-00">
879                                                             <span class="tdlabel">Expiration:</span>
880                                                             Never expires
881                                                         </span>
882                                                     [% END %]
883                                                 </td>
884                                                 <td class="branch">
885                                                     <span class="tdlabel">Pick up location:</span>
886                                                     [% RECALL.library.branchname | html %]
887                                                 </td>
888                                                 <td class="status">
889                                                     <span class="tdlabel">Status:</span>
890                                                     [% IF ( RECALL.requested ) %]
891                                                         <span>Requested</span>
892                                                     [% ELSIF ( RECALL.overdue ) %]
893                                                         <span>Overdue to be returned</span>
894                                                     [% ELSIF ( RECALL.in_transit ) %]
895                                                         <span>In transit to [% RECALL.library.branchname | html %]</span>
896                                                     [% ELSIF ( RECALL.waiting ) %]
897                                                         <span>Ready for pickup</span>
898                                                     [% END %]
899                                                 </td>
900                                                 <td class="cancelrecall">
901                                                     [% IF ( RECALL.requested or RECALL.overdue ) %]
902                                                         <form action="/cgi-bin/koha/opac-recall.pl" method="post">
903                                                             <input type="hidden" name="op" value="cancel">
904                                                             <input type="hidden" name="recall_id" value="[% RECALL.id | html %]">
905                                                             <input type="hidden" name="biblionumber" value="[% RECALL.biblio_id | html %]">
906                                                             <button type="submit" name="submit" class="btn btn-sm btn-danger cancel_recall"><i class="fa fa-times" aria-hidden="true"></i> Cancel</button>
907                                                         </form>
908                                                     [% END %]
909                                                 </td>
910                                             [% END %]
911                                             <td></td>
912                                             </tr>
913                                         </tbody>
914                                     </table>
915                                 </div>
916                             [% END # / # RECALLS.count %]
917
918                             [% IF Koha.Preference('ArticleRequests') %]
919                                 <div id="opac-user-article-requests" class="tab-pane" role="tabpanel" aria-labelledby="opac-user-article-requests-tab">
920                                     [% IF current_article_requests.size %]
921                                         <table id="article-requests-table" class="table table-bordered table-striped">
922                                             <caption>Article requests <span class="count"></span></caption>
923                                             <thead>
924                                                 <tr>
925                                                     <th class="anti-the article-request-record-title">Record title</th>
926                                                     <th class="psort article-request-created-on">Placed on</th>
927                                                     <th class="anti-the article-request-title">Title</th>
928                                                     <th class="article-request-author">Author</th>
929                                                     <th class="article-request-volume">Volume</th>
930                                                     <th class="article-request-issue">Issue</th>
931                                                     <th class="article-request-date">Date</th>
932                                                     <th class="article-request-toc" title="Table of contents">TOC</th>
933                                                     <th class="article-request-pages">Pages</th>
934                                                     <th class="article-request-chapters">Chapters</th>
935                                                     <th class="article-request-patron-notes">Notes</th>
936                                                     <th class="article-request-format">Format</th>
937                                                     <th class="article-request-status">Status</th>
938                                                     <th class="article-request-branchcode">Pickup library</th>
939                                                     <th class="nosort article-request-cancel">&nbsp;</th>
940                                                     <th></th>
941                                                 </tr>
942                                             </thead>
943
944                                             <tbody>
945                                                     [% FOREACH ar IN current_article_requests %]
946                                                         <tr>
947                                                             <td class="article-request-record-title">
948                                                                 [% INCLUDE 'biblio-title.inc' biblio=ar.biblio link=> 1 %]
949                                                                 [% ar.item.enumchron | html %]
950                                                                 [% ar.biblio.author | html %]
951                                                                 [% IF ar.itemnumber %] <em>(only [% ar.item.barcode | html %])</em>[% END %]
952                                                             </td>
953
954                                                             <td class="article-request-created_on">
955                                                                 [% ar.created_on | $KohaDates %]
956                                                             </td>
957
958                                                             <td class="article-request-title">
959                                                                 [% ar.title | html %]
960                                                             </td>
961
962                                                             <td class="article-request-author">
963                                                                 [% ar.author | html %]
964                                                             </td>
965
966                                                             <td class="article-request-volume">
967                                                                 [% ar.volume | html %]
968                                                             </td>
969
970                                                             <td class="article-request-issue">
971                                                                 [% ar.issue | html %]
972                                                             </td>
973
974                                                             <td class="article-request-date">
975                                                                 [% ar.date | html %]
976                                                             </td>
977
978                                                             <td class="article-request-toc">
979                                                                 [% IF ar.toc_request %]Yes[% END %]
980                                                             </td>
981
982                                                             <td class="article-request-pages">
983                                                                 [% ar.pages | html %]
984                                                             </td>
985
986                                                             <td class="article-request-chapters">
987                                                                 [% ar.chapters | html %]
988                                                             </td>
989
990                                                             <td class="article-request-patron-notes">
991                                                                 [% ar.patron_notes | html %]
992                                                             </td>
993
994                                                             <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]<span>Copy</span>[% ELSIF ar.format == 'SCAN' %]<span>Scan</span>[% END %]</td>
995
996                                                             <td class="article-request-status">
997                                                                 [% IF ar.status == 'PENDING' %]
998                                                                     <span>Pending</span>
999                                                                 [% ELSIF ar.status == 'PROCESSING' %]
1000                                                                     <span>Processing</span>
1001                                                                 [% ELSIF ar.status == 'REQUESTED' %]
1002                                                                     <span>New</span>
1003                                                                 [% ELSIF ar.status == 'COMPLETED' %]
1004                                                                     <span>Completed</span>
1005                                                                 [% ELSIF ar.status == 'CANCELED' %]
1006                                                                     <span>Canceled</span>
1007                                                                 [% END %]
1008                                                             </td>
1009
1010                                                             <td class="article-request-branchcode">
1011                                                                 [% ar.branch.branchname | html %]
1012                                                             </td>
1013
1014                                                             <td class="article-request-cancel">
1015                                                                 <button data-title="[% ar.biblio.title | html %] [% ar.item.enumchron | html %]" data-article-request_id="[% ar.id | html %]" class="btn btn-sm btn-danger btn-delete-article-request"><i class="fa fa-times" aria-hidden="true"></i> Cancel</button>
1016                                                             </td>
1017                                                             <td></td>
1018                                                         </tr>
1019                                                     [% END %]
1020                                             </tbody>
1021                                         </table>
1022                                     [% ELSE %]
1023                                         <table class="table table-bordered table-striped">
1024                                             <caption class="sr-only">Article requests</caption>
1025                                             <tr><td>You have no article requests currently.</td></tr>
1026                                         </table>
1027                                     [% END # IF current_article_requests.size %]
1028                                 </div> <!-- / #opac-user-article-requests -->
1029                             [% END %]
1030                         </div> <!-- /.tab-content -->
1031                     </div> <!-- /#opac-user-views -->
1032                 </div> <!-- /#userdetails -->
1033             </div> <!-- /.col-10 -->
1034         </div> <!-- /.row -->
1035     </div> <!-- /.container-fluid -->
1036 </div> <!-- /#main -->
1037
1038 [% # hold suspend modal form %]
1039 <div id="suspendHoldModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="suspendModalLabel" aria-hidden="true" data-focus="false">
1040     <div class="modal-dialog">
1041         <div class="modal-content">
1042             <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
1043                 <div class="modal-header">
1044                     [% IF HOLD.suspend %]
1045                         <h5 class="modal-title" id="suspendModalLabel">Resume hold</h5>
1046                     [% ELSE %]
1047                         <h5 class="modal-title" id="suspendModalLabel">Suspend hold</h5>
1048                     [% END %]
1049                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
1050                         <span aria-hidden="true">x</span>
1051                     </button>
1052                 </div>
1053                 <div class="modal-body">
1054                     <h6 id="suspendHoldTitle"></h6>
1055                     <input type="hidden" name="reserve_id" id="suspendHoldReserveId" value="" />
1056                     <label for="suspend_untilDate">Suspend until:</label>
1057                     <input type="text" name="suspend_until" id="suspend_untilDate" size="10" />
1058                     [% INCLUDE 'date-format.inc' %]
1059                     <p><a href="#" class="clear-flatpickr" data-fp="suspend_untilDate">Clear date to suspend indefinitely</a></p>
1060                 </div>
1061                 <div class="modal-footer">
1062                     <button class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Suspend</button>
1063                     <button data-dismiss="modal" class="btn btn-secondary"><i class="fa fa-times" aria-hidden="true"></i> Do not suspend</button>
1064                 </div>
1065             </form>
1066         </div> <!-- /.modal-content -->
1067     </div> <!-- /.modal-dialog -->
1068 </div>  <!-- /#suspendModal -->
1069
1070 [% IF ( OverDriveCirculation ) %]
1071     [% INCLUDE 'overdrive-checkout.inc' %]
1072     [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %]
1073         [% INCLUDE 'overdrive-login.inc' %]
1074     [% END %]
1075 [% END %]
1076
1077 [% INCLUDE 'opac-bottom.inc' %]
1078 [% BLOCK jsinclude %]
1079     [% INCLUDE 'calendar.inc' %]
1080     [% INCLUDE 'datatables.inc' %]
1081     <script>
1082         var AR_CAPTION_COUNT = _("(%s total)");
1083
1084
1085         function tableInit( tableId ){
1086             if( tableId == "checkoutst" ){
1087                 $(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> ");
1088                 [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
1089                     $(".dt-buttons").append("<button id=\"renewselected_link\" class=\"dt-button buttons-renew\"><i class=\"fa fa-check\" aria-hidden=\"true\"></i> "+_("Renew selected")+"</button> <button id=\"renewall_link\" class=\"dt-button buttons-renewall\"><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")+"</button>");
1090                 [% END %]
1091             }
1092         }
1093         $(document).ready(function(){
1094             $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]'));
1095
1096             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1097
1098             $(".btn-delete-hold").on("click", function(e){
1099                 e.preventDefault();
1100                 var hold_title = $(this).data("title");
1101                 var reserve_id = $(this).data("reserve_id");
1102                 confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
1103                         $("#bootstrap-confirm-box-modal").remove()
1104                         if( result ){
1105                             $("#delete_hold_" + reserve_id ).submit();
1106                         }
1107                     }
1108                 );
1109             });
1110
1111             $(".btn-req-delete-hold").on("click", function(e){
1112                 e.preventDefault();
1113                 var hold_title = $(this).data("title");
1114                 var reserve_id = $(this).data("reserve_id");
1115                 confirmModal( hold_title, _("Are you sure you want to request cancelling this hold?"), _("Yes"), _("No"), function( result ){
1116                         $("#bootstrap-confirm-box-modal").remove()
1117                         if( result ){
1118                             $("#req_cancel_hold_" + reserve_id ).submit();
1119                         }
1120                     }
1121                 );
1122             });
1123
1124             $(".btn-delete-article-request").on("click", function(e){
1125                 e.preventDefault();
1126                 var article_request = $(this).data("title");
1127                 var article_request_id = $(this).data("article-request_id");
1128                 (function(row){
1129                     var doCancel = function( result ){
1130                         $("#bootstrap-confirm-box-modal").remove();
1131                         if( result ){
1132                             $.ajax({
1133                                 type: "DELETE",
1134                                 url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC',
1135                                 success: function( data ) {
1136                                     row.parents('tr').hide({
1137                                         duration: 'slow',
1138                                         complete: function() {
1139                                             var ar_tab = $('a[href="#opac-user-article-requests"');
1140                                             var ar_table = $('#article-requests-table');
1141                                             var ar_length = $('tbody tr:visible', ar_table).length;
1142                                             var ar_count = $('caption .count', ar_table);
1143
1144                                             ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')'));
1145                                             ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1146                                         }
1147                                     });
1148                                 }
1149                             });
1150                         }
1151                     };
1152                     confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel);
1153                 })($(this))
1154             });
1155
1156             /* We initiate this flatpickr instance here so that we can use the variable later */
1157             var suspend_until_date = $("#suspend_untilDate").flatpickr({
1158                 minDate: "today"
1159             });
1160
1161             $(document).on("click", ".suspend_hold", function(e){
1162                 e.preventDefault();
1163                 var title = $(this).data("title");
1164                 var reserve_id = $(this).data("reserve_id");
1165                 $("#suspendHoldReserveId").val( reserve_id );
1166                 $("#suspendHoldTitle").html( "<em>" + title + "</em>" );
1167                 $("#suspendHoldModal").modal("show");
1168             });
1169
1170             $("#suspendHoldModal").on("hidden.bs.modal", function(){
1171                 $("#suspendHoldTitle").html("");
1172                 $("#suspendHoldReserveId").val("");
1173                 suspend_until_date.clear();
1174             });
1175
1176             $("#suspend_all_submit").on("click", function(e){
1177                 e.preventDefault();
1178                 var title = _("Are you sure you want to suspend all holds?");
1179                 var body = _("All holds will be suspended.");
1180                 confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
1181                         $("#bootstrap-confirm-box-modal").remove()
1182                         if( result ){
1183                             $("#suspend_all_holds").submit();
1184                         }
1185                     }
1186                 );
1187             });
1188
1189             $("#resume_all_submit").on("click", function(e){
1190                 e.preventDefault();
1191                 var title = _("Are you sure you want to resume all suspended holds?");
1192                 var body = _("All holds will resume.");
1193                 confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
1194                         $("#bootstrap-confirm-box-modal").remove()
1195                         if( result ){
1196                             $("#resume_all_holds").submit();
1197                         }
1198                     }
1199                 );
1200             });
1201
1202             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1203             dTables.each(function(){
1204                 var thIndex = $(this).find("th.psort").index();
1205                 $(this).on("init.dt", function() {
1206                         tableInit( $(this).attr("id") );
1207                     })
1208                     .dataTable($.extend(true, {}, dataTablesDefaults, {
1209                     "sorting" : [[ thIndex, 'asc' ]],
1210                     "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
1211                     "columnDefs": [
1212                         { "targets": [ "nosort" ],"sortable": false,"searchable": false },
1213                         { "type": "anti-the", "targets" : [ "anti-the" ] },
1214                         { "visible": false, "targets" : [ "hidden" ] },
1215                         { "className": 'dtr-control', "orderable": false, "targets": -1 }
1216                     ],
1217                     "language": {
1218                         "search": "_INPUT_",
1219                         "searchPlaceholder": _("Search")
1220                     },
1221                     "autoWidth": false,
1222                     "responsive": {
1223                         details: {
1224                             type: 'column',
1225                             target: -1
1226                         }
1227                     },
1228                     buttons: [
1229                         /* Override default button set so that we can extend the options of print and csv */
1230                         'clearFilter', 'copy',
1231                         {
1232                             extend: "print",
1233                             exportOptions: {
1234                                 /* Print view should show all columns (even invisible ones) unless they are .noExport */
1235                                 columns: ":not(.noExport)"
1236                             }
1237                         },
1238                         {
1239                             extend: "csv",
1240                             exportOptions: {
1241                                 /* CSV export should include all columns (even invisible ones) unless they are .noExport */
1242                                 columns: ":not(.noExport)"
1243                             }
1244                         }
1245                     ]
1246                 }));
1247             });
1248
1249             var dataTables = $("#recalls-table,#article-requests-table");
1250             dataTables.each(function(){
1251                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
1252                     "searching": false,
1253                     "paging": false,
1254                     "info": false,
1255                     "autoWidth": false,
1256                     "responsive": {
1257                         "details": { "type": 'column',"target": -1 }
1258                     },
1259                     "columnDefs": [
1260                         { "className": 'dtr-control', "orderable": false, "targets": -1 }
1261                     ],
1262                 }));
1263             });
1264             $('a[data-toggle="tab"]').on('shown.bs.tab', function (event) {
1265                 dTables.DataTable().responsive.recalc();
1266                 dataTables.DataTable().responsive.recalc();
1267             } );
1268
1269             $("body").on("click", "#buttons-ics", function(){
1270                 location.href="/cgi-bin/koha/opac-ics.pl";
1271             });
1272
1273             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1274             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
1275                 $("#renewselected").submit(function(){
1276                     valid = false;
1277                     $("input[type=checkbox]").each(function(){
1278                         if($(this).is(':checked')){
1279                             valid = true;
1280                         }
1281                     });
1282                     if(!valid){
1283                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
1284                     }
1285                     return valid;
1286                 });
1287                 $("body").on("click","#renewselected_link",function(e){
1288                     e.preventDefault();
1289                     $("#renewselected").submit();
1290                 });
1291                 $("body").on("click","#renewall_link, #renewall_js",function(e){
1292                     e.preventDefault();
1293                     $("#renewall").submit();
1294                 });
1295             [% END # /IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
1296
1297             [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
1298
1299                 /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1300                 $(".nonjs_submitnote").hide();
1301
1302                 $("input[name='note']").prop('readonly', false);
1303                 $("input[name='note']").keypress(function(e){
1304                     /* prevent submitting of renewselected form */
1305                     if(e.which == 13)
1306                         e.preventDefault();
1307                 });
1308
1309                 $("input[name='note']").keyup(function(e){
1310                     var $btn_save = $('#save_'+$(this).data('issue_id'));
1311                     var origvalue = $(this).data('origvalue');
1312                     var value = $(this).val();
1313
1314                     if(origvalue != value) {
1315                         if(origvalue != "")
1316                             $btn_save.text(_("Submit changes"));
1317                         else
1318                             $btn_save.text(_("Submit note"));
1319                         $btn_save.show();
1320                     } else {
1321                         $btn_save.hide();
1322                     }
1323                 });
1324
1325             [% END %]
1326
1327             $(".change_pickup").on("click", function(){
1328                 var hold_id = $(this).data("hold-id");
1329                 $(this).hide();
1330                 $("#change-pickup-location" + hold_id ).show();
1331             });
1332
1333             if ( $('#opac-user-clubs').length ) {
1334                 $('#opac-user-clubs-tab-link').on('click', function() {
1335                     $('#opac-user-clubs').text(_("Loading..."));
1336                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
1337                 });
1338             }
1339
1340             $(".cancel_recall").click(function(e){
1341                 return confirmDelete(_("Are you sure you want to remove this recall?"));
1342             });
1343
1344             $("body").on("click", ".btn-add-note", function(e){
1345                 e.preventDefault();
1346                 var title = $(this).data("title");
1347                 var issue_id = $(this).data("issueid");
1348                 var note = $("#note_" + issue_id ).val();
1349                 var origvalue = $("#note_" + issue_id ).data("origvalue");
1350                 $("#addNote").val( note );
1351                 $("#addNoteIssueId").val( issue_id );
1352                 $("#addNoteTitle").text( title );
1353                 $("#addNoteModal").modal("show");
1354             });
1355
1356             $("#addNoteForm").on("submit", function(e){
1357                 e.preventDefault();
1358                 var title = $("#addNoteTitle").text();
1359                 var issue_id = $("#addNoteIssueId").val();
1360                 var note = $("#addNote").val();
1361                 submitNote( title, issue_id, note );
1362             });
1363
1364             $("#addNoteModal").on("hidden.bs.modal", function(){
1365                 $("#addNoteTitle").text("");
1366                 $("#addNote").val("");
1367             });
1368
1369             $(".dismiss-message-button").click(function(e){
1370                 return confirmDelete(_("Are you sure you want to dismiss this message?"));
1371             });
1372         });
1373
1374         function submitNote( title, issue_id, note ){
1375             var self = $("#addNoteModal");
1376             var notebutton = $("#save_" + issue_id );
1377             var noteinput = $("#note_" + issue_id );
1378
1379             var ajaxData = {
1380                 'action': 'issuenote',
1381                 'issue_id': issue_id,
1382                 'note': note
1383             };
1384
1385             $.ajax({
1386                 url: '/cgi-bin/koha/svc/checkout_notes/',
1387                 type: 'POST',
1388                 dataType: 'json',
1389                 data: ajaxData,
1390             })
1391             .done(function(data) {
1392                 var message = "";
1393                 if(data.status == 'saved') {
1394                     $("#notesaved").removeClass("alert-error");
1395                     $("#notesaved").addClass("alert-info");
1396                     noteinput.data('origvalue', data.note)
1397                         .val(data.note);
1398                     notebutton.text( _("Edit note" ) );
1399                     $("#viewnote_" + issue_id ).text( data.note );
1400                     message = "<p>" + _("Your note about %s has been saved and sent to the library.").format( em(title) ) + "</p>";
1401                     message += "<p class=\"checkout_note\">" + data.note;
1402                     message += "<a href=\"/cgi-bin/koha/opac-issue-note.pl?issue_id=" + issue_id + "\" class=\"btn btn-link btn-sm btn-add-note\" data-title=\"" + title + "\" data-issueid=\"" + issue_id + "\"><i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> " + _("Edit note") + "</a>";
1403                     message += "</p>";
1404                 } else if(data.status == 'removed') {
1405                     $("#notesaved").removeClass("alert-error");
1406                     $("#notesaved").addClass("alert-info");
1407                     noteinput.data('origvalue', "")
1408                         .val("")
1409                     notebutton.text( _("Add note") );
1410                     $("#viewnote_" + issue_id ).text( data.note );
1411                     message = "<p>" + _("Your note about %s was removed.").format( em(title) ) + "</p>";
1412                 } else {
1413                     $("#notesaved").removeClass("alert-info");
1414                     $("#notesaved").addClass("alert-error");
1415                     message =  "<p>" + _("Your note about %s could not be saved.").format( em(title) ) + "</p>";
1416                     notebutton.text( _("Add note") );
1417                     $("#viewnote_" + issue_id ).text( data.note );
1418                     message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1419                 }
1420                 $("#notesaved").html(message);
1421             })
1422             .fail(function(data) {
1423                 $("#notesaved").removeClass("alert-info");
1424                 $("#notesaved").addClass("alert-error");
1425                 var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1426                 $("#notesaved").html(message);
1427             })
1428             .always(function() {
1429                 self.modal("hide");
1430                 $("#notesaved").show();
1431             });
1432         }
1433
1434         function em( title ){
1435             return "<em>" + title + "</em>";
1436         }
1437
1438         var borrowernumber = "[% borrowernumber | html %]";
1439     </script>
1440     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
1441         [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
1442         [% Asset.js("js/ratings.js") | $raw %]
1443     [% END %]
1444     [% IF Koha.Preference('OverDriveCirculation') %]
1445     [% Asset.js("js/overdrive.js") | $raw %]
1446     <script>
1447     [%- IF Koha.Preference('OverDrivePasswordRequired') -%]
1448         var OD_password_required = 1;
1449     [%- ELSE -%]
1450         var OD_password_required = 0;
1451     [%- END -%]
1452     $(document).ready(function() {
1453         [% IF ( overdrive_error ) %]
1454             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]");
1455         [% END %]
1456
1457         [% IF ( overdrive_tab ) %]
1458             $("#opac-user-views a[href='#opac-user-overdrive']").tab("show");
1459         [% END %]
1460
1461         $("#opac-user-overdrive").each( function() {
1462             KOHA.OverDriveCirculation.display_account_details(this);
1463         } );
1464     });
1465     </script>
1466     [% END %]
1467 [% END %]