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