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