Bug 14404: Rename class no-show to noshow for consistency with nosort
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / sco / sco-main.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
7 <link rel="shortcut icon" href="[% IF ( OpacFavicon  ) %][% OpacFavicon  %][% ELSE %][% interface %]/[% theme %]/images/favicon.ico[% END %]" type="image/x-icon" />
8 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/bootstrap/css/bootstrap.min.css" />
9 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/lib/jquery/jquery-ui.css" />
10 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/sco.css" />
11 [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
12 [% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
13 <!--[if lt IE 9]>
14     <script src="[% interface %]/[% theme %]/lib/respond.min.js"></script>
15 <![endif]-->
16 <script type="text/javascript">
17     function _(s) { return s } // dummy function for gettext
18 </script>
19 <script type="text/javascript" src="[% interface %]/[% theme %]/lib/modernizr.min.js"></script>
20 </head>
21 <body id="sco_main" class="sco" onload="dofocus();" onunload="mungeHistory();">
22 [% INCLUDE 'masthead-sco.inc' %]
23
24     <div class="main">
25         <div class="container-fluid">
26             <div class="row-fluid">
27                 [% IF ( display_patron_image ) %]
28                     <div class="span10">
29                 [% ELSE %]
30                     <div class="span12">
31                 [% END %]
32
33                     <div id="masthead"><h1>[% LibraryName %] Self checkout system</h1></div>
34
35                     [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
36                         <div class="alert">
37                             <h3>Item cannot be checked out.</h3>
38                             <p>Sorry, this item cannot be checked out at this station.</p>
39                             [% IF ( title ) %]
40                                 <p>Title: <em>[% title |html %]</em> </p>
41                             [% END %]
42
43                             <p>
44                                 [% IF ( circ_error_UNKNOWN_BARCODE ) %]
45                                     <em>MESSAGE 1:</em> The system does not recognize this barcode.
46                                 [% ELSIF ( circ_error_max_loans_allowed ) %]
47                                     <em>MESSAGE 2:</em> You have checked out too many items and can't check out any more.
48                                 [% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
49                                 <em>MESSAGE 3:</em> This item is checked out to someone else.
50                                 [% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
51                                     <em>MESSAGE 4:</em> You cannot renew this item again.
52                                 [% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
53                                     <em>MESSAGE 5:</em> This item is not for loan.
54                                 [% ELSIF ( circ_error_DEBT ) %]
55                                     <em>MESSAGE 6:</em> You owe the library [% amount %] and cannot check out.
56                                 [% ELSIF ( circ_error_WTHDRAWN ) %]
57                                     <em>MESSAGE 7:</em> This item has been withdrawn from the collection.
58                                 [% ELSIF ( circ_error_RESTRICTED ) %]
59                                     <em>MESSAGE 8:</em>
60                                 [% ELSIF ( circ_error_RESERVED ) %]
61                                     <em>MESSAGE 9:</em> This item is on hold for another patron.
62                                 [% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
63                                     <em>MESSAGE 10:</em>
64                                 [% ELSIF ( circ_error_EXPIRED ) %]
65                                     <em>MESSAGE 11:</em> Your account has expired.
66                                 [% ELSIF ( circ_error_DEBARRED ) %]
67                                     <em>MESSAGE 12:</em> Your account has been suspended.
68                                 [% ELSIF ( circ_error_CARD_LOST ) %]
69                                     <em>MESSAGE 13:</em> This card has been declared lost.
70                                 [% ELSIF ( circ_error_GNA ) %]
71                                     <em>MESSAGE 14:</em>
72                                 [% ELSIF ( circ_error_INVALID_DATE ) %]
73                                     <em>MESSAGE 15:</em>
74                                 [% END # / IF circ_error_UNKNOWN_BARCODE %]
75                                 Please see a member of the library staff.
76                             </p>
77
78                             [% IF ( returnitem && AllowSelfCheckReturns ) %]
79                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
80                                     <input type="hidden" name="op" value="returnbook" />
81                                     <input type="hidden" name="patronid" value="[% patronid %]" />
82                                     <input type="hidden" name="barcode" value="[% barcode %]" />
83                                     <button type="submit" name="returnbook" class="btn"><i class="return"></i> Return this item</button>
84                                 </form>
85                             [% END %]
86
87                             <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
88                                 <input type="hidden" name="op" value="" />
89                                 <input type="hidden" name="patronid" value="[% patronid %]" />
90                                 <input type="hidden" name="barcode" value="[% barcode %]" />
91                                 <input type="submit" name= "confirm" value="Return to account summary" class="btn back focus" />
92                             </form>
93                         </div> <!-- / .alert -->
94                     [% END # / IF ( impossible %]
95
96                     [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
97                         <div class="alert"><h3>Please confirm the checkout:</h3>
98                             [% IF ( confirm_renew_issue ) %]
99                                 <p>This item is already checked out to you.</p>
100                             [% END %]
101
102                             [% IF ( renew && AllowSelfCheckReturns ) %]
103                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
104                                     <input type="hidden" name="op" value="returnbook" />
105                                     <input type="hidden" name="patronid" value="[% patronid %]" />
106                                     <input type="hidden" name="barcode" value="[% barcode %]" />
107                                     <input type="hidden" name="confirmed" value="" />
108                                     <button type="submit" name="returnbook" class="btn"><i class="icon return"></i> Return this item</button>
109                                 </form>
110                             [% END %]
111
112                             [% UNLESS ( renew ) %]
113                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
114                                     <input type="hidden" name="op" value="checkout" />
115                                     <input type="hidden" name="patronid" value="[% patronid %]" />
116                                     <input type="hidden" name="barcode" value="[% barcode %]" />
117                                     <input type="hidden" name="confirmed" value="1" />
118                                     <button type="submit" name="confirm" class="btn"><i class="icon renew"></i> Renew item</button>
119                                   </form>
120                             [% ELSE %]
121                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
122                                     <input type="hidden" name="op" value="checkout" />
123                                     <input type="hidden" name="patronid" value="[% patronid %]" />
124                                     <input type="hidden" name="barcode" value="[% barcode %]" />
125                                     <input type="hidden" name="confirmed" value="1" />
126                                     <button type="submit" class="btn"><i class="icon renew"></i> Renew item</button>
127                                 </form>
128                             [% END %]
129
130                             <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
131                                 <input type="hidden" name="op" value="" />
132                                 <input type="hidden" name="patronid" value="[% patronid %]" />
133                                 <button type="submit" class="btn"><i class="icon cancel"></i> Cancel</button>
134                             </form>
135                         </div>
136                     [% END # / IF confirm %]
137
138                     [% IF ( nopermission ) %]
139                         <!-- This is what is displayed if user doesnt have permission -->
140                         <div class="alert">
141                             <h3>Access denied</h3>
142                             <p>Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem.</p>
143                         </div>
144                     [% END %]
145
146                     [% IF ( different_ip ) %]
147                         <!-- This is what is displayed if user doesnt have permission -->
148                         <div class="alert">
149                             <h3>Session lost</h3>
150                             <p>You are accessing self-checkout from a different IP address! please log in again.</p>
151                         </div>
152                     [% END %]
153
154                     [% IF ( invalid_username_or_password ) %]
155                         <!-- This is what is displayed if user doesnt have permission -->
156                         <div class="alert">
157                             <h3>Record not found</h3>
158                             <p>Your userid was not found in the database.  Please try again.</p>
159                         </div>
160                     [% END %]
161
162
163                     [% UNLESS ( hide_main ) %]
164
165                         [% IF ( patronid ) %]
166                             [% IF ( validuser ) %]
167                                 <div class="alert alert-info">You are logged in as [% borrowername %].</div>
168                             [% END %]
169
170                             [% IF ( nouser ) %]
171                                 <div class="alert">
172                                     <h4>Sorry</h4>
173                                     <p>The userid <strong>[% patronid %]</strong> was not found in the database.  Please try again.</p>
174                                 </div>
175                             [% END %]
176                         [% END # / IF patronid %]
177
178                         [% IF ( validuser ) %]
179                             <div id="newcheckout" class="sco_entry">
180                                 <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
181                                     <fieldset>
182                                         <legend>Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
183                                         <div class="input-append">
184                                             <label for="barcode">Scan a new item or enter its barcode:</label>
185                                             <input id="barcode" name="barcode" size="20" type="text" class="focus" autocomplete="off" />
186                                             <button type="submit" class="btn">Submit</button>
187                                         </div>
188                                         <input type="hidden" name="op" value="checkout" />
189                                         <input type="hidden" name="patronid" value="[% patronid %]" />
190                                     </fieldset>
191                                 </form>
192
193                                 <div>
194                                     <form method="post" action="#" id="logout_form">
195                                         <button type="submit" class="btn"><i class="icon finish"></i> Finish</button>
196                                     </form>
197                                 </div>
198                             </div> <!-- / #newcheckout -->
199                 </div> <!-- / .span12/12 -->
200                 [% IF ( display_patron_image ) %]
201                     <div class="span2">
202                         <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
203                     </div>
204                 [% END %]
205             </div> <!-- / .row-fluid -->
206         </div> <!-- / .container-fluid -->
207
208         <div class="container-fluid">
209             <div class="row-fluid">
210                     <div class="span12">
211                         <div id="borrowerdetails">
212                             [% IF ( issues_count ) %]
213                                 <table id="loanTable" class="table table-bordered table-striped">
214                                     <caption>Checkouts for [% borrowername %] <span class="count">([%   issues_count %] total)</span></caption>
215                                     <!-- ISSUES TABLE ROWS -->
216                                     <thead>
217                                         <tr>
218                                             <th class="noshow">Checked out on</th>
219                                             <th class="anti-the">Title</th>
220                                             <th>Call no.</th>
221                                             <th class="title-string">Due</th>
222                                             <th class="nosort">Renew</th>
223                                             [% UNLESS ( nofines ) %]
224                                                 <th>Fines</th>
225                                             [% END %]
226                                         </tr>
227                                     </thead>
228                                     <tbody>
229                                         [% FOREACH ISSUE IN ISSUES %]
230                                             <tr>
231                                                 <td>[% ISSUE.issuedate %]</td>
232                                                 <td>
233                                                     [% UNLESS ( noitemlinks ) %]
234                                                         <a href="/cgi-bin/koha/opac-detail.pl?bib=[% ISSUE.  biblionumber %]">[% ISSUE.title |html %]</a>
235                                                     [% ELSE %]
236                                                         <strong>[% ISSUE.title |html %]</strong>
237                                                     [% END %]
238                                                     <span class="item-details">[% ISSUE.author %]</span>
239                                                     ([% ISSUE.barcode %])
240                                                 </td>
241                                                 <td>[% ISSUE.itemcallnumber %]</td>
242                                                 [% IF ( ISSUE.overdue ) %]
243                                                     <td class="overdue"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
244                                                 [% ELSE   %]
245                                                     <td><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
246                                                 [% END %]
247                                                 <td>
248                                                     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
249                                                         <input type="hidden" name="patronid" value="[% patronid %]" />
250                                                         <input type="hidden" name="barcode" value="[% ISSUE.barcode %]" />
251                                                         [% IF ( ISSUE.norenew ) %]
252                                                             [% IF ( AllowSelfCheckReturns ) %]
253                                                                 <input type="submit" value="Check in item" name="confirm" class="btn return" />
254                                                                 <input type="hidden" name="op" value="returnbook" />
255                                                                 <input type="hidden" name="confirmed" value=""  />
256                                                             [% ELSE %]
257                                                                 <span>No renewals allowed</span>
258                                                             [% END %]
259                                                         [% ELSE %]
260                                                             <input type="hidden" name="op" value="checkout" />
261                                                             <input type="hidden" name="confirmed" value="1" />
262                                                             [% UNLESS ( ISSUE.renew ) %]
263                                                                 <input type="submit" value="Renew item"  name="confirm  " class="btn renew" />
264                                                             [% ELSE %]
265                                                                 <input type="submit" value="Renew item" class="btn renew" />
266                                                             [% END %]
267                                                         [% END %]
268                                                     </form>
269                                                 </td>
270                                                 [% UNLESS ( nofines ) %]
271                                                     <td>
272                                                         [% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]
273                                                     </td>
274                                                 [% END %]
275                                             </tr>
276                                         [% END # / FOREACH ISSUE %]
277                                     </tbody>
278                                 </table>
279                             [% ELSE %]
280                                 <h3>You currently have nothing checked out.</h3>
281                             [% END # / IF issues_count %]
282                         </div> <!-- / #borrowerdetails -->
283                         [% ELSE # IF validuser %]
284                             <div class="sco_entry" >
285                                 <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
286                                     <fieldset class="checkout brief">
287                                         [% IF ( authbylogin ) %]
288                                             <legend>Log in to your account</legend>
289                                             <label for="patronlogin">Login:</label>
290                                             <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
291                                             <label for="patronpw">Password:</label>
292                                             <input type="password" id="patronpw" size="20" name="patronpw" />
293                                             <fieldset class="action">
294                                                 <button type="submit" class="btn">Log in</button>
295                                             </fieldset>
296                                         [% ELSE %]
297                                             <div class="input-append">
298                                                 <label for="patronid">Please enter your card number:</label>
299                                                 <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
300                                                 <button type="submit" class="btn">Submit</button>
301                                             </div>
302                                         [% END # / IF authbylogin %]
303
304                                         [% FOREACH INPUT IN INPUTS %]
305                                             <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">
306                                         [% END %]
307                                         <input type="hidden" name="op" value="login" />
308                                     </fieldset>
309                                 </form>
310                             </div> <!-- / .sco_entry -->
311                         [% END # / IF validuser %]
312                     [% END # / UNLESS ( hide_main %]
313
314                 </div> <!-- / .span12 -->
315             </div> <!-- / .row-fluid -->
316         </div> <!-- / .container-fluid -->
317     </div> <!-- / .main -->
318
319 [% INCLUDE 'opac-bottom.inc' %]
320 [% BLOCK jsinclude %]
321     [% INCLUDE 'datatables.inc' %]
322     <script type="text/javascript">
323         //<![CDATA[
324         function mungeHistory() {
325             // prevent back button from allowing form resubmission
326             if (history && history.pushState) {
327                 history.replaceState(null, document.title, window.location.href);
328             }
329         }
330         var mainTimeout;
331         function sco_init() {
332             mainTimeout = setTimeout(function() {
333                 location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
334             }, [% SelfCheckTimeout %]);
335         }
336         function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
337             // alert("dofocus called");
338             $(".focus:last").select();
339         }
340         var slip_re = /slip/;
341         function printx_window(print_type) {
342           var handler = print_type.match(slip_re) ? "printslip" : "moremember";
343
344           return false;
345         }
346         function checkout_confirm(patronid) {
347             var   barcode = $("#barcode").val();
348             // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
349             if (! barcode) { dofocus(); return false; }    // no barcode
350             if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode
351                 window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
352                 return false;
353             }
354             return true;
355         }
356
357         $(document).ready(function() {
358             dofocus();
359             [% IF ( patronid ) %]sco_init();[% END %]
360             $("#loanTable").dataTable($.extend(true, {}, dataTablesDefaults, {
361                 "aaSorting": [ 0 ],
362                 "aoColumnDefs": [
363                     { "aTargets": [ "nosort" ], "bSortable": false, "bSearchable": false },
364                     { "aTargets": [ "noshow" ], "bVisible": false, "bSearchable": false },
365                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
366                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
367                 ]
368             }));
369
370             $("#logout_form").submit(function(){
371                 clearTimeout(mainTimeout);
372                 [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
373                     if(confirm(_("Would you like to print a receipt?"))){
374                         window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
375                     }
376                 [% END %]
377
378                 return true;
379             });
380     });
381     //]]>
382     </script>
383
384     [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
385 [% END %]