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