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