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