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