adf6dc1cb4e0135879d15c5ee47dc0e73f96dde1
[koha_gimpoz] / koha-tmpl / opac-tmpl / prog / en / modules / sco / sco-main.tt
1 [% use KohaDates %]
2
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="[% themelang %]/includes/favicon.ico" type="image/x-icon" />
7 <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
9 <script type="text/javascript">//<![CDATA[
10 function sco_init(valid_session) {
11     if (valid_session == 1) {
12         setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",[% SelfCheckTimeout %]); 
13     }
14 }
15 function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
16     // alert("dofocus called");
17     $(".focus:last").select();
18 }
19
20 function checkout_confirm(patronid) {
21     var   barcode = $("#barcode").val();
22     // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
23     if (! barcode) { dofocus(); return false; }    // no barcode
24     if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode 
25         window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
26         return false;
27     }
28     if (this.valid_session == 0) {
29         // probably should force logout like above ? --atz 6/09
30         if (confirm('Session has expired.  Click \'OK\' to continue processing this item.  Click Cancel if you are not ' + patronid)){
31             this.op.value='logout';
32             this.patronid.value='';
33         }
34     }
35     return true;
36 }
37
38 $.tablesorter.addParser({
39     id: 'articles',
40     is: function(s) {return false;  },
41     format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
42     type: 'text'
43 });
44
45 $(document).ready(function() {
46     [% IF ( patronid ) %] sco_init(1);
47     [% ELSIF ( timedout ) %] sco_init(1);
48     [% END %]
49     $("#loanTable").tablesorter({
50         [% IF ( dateformat_metric ) %]
51             dateFormat: 'uk',
52         [% END %]
53         widgets:   ['zebra'],
54         sortList:  [[2, 1], [0, 0]],
55         headers: {
56             0: { sorter: 'articles' },
57             3: { sorter: false }
58             [% UNLESS ( nofines ) %], 4: { sorter: false }[% END %]
59         }
60     });
61 });
62 //]]>
63 </script>
64 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" />
65 </head>
66 <body onload="dofocus();">
67
68 <div id="doc" class="yui-t7">
69
70 <div id="masthead"><h1>[% LibraryName %] Self checkout system</h1></div>
71 <div id="bd">
72
73 [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
74 <div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, This item cannot be checked out at this station.  </p>
75 [% IF ( title ) %]<p>Title: <em>[% title |html %]</em> </p>[% END %]
76 <p>
77    [% IF ( circ_error_UNKNOWN_BARCODE ) %]
78     <em>MESSAGE 1:</em> The system does not recognize this barcode.
79    [% ELSIF ( circ_error_TOO_MANY ) %]
80     <em>MESSAGE 2:</em> You have borrowed too many items and can't check out any more.
81    [% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
82     <em>MESSAGE 3:</em> This item is checked out to someone else.
83    [% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
84     <em>MESSAGE 4:</em> You cannot renew this item again.
85    [% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
86     <em>MESSAGE 5:</em> This item is not for loan.
87    [% ELSIF ( circ_error_DEBT ) %]
88     <em>MESSAGE 6:</em> You owe the library [% amount %] and cannot borrow.
89    [% ELSIF ( circ_error_WTHDRAWN ) %]
90     <em>MESSAGE 7:</em> This item has been withdrawn from the collection.
91    [% ELSIF ( circ_error_RESTRICTED ) %]
92     <em>MESSAGE 8:</em>
93    [% ELSIF ( circ_error_RESERVED ) %]
94     <em>MESSAGE 9:</em> This item is reserved for another patron.
95    [% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
96     <em>MESSAGE 10:</em>
97    [% ELSIF ( circ_error_EXPIRED ) %]
98     <em>MESSAGE 11:</em> Your account has expired.
99    [% ELSIF ( circ_error_DEBARRED ) %]
100     <em>MESSAGE 12:</em> Your account has been suspended.
101    [% ELSIF ( circ_error_CARD_LOST ) %]
102     <em>MESSAGE 13:</em> This card has been declared lost.
103    [% ELSIF ( circ_error_GNA ) %]
104     <em>MESSAGE 14:</em>
105    [% ELSIF ( circ_error_INVALID_DATE ) %]
106     <em>MESSAGE 15:</em>
107    [% END %]
108    Please see a member of the library staff.
109 </p>
110 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" method="post">
111 <input type="hidden" name="op" value="login" />
112 <input type="hidden" name="patronid" value="[% patronid %]" />
113 [% IF ( returnitem ) %]
114 [% IF ( AllowSelfCheckReturns ) %]
115 <input type="hidden" name="barcode" value="[% barcode %]" />
116 <input type="button" name="returnbook" value="Return this item" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
117 [% END %]
118 [% END %]
119 <input type="submit" name= "confirm" value="Return to Account Summary" class="back focus" />
120 </form>
121 [% END %]
122 [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
123 <div class="dialog alert"><h3>Please confirm the checkout:</h3>
124 <p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
125
126 <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" method="post">
127 <input type="hidden" name="op" value="checkout" />
128 <input type="hidden" name="patronid" value="[% patronid %]" />
129 <input type="hidden" name="barcode" value="[% barcode %]" />
130 <input type="hidden" name="confirmed" value="" />
131 [% IF ( renew ) %]
132 [% IF ( AllowSelfCheckReturns ) %]
133 <input type="button" value="Return item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
134 [% END %]
135 [% END %]
136 [% UNLESS ( renew ) %]<input type="button" value="Renew item" name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
137 [% ELSE %]<input type="button" value="Renew item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
138 <input type="button" value="Cancel" class="cancel" onclick="this.form.op.value='';this.form.submit();return true;"  />
139 </form>
140 </div>
141 [% END %]
142
143 [% IF ( nopermission ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access denied</h3>
144 Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem. </div>
145 [% END %]
146 [% IF ( timed_out ) %]<!-- This is what is displayed if login has timed out -->
147 <div class="dialog alert"><h3>Session timed out</h3>Sorry, your session has timed out, please log in again.</div>[% END %]
148 [% IF ( 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>[% END %]
149 [% IF ( invalid_username_or_password ) %]
150 <!-- 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>[% END %]
151
152
153 [% UNLESS ( hide_main ) %]
154         <div class="sco_head">
155         [% UNLESS ( validuser ) %] 
156     <h3>Self checkout</h3>
157         [% END %]
158
159         <div id="checkouthelp">
160                 <a href="/cgi-bin/koha/sco/help.pl">HELP</a> with the self checkout system
161         </div>
162
163         [% IF ( patronid ) %]
164         [% IF ( validuser ) %]
165     <h3 class="warning">You are logged in as [% borrowername %].</h3>
166         [% END %]
167         </div>
168         [% IF ( nouser ) %]
169         <div class="dialog alert"><h4>Sorry</h4><p>The userid <strong>[% patronid %]</strong> was not found in the database.  Please try again.</p></div>
170         <br />
171         [% END %]
172         [% END %]
173
174         [% IF ( timedout ) %]
175         <div class="dialog message"><h4>Sorry</h4><p>Your session has timed out due to inactivity.  Please sign in.</p></div>
176         <br />
177         [% END %]
178         [% IF ( validuser ) %]
179   [% IF ( display_patron_image ) %]<div class="yui-ge"><div class="yui-u first">[% END %]
180         <div id="newcheckout" class="sco_entry">
181         <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
182         <fieldset><legend> Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
183         <label for="barcode">Scan a new item or enter its barcode:</label>
184         <input id="barcode" name="barcode" size="20" class="focus" />
185         <input type="hidden" name="op" value="checkout" />
186         <input type="hidden" name="patronid" value="[% patronid %]" />
187         <input type="hidden" name="valid_session" value="1" />
188         <input type="submit" value="Submit" class="submit" /></fieldset>
189         </form>
190         <div><form method="post" action="/cgi-bin/koha/sco/sco-main.pl?op=logout" ><input type="submit" value="Finish" class="finish" /></form></div>
191         </div> <!-- sco_entry --> <!-- newcheckout -->
192   [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
193   [% IF ( display_patron_image ) %]
194   <div class="yui-u">
195         <img src="/cgi-bin/koha/sco/sco-patron-image.pl?cardnumber=[% cardnumber %]" alt="" />
196   </div>
197   [% END %]
198   </div> <!-- /yui-ge -->
199   <div class="yui-g">
200         <div id="borrowerdetails">
201         [% IF ( issues_count ) %]
202         <table id="loanTable"><caption>Checkouts for [% borrowername %] <span class="count">([% issues_count %] total)</span></caption>
203         <!-- ISSUES TABLE ROWS -->
204     <thead>
205         <tr><th>Title</th><th>Call no.</th><th>Due</th><th>Renew</th>[% UNLESS ( nofines ) %]<th>Fines</th>[% END %]</tr>
206     </thead>
207
208     <tbody>
209         [% FOREACH ISSUE IN ISSUES %]
210         [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
211     <!-- FIXME: yet another jacket image breakpoint -->
212         <td>[% UNLESS ( ISSUE.noitemlinks ) %]<a href="/cgi-bin/koha/opac-detail.pl?bib=[% ISSUE.biblionumber %]">[% ISSUE.title |html %]</a>[% ELSE %]<strong>[% ISSUE.title |html %]</strong>[% END %]<span class="item-details">
213         [% ISSUE.author %]</span> ([% ISSUE.barcode %])</td>
214         <td>[% ISSUE.itemcallnumber %]</td>
215         [% IF ( ISSUE.overdue ) %]<td class="overdue">[% ISSUE.date_due | $KohaDates %]</td>[% ELSE %]<td>[% ISSUE.date_due | $KohaDates %]</td>[% END %]
216         <td>
217     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
218     <input type="hidden" name="op" value="checkout" />
219     <input type="hidden" name="patronid" value="[% patronid %]" />
220     <input type="hidden" name="barcode" value="[% ISSUE.barcode %]" />
221     <input type="hidden" name="confirmed" value=""  />
222         [% IF ( ISSUE.norenew ) %]
223           [% IF ( ISSUE.AllowSelfCheckReturns ) %]
224           <input type="button" value="Return Item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
225           [% ELSE %]
226           <span>No renewals allowed</span>
227           [% END %]
228         [% ELSE %]
229             [% UNLESS ( ISSUE.renew ) %]<input type="button" value="Renew Item"  name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
230             [% ELSE %]<input type="button" value="Renew Item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
231         [% END %]
232     </form>
233         </td>
234         [% UNLESS ( nofines ) %]<td>[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]</td>[% END %]</tr>
235         [% END %]
236     </tbody>
237
238         </table>
239         [% ELSE %]
240         <h3>You currently have nothing checked out.</h3>
241         [% END %]
242 </div> <!-- /yui-g -->
243         [% ELSE %]<!-- not validuser -->
244         <div class="sco_entry" >
245         <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
246        [% IF ( authbylogin ) %]
247         <fieldset class="checkout">
248        <legend>Please login with your username and password</legend>
249        <label for="patronlogin">Username:</label>
250         <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
251        <label for="patronpw">Password:</label>
252         <input type="password" id="patronpw" size="20" name="patronpw" />
253        [% ELSE %]
254         <fieldset class="checkout"><label for="patronid">Please enter your card number:</label> 
255         <input type="text" id="patronid" class="focus" size="20" name="patronid" />
256         [% END %]
257
258         [% FOREACH INPUT IN INPUTS %]<input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">[% END %]
259         <input type="hidden" name="op" value="login" />
260         <input type="submit" value="Submit" class="submit" /></fieldset></form>
261         </div>
262         [% END %]
263 [% END %] <!-- ( / hide main) -->       
264         
265         </div>
266 </div>
267 [% INCLUDE 'opac-bottom.inc' %]