Bug 30508: Do not display OPAC message about block from holds when OPACHoldRequests...
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE KohaDates %]
5 [% USE Branches %]
6 [% USE ItemTypes %]
7 [% USE Price %]
8 [% USE AuthorisedValues %]
9 [% USE AdditionalContents %]
10 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12 [% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %]
13
14 [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
15 [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
16
17 [% INCLUDE 'doc-head-open.inc' %]
18 <title>Your library home &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 [% Asset.css("css/overdrive.css") | $raw %]
21 [% BLOCK cssinclude %][% END %]
22 </head>
23 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
24 [% INCLUDE 'masthead.inc' %]
25
26 [% IF Koha.Preference('AmazonAssocTag') %]
27     [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
28 [% ELSE %]
29     [% AmazonAssocTag = '' %]
30 [% END %]
31
32 <div class="main">
33     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
34         <ol class="breadcrumb">
35             <li class="breadcrumb-item">
36                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
37             </li>
38             <li class="breadcrumb-item">
39                 <a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
40             </li>
41             <li class="breadcrumb-item active">
42                 <a href="#" aria-current="page">Your summary</a>
43             </li>
44         </ol>
45     </nav> <!-- /#breadcrumbs -->
46
47     <div class="container-fluid">
48         <div class="row">
49             <div class="col col-lg-2 order-2 order-lg-1">
50                 <div id="navigation">
51                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
52                 </div>
53             </div>
54             <div class="col-md-12 col-lg-10 order-1 order-lg-2">
55                 <div id="userdetails" class="maincontent">
56
57                     <h1>Your summary</h1>
58
59                     [% INCLUDE 'opac-note.inc' %]
60
61                     <p>Hello, [% INCLUDE 'patron-title.inc' patron = logged_in_user %]
62                     <br />
63                     <a href="/cgi-bin/koha/opac-main.pl?logout.x=1">Click here if you're not [% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></p>
64
65                     [% IF ( patronupdate ) %]<div class="alert alert-info"><h2>Thank you!</h2><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
66
67                     [% IF failed_holds %]
68                         <div class="alert alert-info">
69                             <h2>Notice:</h2>
70                             <p>One or more holds were not placed due to existing holds.</p>
71                         </div>
72                     [% END %]
73
74                     [% IF ( borrower.blockedonfines && Koha.Preference('OPACHoldRequests') ) %]
75                         <div class="alert alert-warning" id="blockedonfines">
76                             <strong>Please note:</strong><span> Your account has outstanding fees & charges of [% amountoutstanding | $Price %]. Holds are blocked because your fine balance is over the limit.</span>
77                         </div>
78                     [% END %]
79
80                     [% IF ( borrower.warndeparture ) %]
81                         <div class="alert alert-warning" id="warndeparture">
82                             <strong>Please note:</strong><span> Your library card will expire on <span id="warndeparture_date">[% borrower.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
83                                 [% IF ( borrower.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your library card expires.</span>[% END %]
84                         </div>
85                     [% END %]
86
87                     [% IF ( borrower.warnexpired ) %]
88                         <div class="alert alert-warning" id="warnexpired">
89                             <strong>Please note: </strong><span>Your account has expired as of [% borrower.warnexpired | $KohaDates %]. Please contact the library if you wish to renew your account.</span>
90                         </div>
91                     [% END %]
92
93                     [% IF ( RENEW_ERROR ) %]
94                         <div class="alert alert-warning">
95                             <strong>Please note:</strong>
96                                 Your loan renewal failed because of the following reason(s):
97                                 <ul>
98                                     [% FOREACH error IN RENEW_ERROR.split('\|') %]
99                                         [% IF error == 'card_expired' %]
100                                             <li>Your account has expired. Please contact the library for more information.</li>
101                                         [% ELSIF error == 'too_many' %]
102                                             <li>You have renewed this item the maximum number of times allowed.</li>
103                                         [% ELSIF error == 'too_unseen' %]
104                                             <li>You have renewed this item the maximum number of consecutive times without it being seen by the library.</li>
105                                         [% ELSIF error == 'too_soon' %]
106                                             <li>It is too soon after the checkout date for this item to be renewed.</li>
107                                         [% ELSIF error == 'on_reserve' %]
108                                             <li>This item is on hold for another borrower.</li>
109                                         [% ELSIF error == 'item_denied_renewal' %]
110                                             <li>Item renewal is not allowed.</li>
111                                         [% ELSIF error == 'auto_too_soon' %]
112                                             <li>This item is scheduled for auto renewal.</li>
113                                         [% END %]
114                                     [% END %]
115                                 </ul>
116                         </div>
117                     [% END %]
118
119                     [% IF ( patron_flagged ) %]
120                         <div class="alert alert-warning">
121                             <ul>
122                                 [% IF ( userdebarred ) %]
123                                     [% IF ( discharge_available ) %]
124                                         <li id="discharged">
125                                             <strong>Please note:</strong> Your account is frozen because it has been discharged. <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a>
126                                         </li>
127                                     [% ELSE %]
128                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
129                                         [% IF ( borrower.debarredcomment ) %]
130                                             Comment:
131                                             <span id="userdebarred_comment">
132                                                 <strong>
133                                                     [% IF borrower.debarredcomment.search('OVERDUES_PROCESS') %]
134                                                         Restriction added by overdues process [% borrower.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
135                                                     [% ELSE %]
136                                                         [% borrower.debarredcomment | html_line_break %]
137                                                     [% END %]
138                                                 </strong>
139                                             </span>
140                                         [% END %]
141                                         [% IF ( borrower.userdebarreddate && debarred_date != '9999-12-31' ) %]
142                                             End date:
143                                             <span id="userdebarred_date">[% borrower.userdebarreddate | $KohaDates %]</span>
144                                         [% END %]
145
146                                         <em>Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a></li>
147                                     [% END %]
148                                 [% END %]
149                                 [% IF ( borrower.gonenoaddress ) %]
150                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
151                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
152                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
153                                     </li>
154                                 [% END %]
155                                 [% IF ( borrower.lost ) %]
156                                     <li id="lost"><strong>Please note: </strong> Your library card has been marked as lost or stolen. <em>If this is an error, please contact the library.</em></li>
157                                 [% END %]
158                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
159                                     <li id="renewal_blocked_fines"><strong>Please note: </strong>You cannot renew your books online. Reason: [% IF ( renewal_blocked_fines ) > 0  %]Your fines exceed <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines | $Price %]</span>.[% ELSE %]You have fines.[% END %]
160                                 [% END %]
161                             </ul>
162                         </div>
163                     [% END # / IF patron_flagged %]
164
165                     <div class="alert alert-info" id="notesaved" style="display:none;"></div>
166                     [% IF ( OpacMySummaryNote ) %]
167                         [% PROCESS koha_news_block news => OpacMySummaryNote %]
168                     [% END %]
169
170                     [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
171                     <form id="autorenewal_option" action="/cgi-bin/koha/opac-user.pl" method="post">
172                         <legend class="sr-only">Auto-renewal</legend>
173                             <label for="yes-autorenew_checkouts">
174                                 Allow auto-renewal:
175                             </label>
176                                 [% IF ( borrower.autorenew_checkouts ) %]
177                                     <label class="radio inline" for="yes-autorenew_checkouts">
178                                         Yes
179                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" checked="checked" />
180                                     </label>
181
182                                     <label class="radio inline" for="no-autorenew_checkouts">
183                                         No
184                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" />
185                                     </label>
186                                 [% ELSE %]
187                                     <label class="radio inline" for="yes-autorenew_checkouts">
188                                         Yes
189                                         <input type="radio" id="yes-autorenew_checkouts" name="borrower_autorenew_checkouts" value="1" />
190                                     </label>
191                                     <label class="radio inline" for="no-autorenew_checkouts">
192                                         No
193                                         <input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" checked="checked" />
194                                     </label>
195                                 [% END %]
196                         <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
197                         <input type="hidden" name="update_arc" value="1" />
198                         <input type="submit" value="Update auto-renewal preference" />
199                     </form>
200                     [% END %]
201
202                     <div id="opac-user-views" class="toptabs">
203                         <ul>
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 | $KohaDates  as_due_date => 1 %]</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">Placed on</th>
760                                             <th>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.biblio_id | html %]">[% INCLUDE 'biblio-title.inc' biblio=RECALL.biblio %]</a> [% IF RECALL.item_level %]<p class="hint">Item recalled: [% RECALL.item.barcode | html %]</p>[% END %]
771                                             </td>
772                                             <td class="recalldate" data-order="[% RECALL.created_date | html %]">
773                                                 <span title="[% RECALL.created_date | html %]">
774                                                     <span class="tdlabel">Recall date:</span>
775                                                     [% RECALL.created_date | $KohaDates %]
776                                                 </span>
777                                             </td>
778                                             <td class="expirationdate" data-order="[% RECALL.expiration_date | html %]">
779                                                 [% IF ( RECALL.expiration_date ) %]
780                                                     <span title="[% RECALL.expiration_date | html %]">
781                                                         <span class="tdlabel">Expiration:</span>
782                                                         [% RECALL.expiration_date | $KohaDates %]
783                                                     </span>
784                                                 [% ELSE %]
785                                                     <span title="0000-00-00">
786                                                         <span class="tdlabel">Expiration:</span>
787                                                         Never expires
788                                                     </span>
789                                                 [% END %]
790                                             </td>
791                                             <td class="branch">
792                                                 <span class="tdlabel">Pick up location:</span>
793                                                 [% RECALL.library.branchname | html %]
794                                             </td>
795                                             <td class="status">
796                                                 <span class="tdlabel">Status:</span>
797                                                 [% IF ( RECALL.requested ) %]
798                                                     Requested
799                                                 [% ELSIF ( RECALL.overdue ) %]
800                                                     Overdue to be returned
801                                                 [% ELSIF ( RECALL.in_transit ) %]
802                                                     In transit to [% RECALL.library.branchname | html %]
803                                                 [% ELSIF ( RECALL.waiting ) %]
804                                                     Ready for pickup
805                                                 [% END %]
806                                             </td>
807                                             <td class="cancelrecall">
808                                                 [% IF ( RECALL.requested or RECALL.overdue ) %]
809                                                     <form action="/cgi-bin/koha/opac-recall.pl" method="post">
810                                                         <input type="hidden" name="op" value="cancel">
811                                                         <input type="hidden" name="recall_id" value="[% RECALL.id | html %]">
812                                                         <input type="hidden" name="biblionumber" value="[% RECALL.biblio_id | html %]">
813                                                         <button type="submit" name="submit" class="btn btn-sm btn-danger cancel_recall"><i class="fa fa-remove" aria-hidden="true"></i> Cancel</button>
814                                                     </form>
815                                                 [% END %]
816                                             </td>
817                                         [% END %]
818                                         </tr>
819                                     </tbody>
820                                 </table>
821                             </div>
822                         [% END # / # RECALLS.count %]
823
824                         [% IF Koha.Preference('ArticleRequests') %]
825                             <div id="opac-user-article-requests">
826                                 [% IF current_article_requests.size %]
827                                     <table id="article-requests-table" class="table table-bordered table-striped">
828                                         <caption>Article requests <span class="count"></span></caption>
829                                         <thead>
830                                             <tr>
831                                                 <th class="anti-the article-request-record-title">Record title</th>
832                                                 <th class="psort article-request-created-on">Placed on</th>
833                                                 <th class="anti-the article-request-title">Title</th>
834                                                 <th class="article-request-author">Author</th>
835                                                 <th class="article-request-volume">Volume</th>
836                                                 <th class="article-request-issue">Issue</th>
837                                                 <th class="article-request-date">Date</th>
838                                                 <th class="article-request-toc" title="Table of contents">TOC</th>
839                                                 <th class="article-request-pages">Pages</th>
840                                                 <th class="article-request-chapters">Chapters</th>
841                                                 <th class="article-request-patron-notes">Notes</th>
842                                                 <th class="article-request-format">Format</th>
843                                                 <th class="article-request-status">Status</th>
844                                                 <th class="article-request-branchcode">Pickup library</th>
845                                                 <th class="nosort article-request-cancel">&nbsp;</th>
846                                             </tr>
847                                         </thead>
848
849                                         <tbody>
850                                         [% FOREACH ar IN current_article_requests %]
851                                                 <td class="article-request-record-title">
852                                                     <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber | html %]">
853                                                         [% INCLUDE 'biblio-title.inc' biblio=ar.biblio %]
854                                                         [% ar.item.enumchron | html %]
855                                                     </a>
856                                                     [% ar.biblio.author | html %]
857                                                     [% IF ar.itemnumber %] <em>(only [% ar.item.barcode | html %])</em>[% END %]
858                                                 </td>
859
860                                                 <td class="article-request-created_on">
861                                                     [% ar.created_on | $KohaDates %]
862                                                 </td>
863
864                                                 <td class="article-request-title">
865                                                     [% ar.title | html %]
866                                                 </td>
867
868                                                 <td class="article-request-author">
869                                                     [% ar.author | html %]
870                                                 </td>
871
872                                                 <td class="article-request-volume">
873                                                     [% ar.volume | html %]
874                                                 </td>
875
876                                                 <td class="article-request-issue">
877                                                     [% ar.issue | html %]
878                                                 </td>
879
880                                                 <td class="article-request-date">
881                                                     [% ar.date | html %]
882                                                 </td>
883
884                                                 <td class="article-request-toc">
885                                                     [% IF ar.toc_request %]Yes[% END %]
886                                                 </td>
887
888                                                 <td class="article-request-pages">
889                                                     [% ar.pages | html %]
890                                                 </td>
891
892                                                 <td class="article-request-chapters">
893                                                     [% ar.chapters | html %]
894                                                 </td>
895
896                                                 <td class="article-request-patron-notes">
897                                                     [% ar.patron_notes | html %]
898                                                 </td>
899
900                                                 <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
901
902                                                 <td class="article-request-status">
903                                                     [% IF ar.status == 'PENDING' %]
904                                                         Pending
905                                                     [% ELSIF ar.status == 'PROCESSING' %]
906                                                         Processing
907                                                     [% ELSIF ar.status == 'REQUESTED' %]
908                                                         New
909                                                     [% ELSIF ar.status == 'COMPLETED' %]
910                                                         Completed
911                                                     [% ELSIF ar.status == 'CANCELED' %]
912                                                         Canceled
913                                                     [% END %]
914                                                 </td>
915
916                                                 <td class="article-request-branchcode">
917                                                     [% ar.branch.branchname | html %]
918                                                 </td>
919
920                                                 <td class="article-request-cancel">
921                                                     <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>
922                                                 </td>
923                                             </tr>
924                                         [% END %]
925                                     </tbody>
926                                 </table>
927                             [% ELSE %]
928                                 <table class="table table-bordered table-striped">
929                                     <caption class="sr-only">Article requests</caption>
930                                     <tr><td>You have no article requests currently.</td></tr>
931                                 </table>
932                             [% END # IF current_article_requests.size %]
933                         </div> <!-- / #opac-user-article-requests -->
934                     [% END %]
935
936                     </div> <!-- /#opac-user-views -->
937                 </div> <!-- /#userdetails -->
938             </div> <!-- /.col-10 -->
939         </div> <!-- /.row -->
940     </div> <!-- /.container-fluid -->
941 </div> <!-- /#main -->
942
943 [% # hold suspend modal form %]
944 <div id="suspendHoldModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="suspendModalLabel" aria-hidden="true" data-focus="false">
945     <div class="modal-dialog">
946         <div class="modal-content">
947             <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
948                 <div class="modal-header">
949                     [% IF HOLD.suspend %]
950                         <h5 class="modal-title" id="suspendModalLabel">Resume hold</h5>
951                     [% ELSE %]
952                         <h5 class="modal-title" id="suspendModalLabel">Suspend hold</h5>
953                     [% END %]
954                     <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close">
955                         <span aria-hidden="true">x</span>
956                     </button>
957                 </div>
958                 <div class="modal-body">
959                     <h6 id="suspendHoldTitle"></h6>
960                     <input type="hidden" name="reserve_id" id="suspendHoldReserveId" value="" />
961                     <label for="suspend_untilDate">Suspend until:</label>
962                     <input type="text" name="suspend_until" id="suspend_untilDate" size="10" />
963                     [% INCLUDE 'date-format.inc' %]
964                     <p><a href="#" class="clear-flatpickr" data-fp="suspend_untilDate">Clear date to suspend indefinitely</a></p>
965                 </div>
966                 <div class="modal-footer">
967                     <button class="btn btn-primary"><i class="fa fa-check" aria-hidden="true"></i> Suspend</button>
968                     <button data-dismiss="modal" class="btn btn-secondary"><i class="fa fa-remove" aria-hidden="true"></i> Do not suspend</button>
969                 </div>
970             </form>
971         </div> <!-- /.modal-content -->
972     </div> <!-- /.modal-dialog -->
973 </div>  <!-- /#suspendModal -->
974
975 [% IF ( OverDriveCirculation ) %]
976     [% INCLUDE 'overdrive-checkout.inc' %]
977     [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %]
978         [% INCLUDE 'overdrive-login.inc' %]
979     [% END %]
980 [% END %]
981 [% IF ( RecordedBooksCirculation ) %]
982 [% INCLUDE 'recordedbooks-checkout.inc' %]
983 [% END %]
984
985 [% INCLUDE 'opac-bottom.inc' %]
986 [% BLOCK jsinclude %]
987     [% INCLUDE 'calendar.inc' %]
988     [% INCLUDE 'datatables.inc' %]
989     <script>
990         var AR_CAPTION_COUNT = _("(%s total)");
991
992
993         function tableInit( tableId ){
994             if( tableId == "checkoutst" ){
995                 $(".dt-buttons").append("<button type=\"button\" class=\"dt-button buttons-ical\" id=\"buttons-ics\">iCal</button> ");
996                 [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
997                     $(".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>");
998                 [% END %]
999             }
1000         }
1001         $(document).ready(function(){
1002             $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests_count | html %]'));
1003             $('#opac-user-views').tabs();
1004             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
1005
1006             $(".btn-delete-hold").on("click", function(e){
1007                 e.preventDefault();
1008                 var hold_title = $(this).data("title");
1009                 var reserve_id = $(this).data("reserve_id");
1010                 confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){
1011                         $("#bootstrap-confirm-box-modal").remove()
1012                         if( result ){
1013                             $("#delete_hold_" + reserve_id ).submit();
1014                         }
1015                     }
1016                 );
1017             });
1018
1019             $(".btn-delete-article-request").on("click", function(e){
1020                 e.preventDefault();
1021                 var article_request = $(this).data("title");
1022                 var article_request_id = $(this).data("article-request_id");
1023                 (function(row){
1024                     var doCancel = function( result ){
1025                         $("#bootstrap-confirm-box-modal").remove();
1026                         if( result ){
1027                             $.ajax({
1028                                 type: "DELETE",
1029                                 url: '/api/v1/public/patrons/'+borrowernumber+'/article_requests/'+article_request_id+'?cancellation_reason=OPAC',
1030                                 success: function( data ) {
1031                                     row.parents('tr').hide({
1032                                         duration: 'slow',
1033                                         complete: function() {
1034                                             var ar_tab = $('a[href="#opac-user-article-requests"');
1035                                             var ar_table = $('#article-requests-table');
1036                                             var ar_length = $('tbody tr:visible', ar_table).length;
1037                                             var ar_count = $('caption .count', ar_table);
1038
1039                                             ar_tab.html(ar_tab.html().replace(/\(\d+\)/, '('+ar_length+')'));
1040                                             ar_count.html(AR_CAPTION_COUNT.format(ar_length));
1041                                         }
1042                                     });
1043                                 }
1044                             });
1045                         }
1046                     };
1047                     confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), doCancel);
1048                 })($(this))
1049             });
1050
1051             /* We initiate this flatpickr instance here so that we can use the variable later */
1052             var suspend_until_date = $("#suspend_untilDate").flatpickr({
1053                 minDate: "today"
1054             });
1055
1056             $(".suspend_hold").on("click", function(e){
1057                 e.preventDefault();
1058                 var title = $(this).data("title");
1059                 var reserve_id = $(this).data("reserve_id");
1060                 $("#suspendHoldReserveId").val( reserve_id );
1061                 $("#suspendHoldTitle").html( "<em>" + title + "</em>" );
1062                 $("#suspendHoldModal").modal("show");
1063             });
1064
1065             $("#suspendHoldModal").on("hidden.bs.modal", function(){
1066                 $("#suspendHoldTitle").html("");
1067                 $("#suspendHoldReserveId").val("");
1068                 suspend_until_date.clear();
1069             });
1070
1071             $("#suspend_all_submit").on("click", function(e){
1072                 e.preventDefault();
1073                 var title = _("Are you sure you want to suspend all holds?");
1074                 var body = _("All holds will be suspended.");
1075                 confirmModal( body, title, _("Yes, suspend all holds"), "", function( result ){
1076                         $("#bootstrap-confirm-box-modal").remove()
1077                         if( result ){
1078                             $("#suspend_all_holds").submit();
1079                         }
1080                     }
1081                 );
1082             });
1083
1084             $("#resume_all_submit").on("click", function(e){
1085                 e.preventDefault();
1086                 var title = _("Are you sure you want to resume all suspended holds?");
1087                 var body = _("All holds will resume.");
1088                 confirmModal( body, title, _("Yes, resume all holds"), _("No, do not resume holds"), function( result ){
1089                         $("#bootstrap-confirm-box-modal").remove()
1090                         if( result ){
1091                             $("#resume_all_holds").submit();
1092                         }
1093                     }
1094                 );
1095             });
1096
1097             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
1098             dTables.each(function(){
1099                 var thIndex = $(this).find("th.psort").index();
1100                 $(this).on("init.dt", function() {
1101                         tableInit( $(this).attr("id") );
1102                     })
1103                     .dataTable($.extend(true, {}, dataTablesDefaults, {
1104                     "sorting" : [[ thIndex, 'asc' ]],
1105                     "dom": '<"top"<"table_entries"><"table_controls"fB>>t',
1106                     "columnDefs": [
1107                         { "targets": [ "nosort" ],"sortable": false,"searchable": false },
1108                         { "type": "anti-the", "targets" : [ "anti-the" ] },
1109                         { "visible": false, "targets" : [ "hidden" ] }
1110                     ],
1111                     "language": {
1112                         "search": "_INPUT_",
1113                         "searchPlaceholder": _("Search")
1114                     },
1115                     "autoWidth": false,
1116                     buttons: [
1117                         /* Override default button set so that we can extend the options of print and csv */
1118                         'clearFilter', 'copy',
1119                         {
1120                             extend: "print",
1121                             exportOptions: {
1122                                 /* Print view should show all columns (even invisible ones) unless they are .noExport */
1123                                 columns: ":not(.noExport)"
1124                             }
1125                         },
1126                         {
1127                             extend: "csv",
1128                             exportOptions: {
1129                                 /* CSV export should include all columns (even invisible ones) unless they are .noExport */
1130                                 columns: ":not(.noExport)"
1131                             }
1132                         }
1133                     ]
1134                 }));
1135             });
1136
1137             $("body").on("click", "#buttons-ics", function(){
1138                 location.href="/cgi-bin/koha/opac-ics.pl";
1139             });
1140
1141             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
1142             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
1143                 $("#renewselected").submit(function(){
1144                     valid = false;
1145                     $("input[type=checkbox]").each(function(){
1146                         if($(this).is(':checked')){
1147                             valid = true;
1148                         }
1149                     });
1150                     if(!valid){
1151                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
1152                     }
1153                     return valid;
1154                 });
1155                 $("body").on("click","#renewselected_link",function(e){
1156                     e.preventDefault();
1157                     $("#renewselected").submit();
1158                 });
1159                 $("body").on("click","#renewall_link, #renewall_js",function(e){
1160                     e.preventDefault();
1161                     $("#renewall").submit();
1162                 });
1163             [% END # /IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
1164
1165             [% IF ( Koha.Preference('AllowCheckoutNotes') ) %]
1166
1167                 /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1168                 $(".nonjs_submitnote").hide();
1169
1170                 $("input[name='note']").prop('readonly', false);
1171                 $("input[name='note']").keypress(function(e){
1172                     /* prevent submitting of renewselected form */
1173                     if(e.which == 13)
1174                         e.preventDefault();
1175                 });
1176
1177                 $("input[name='note']").keyup(function(e){
1178                     var $btn_save = $('#save_'+$(this).data('issue_id'));
1179                     var origvalue = $(this).data('origvalue');
1180                     var value = $(this).val();
1181
1182                     if(origvalue != value) {
1183                         if(origvalue != "")
1184                             $btn_save.text(_("Submit changes"));
1185                         else
1186                             $btn_save.text(_("Submit note"));
1187                         $btn_save.show();
1188                     } else {
1189                         $btn_save.hide();
1190                     }
1191                 });
1192
1193             [% END %]
1194
1195             if ( $('#opac-user-clubs').length ) {
1196                 $('#opac-user-clubs-tab-link').on('click', function() {
1197                     $('#opac-user-clubs').text(_("Loading..."));
1198                     $('#opac-user-clubs').load('/cgi-bin/koha/clubs/clubs-tab.pl?borrowernumber=[% borrowernumber | html %]');
1199                 });
1200             }
1201
1202             $(".cancel_recall").click(function(e){
1203                 return confirmDelete(_("Are you sure you want to remove this recall?"));
1204             });
1205
1206             $("body").on("click", ".btn-add-note", function(e){
1207                 e.preventDefault();
1208                 var title = $(this).data("title");
1209                 var issue_id = $(this).data("issueid");
1210                 var note = $("#note_" + issue_id ).val();
1211                 var origvalue = $("#note_" + issue_id ).data("origvalue");
1212                 $("#addNote").val( note );
1213                 $("#addNoteIssueId").val( issue_id );
1214                 $("#addNoteTitle").text( title );
1215                 $("#addNoteModal").modal("show");
1216             });
1217
1218             $("#addNoteForm").on("submit", function(e){
1219                 e.preventDefault();
1220                 var title = $("#addNoteTitle").text();
1221                 var issue_id = $("#addNoteIssueId").val();
1222                 var note = $("#addNote").val();
1223                 submitNote( title, issue_id, note );
1224             });
1225
1226             $("#addNoteModal").on("hidden.bs.modal", function(){
1227                 $("#addNoteTitle").text("");
1228                 $("#addNote").val("");
1229             });
1230         });
1231
1232         function submitNote( title, issue_id, note ){
1233             var self = $("#addNoteModal");
1234             var notebutton = $("#save_" + issue_id );
1235             var noteinput = $("#note_" + issue_id );
1236
1237             var ajaxData = {
1238                 'action': 'issuenote',
1239                 'issue_id': issue_id,
1240                 'note': note
1241             };
1242
1243             $.ajax({
1244                 url: '/cgi-bin/koha/svc/checkout_notes/',
1245                 type: 'POST',
1246                 dataType: 'json',
1247                 data: ajaxData,
1248             })
1249             .done(function(data) {
1250                 var message = "";
1251                 if(data.status == 'saved') {
1252                     $("#notesaved").removeClass("alert-error");
1253                     $("#notesaved").addClass("alert-info");
1254                     noteinput.data('origvalue', data.note)
1255                         .val(data.note);
1256                     notebutton.text( _("Edit note" ) );
1257                     $("#viewnote_" + issue_id ).text( data.note );
1258                     message = "<p>" + _("Your note about %s has been saved and sent to the library.").format( em(title) ) + "</p>";
1259                     message += "<p class=\"checkout_note\">" + data.note;
1260                     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>";
1261                     message += "</p>";
1262                 } else if(data.status == 'removed') {
1263                     $("#notesaved").removeClass("alert-error");
1264                     $("#notesaved").addClass("alert-info");
1265                     noteinput.data('origvalue', "")
1266                         .val("")
1267                     notebutton.text( _("Add note") );
1268                     $("#viewnote_" + issue_id ).text( data.note );
1269                     message = "<p>" + _("Your note about %s was removed.").format( em(title) ) + "</p>";
1270                 } else {
1271                     $("#notesaved").removeClass("alert-info");
1272                     $("#notesaved").addClass("alert-error");
1273                     message =  "<p>" + _("Your note about %s could not be saved.").format( em(title) ) + "</p>";
1274                     notebutton.text( _("Add note") );
1275                     $("#viewnote_" + issue_id ).text( data.note );
1276                     message += "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1277                 }
1278                 $("#notesaved").html(message);
1279             })
1280             .fail(function(data) {
1281                 $("#notesaved").removeClass("alert-info");
1282                 $("#notesaved").addClass("alert-error");
1283                 var message = "<p style=\"font-weight:bold;\">" + _("Something went wrong. The note has not been saved") + "</p>";
1284                 $("#notesaved").html(message);
1285             })
1286             .always(function() {
1287                 self.modal("hide");
1288                 $("#notesaved").show();
1289             });
1290         }
1291
1292         function em( title ){
1293             return "<em>" + title + "</em>";
1294         }
1295
1296         var borrowernumber = "[% borrowernumber | html %]";
1297         var MSG_YOUR_RATING = _("Your rating: %s, ");
1298         var MSG_AVERAGE_RATING = _("Average rating: %s (%s votes)");
1299     </script>
1300     [% IF ( Koha.Preference('OpacStarRatings') == 'all' ) %]
1301         [% Asset.js("lib/jquery/plugins/jquery.barrating.min.js") | $raw %]
1302         [% Asset.js("js/ratings.js") | $raw %]
1303     [% END %]
1304     [% IF Koha.Preference('OverDriveCirculation') %]
1305     [% Asset.js("js/overdrive.js") | $raw %]
1306     <script>
1307     var OD_password_required = [% IF Koha.Preference('OverDrivePasswordRequired') %]1[% ELSE %]0[% END %];
1308     $(document).ready(function() {
1309         [% IF ( overdrive_error ) %]
1310             KOHA.OverDriveCirculation.display_error("#opac-user-overdrive", "[% overdrive_error.dquote | html %]");
1311         [% END %]
1312
1313         [% IF ( overdrive_tab ) %]
1314             $("#opac-user-views").tabs("select", "#opac-user-overdrive");
1315         [% END %]
1316
1317         $("#opac-user-overdrive").each( function() {
1318             KOHA.OverDriveCirculation.display_account_details(this);
1319         } );
1320     });
1321     </script>
1322     [% END %]
1323     [% IF RecordedBooksCirculation %]
1324         [% Asset.js("js/recordedbooks.js") | $raw %]
1325         <script>
1326             $(document).ready(function() {
1327                 [% IF ( recordedbooks_error ) %]
1328                     KOHA.RecordedBooks.display_error("#opac-user-recordedbooks", "[% recordedbooks_error.dquote | html %]");
1329                 [% END %]
1330                 [% IF ( recordedbooks_tab ) %]
1331                     $("#opac-user-views").tabs("select", "#opac-user-recordedbooks");
1332                 [% END %]
1333                 $("#opac-user-recordedbooks").each( function() {
1334                     KOHA.RecordedBooks.display_account_details(this);
1335                 } );
1336             });
1337         </script>
1338     [% END %]
1339 [% END %]