Bug 16464 - If a patron has been discharged, show a message in the OPAC
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-user.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Branches %]
4 [% USE ItemTypes %]
5 [% USE Price %]
6
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %][% END %]
11 </head>
12 [% INCLUDE 'bodytag.inc' bodyid='opac-user' bodyclass='scrollto' %]
13 [% INCLUDE 'masthead.inc' %]
14
15 <div class="main">
16     <ul class="breadcrumb">
17         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
18         <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>
19         <li><a href="#">Your summary</a></li>
20     </ul>
21
22     <div class="container-fluid">
23         <div class="row-fluid">
24             <div class="span2">
25                 <div id="navigation">
26                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
27                 </div>
28             </div>
29             <div class="span10">
30                 <div id="userdetails" class="maincontent">
31
32                     [% IF adminWarning %]
33                         <div id="adminwarning" class="dialog alert">
34                             <p>
35 <strong><i class="fa fa-exclamation-triangle"> </i> Warning:</strong>
36 Using this account is not recommended because some parts of Koha will not function as expected. Instead, please log in with a different account.
37 <a class="btn btn-small" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
38 <i class="fa fa-sign-out"> </i> Log out</a>
39                             </p>
40                         </div>
41                     [% END %]
42
43                     [% IF ( bor_messages ) %]
44                         <div class="alert alert-info">
45                             <h3>Messages for you</h3>
46                                 <ul>
47                                     [% FOREACH message IN patron_messages %]
48                                         <li>
49                                         <strong>[% message.message %]</strong><br>
50                                         &nbsp;&nbsp;&nbsp;<i>Written on [% message.message_date | $KohaDates %] by [% Branches.GetName(message.branchcode) %]</i>
51                                         </li>
52                                     [% END %]
53
54                                     [% IF ( opacnote ) %]<li>[% opacnote %]</li>[% END %]
55                                 </ul>
56                         </div>
57                     [% END %]
58                     <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 %]
59                     </h2>
60
61                     <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>
62
63                     [% 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 %]
64
65                     [% IF failed_holds %]
66                         <div class="alert alert-info">
67                             <h3>Notice:</h3>
68                             <p>One or more holds were not placed due to existing holds.</p>
69                         </div>
70                     [% END %]
71
72                     [% IF ( BORROWER_INFO.warndeparture ) %]
73                         <div class="alert" id="warndeparture">
74                             <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>
75                                 [% IF ( BORROWER_INFO.returnbeforeexpiry ) %]<span id="warndeparture_returnbeforeexpiry"> Also note that you must return all checked out items before your card expires.</span>[% END %]
76                         </div>
77                     [% END %]
78
79                     [% IF ( BORROWER_INFO.warnexpired ) %]
80                         <div class="alert" id="warnexpired">
81                             <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>
82                         </div>
83                     [% END %]
84
85                     [% IF ( RENEW_ERROR ) %]
86                         <div class="dialog alert">
87                             <strong>Please note:</strong>
88                             <span>
89                                 Your loan renewal failed because of the following reason(s):
90                                 [% FOREACH error IN RENEW_ERROR.split('\|') %]
91                                     [% IF error == 'card_expired' %]
92                                         Your account has expired. Please contact the library for more information.
93                                     [% ELSIF error == 'too_many' %]
94                                         You have renewed this item the maximum number of times allowed.
95                                     [% ELSIF error == 'too_soon' %]
96                                         It is too soon after the checkout date for this item to be renewed.
97                                     [% ELSIF error == 'on_reserve' %]
98                                         This item is on hold for another patron.
99                                     [% END %]
100                                 [% END %]
101                             </span>
102                         </div>
103                     [% END %]
104
105                     [% IF ( patron_flagged ) %]
106                         <div class="alert">
107                             <ul>
108                                 [% IF ( userdebarred ) %]
109                                     [% IF ( discharge_available ) %]
110                                         <li id="discharged">
111                                             <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>
112                                         </li>
113                                     [% ELSE %]
114                                         <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen.
115                                         [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: <span id="userdebarred_comment">"[% BORROWER_INFO.debarredcomment %]"</span>[% END %]
116                                         [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: <span id="userdebarred_date">[% BORROWER_INFO.userdebarreddate | $KohaDates %]</span>[% END %]
117                                         <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>
118                                     [% END %]
119                                 [% END %]
120                                 [% IF ( BORROWER_INFO.gonenoaddress ) %]
121                                     <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library.
122                                 <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a>
123                                 [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %]
124                                     </li>
125                                 [% END %]
126                                 [% IF ( BORROWER_INFO.lost ) %]
127                                     <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>
128                                 [% END %]
129                                 [% IF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %]
130                                     <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 %]
131                                 [% END %]
132                             </ul>
133                         </div>
134                     [% END # / IF patron_flagged %]
135
136                     [% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %]
137                     [% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %]
138
139                     <div id="opac-user-views" class="toptabs">
140                         <ul>
141                             <li><a href="#opac-user-checkouts">Checked out ([% issues_count %])</a></li>
142                             [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
143                             [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %]
144                             [% IF ( OPACFinesTab ) %]
145                                 [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %]
146                                 [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %]
147                                 [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %]
148                             [% END %]
149                             [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
150                         </ul>
151
152                         <div id="opac-user-checkouts">
153                             [% IF ( issues_count ) %]
154                                 <form id="renewselected" action="/cgi-bin/koha/opac-renew.pl" method="post">
155                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]">
156                                     <input type="hidden" name="from" value="opac_user" />
157                                     <table id="checkoutst" class="table table-bordered table-striped">
158                                         <caption>[% issues_count %] Item(s) checked out</caption>
159                                         <thead>
160                                             <tr>
161                                                 [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
162                                                 <th class="anti-the">Title</th>
163                                                 <th class="title-string psort">Due</th>
164                                                 [% UNLESS ( item_level_itypes ) %]
165                                                     <th>Item type</th>
166                                                 [% END %]
167                                                 [% IF ( show_barcode ) %]
168                                                     <th>Barcode</th>
169                                                 [% END %]
170                                                     <th>Call no.</th>
171                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
172                                                     <th class="nosort">Renew</th>
173                                                 [% END %]
174                                                 [% IF ( OPACFinesTab ) %]
175                                                     <th>Fines</th>
176                                                 [% END %]
177                                                 [% IF ( OPACMySummaryHTML ) %]
178                                                     <th class="nosort">Links</th>
179                                                 [% END %]
180                                             </tr>
181                                         </thead>
182                                         <tbody>
183                                             [% FOREACH ISSUE IN ISSUES %]
184                                                 [% IF ( ISSUE.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
185                                                 [% IF ( JacketImages ) %]<td class="jacketcell">
186
187                                                     [% IF ( OPACAmazonCoverImages ) %]
188                                                         [% IF ( ISSUE.normalized_isbn ) %]
189                                                             <a href="http://www.amazon.com/gp/reader/[% ISSUE.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#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>
190                                                         [% ELSE %]
191                                                             <a href="#"><span class="no-image">No cover image available</span></a>
192                                                         [% END %]
193                                                     [% END %]
194
195                                                     [% IF ( GoogleJackets ) %]
196                                                         [% IF ( ISSUE.normalized_isbn ) %]
197                                                             <div style="display:block;" title="Click to view in Google Books" class="[% ISSUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
198                                                         [% ELSE %]
199                                                             <a href="http://books.google.com/books?q=[% ISSUE.title |url %]"><span class="no-image">No cover image available</span></a>
200                                                         [% END %]
201                                                     [% END %]
202
203                                                     [% IF ( BakerTaylorEnabled ) %]
204                                                         [% bt_id = ( ISSUE.normalized_upc || ISSUE.normalized_isbn ) %]
205                                                         [% IF ( bt_id ) %]
206                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
207                                                         [% ELSE %]
208                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
209                                                         [% END %]
210                                                     [% END %]
211
212                                                     [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
213                                                         [% IF ( using_https ) %]
214                                                             <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" />
215                                                         [% ELSE %]
216                                                             <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" />
217                                                         [% END %]
218                                                     [% END %]
219
220                                                 </td>[% END # / IF JacketImages %]
221
222                                                 <td class="title">
223                                                     <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>
224                                                     <span class="item-details">[% ISSUE.author %]</span>
225                                                 </td>
226                                                 [% IF ( ISSUE.overdue ) %]
227                                                     <td class="date_due overdue">
228                                                         <span title="[% ISSUE.date_due %]">
229                                                             <span class="tdlabel">Date due:</span>
230                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
231                                                         </span>
232                                                     </td>
233                                                 [% ELSE %]
234                                                     <td class="date_due">
235                                                         <span title="[% ISSUE.date_due %]">
236                                                             <span class="tdlabel">Date due:</span>
237                                                             [% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
238                                                         </span>
239                                                     </td>
240                                                 [% END %]
241                                                 [% UNLESS ( item_level_itypes ) %]
242                                                     <td class="itype">
243                                                         <span class="tdlabel">Item type:</span>
244                                                         [% IF ( ISSUE.imageurl ) %]
245                                                             <img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />
246                                                         [% END %] [% ISSUE.description %]
247                                                     </td>
248                                                 [% END %]
249                                                 [% IF ( show_barcode ) %]
250                                                     <td class="barcode">
251                                                         <span class="tdlabel">Barcode:</span>
252                                                         [% ISSUE.barcode %]
253                                                     </td>
254                                                 [% END %]
255                                                 <td class="call_no">
256                                                     <span class="tdlabel">Call no.:</span>
257                                                     [% ISSUE.itemcallnumber %]
258                                                 </td>
259                                                 [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
260                                                     <td class="renew">
261                                                     [% IF ISSUE.renewed %]<span class="blabel label-success">Renewed!</span><br />[% END %]
262                                                     [% IF ( ISSUE.status ) %]
263                                                         [% IF ( canrenew ) %]
264                                                             <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>
265                                                         [% END %]
266                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
267                                                     [% ELSIF ( ISSUE.on_reserve ) %]
268                                                         Not renewable <span class="renewals">(on hold)</span>
269                                                     [% ELSIF ( ISSUE.too_many ) %]
270                                                         Not renewable
271                                                     [% ELSIF ( ISSUE.norenew_overdue ) %]
272                                                         Not allowed <span class="renewals">(overdue)</span>
273                                                     [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
274                                                         Automatic renewal
275                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
276                                                     [% ELSIF ( ISSUE.too_soon ) %]
277                                                         No renewal before [% ISSUE.soonestrenewdate %]
278                                                         <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
279                                                     [% END %]
280                                                     </td>
281                                                 [% END %]
282                                                 [% IF ( OPACFinesTab ) %]
283                                                     <td class="fines">
284                                                         <span class="tdlabel">Fines:</span>
285                                                         [% IF ( ISSUE.charges ) %]
286                                                             Yes
287                                                         [% ELSE %]
288                                                             No
289                                                         [% END %]
290                                                     </td>
291                                                 [% END %]
292                                                 [% IF ( OPACMySummaryHTML ) %]
293                                                     <td class="links">[% ISSUE.MySummaryHTML %]</td>
294                                                 [% END %]
295                                             </tr>
296                                         [% END # /FOREACH ISSUES %]
297                                     </tbody>
298                                 </table>
299                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
300                                     <input type="submit" class="btn" value="Renew selected" />
301                                 [% END %]
302                                 </form>
303
304                                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
305                                 <form id="renewall" action="/cgi-bin/koha/opac-renew.pl" method="post">
306                                     <input type="hidden" name="from" value="opac_user" />
307                                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
308                                     [% FOREACH ISSUE IN ISSUES %]
309                                         <input type="hidden" name="item" value="[% ISSUE.itemnumber %]" />
310                                     [% END %]
311                                     <input type="submit" class="btn" value="Renew all" />
312                                 </form>
313                                 [% END %]
314                             [% ELSE %]
315                                 <table class="table table-bordered table-striped">
316                                     <tr><td>You have nothing checked out</td></tr>
317                                 </table>
318                             [% END # IF issues_count %]
319                         </div> <!-- / .opac-user-checkouts -->
320
321                         [% IF ( OPACFinesTab ) %]
322                             <!-- FINES BOX -->
323                             [% IF BORROWER_INFO.amountoverfive %]
324                                 <div id="opac-user-fines"> <h3>Fines and charges</h3>
325                                     <table class="table table-bordered table-striped">
326                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
327                                         <tbody>
328                                             <tr>
329                                                 <td>You currently owe fines and charges amounting to:</td>
330                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding | $Price %]</a></td>
331                                             </tr>
332                                         </tbody>
333                                     </table>
334                                 </div>
335                             [% END %]
336
337                             [% IF BORROWER_INFO.amountoverzero %]
338                                <div id="opac-user-fines"> <h3>Fines and charges</h3>
339                                     <table class="table table-bordered table-striped">
340                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
341                                         <tbody>
342                                             <tr>
343                                                 <td>You currently owe fines and charges amounting to:</td>
344                                                 <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding %]</a></td>
345                                             </tr>
346                                         </tbody>
347                                     </table>
348                                 </div>
349                             [% END %]
350
351                             [% IF BORROWER_INFO.amountlessthanzero %]
352                                 <div id="opac-user-fines">  <h3>Credits</h3>
353                                     <table class="table table-bordered table-striped">
354                                         <thead><tr><th colspan="2">Amount</th></tr></thead>
355                                         <tbody>
356                                             <tr>
357                                                 <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding %]</a></td>
358                                             </tr>
359                                         </tbody>
360                                     </table>
361                                 </div>
362                             [% END %]
363                         [% END # / OPACFinesTab %]
364
365                         [% IF relatives %]
366                             <div id="opac-user-relative-issues">
367                                 <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
368                                     <thead>
369                                         <tr>
370                                             <th class="anti-the">Title</th>
371                                             <th>Due</th>
372                                             <th>Barcode</th>
373                                             <th>Call no.</th>
374                                             <th class="psort">Relative</th>
375                                         </tr>
376                                     </thead>
377
378                                     <tbody>
379                                         [% FOREACH r IN relatives %]
380                                             [% FOREACH i IN r.issues %]
381                                                 <tr>
382                                                     <td>
383                                                         <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber %]">
384                                                             [% i.item.biblio.title %]
385                                                         </a>
386                                                     </td>
387
388                                                     <td>
389                                                         [% i.date_due | $KohaDates %]
390                                                     </td>
391
392                                                     <td>
393                                                         [% i.item.barcode %]
394                                                     </td>
395
396                                                     <td>
397                                                         [% i.item.itemcallnumber %]
398                                                     </td>
399
400                                                     <td>
401                                                         [% r.firstname %] [% r.surname %]
402                                                     </td>
403                                                 </tr>
404                                             [% END %]
405                                         [% END %]
406                                     </tbody>
407                                 </table>
408                             </div>
409                         [% END %]
410
411                         [% IF ( overdues_count ) %]
412                             <div id="opac-user-overdues">
413                                 <table id="overduest" class="table table-bordered table-striped">
414                                     <caption>Overdues <span class="count">([% overdues_count %] total)</span></caption>
415                                     <!-- OVERDUES TABLE ROWS -->
416                                     <thead>
417                                         <tr>
418                                             [% IF ( JacketImages ) %]<th class="nosort">&nbsp;</th>[% END %]
419                                             <th class="anti-the">Title</th>
420                                             [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
421                                             [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
422                                             <th>Call no.</th>
423                                             <th class="title-string psort">Due</th>
424                                             [% IF ( OpacRenewalAllowed ) %]
425                                                 <th class="nosort">Renew</th>
426                                             [% END %]
427                                             [% IF ( OPACFinesTab ) %]
428                                                 <th>Fines</th>
429                                             [% END %]
430                                         </tr>
431                                     </thead>
432                                     <tbody>
433                                         [% FOREACH OVERDUE IN OVERDUES %]
434                                             <tr>
435                                                 [% IF ( JacketImages ) %]
436                                                     <td class="jacketcell">
437                                                     [% IF ( OPACAmazonCoverImages ) %]
438                                                         [% IF ( OVERDUE.normalized_isbn ) %]
439                                                             <a href="http://www.amazon.com/gp/reader/[% OVERDUE.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#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>
440                                                         [% ELSE %]
441                                                             <a href="#"><span class="no-image">No cover image available</span></a>
442                                                         [% END %]
443                                                     [% END %]
444
445                                                     [% IF ( GoogleJackets ) %]
446                                                         [% IF ( OVERDUE.normalized_isbn ) %]
447                                                             <div style="display:block;" title="Click to view in Google Books" class="[% OVERDUE.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
448                                                         [% ELSE %]
449                                                             <a href="http://books.google.com/books?q=[% OVERDUE.title |url %]"><span class="no-image">No cover image available</span></a>
450                                                         [% END %]
451                                                     [% END %]
452
453                                                     [% IF ( BakerTaylorEnabled ) %]
454                                                         [% bt_id = ( OVERDUE.normalized_upc || OVERDUE.normalized_isbn ) %]
455                                                         [% IF ( bt_id ) %]
456                                                             <a href="https://[% BakerTaylorBookstoreURL |html %][% bt_id %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% bt_id %]" /></a>
457                                                         [% ELSE %]
458                                                             <span class="no-image">No cover image available</span><!-- BakerTaylor needs normalized_upc or normalized_isbn! -->
459                                                         [% END %]
460                                                     [% END %]
461
462                                                     [% IF ( SyndeticsCoverImages ) %]
463                                                         [% IF ( using_https ) %]
464                                                             <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" />
465                                                         [% ELSE %]
466                                                             <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" />
467                                                         [% END %]
468                                                     [% END %]
469                                                     </td>
470                                                 [% END # /IF jacketcell %]
471
472                                                 <td>
473                                                     <a class="title" href="/cgi-bin/koha/opac-detail.pl?bib=[% OVERDUE.biblionumber %]">[% OVERDUE.title |html %] [% FOREACH subtitl IN OVERDUE.subtitle %] [% subtitl.subfield %][% END %]
474                                                     </a>
475                                                     <span class="item-details">[% OVERDUE.author %]</span></td>
476
477                                                 [% UNLESS ( item_level_itypes ) %]
478                                                     <td>
479                                                         [% IF ( OVERDUE.imageurl ) %]
480                                                             <img src="[% OVERDUE.imageurl %]" title="[% OVERDUE.description %]" alt="[% OVERDUE.description %]" />
481                                                         [% END %] [% OVERDUE.description %]
482                                                     </td>
483                                                 [% END %]
484                                                 [% IF ( show_barcode ) %]
485                                                     <td>
486                                                         <span class="tdlabel">Barcode:</span>
487                                                         [% OVERDUE.barcode %]
488                                                     </td>
489                                                 [% END %]
490                                                 <td>
491                                                     <span class="tdlabel">Call no.:</span>
492                                                     [% OVERDUE.itemcallnumber %]
493                                                 </td>
494                                                 <td>
495                                                     <span title="[% OVERDUE.date_due %]">
496                                                         <span class="tdlabel">Date due:</span>
497                                                         [% OVERDUE.date_due_sql | $KohaDates as_due_date => 1 %]
498                                                     </span>
499                                                 </td>
500                                                 [% IF ( OpacRenewalAllowed ) %]
501                                                     <td>
502                                                         [% IF ( OVERDUE.debarred ) %]
503                                                             Account frozen
504                                                         [% ELSIF ( OVERDUE.status ) %]
505                                                             [% IF ( canrenew ) %]
506                                                                 <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber %]&amp;bornum=[% OVERDUE.borrowernumber %]">Renew</a>
507                                                             [% END %]
508                                                                 <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span>
509                                                         [% ELSIF ( OVERDUE.norenew_overdue ) %]
510                                                             Not allowed<span class="renewals">(overdue)</span>
511                                                         [% ELSIF ( OVERDUE.onreserve ) %]
512                                                             On hold
513                                                         [% ELSE %]
514                                                             No renewals left
515                                                         [% END %]
516                                                     </td>
517                                                 [% END %]
518                                                 [% IF ( OPACFinesTab ) %]
519                                                     <td>
520                                                         <span class="tdlabel">Fines:</span>
521                                                         [% IF ( OVERDUE.charges ) %]
522                                                             Yes
523                                                         [% ELSE %]
524                                                             No
525                                                         [% END %]
526                                                     </td>
527                                                 [% END %]
528                                             </tr>
529                                         [% END %]
530                                     </tbody>
531                                 </table>
532                             </div> <!-- / #opac-user-overdues -->
533                         [% END # /overdues_count %]
534
535
536                         [% IF ( RESERVES.count ) %]
537                             <div id="opac-user-holds">
538                                 <table id="holdst" class="table table-bordered table-striped">
539                                     <caption>Holds <span class="count">([% RESERVES.count %] total)</span></caption>
540                                     <!-- RESERVES TABLE ROWS -->
541                                     <thead>
542                                         <tr>
543                                             <th class="anti-the">Title</th>
544                                             <th class="psort">Placed on</th>
545                                             <th>Expires on</th>
546                                             <th>Pick up location</th>
547                                             [% IF ( showpriority ) %]
548                                                 <th>Priority</th>
549                                             [% END %]
550                                             <th>Status</th>
551                                             [% IF SuspendHoldsOpac %]
552                                                  <th class="nosort" >Suspend</th>
553                                             [% END %]
554                                             <th class="nosort">Modify</th>
555                                         </tr>
556                                     </thead>
557                                     <tbody>
558                                     [% FOREACH RESERVE IN RESERVES %]
559                                         [% IF ( RESERVE.is_waiting ) %]
560                                             [% IF ( RESERVE.is_at_destination ) %]
561                                                 [% IF ( RESERVE.is_found ) %]
562                                                     <tr class="reserved">
563                                                 [% ELSE %]
564                                                     <tr>
565                                                 [% END %]
566                                             [% ELSE %]
567                                                 <tr class="transfered">
568                                             [% END %]
569                                         [% ELSE %]
570                                             <tr>
571                                         [% END %]
572                                             <td class="title">
573                                                 <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
574                                                     [% RESERVE.biblio.title %]
575                                                     [% FOREACH s IN RESERVE.biblio.subtitles %]
576                                                         [% s %]
577                                                     [% END %]
578                                                     [% RESERVE.item.enumchron %]
579                                                 </a>
580                                                 [% RESERVE.biblio.author %]
581                                             </td>
582                                             <td class="reservedate">
583                                                 <span title="[% RESERVE.reservedate %]">
584                                                     <span class="tdlabel">Hold date:</span>
585                                                     [% RESERVE.reservedate | $KohaDates %]
586                                                 </span>
587                                             </td>
588                                             <td class="expirationdate">
589                                                 [% IF ! RESERVE.found %]
590                                                     [% IF ( RESERVE.expirationdate ) %]
591                                                         <span>
592                                                             <span class="tdlabel">Expiration:</span>
593                                                                 [% RESERVE.expirationdate | $KohaDates %]
594                                                         </span>
595                                                     [% ELSE %]
596                                                         <span class="tdlabel">Expiration:</span>
597                                                         Never expires
598                                                     [% END %]
599                                                 [% ELSE %]
600                                                     -
601                                                 [% END %]
602                                             </td>
603                                             <td class="branch">
604                                                 <span class="tdlabel">Pick up location:</span>
605                                                 [% RESERVE.branch.branchname %]
606                                             </td>
607                                             [% IF ( showpriority ) %]
608                                                  <td class="priority">
609                                                     <span class="tdlabel">Priority:</span>
610                                                     [% RESERVE.priority %]
611                                                 </td>
612                                             [% END %]
613                                             <td class="status">
614                                                 <span class="tdlabel">Status:</span>
615                                                 [% IF ( RESERVE.is_waiting ) %]
616                                                     [% IF ( RESERVE.is_at_destination ) %]
617                                                         [% IF ( RESERVE.found ) %]
618                                                             Item waiting at <b> [% RESERVE.branch.branchname %]</b>
619                                                             [% IF ( RESERVE.waitingdate ) %]
620                                                                 since [% RESERVE.waitingdate | $KohaDates %]
621                                                                 [% IF RESERVE.waiting_expires_on %]
622                                                                     until [% RESERVE.waiting_expires_on | $KohaDates %]
623                                                                 [% END %]
624                                                             [% END %]
625                                                             <input type="hidden" name="pickup" value="[% RESERVE.branchcode %]" />
626                                                         [% ELSE %]
627                                                             Item waiting to be pulled from <b> [% Branches.GetName( RESERVE.branchcode ) %]</b>
628                                                         [% END %]
629                                                     [% ELSE %]
630                                                         Item in transit to <b> [% Branches.GetName( RESERVE.branchcode ) %]</b> <input type="hidden" name="pickup" value="[% RESERVE.branchcode %]" />
631                                                     [% END %]
632                                                 [% ELSE %]
633                                                     [% IF ( RESERVE.is_in_transit ) %]
634                                                         [% SET transfer = RESERVE.item.get_transfer %]
635                                                         Item in transit from <b> [% Branches.GetName( transfer.frombranch ) %]</b> since
636                                                         [% transfer.datesent | $KohaDates %]
637                                                     [% ELSIF ( RESERVE.suspend ) %]
638                                                         Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until %] [% END %]
639                                                     [% ELSE %]
640                                                         [% IF RESERVE.itemtype %]
641                                                             Pending for next available item of item type '[% ItemTypes.GetDescription( RESERVE.itemtype ) %]'
642                                                         [% ELSE %]
643                                                             Pending
644                                                         [% END %]
645                                                     [% END %]
646                                                 [% END %]
647                                             </td>
648                                             [% IF SuspendHoldsOpac %]
649                                                 <td>
650                                                     [% IF ( RESERVE.is_cancelable ) %]
651                                                         [% IF RESERVE.suspend %]
652                                                             <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
653                                                                 <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
654                                                                 <button class="btn btn-link" type="submit" name="submit"><i class="icon-play"></i> Resume</button>
655                                                             </form>
656                                                         [% ELSE %]
657                                                             [% IF AutoResumeSuspendedHolds %]
658                                                                 <a class="btn btn-link js-show" href="#suspendModal[% RESERVE.reserve_id %]" role="button" data-toggle="modal"><i class="icon-pause"></i> Suspend</a>
659                                                                 [% # hold suspend modal form %]
660                                                                 <div id="suspendModal[% RESERVE.reserve_id %]" class="modal-nojs" tabindex="-1" role="dialog" aria-labelledby="suspendModal[% RESERVE.reserve_id %]Label" aria-hidden="true">
661                                                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
662                                                                         <div class="modal-header">
663                                                                             <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
664                                                                             [% IF RESERVE.suspend %]
665                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.biblio.title %]</i></h3>
666                                                                             [% ELSE %]
667                                                                                 <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.biblio.title %]</i></h3>
668                                                                             [% END %]
669                                                                         </div>
670                                                                         <div class="modal-body">
671                                                                             <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
672                                                                             <label for="suspend_until_[% RESERVE.reserve_id %]">Suspend until:</label>
673                                                                             <input name="suspend_until" id="suspend_until_[% RESERVE.reserve_id %]" class="suspend-until" size="10" />
674                                                                             [% INCLUDE 'date-format.inc' %]
675                                                                             <p class="js-show"><a href="#" onclick="document.getElementById('suspend_until_[% RESERVE.reserve_id %]').value='';return false;">Clear date to suspend indefinitely</a></p>
676                                                                             <button class="btn btn-mini js-hide" type="submit" name="submit">Suspend</button>
677                                                                         </div>
678                                                                         <div class="modal-footer">
679                                                                             <button class="btn btn-primary" type="submit" name="submit">Suspend</button>
680                                                                             <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
681                                                                         </div>
682                                                                     </form>
683                                                                 </div>  <!-- /#suspendModal[% RESERVE.reserve_id %] -->
684                                                             [% ELSE %]
685                                                                 <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
686                                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
687                                                                     <button class="btn btn-link" type="submit" name="submit"><i class="icon-pause"></i> Suspend</button>
688                                                                 </form>
689                                                             [% END # / IF AutoResumeSuspendedHolds %]
690                                                         [% END # / IF RESERVE.suspend %]
691                                                     [% END # / IF ( RESERVE.is_cancelable )%]
692                                                 </td>
693                                             [% END # / IF SuspendHoldsOpac %]
694                                             <td class="modify">
695                                                 [% IF ( RESERVE.is_cancelable ) %]
696                                                     <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
697                                                     <input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
698                                                     <input type="hidden" name="reserve_id" value="[% RESERVE.reserve_id %]" />
699                                                     <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>
700                                                 [% END %]
701                                             </td>
702                                         </tr>
703                                     [% END # /FOREACH RESERVES %]
704                                 </tbody>
705                             </table>
706
707                             [% IF SuspendHoldsOpac %]
708                                 <div>
709                                     <form class="form-inline" action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
710                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_SUSPEND_HOLDS);"><i class="icon-pause"></i> Suspend all holds</button>
711                                         <input type="hidden" name="suspend" value="1" />
712
713                                         [% IF AutoResumeSuspendedHolds %]
714                                             <label for="suspend_until"> until </label>
715                                             <input name="suspend_until" id="suspend_until" class="suspend-until" readonly="readonly" size="10" />
716                                             <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('suspend_until').value='';return false;">Clear date to suspend indefinitely</a>
717                                         [% END %]
718                                     </form>
719                                 </div>
720                                 <br/>
721                                 <div>
722                                     <form action="/cgi-bin/koha/opac-modrequest-suspend.pl" method="post">
723                                         <button type="submit" name="submit" class="btn" onclick="return confirmDelete(MSG_CONFIRM_RESUME_HOLDS);"><i class="icon-play"></i> Resume all suspended holds</button>
724                                         <input type="hidden" name="suspend" value="0" />
725                                     </form>
726                                 </div>
727                             [% END %]
728                         </div> <!-- / #opac-user-holds -->
729                         [% END # / #RESERVES.count %]
730                     </div> <!-- /#opac-user-views -->
731                 </div> <!-- /#userdetails -->
732             </div> <!-- /.span10 -->
733         </div> <!-- /.row-fluid -->
734     </div> <!-- /.container-fluid -->
735 </div> <!-- /#main -->
736
737 [% INCLUDE 'opac-bottom.inc' %]
738
739
740 [% BLOCK jsinclude %]
741     [% INCLUDE 'calendar.inc' %]
742     [% INCLUDE 'datatables.inc' %]
743     <script type="text/JavaScript">
744         //<![CDATA[
745         var MSG_CONFIRM_DELETE_HOLD   = _("Are you sure you want to cancel this hold?");
746         var MSG_CONFIRM_SUSPEND_HOLDS = _("Are you sure you want to suspend all holds?");
747         var MSG_CONFIRM_RESUME_HOLDS  = _("Are you sure you want to resume all suspended holds?");
748
749         $(document).ready(function(){
750             $('#opac-user-views').tabs();
751             $(".js-show").show();
752             $(".js-hide").hide();
753             $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
754             $(".suspend-until").prop("readonly",1);
755
756             var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
757             dTables.each(function(){
758                 var thIndex = $(this).find("th.psort").index();
759                 $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
760                     "aaSorting" : [[ thIndex, 'asc' ]],
761                     "aoColumnDefs": [
762                         { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
763                         { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
764                         { "sType": "title-string", "aTargets" : [ "title-string" ] }
765                     ]
766                 }));
767             });
768
769             [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
770             [% IF ( OpacRenewalAllowed && canrenew && !userdebarred ) %]
771                 $("#renewselected").submit(function(){
772                     valid = false;
773                     $("input[type=checkbox]").each(function(){
774                         if($(this).is(':checked')){
775                             valid = true;
776                         }
777                     });
778                     if(!valid){
779                         alert(_("Nothing has been selected. Check the box for each item you want to renew"));
780                     }
781                     return valid;
782                 });
783                 $("body").on("click","#renewselected_link",function(e){
784                     e.preventDefault();
785                     $("#renewselected").submit();
786                 });
787                 $("body").on("click","#renewall_link",function(e){
788                     e.preventDefault();
789                     $("#renewall").submit();
790                 });
791                 [% IF ( canrenew && !userdebarred && OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
792                     $("#checkoutst caption").append("<div id=\"renewcontrols\"><a id=\"renewselected_link\" href=\"#\">"+_("Renew selected")+"</a> <a id=\"renewall_link\" href=\"#\">"+_("Renew all")+"</a></div>");
793                 [% END %]
794             [% END %]
795
796             $( ".suspend-until" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
797         });
798         //]]>
799     </script>
800 [% END %]