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