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