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