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