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