Bug 28047: Standardize: Call number, callnumber, Call no. etc.
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE Price %]
8 [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
9 [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
10
11 [% SET borrower_club_enrollments =  logged_in_user.get_club_enrollments(1) %]
12 [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1,1) %]
13
14 [% INCLUDE 'doc-head-open.inc' %]
15 <title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
16 [% INCLUDE 'doc-head-close.inc' %]
17 [% BLOCK cssinclude %][% END %]
18 </head>
19 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
20 [% INCLUDE 'masthead.inc' %]
21
22 [% IF Koha.Preference('AmazonAssocTag') %]
23     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
24 [% ELSE %]
25     [% AmazonAssocTag = '' %]
26 [% END %]
27
28 <div class="main">
29     <nav aria-label="breadcrumb">
30         <ul class="breadcrumb">
31             <li class="breadcrumb-item">
32                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
33             </li>
34             <li class="breadcrumb-item">
35                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
36             </li>
37             <li class="breadcrumb-item active" aria-current="page">
38                 <a href="#">Your summary</a>
39             </li>
40         </ul>
41     </nav>
42
43     <div class="container-fluid">
44         <div class="row">
45             <div class="col col-lg-2 order-2 order-lg-1">
46                 <div id="navigation">
47                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
48                 </div>
49             </div>
50             <div class="col-md-12 col-lg-10 order-1 order-lg-2">
51                 <div id="userdetails" class="maincontent">
52
53                     <h1>Your summary</h1>
54
55                     [% INCLUDE 'opac-note.inc' %]
56
57                     <p>Hello, [% INCLUDE 'patron-title.inc' patron = logged_in_user %]
58                     <br />
59                     <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>
60
61                     [% IF ( patronupdate ) %]<div class="alert alert-info"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
62
63                     [% IF failed_holds %]
64                         <div class="alert alert-info">
65                             <h3>Notice:</h3>
66                             <p>One or more holds were not placed due to existing holds.</p>
67                         </div>
68                     [% END %]
69
70                     [% IF ( borrower.blockedonfines ) %]
71                         <div class="alert alert-warning" id="blockedonfines">
72                             <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>
73                         </div>
74                     [% END %]
75
76                     [% IF ( borrower.warndeparture ) %]
77                         <div class="alert alert-warning" id="warndeparture">
78                             <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% borrower.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
79                                 [% IF ( borrower.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your card expires.</span>[% END %]
80                         </div>
81                     [% END %]
82
83                     [% IF ( borrower.warnexpired ) %]
84                         <div class="alert alert-warning" id="warnexpired">
85                             <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>
86                         </div>
87                     [% END %]
88
89                     [% IF ( RENEW_ERROR ) %]
90                         <div class="alert alert-warning">
91                             <strong>Please note:</strong>
92                                 Your loan renewal failed because of the following reason(s):
93                                 <ul>
94                                     [% FOREACH error IN RENEW_ERROR.split('\|') %]
95                                         [% IF error == 'card_expired' %]
96                                             <li>Your account has expired. Please contact the library for more information.</li>
97                                         [% ELSIF error == 'too_many' %]
98                                             <li>You have renewed this item the maximum number of times allowed.</li>
99                                         [% ELSIF error == 'too_unseen' %]
100                                             <li>You have renewed this item the maximum number of consecutive times without it being seen by the library.</li>
101                                         [% ELSIF error == 'too_soon' %]
102                                             <li>It is too soon after the checkout date for this item to be renewed.</li>
103                                         [% ELSIF error == 'on_reserve' %]
104                                             <li>This item is on hold for another borrower.</li>
105                                         [% ELSIF error == 'item_denied_renewal' %]
106                                             <li>Item renewal is not allowed.</li>
107                                         [% ELSIF error == 'auto_too_soon' %]
108                                             <li>This item is scheduled for auto renewal.</li>
109                                         [% END %]
110                                     [% END %]
111                                 </ul>
112                         </div>
113                     [% END %]
114
115                     [% IF ( patron_flagged ) %]
116                         <div class="alert alert-warning">
117                             <ul>
118                                 [% IF ( userdebarred ) %]
119                                     [% IF ( discharge_available ) %]
120                                         <li id="discharged">
121                                             <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>
122                                         </li>
123                                     [% ELSE %]
124                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
125                                         [% IF ( borrower.debarredcomment ) %]
126                                             Comment:
127                                             <span id="userdebarred_comment">
128                                                 <strong>
129                                                     [% IF borrower.debarredcomment.search('OVERDUES_PROCESS') %]
130                                                         Restriction added by overdues process [% borrower.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
131                                                     [% ELSE %]
132                                                         [% borrower.debarredcomment | html_line_break %]
133                                                     [% END %]
134                                                 </strong>
135                                             </span>
136                                         [% END %]
137                                         [% IF ( borrower.userdebarreddate && debarred_date != '9999-12-31' ) %]
138                                             End date:
139                                             <span id="userdebarred_date">[% borrower.userdebarreddate | $KohaDates %]</span>
140                                         [% END %]
141
142                                         <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>
143                                     [% END %]
144                                 [% END %]
145                                 [% IF ( borrower.gonenoaddress ) %]
146                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
147                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
148                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
149                                     </li>
150                                 [% END %]
151                                 [% IF ( borrower.lost ) %]
152                                     <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>
153                                 [% END %]
154                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
155                                     <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 %]
156                                 [% END %]
157                             </ul>
158                         </div>
159                     [% END # / IF patron_flagged %]
160
161                     <div class="alert alert-info" id="notesaved" style="display:none;"></div>
162
163                     [% IF Koha.Preference('OPACMySummaryNote') %]
164                         <div id="opac-my-summary-note">[% Koha.Preference('OPACMySummaryNote') | $raw %]</div>
165                     [% END %]
166
167                     [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
168                     <form id="autorenewal_option" action="/cgi-bin/koha/opac-user.pl" method="post">
169                             <label for="yes-autorenew_checkouts">
170                                 Allow auto-renewal:
171                             </label>
172                                 [% IF ( borrower.autorenew_checkouts ) %]
173                                     <label class="radio inline" for="yes-autorenew_checkouts">
174                                         Yes
175                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" checked="checked" />
176                                     </label>
177
178                                     <label class="radio inline" for="no-autorenew_checkouts">
179                                         No
180                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" />
181                                     </label>
182                                 [% ELSE %]
183                                     <label class="radio inline" for="yes-autorenew_checkouts">
184                                         Yes
185                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" />
186                                     </label>
187                                     <label class="radio inline" for="no-autorenew_checkouts">
188                                         No
189                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" checked="checked" />
190                                     </label>
191                                 [% END %]
192                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
193                         <input type="hidden" name="update_arc" value="1" />
194                         <input type="submit" value="Update auto-renewal preference" />
195                     </form>
196                     [% END %]
197
198                     <div id="opac-user-views" class="toptabs">
199                         <ul>
200                             <li><a href="#opac-user-checkouts">Checked out ([% issues_count | html %])</a></li>
201                             [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
202                             [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count | html %])</a></li>[% END %]
203                             [% IF ( OPACFinesTab ) %]
204                             [% IF ( amountoutstanding > 0 ) %]<li><a href="#opac-user-fines">Charges ([% amountoutstanding | $Price %])</a></li>[% END %]
205                                 [% IF ( amountoutstanding < 0 ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding * -1 | $Price %])</a></li>[% END %]
206                                 [% IF relatives_with_fines %]<li><a href="#opac-user-relative-fines">Relatives' charges</a></li>[% END %]
207                             [% END %]
208
209                             [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
210                                 <li>
211                                     <a id="opac-user-clubs-tab-link" href="#opac-user-clubs">
212                                         Clubs ([% borrower_club_enrollments.count || 0 | html %]/[% borrower_enrollable_clubs.count || 0 | html %])
213                                     </a>
214                                 </li>
215                             [% END %]
216
217                             [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count | html %])</a></li>[% END %]
218                             [% IF Koha.Preference('ArticleRequests') && logged_in_user.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% logged_in_user.article_requests_current.count | html %])</a></li>[% END %]
219                             [% IF ( OverDriveCirculation ) %]
220                             <li><a href="#opac-user-overdrive">OverDrive Account</a></li>
221                             [% END %]
222                             [% IF ( RecordedBooksCirculation ) %]
223                             <li><a href="#opac-user-recordedbooks">RecordedBooks Account</a></li>
224                             [% END %]
225                         </ul>
226
227                         <div id="opac-user-overdrive">
228                         </div>
229                         <div id="opac-user-recordedbooks">
230                         </div>
231                         <div id="opac-user-checkouts">
232                             [% IF ( issues_count ) %]
233                                 <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
234                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]">
235                                     <input type="hidden" name="from" value="opac_user" />
236                                     <table id="checkoutst" class="table table-bordered table-striped">
237                                         <caption>[% issues_count | html %] Item(s) checked out</caption>
238                                         <thead>
239                                             <tr>
240                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]<th class="nosort">&nbsp;</th>[% END %]
241                                                 <th class="anti-the">Title</th>
242                                                 <th>Author</th>
243                                                 <th class="psort">Due</th>
244                                                 [% UNLESS ( item_level_itypes ) %]
245                                                     <th>Item type</th>
246                                                 [% END %]
247                                                 [% IF ( show_barcode ) %]
248                                                     <th>Barcode</th>
249                                                 [% END %]
250                                                     <th>Call number</th>
251                                                 [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
252                                                     <th>Renew</th>
253                                                 [% END %]
254                                                 [% IF ( OPACFinesTab ) %]
255                                                     <th>Fines</th>
256                                                 [% END %]
257                                                 [% IF ( OPACMySummaryHTML ) %]
258                                                     <th class="nosort">Links</th>
259                                                 [% END %]
260                                                 [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
261                                                     <th id="checkout-notes" class="nosort" title="Use this to report any problems with your currently checked out items">Report a problem</th>
262                                                 [% END %]
263                                             </tr>
264                                         </thead>
265                                         <tbody>
266                                             [% FOREACH ISSUE IN ISSUES %]
267                                                 [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
268                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]<td class="jacketcell">
269                                                     [% IF ( AdlibrisEnabled && ISSUE.normalized_isbn ) %]
270                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% ISSUE.normalized_isbn | uri %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
271                                                     [% END %]
272                                                     [% IF ( OPACAmazonCoverImages ) %]
273                                                         [% IF ( ISSUE.normalized_isbn ) %]
274                                                             <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>
275                                                         [% ELSE %]
276                                                             <a href="#"><span class="no-image">No cover image available</span></a>
277                                                         [% END %]
278                                                     [% END %]
279
280                                                     [% IF ( GoogleJackets ) %]
281                                                         [% IF ( ISSUE.normalized_isbn ) %]
282                                                             <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
283                                                         [% ELSE %]
284                                                             <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
285                                                         [% END %]
286                                                     [% END %]
287
288                                                     [% IF ( BakerTaylorEnabled ) %]
289                                                         [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %]
290                                                         [% IF ( bt_id ) %]
291                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
292                                                         [% ELSE %]
293                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
294                                                         [% END %]
295                                                     [% END %]
296
297                                                     [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
298                                                         [% SET custom_cover_image_url = ISSUE.biblio_object.custom_cover_image_url %]
299                                                         [% IF custom_cover_image_url %]
300                                                             <a class="custom_cover_image" href="[% custom_cover_image_url | url %]"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
301                                                         [% END %]
302                                                     [% END %]
303
304                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
305                                                         <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" />
306                                                     [% END %]
307
308                                                 </td>[% END # / IF JacketImages %]
309
310                                                 <td class="title">
311                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber | html %]">[% INCLUDE 'biblio-title.inc' biblio=ISSUE %]</a>
312                                                     [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron | html %][% END %]
313
314                                                     [% IF ( ISSUE.onsite_checkout ) %] <em class="onsite_checkout">(On-site checkout)</em>[% END %]
315
316                                                     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
317                                                         [% INCLUDE 'user-star-ratings.inc' item=ISSUE %]
318                                                     [% END %]
319                                                 </td>
320
321                                                 <td class="author">[% ISSUE.author | html %]</td>
322                                                 [% IF ( ISSUE.overdue ) %]
323                                                     <td class="date_due overdue" data-order="[% ISSUE.date_due | html %]">
324                                                         <span class="tdlabel">Date due:</span>
325                                                         [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
326                                                     </td>
327                                                 [% ELSE %]
328                                                     <td class="date_due" data-order="[% ISSUE.date_due | html %]">
329                                                         <span class="tdlabel">Date due:</span>
330                                                         [% ISSUE.date_due | $KohaDates  as_due_date => 1 %]
331                                                     </td>
332                                                 [% END %]
333                                                 [% UNLESS ( item_level_itypes ) %]
334                                                     <td class="itype">
335                                                         <span class="tdlabel">Item type:</span>
336                                                         [% IF ( ISSUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
337                                                             <img src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" />
338                                                         [% END %] [% ISSUE.description | html %]
339                                                     </td>
340                                                 [% END %]
341                                                 [% IF ( show_barcode ) %]
342                                                     <td class="barcode">
343                                                         <span class="tdlabel">Barcode:</span>
344                                                         [% ISSUE.barcode | html %]
345                                                     </td>
346                                                 [% END %]
347                                                 <td class="call_no">
348                                                     <span class="tdlabel">Call number:</span>
349                                                     [% ISSUE.itemcallnumber | html %]
350                                                 </td>
351                                                 [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
352                                                     [% IF ( ISSUE.status && canrenew ) %]
353                                                         <td class="renew" data-order="[% ISSUE.renewsleft | html %]">
354                                                     [% ELSE %]
355                                                         <td class="renew" data-order="0">
356                                                     [% END %]
357                                                         [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
358                                                         [% IF ( ISSUE.status ) %]
359                                                             [% IF ( canrenew ) %]
360                                                                 <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>
361                                                             [% END %]
362                                                             [% IF ISSUE.renewalfee > 0 %]
363                                                                 <span class="renewalfee label label-warning">Fee for item type '[% ItemTypes.GetDescription( ISSUE.renewalitemtype) | html %]': [% ISSUE.renewalfee | $Price %]</span>
364                                                             [% END %]
365                                                             [% IF ISSUE.itemtype_object.rentalcharge_daily > 0 %]
366                                                                 <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_daily | $Price %] per day</span>
367                                                             [% END %]
368                                                             [% IF ISSUE.itemtype_object.rentalcharge_hourly > 0 %]
369                                                                 <span class="renewalfee label label-warning">[% ISSUE.itemtype_object.rentalcharge_hourly | $Price %] per hour</span>
370                                                             [% END %]
371                                                             <span class="renewals">(
372                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
373                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
374                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
375                                                                 [% END %]
376                                                             )</span>
377                                                         [% ELSIF ( ISSUE.on_reserve ) %]
378                                                             Not renewable <span class="renewals">(on hold)</span>
379                                                         [% ELSIF ( ISSUE.too_many ) %]
380                                                             Not renewable
381                                                         [% ELSIF ( ISSUE.too_unseen ) %]
382                                                             Item must be renewed at the library. [% ISSUE.renewsleft | html %] renewals remaining
383                                                         [% ELSIF ( ISSUE.norenew_overdue ) %]
384                                                             Not allowed <span class="renewals">(overdue)</span>
385                                                         [% ELSIF ( ISSUE.auto_too_late ) %]
386                                                             No longer renewable
387                                                         [% ELSIF ISSUE.auto_too_much_oweing %]
388                                                             Automatic renewal failed, you have unpaid fines.
389                                                             <span class="renewals">(
390                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
391                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
392                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
393                                                                 [% END %]
394                                                             )</span>
395                                                         [% ELSIF ISSUE.auto_account_expired %]
396                                                             Automatic renewal failed, your account is expired.
397                                                             <span class="renewals">(
398                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
399                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
400                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
401                                                                 [% END %]
402                                                             )</span>
403                                                         [% ELSIF ( ISSUE.too_soon ) %]
404                                                             No renewal before [% ISSUE.soonestrenewdate | html %]
405                                                             <span class="renewals">(
406                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
407                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
408                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
409                                                                 [% END %]
410                                                             )</span>
411                                                         [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
412                                                             Automatic renewal
413                                                             <span class="renewals">(
414                                                                 [% ISSUE.renewsleft | html %] of [% ISSUE.renewsallowed | html %] renewals remaining
415                                                                 [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
416                                                                     / [% ISSUE.unseenleft | html %] of [% ISSUE.unseenallowed | html %] renewals left before the item must be seen by the library
417                                                                 [% END %]
418                                                             )</span>
419                                                         [% ELSIF ( ISSUE.item_denied_renewal ) %]
420                                                             Renewal not allowed
421                                                         [% END %]
422                                                     </td>
423                                                 [% END %]
424                                                 [% IF ( OPACFinesTab ) %]
425                                                     <td class="fines">
426                                                         <span class="tdlabel">Fines:</span>
427                                                         [% IF ( ISSUE.charges ) %]
428                                                             Yes (Item overdue or lost)
429                                                         [% ELSIF ( ISSUE.rentalfines ) %]
430                                                             Yes (Rental fees)
431                                                         [% ELSE %]
432                                                             No
433                                                         [% END %]
434                                                     </td>
435                                                 [% END %]
436                                                 [% IF ( OPACMySummaryHTML ) %]
437                                                     <td class="links">[% ISSUE.MySummaryHTML | $raw %]</td>
438                                                 [% END %]
439                                                 [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
440                                                     <td class="note">
441                                                         <input type="text" name="note" data-issue_id="[% ISSUE.issue_id | html %]" data-origvalue="[% ISSUE.note | html %]" value="[% ISSUE.note | html %]" maxlength="255" readonly>
442                                                         <div class="hint">255 characters maximum</div>
443                                                         <button type="button" class="btn btn-primary btn-sm js_submitnote" id="save_[% ISSUE.issue_id | html %]" style="display:none;">Submit note</button>
444                                                         <button type="button" class="btn btn-primary btn-sm nonjs_submitnote" href="/cgi-bin/koha/opac-issue-note.pl?issue_id=[% ISSUE.issue_id | url %]">Edit / Create note</button>
445                                                     </td>
446                                                 [% END %]
447                                             </tr>
448                                         [% END # /FOREACH ISSUES %]
449                                     </tbody>
450                                 </table>
451                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
452                                     <input type="submit" class="btn btn-primary" value="Renew selected" />
453                                     <button type="button" id="renewall_js" class="btn btn-primary">Renew all</button>
454                                 [% END %]
455                                 </form>
456
457                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions ) ) %]
458                                     <form id="renewall" class="js-hide" action="/cgi-bin/koha/opac-renew.pl" method="post">
459                                         <input type="hidden" name="from" value="opac_user" />
460                                         <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
461                                         [% FOREACH ISSUE IN ISSUES %]
462                                             [% IF ISSUE.status %]
463                                                 <input type="hidden" name="item" value="[% ISSUE.itemnumber | html %]" />
464                                             [% END %]
465                                         [% END %]
466                                         <input type="submit" class="btn btn-primary" value="Renew all" />
467                                     </form>
468                                 [% END %]
469                             [% ELSE %]
470                                 <table class="table table-bordered table-striped">
471                                     <tr><td>You have nothing checked out</td></tr>
472                                 </table>
473                             [% END # IF issues_count %]
474                         </div> <!-- / .opac-user-checkouts -->
475
476                         [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
477                             <div id="opac-user-clubs">
478                                 Loading...
479                             </div>
480                         [% END %]
481
482                         [% IF ( OPACFinesTab ) %]
483                             <!-- FINES BOX -->
484                             [% IF ( amountoutstanding > 0 ) %]
485                                 <div id="opac-user-fines"> <h3>Charges</h3>
486                                     <table class="table table-bordered table-striped">
487                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
488                                         <tbody>
489                                             <tr>
490                                                 <td>You currently owe fines and charges amounting to:</td>
491                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding | $Price %]</a></td>
492                                             </tr>
493                                         </tbody>
494                                     </table>
495                                 </div>
496                             [% END %]
497
498                             [% IF ( amountoutstanding < 0 ) %]
499                                 <div id="opac-user-fines">  <h3>Credits</h3>
500                                     <table class="table table-bordered table-striped">
501                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
502                                         <tbody>
503                                             <tr>
504                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% amountoutstanding * -1 | $Price %]</a></td>
505                                             </tr>
506                                         </tbody>
507                                     </table>
508                                 </div>
509                             [% END %]
510
511                             [% IF relatives_with_fines %]
512                                <div id="opac-user-relative-fines"> <h3>Fines and charges</h3>
513                                     <table class="table table-bordered table-striped">
514                                         <thead>
515                                             <tr>
516                                                 <th colspan="2">Amount</th>
517                                             </tr>
518                                         </thead>
519                                         <tbody>
520                                             [% FOREACH r IN relatives_with_fines %]
521                                             <tr>
522                                                 <td>[% r.firstname | html %] [% r.surname | html %] currently owes fines and charges amounting to:</td>
523                                                 <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id | uri %]">[% r.account.balance | $Price %]</a></td>
524                                             </tr>
525                                             [% END %]
526                                         </tbody>
527                                     </table>
528                                 </div>
529                             [% END %]
530                         [% END # / OPACFinesTab %]
531
532                         [% IF relatives %]
533                             <div id="opac-user-relative-issues">
534                                 <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
535                                     <thead>
536                                         <tr>
537                                             <th class="anti-the">Title</th>
538                                             <th>Due</th>
539                                             <th>Barcode</th>
540                                             <th>Call number</th>
541                                             <th class="psort">Relative</th>
542                                         </tr>
543                                     </thead>
544
545                                     <tbody>
546                                         [% FOREACH r IN relatives %]
547                                             [% FOREACH c IN r.checkouts %]
548                                                 <tr>
549                                                     <td>
550                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% c.item.biblio.biblionumber | uri %]">
551                                                             [% c.item.biblio.title | html %][% IF ( c.item.enumchron ) %] [% c.item.enumchron | html %][% END %]
552                                                         </a>
553                                                     </td>
554
555                                                     <td>
556                                                         [% c.date_due | $KohaDates %]
557                                                     </td>
558
559                                                     <td>
560                                                         [% c.item.barcode | html %]
561                                                     </td>
562
563                                                     <td>
564                                                         [% c.item.itemcallnumber | html %]
565                                                     </td>
566
567                                                     <td>
568                                                         [% r.firstname | html %] [% r.surname | html %]
569                                                     </td>
570                                                 </tr>
571                                             [% END %]
572                                         [% END %]
573                                     </tbody>
574                                 </table>
575                             </div>
576                         [% END %]
577
578                         [% IF ( overdues_count ) %]
579                             <div id="opac-user-overdues">
580                                 <table id="overduest" class="table table-bordered table-striped">
581                                     <caption>Overdues <span class="count">([% overdues_count | html %] total)</span></caption>
582                                     <!-- OVERDUES TABLE ROWS -->
583                                     <thead>
584                                         <tr>
585                                             [% IF ( JacketImages || AdlibrisEnabled ) %]<th class="nosort">&nbsp;</th>[% END %]
586                                             <th class="anti-the">Title</th>
587                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
588                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
589                                             <th>Call number</th>
590                                             <th class="psort">Due</th>
591                                             [% IF ( OpacRenewalAllowed ) %]
592                                                 <th class="nosort">Renew</th>
593                                             [% END %]
594                                             [% IF ( OPACFinesTab ) %]
595                                                 <th>Fines</th>
596                                             [% END %]
597                                         </tr>
598                                     </thead>
599                                     <tbody>
600                                         [% FOREACH OVERDUE IN OVERDUES %]
601                                             <tr>
602                                                 [% IF ( JacketImages || AdlibrisEnabled ) %]
603                                                     <td class="jacketcell">
604                                                     [% IF ( AdlibrisEnabled && OVERDUE.normalized_isbn ) %]
605                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% OVERDUE.biblionumber | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% OVERDUE.normalized_isbn | uri %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
606                                                     [% END %]
607                                                     [% IF ( OPACAmazonCoverImages ) %]
608                                                         [% IF ( OVERDUE.normalized_isbn ) %]
609                                                             <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>
610                                                         [% ELSE %]
611                                                             <a href="#"><span class="no-image">No cover image available</span></a>
612                                                         [% END %]
613                                                     [% END %]
614
615                                                     [% IF ( GoogleJackets ) %]
616                                                         [% IF ( OVERDUE.normalized_isbn ) %]
617                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
618                                                         [% ELSE %]
619                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
620                                                         [% END %]
621                                                     [% END %]
622
623                                                     [% IF ( BakerTaylorEnabled ) %]
624                                                         [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
625                                                         [% IF ( bt_id ) %]
626                                                             <a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
627                                                         [% ELSE %]
628                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
629                                                         [% END %]
630                                                     [% END %]
631
632                                                     [% IF ( SyndeticsCoverImages ) %]
633                                                         <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" />
634                                                     [% END %]
635                                                     </td>
636                                                 [% END # /IF jacketcell %]
637
638                                                 <td>
639                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber | html %]">[% INCLUDE 'biblio-title.inc' biblio=OVERDUE %]</a>
640                                                     <span class="item-details">[% OVERDUE.author | html %]</span>
641                                                 </td>
642
643                                                 [% UNLESS ( item_level_itypes ) %]
644                                                     <td>
645                                                         [% IF ( OVERDUE.imageurl  && !Koha.Preference('OpacNoItemTypeImages') ) %]
646                                                             <img src="[% OVERDUE.imageurl | html %]" title="[% OVERDUE.description | html %]" alt="[% OVERDUE.description | html %]" />
647                                                         [% END %] [% OVERDUE.description | html %]
648                                                     </td>
649                                                 [% END %]
650                                                 [% IF ( show_barcode ) %]
651                                                     <td>
652                                                         <span class="tdlabel">Barcode:</span>
653                                                         [% OVERDUE.barcode | html %]
654                                                     </td>
655                                                 [% END %]
656                                                 <td>
657                                                     <span class="tdlabel">Call number:</span>
658                                                     [% OVERDUE.itemcallnumber | html %]
659                                                 </td>
660                                                 <td data-order="[% OVERDUE.date_due | html %]">
661                                                     <span class="tdlabel">Date due:</span>
662                                                     [% OVERDUE.date_due | $KohaDates  as_due_date => 1 %]
663                                                 </td>
664                                                 [% IF ( OpacRenewalAllowed ) %]
665                                                     <td>
666                                                         [% IF ( OVERDUE.debarred ) %]
667                                                             Account frozen
668                                                         [% ELSIF ( OVERDUE.status ) %]
669                                                             [% IF ( canrenew ) %]
670                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber | uri %]&amp;bornum=[% OVERDUE.borrowernumber | uri %]">Renew</a>
671                                                             [% END %]
672                                                                 <span class="renewals">(
673                                                                     [% OVERDUE.renewsleft | html %] of [% OVERDUE.renewsallowed | html %] renewals remaining
674                                                                     [% IF Koha.Preference('UnseenRenewals') && ISSUE.unseenallowed %]
675                                                                         / [% OVERDUE.unseenleft | html %] of [% OVERDUE.unseenallowed | html %] renewals left before the item must be seen by the library
676                                                                     [% END %]
677                                                                 )</span>
678                                                         [% ELSIF ( OVERDUE.norenew_overdue ) %]
679                                                             Not allowed<span class="renewals">(overdue)</span>
680                                                         [% ELSIF ( OVERDUE.onreserve ) %]
681                                                             On hold
682                                                         [% ELSE %]
683                                                             No renewals left
684                                                         [% END %]
685                                                     </td>
686                                                 [% END %]
687                                                 [% IF ( OPACFinesTab ) %]
688                                                     <td>
689                                                         <span class="tdlabel">Fines:</span>
690                                                         [% IF ( OVERDUE.charges ) %]
691                                                             Yes
692                                                         [% ELSE %]
693                                                             No
694                                                         [% END %]
695                                                     </td>
696                                                 [% END %]
697                                             </tr>
698                                         [% END %]
699                                     </tbody>
700                                 </table>
701                             </div> <!-- / #opac-user-overdues -->
702                         [% END # /overdues_count %]
703
704                         [% PROCESS 'holds-table.inc' HOLDS = RESERVES, SuspendHoldsOpac = SuspendHoldsOpac, showpriority = showpriority, AutoResumeSuspendedHolds = AutoResumeSuspendedHolds %]
705
706                         [% IF Koha.Preference('ArticleRequests') %]
707                             <div id="opac-user-article-requests">
708                                 [% IF logged_in_user.article_requests_current.count %]
709                                     <table id="article-requests-table" class="table table-bordered table-striped">
710                                         <caption>Article requests <span class="count">([% logged_in_user.article_requests_current.count | html %] total)</span></caption>
711                                         <thead>
712                                             <tr>
713                                                 <th class="anti-the article-request-record-title">Record title</th>
714                                                 <th class="psort article-request-created-on">Placed on</th>
715                                                 <th class="anti-the article-request-title">Title</th>
716                                                 <th class="article-request-author">Author</th>
717                                                 <th class="article-request-volume">Volume</th>
718                                                 <th class="article-request-issue">Issue</th>
719                                                 <th class="article-request-date">Date</th>
720                                                 <th class="article-request-pages">Pages</th>
721                                                 <th class="article-request-chapters">Chapters</th>
722                                                 <th class="article-request-patron-notes">Notes</th>
723                                                 <th class="article-request-status">Status</th>
724                                                 <th class="article-request-branchcode">Pickup library</th>
725                                                 <th class="nosort article-request-cancel">&nbsp;</th>
726                                             </tr>
727                                         </thead>
728
729                                         <tbody>
730                                         [% FOREACH ar IN logged_in_user.article_requests_current %]
731                                                 <td class="article-request-record-title">
732                                                     <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber | html %]">
733                                                         [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
734                                                         [% ar.item.enumchron | html %]
735                                                     </a>
736                                                     [% ar.biblio.author | html %]
737                                                     [% IF ar.itemnumber %] <em>(only [% ar.item.barcode | html %])</em>[% END %]
738                                                 </td>
739
740                                                 <td class="article-request-created_on">
741                                                     [% ar.created_on | $KohaDates %]
742                                                 </td>
743
744                                                 <td class="article-request-title">
745                                                     [% ar.title | html %]
746                                                 </td>
747
748                                                 <td class="article-request-author">
749                                                     [% ar.author | html %]
750                                                 </td>
751
752                                                 <td class="article-request-volume">
753                                                     [% ar.volume | html %]
754                                                 </td>
755
756                                                 <td class="article-request-issue">
757                                                     [% ar.issue | html %]
758                                                 </td>
759
760                                                 <td class="article-request-date">
761                                                     [% ar.date | html %]
762                                                 </td>
763
764                                                 <td class="article-request-pages">
765                                                     [% ar.pages | html %]
766                                                 </td>
767
768                                                 <td class="article-request-chapters">
769                                                     [% ar.chapters | html %]
770                                                 </td>
771
772                                                 <td class="article-request-patron-notes">
773                                                     [% ar.patron_notes | html %]
774                                                 </td>
775
776                                                 <td class="article-request-status">
777                                                     [% IF ar.status == 'PENDING' %]
778                                                         Pending
779                                                     [% ELSIF ar.status == 'PROCESSING' %]
780                                                         Processing
781                                                     [% ELSIF ar.status == 'COMPLETED' %]
782                                                         Completed
783                                                     [% ELSIF ar.status == 'CANCELED' %]
784                                                         Canceled
785                                                     [% END %]
786                                                 </td>
787
788                                                 <td class="article-request-branchcode">
789                                                     [% ar.branch.branchname | html %]
790                                                 </td>
791
792                                                 <td class="article-request-cancel">
793                                                     <span class="tdlabel">Cancel:</span>
794                                                     <form action="/cgi-bin/koha/opac-article-request-cancel.pl" id="delete_article_request_[% ar.id | html %]">
795                                                         <input type="hidden" name="id" value="[% ar.id | html %]" />
796                                                         <button data-title="[% ar.biblio.title | html %] [% ar.item.enumchron | html %]" data-article-request_id="[% ar.id | html %]" type="submit" class="btn btn-sm btn-danger btn-delete-article-request"><i class="fa fa-remove" aria-hidden="true"></i> Cancel</button>
797                                                     </form>
798                                                 </td>
799                                             </tr>
800                                         [% END %]
801                                     </tbody>
802                                 </table>
803                             [% ELSE %]
804                                 <table class="table table-bordered table-striped">
805                                     <tr><td>You have no article requests currently.</td></tr>
806                                 </table>
807                             [% END # IF article_requests_current.count %]
808                         </div> <!-- / #opac-user-article-requests -->
809                     [% END %]
810
811                     </div> <!-- /#opac-user-views -->
812                 </div> <!-- /#userdetails -->
813             </div> <!-- /.col-10 -->
814         </div> <!-- /.row -->
815     </div> <!-- /.container-fluid -->
816 </div> <!-- /#main -->
817
818 [% IF ( OverDriveCirculation ) %]
819     [% INCLUDE 'overdrive-checkout.inc' %]
820     [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %]
821         [% INCLUDE 'overdrive-login.inc' %]
822     [% END %]
823 [% END %]
824 [% IF ( RecordedBooksCirculation ) %]
825 [% INCLUDE 'recordedbooks-checkout.inc' %]
826 [% END %]
827
828 [% INCLUDE 'opac-bottom.inc' %]
829 [% BLOCK jsinclude %]
830     [% INCLUDE 'calendar.inc' %]
831     [% INCLUDE 'datatables.inc' %]
832     <script>
833         function tableInit( tableId ){
834             if( tableId == "checkoutst" ){
835                 $(".dt-buttons").append("<a class=\"dt-button buttons-ical\" href=\"opac-ics.pl\">iCal</a> ");
836                 [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
837                     $(".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>");
838                 [% END %]
839             }
840         }
841         $(document).ready(function(){
842             $('#opac-user-views').tabs();
843             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
844             $(".suspend-until").prop("readonly",1);
845
846             $(".btn-delete-hold").on("click", function(e){
847                 e.preventDefault();
848                 var hold_title = $(this).data("title");
849                 var reserve_id = $(this).data("reserve_id");
850                 confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
851                         if( result ){
852                             $("#delete_hold_" + reserve_id ).submit();
853                         }
854                     }
855                 );
856             });
857
858             $(".btn-delete-article-request").on("click", function(e){
859                 e.preventDefault();
860                 var article_request = $(this).data("title");
861                 var article_request_id = $(this).data("article-request_id");
862                 confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), function( result ){
863                         if( result ){
864                             $("#delete_article_request_" + article_request_id ).submit();
865                         }
866                     }
867                 );
868             });
869
870             $("#suspend_all_submit").on("click", function(e){
871                 e.preventDefault();
872                 var title = _("Are you sure you want to suspend all holds?");
873                 var body = _("All holds will be suspended.");
874                 confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
875                         if( result ){
876                             $("#suspend_all_holds").submit();
877                         }
878                     }
879                 );
880             });
881
882             $("#resume_all_submit").on("click", function(e){
883                 e.preventDefault();
884                 var title = _("Are you sure you want to resume all suspended holds?");
885                 var body = _("All holds will resume.");
886                 confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
887                         if( result ){
888                             $("#resume_all_holds").submit();
889                         }
890                     }
891                 );
892             });
893
894             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
895             dTables.each(function(){
896                 var thIndex = $(this).find("th.psort").index();
897                 $(this).on("init.dt", function() {
898                         tableInit( $(this).attr("id") );
899                     })
900                     .dataTable($.extend(true, {}, dataTablesDefaults, {
901                     "sorting" : [[ thIndex, 'asc' ]],
902                     "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
903                     "columnDefs": [
904                         { "targets": [ "nosort" ],"sortable": false,"searchable": false },
905                         { "type": "anti-the", "targets" : [ "anti-the" ] }
906                     ],
907                     "language": {
908                         "search": "_INPUT_",
909                         "searchPlaceholder": _("Search")
910                     }
911                 }));
912             });
913
914             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
915             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
916                 $("#renewselected").submit(function(){
917                     valid = false;
918                     $("input[type=checkbox]").each(function(){
919                         if($(this).is(':checked')){
920                             valid = true;
921                         }
922                     });
923                     if(!valid){
924                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
925                     }
926                     return valid;
927                 });
928                 $("body").on("click","#renewselected_link",function(e){
929                     e.preventDefault();
930                     $("#renewselected").submit();
931                 });
932                 $("body").on("click","#renewall_link, #renewall_js",function(e){
933                     e.preventDefault();
934                     $("#renewall").submit();
935                 });
936             [% END # /IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
937
938             [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
939
940                 /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
941                 $(".nonjs_submitnote").hide();
942
943                 $("input[name='note']").prop('readonly', false);
944                 $("input[name='note']").keypress(function(e){
945                     /* prevent submitting of renewselected form */
946                     if(e.which == 13)
947                         e.preventDefault();
948                 });
949
950                 $("input[name='note']").keyup(function(e){
951                     var $btn_save = $('#save_'+$(this).data('issue_id'));
952                     var origvalue = $(this).data('origvalue');
953                     var value = $(this).val();
954
955                     if(origvalue != value) {
956                         if(origvalue != "")
957                             $btn_save.text(_("Submit changes"));
958                         else
959                             $btn_save.text(_("Submit note"));
960                         $btn_save.show();
961                     } else {
962                         $btn_save.hide();
963                     }
964                 });
965
966                 $(".js_submitnote").click(function(e){
967                     var $self = $(this);
968                     var title = $(this).parent().parent().find('a.title')[0].outerHTML;
969                     var $noteinput = $(this).siblings('input[name="note"]').first();
970
971                     var ajaxData = {
972                         'action': 'issuenote',
973                         'issue_id': $noteinput.data('issue_id'),
974                         'note': $noteinput.val(),
975                     };
976
977                     $.ajax({
978                         url: '/cgi-bin/koha/svc/checkout_notes/',
979                         type: 'POST',
980                         dataType: 'json',
981                         data: ajaxData,
982                     })
983                     .done(function(data) {
984                         var message = "";
985                         if(data.status == 'saved') {
986                             $("#notesaved").removeClass("alert-error");
987                             $("#notesaved").addClass("alert-info");
988                             $noteinput.data('origvalue', data.note);
989                             $noteinput.val(data.note);
990                             message = "<p>" + _("Your note about %s has been saved and sent to the library.").format(title) + "</p>";
991                             message += "<p style=\"font-style:italic;\">" + data.note + "</p>";
992                             $self.hide();
993                         } else if(data.status == 'removed') {
994                             $("#notesaved").removeClass("alert-error");
995                             $("#notesaved").addClass("alert-info");
996                             $noteinput.data('origvalue', "");
997                             $noteinput.val("");
998                             message = "<p>" + _("Your note about %s was removed.").format(title) + "</p>";
999                             $self.hide();
1000                         } else {
1001                             $("#notesaved").removeClass("alert-info");
1002                             $("#notesaved").addClass("alert-error");
1003                             message =  "<p>" + _("Your note about %s could not be saved.").format(title) + "</p>";
1004                             message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1005                         }
1006                         $("#notesaved").html(message);
1007                     })
1008                     .fail(function(data) {
1009                         $("#notesaved").removeClass("alert-info");
1010                         $("#notesaved").addClass("alert-error");
1011                         var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1012                         $("#notesaved").html(message);
1013                     })
1014                     .always(function() {
1015                         $("#notesaved").show();
1016                     });
1017                 });
1018             [% END %]
1019
1020             $(".suspend-until").datepicker({
1021                 beforeShow: function(input, inst) {
1022                     // https://stackoverflow.com/questions/662220/how-to-change-the-pop-up-position-of-the-jquery-datepicker-control#answer-10598178
1023                     var calendar = inst.dpDiv;
1024                     setTimeout(function() {
1025                         calendar.position({
1026                             my: 'left top',
1027                             at: 'left bottom',
1028                             collision: 'none',
1029                             of: input
1030                         });
1031                     }, 1);
1032                 },
1033                 minDate: 1
1034             });
1035
1036             if ( $('#opac-user-clubs').length ) {
1037                 $('#opac-user-clubs-tab-link').on('click', function() {
1038                     $('#opac-user-clubs').text(_("Loading..."));
1039                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
1040                 });
1041             }
1042         });
1043
1044         var borrowernumber = "[% borrowernumber | html %]";
1045         var MSG_YOUR_RATING = _("Your rating: %s, ");
1046         var MSG_AVERAGE_RATING = _("Average rating: %s (%s votes)");
1047     </script>
1048     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
1049         [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
1050         [% Asset.js("js/ratings.js") | $raw %]
1051     [% END %]
1052     [% IF Koha.Preference('OverDriveCirculation') %]
1053     [% Asset.js("js/overdrive.js") | $raw %]
1054     <script>
1055     var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %];
1056     $(document).ready(function() {
1057         [% IF ( overdrive_error ) %]
1058             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]");
1059         [% END %]
1060
1061         [% IF ( overdrive_tab ) %]
1062             $("#opac-user-views").tabs("select", "#opac-user-overdrive");
1063         [% END %]
1064
1065         $("#opac-user-overdrive").each( function() {
1066             KOHA.OverDriveCirculation.display_account_details(this);
1067         } );
1068     });
1069     </script>
1070     [% END %]
1071     [% IF RecordedBooksCirculation %]
1072         [% Asset.js("js/recordedbooks.js") | $raw %]
1073         <script>
1074             $(document).ready(function() {
1075                 [% IF ( recordedbooks_error ) %]
1076                     KOHA.RecordedBooks.display_error("#opac-user-recordedbooks", "[% recordedbooks_error.dquote | html %]");
1077                 [% END %]
1078                 [% IF ( recordedbooks_tab ) %]
1079                     $("#opac-user-views").tabs("select", "#opac-user-recordedbooks");
1080                 [% END %]
1081                 $("#opac-user-recordedbooks").each( function() {
1082                     KOHA.RecordedBooks.display_account_details(this);
1083                 } );
1084             });
1085         </script>
1086     [% END %]
1087 [% END %]