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