bug 3436: add patron images to web self-check
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / sco / sco-main.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryName" --> &rsaquo; Self Checkout </title>
2 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
3 <meta name="generator" content="Koha <!-- TMPL_VAR NAME="Version" -->" /> <!-- leave this for stats -->
4 <link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
5 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/jquery.js"></script>
6 <script type="text/javascript">//<![CDATA[
7 function sco_init(valid_session) {
8     if (valid_session == 1) {
9         setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",120000); // TODO: syspref for timeout
10     }
11 }
12 function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
13     // alert("dofocus called");
14     $(".focus:last").select();
15 }
16
17 function checkout_confirm(patronid) {
18     var   barcode = $("#barcode").val();
19     // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
20     if (! barcode) { dofocus(); return false; }    // no barcode
21     if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode 
22         window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
23         return false;
24     }
25     if (this.valid_session == 0) {
26         // probably should force logout like above ? --atz 6/09
27         if (confirm('Session has expired.  Click \'OK\' to continue processing this item.  Click Cancel if you are not ' + patronid)){
28             this.op.value='logout';
29             this.patronid.value='';
30         }
31     }
32     return true;
33 }
34
35 $(document).ready(function() {
36     <!-- TMPL_IF    NAME="patronid" --> sco_init(1);
37     <!-- TMPL_ELSIF NAME="timedout" --> sco_init(1);
38     <!-- /TMPL_IF -->
39 });
40 //]]>
41 </script>
42 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/css/sco.css" />
43 </head>
44 <body onload="dofocus();">
45
46 <div id="doc" class="yui-t7">
47
48 <div id="masthead"><h1><!-- TMPL_VAR NAME="LibraryName" --> Self Checkout System</h1></div>
49 <div id="bd">
50     <div class="yui-g">
51
52 <!-- TMPL_IF NAME="impossible" --><!-- We tried to issue, but failed. -->
53 <div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, This item cannot be checked out at this station.  </p>
54 <!-- TMPL_IF NAME="title" --><p>Title: <em><!-- TMPL_VAR NAME="title" escape="html" --></em> </p><!-- /TMPL_IF -->
55 <p><em>Error type:</em> <!-- TMPL_VAR NAME="impossible" --></p>
56 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" method="post">
57 <input type="hidden" name="op" value="login" />
58 <input type="hidden" name="patronid" value="<!-- TMPL_VAR NAME="patronid" -->" />
59 <!-- TMPL_IF NAME="returnitem" -->
60 <input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
61 <input type="button" name="returnbook" value="Return this item" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
62 <!-- /TMPL_IF -->
63 <input type="submit" name= "confirm" value="Return to Account Summary" class="back focus" />
64 </form>
65 <!-- /TMPL_IF -->
66 <!-- TMPL_IF NAME="confirm" --><!-- We need to confirm the issue.. -->
67 <div class="dialog alert"><h3>Please confirm the checkout:</h3>
68 <p><!-- TMPL_IF NAME="confirm_renew_issue" -->This item is already checked out to you.  Return it?<!-- /TMPL_IF --></p>
69
70 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" method="post">
71 <input type="hidden" name="op" value="checkout" />
72 <input type="hidden" name="patronid" value="<!-- TMPL_VAR NAME="patronid" -->" />
73 <input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
74 <input type="hidden" name="confirmed" value="" />
75 <!-- TMPL_IF NAME="renew" -->
76 <input type="button" value="Return Item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
77 <!-- /TMPL_IF -->
78 <input type="button" value="Renew Item" <!-- TMPL_UNLESS NAME="renew" --> name="confirm"<!-- /TMPL_UNLESS --> class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
79 <input type="button" value="Cancel" class="cancel" onclick="this.form.op.value='';this.form.submit();return true;"  />
80 </form>
81 </div>
82 <!-- /TMPL_IF -->
83
84 <!-- TMPL_IF NAME="nopermission" --><!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access Denied</h3>
85 Sorry, This Self-Checkout Station has lost authentication.  Please contact the administrator to resolve this problem. </div>
86 <!-- /TMPL_IF -->
87 <!-- TMPL_IF NAME="timed_out" --><!-- This is what is displayed if login has timed out -->
88 <div class="dialog alert"><h3>Session timed out</h3>Sorry, your session has timed out, please log in again.</div><!-- /TMPL_IF -->
89 <!-- TMPL_IF NAME="different_ip" --><!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Session Lost</h3>You are accessing Self-Checkout from a different IP address! please log in again.</div><!-- /TMPL_IF -->
90 <!-- TMPL_IF NAME="invalid_username_or_password" -->
91 <!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Record not found</h3><p>Your userid was not found in the database.  Please try again.</p></div><!-- /TMPL_IF -->
92
93
94 <!-- TMPL_UNLESS NAME="hide_main" -->
95         <div class="sco_head">
96         <!-- TMPL_UNLESS NAME="validuser" --> 
97         <h3>Self Checkout</h3>
98         <!-- /TMPL_UNLESS -->
99
100         <div id="checkouthelp">
101                 <a href="/cgi-bin/koha/sco/help.pl">HELP</a> with the self checkout system
102         </div>
103
104         <!-- TMPL_IF NAME="patronid" -->
105         <!-- TMPL_IF NAME="validuser" -->
106         <h3 class="warning">You are logged in as <!-- TMPL_VAR NAME="borrowername" -->.</h3>
107     <!-- TMPL_IF NAME="display_patron_image" -->
108         <img src="/cgi-bin/koha/sco/sco-patron-image.pl?cardnumber=<!-- TMPL_VAR NAME="cardnumber" -->" alt="" />
109     <!-- /TMPL_IF -->
110         <!-- /TMPL_IF -->
111         </div>
112         <!-- TMPL_IF NAME="nouser" -->
113         <div class="error"><h4>Sorry</h4><p>The userid <strong><!-- TMPL_VAR NAME="patronid" --></strong> was not found in the database.  Please try again.</p></div>
114         <br />
115         <!-- /TMPL_IF -->
116         <!-- /TMPL_IF -->
117
118         <!-- TMPL_IF NAME="timedout" -->
119         <div class="error"><h4>Sorry</h4><p>Your session has timed out due to inactivity.  Please sign in.</p></div>
120         <br />
121         <!-- /TMPL_IF -->
122         <!-- TMPL_IF NAME="validuser" -->
123         <div id="newcheckout" class="sco_entry">
124         <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('<!-- TMPL_VAR NAME='patronid' -->');">
125         <fieldset><legend> Check out or return an item: </legend>
126         <label for="barcode">Scan a new item or enter its barcode:</label>
127         <input id="barcode" name="barcode" size="20" class="focus" />
128         <input type="hidden" name="op" value="checkout" />
129         <input type="hidden" name="patronid" value="<!-- TMPL_VAR name="patronid" -->" />
130         <input type="hidden" name="valid_session" value="1" />
131         <input type="submit" value="Submit" class="submit" /></fieldset>
132         </form>
133         <div><form method="post" action="/cgi-bin/koha/sco/sco-main.pl?op=logout" >Scan next item, or <input type="submit" value="Click here if done." class="finish" /></form></div>
134         </div> <!-- sco_entry --> <!-- newcheckout -->
135
136         <div id="borrowerdetails">
137         <!-- TMPL_IF NAME="issues_count" -->
138         <table><caption>Issues for <!-- TMPL_VAR NAME='borrowername' --> <span class="count">(<!-- TMPL_VAR NAME="issues_count" --> total)</span></caption>
139         <!-- ISSUES TABLE ROWS -->
140         <tr><th>Title</th><th>Call No.</th><th>Due</th><th>Renew</th><!-- TMPL_UNLESS NAME="nofines" --><th>Fines</th><!-- /TMPL_UNLESS --></tr>
141
142         <!-- TMPL_LOOP NAME="ISSUES" -->
143         <!-- TMPL_UNLESS name="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
144     <!-- FIXME: yet another jacket image breakpoint -->
145         <td><!-- TMPL_IF NAME="amazonimages" --> <!-- TMPL_IF NAME="isbn" --><a href="/cgi-bin/koha/opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><img src="http://images.amazon.com/images/P/<!-- TMPL_VAR name="isbn" -->.01.THUMBZZZ.jpg" alt="Book Cover Image" class="thumbnail" /></a><!-- /TMPL_IF --> <!-- /TMPL_IF --><!-- TMPL_UNLESS NAME="noitemlinks" --><a href="/cgi-bin/koha/opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --></a><!-- TMPL_ELSE --><strong><!-- TMPL_VAR NAME="title" escape="html" --></strong><!-- /TMPL_UNLESS --><span class="item-details">
146         <!-- TMPL_VAR NAME="author" --></span> (<!-- TMPL_VAR NAME="barcode" -->)</td>
147         <td><!-- TMPL_VAR NAME="itemcallnumber" DEFAULT="&nbsp;" --></td>
148         <!-- TMPL_IF NAME="overdue" --><td class="overdue"><!-- TMPL_VAR NAME="date_due" --></td><!-- TMPL_ELSE --><td><!-- TMPL_VAR NAME="date_due" --></td><!-- /TMPL_IF -->
149         <td>
150     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
151     <input type="hidden" name="op" value="checkout" />
152     <input type="hidden" name="patronid" value="<!-- TMPL_VAR NAME="patronid" -->" />
153     <input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
154     <input type="hidden" name="confirmed" value=""  />
155         <!-- TMPL_IF NAME="norenew" -->
156         <input type="button" value="Return Item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
157         <!-- TMPL_ELSE  -->
158         <input type="button" value="Renew Item" <!-- TMPL_UNLESS NAME="renew" --> name="confirm"<!-- /TMPL_UNLESS --> class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
159         <!-- /TMPL_IF -->
160     </form>
161         </td>
162         <!-- TMPL_UNLESS NAME="nofines" --><td><!-- TMPL_IF NAME="charges" -->Yes<!-- TMPL_ELSE -->No<!-- /TMPL_IF --></td><!-- /TMPL_UNLESS --></tr>
163         <!-- /TMPL_LOOP -->
164
165         </table>
166         <!-- TMPL_ELSE -->
167         <h3>You currently have nothing checked out.</h3>
168         <!-- /TMPL_IF -->
169
170         <!-- TMPL_ELSE --><!-- not validuser -->
171         <div class="sco_entry" >
172         <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
173         <fieldset class="checkout"><label for="patronid">Please enter your card number:</label> 
174         <input type="text" id="patronid" class="focus" size="20" name="patronid" />
175
176         <!-- TMPL_LOOP NAME="INPUTS" --><input type="hidden" name="<!-- TMPL_VAR NAME="name" -->" value="<!-- TMPL_VAR NAME="value" -->"><!-- /TMPL_LOOP -->
177         <input type="hidden" name="op" value="login" />
178         <input type="submit" value="Submit" class="submit" /></fieldset></form>
179         </div>
180         <!-- /TMPL_IF -->
181 <!-- /TMPL_UNLESS --> <!-- ( / hide main) -->   
182         
183         </div>
184         </div>
185 </div>
186 <!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->