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