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