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