print notice that member returned all books
[koha_fer] / koha-tmpl / opac-tmpl / prog / 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="[% interface %]/[% theme %]/images/favicon.ico" type="image/x-icon" />
7 <!-- yui js -->
8 <script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
9 <script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
10 <script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
11 <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
12 <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
13 <script type="text/javascript">//<![CDATA[
14     function _(s) { return s } // dummy function for gettext
15 //]]>
16 </script>
17 [% INCLUDE 'datatables.inc' %]
18 <script type="text/javascript">//<![CDATA[
19 function mungeHistory() {
20     // prevent back button from allowing form resubmission
21     if (history && history.pushState) {
22         history.replaceState(null, document.title, window.location.href);
23     }
24 }
25 var mainTimeout;
26 function sco_init() {
27     mainTimeout = setTimeout(function() {
28         location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout';
29     }, [% SelfCheckTimeout %]);
30 }
31 function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
32     // alert("dofocus called");
33     $(".focus:last").select();
34 }
35 var slip_re = /slip/;
36 function printx_window(print_type) {
37   var handler = print_type.match(slip_re) ? "printslip" : "moremember";
38
39   return false;
40 }
41 function checkout_confirm(patronid) {
42     var   barcode = $("#barcode").val();
43     // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
44     if (! barcode) { dofocus(); return false; }    // no barcode
45     if (barcode == "__KOHA_NEW_CIRC__") {   // magic barcode 
46         window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
47         return false;
48     }
49     return true;
50 }
51
52 // build Change Language menus
53 YAHOO.util.Event.onContentReady("changelanguage", function () {
54   $(".sublangs").each(function(){
55     var menuid = $(this).attr("id");
56     var menuid = menuid.replace("show","");
57
58     var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
59     function positionoMenu() {
60       oMenu.align("bl", "tl");
61     }
62     oMenu.subscribe("beforeShow", function () {
63     if (this.getRoot() == this) {
64       positionoMenu();
65     }
66     });
67     oMenu.render();
68     oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
69     function onYahooClick(p_oEvent) {
70       // Position and display the menu
71       positionoMenu();
72       oMenu.show();
73       // Stop propagation and prevent the default "click" behavior
74       YAHOO.util.Event.stopEvent(p_oEvent);
75     }
76     YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
77     YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
78   });
79 });
80
81 $(document).ready(function() {
82     dofocus();
83     [% IF ( patronid ) %]sco_init();[% END %]
84     $("#loanTable").dataTable($.extend(true, {}, dataTablesDefaults, {
85         "aaSorting": [ [2, "desc"], [0, "asc"] ],
86         "aoColumnDefs": [
87             { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
88             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
89             { "sType": "title-string", "aTargets" : [ "title-string" ] }
90         ]
91     }));
92     $("#logout_form").submit(function(){
93         clearTimeout(mainTimeout);
94         [% IF Koha.Preference('SelfCheckReceiptPrompt') %]
95             if( confirm("Would you like to print a receipt?") ) {
96                 window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
97             }
98         [% END %]
99         return true;
100     });
101 });
102 //]]>
103 </script>
104 [% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %]
105 [% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
106
107 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" />
108 [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
109 [% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
110
111 </head>
112 <body onload="dofocus();" onunload="mungeHistory();">
113
114 <div id="doc" class="yui-t7">
115
116 <div id="masthead"><h1>[% LibraryName %] Self checkout system</h1></div>
117 <div id="bd">
118
119 [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
120 <div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, this item cannot be checked out at this station.  </p>
121 [% IF ( title ) %]<p>Title: <em>[% title |html %]</em> </p>[% END %]
122 <p>
123    [% IF ( circ_error_UNKNOWN_BARCODE ) %]
124     <em>MESSAGE 1:</em> The system does not recognize this barcode.
125    [% ELSIF ( circ_error_max_loans_allowed ) %]
126     <em>MESSAGE 2:</em> You have checked out too many items and can't check out any more.
127    [% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
128     <em>MESSAGE 3:</em> This item is checked out to someone else.
129    [% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
130     <em>MESSAGE 4:</em> You cannot renew this item again.
131    [% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
132     <em>MESSAGE 5:</em> This item is not for loan.
133    [% ELSIF ( circ_error_DEBT ) %]
134     <em>MESSAGE 6:</em> You owe the library [% amount %] and cannot check out.
135    [% ELSIF ( circ_error_WTHDRAWN ) %]
136     <em>MESSAGE 7:</em> This item has been withdrawn from the collection.
137    [% ELSIF ( circ_error_RESTRICTED ) %]
138     <em>MESSAGE 8:</em>
139    [% ELSIF ( circ_error_RESERVED ) %]
140     <em>MESSAGE 9:</em> This item is on hold for another patron.
141    [% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
142     <em>MESSAGE 10:</em>
143    [% ELSIF ( circ_error_EXPIRED ) %]
144     <em>MESSAGE 11:</em> Your account has expired.
145    [% ELSIF ( circ_error_DEBARRED ) %]
146     <em>MESSAGE 12:</em> Your account has been suspended.
147    [% ELSIF ( circ_error_CARD_LOST ) %]
148     <em>MESSAGE 13:</em> This card has been declared lost.
149    [% ELSIF ( circ_error_GNA ) %]
150     <em>MESSAGE 14:</em>
151    [% ELSIF ( circ_error_INVALID_DATE ) %]
152     <em>MESSAGE 15:</em>
153    [% END %]
154    Please see a member of the library staff.
155 </p>
156 [% IF ( returnitem ) %]
157 [% IF ( AllowSelfCheckReturns ) %]
158 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
159     <input type="hidden" name="op" value="returnbook" />
160     <input type="hidden" name="patronid" value="[% patronid %]" />
161     <input type="hidden" name="barcode" value="[% barcode %]" />
162     <input type="submit" name="returnbook" value="Return this item" class="return" />
163 </form>
164 [% END %]
165 [% END %]
166 <form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
167     <input type="hidden" name="op" value="" />
168     <input type="hidden" name="patronid" value="[% patronid %]" />
169     <input type="hidden" name="barcode" value="[% barcode %]" />
170     <input type="submit" name= "confirm" value="Return to account summary" class="back focus" />
171 </form>
172 [% END %]
173 [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
174 <div class="dialog alert"><h3>Please confirm the checkout:</h3>
175 <p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
176
177 [% IF ( renew ) %]
178 [% IF ( AllowSelfCheckReturns ) %]
179     <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
180         <input type="hidden" name="op" value="returnbook" />
181         <input type="hidden" name="patronid" value="[% patronid %]" />
182         <input type="hidden" name="barcode" value="[% barcode %]" />
183         <input type="hidden" name="confirmed" value="" />
184         <input type="submit" value="Return item" name="confirm" class="return" />
185     </form>
186 [% END %]
187 [% END %]
188
189 [% UNLESS ( renew ) %]
190     <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
191         <input type="hidden" name="op" value="checkout" />
192         <input type="hidden" name="patronid" value="[% patronid %]" />
193         <input type="hidden" name="barcode" value="[% barcode %]" />
194         <input type="hidden" name="confirmed" value="1" />
195         <input type="submit" value="Renew item" name="confirm" class="renew" />
196       </form>
197 [% ELSE %]
198     <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
199         <input type="hidden" name="op" value="checkout" />
200         <input type="hidden" name="patronid" value="[% patronid %]" />
201         <input type="hidden" name="barcode" value="[% barcode %]" />
202         <input type="hidden" name="confirmed" value="1" />
203         <input type="submit" value="Renew item" class="renew" />
204     </form>
205 [% END %]
206     <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
207       <input type="hidden" name="op" value="" />
208       <input type="hidden" name="patronid" value="[% patronid %]" />
209       <input type="submit" value="Cancel" class="cancel" />
210     </form>
211 </div>
212 [% END %]
213
214 [% IF ( nopermission ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access denied</h3>
215 Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem. </div>
216 [% END %]
217 [% 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 %]
218 [% IF ( invalid_username_or_password ) %]
219 <!-- 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 %]
220
221
222 [% UNLESS ( hide_main ) %]
223         <div class="sco_head">
224         [% UNLESS ( validuser ) %] 
225     <h3>Self checkout</h3>
226         [% END %]
227
228         <div id="checkouthelp">
229                 <a href="/cgi-bin/koha/sco/help.pl">HELP</a> with the self checkout system
230         </div>
231
232         [% IF ( patronid ) %]
233         [% IF ( validuser ) %]
234     <h3 class="warning">You are logged in as [% borrowername %].</h3>
235         [% END %]
236         </div>
237         [% IF ( nouser ) %]
238         <div class="dialog alert"><h4>Sorry</h4><p>The userid <strong>[% patronid %]</strong> was not found in the database.  Please try again.</p></div>
239         <br />
240         [% END %]
241         [% END %]
242
243         [% IF ( validuser ) %]
244   [% IF ( display_patron_image ) %]<div class="yui-ge"><div class="yui-u first">[% END %]
245         <div id="newcheckout" class="sco_entry">
246         <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
247         <fieldset><legend> Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
248         <label for="barcode">Scan a new item or enter its barcode:</label>
249     <input id="barcode" name="barcode" size="20" class="focus" autocomplete="off" />
250         <input type="hidden" name="op" value="checkout" />
251         <input type="hidden" name="patronid" value="[% patronid %]" />
252         <input type="submit" value="Submit" class="submit" /></fieldset>
253         </form>
254     <div><form method="post" action="#" id="logout_form"><input type="submit" value="Finish" class="finish" /></form></div>
255         </div> <!-- sco_entry --> <!-- newcheckout -->
256   [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
257   [% IF ( display_patron_image ) %]
258   <div class="yui-u">
259         <img src="/cgi-bin/koha/sco/sco-patron-image.pl?borrowernumber=[% borrowernumber %]" alt="" />
260   </div>
261   [% END %]
262   </div> <!-- /yui-ge -->
263   <div class="yui-g">
264         <div id="borrowerdetails">
265         [% IF ( issues_count ) %]
266         <table id="loanTable"><caption>Checkouts for [% borrowername %] <span class="count">([% issues_count %] total)</span></caption>
267         <!-- ISSUES TABLE ROWS -->
268     <thead>
269         <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 class="nosort">Fines</th>[% END %]</tr>
270     </thead>
271
272     <tbody>
273         [% FOREACH ISSUE IN ISSUES %]
274         [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
275     <!-- FIXME: yet another jacket image breakpoint -->
276         <td>[% UNLESS ( 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">
277         [% ISSUE.author %]</span> ([% ISSUE.barcode %])</td>
278         <td>[% ISSUE.itemcallnumber %]</td>
279     [% IF ( ISSUE.overdue ) %]<td class="overdue"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>[% ELSE %]<td><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>[% END %]
280         <td>
281     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
282     <input type="hidden" name="patronid" value="[% patronid %]" />
283     <input type="hidden" name="barcode" value="[% ISSUE.barcode %]" />
284         [% IF ( ISSUE.norenew ) %]
285           [% IF ( AllowSelfCheckReturns ) %]
286             <input type="submit" value="Check in item" name="confirm" class="return" />
287             <input type="hidden" name="op" value="returnbook" />
288             <input type="hidden" name="confirmed" value=""  />
289           [% ELSE %]
290             <span>No renewals allowed</span>
291           [% END %]
292         [% ELSE %]
293             <input type="hidden" name="op" value="checkout" />
294             <input type="hidden" name="confirmed" value="1" />
295             [% UNLESS ( ISSUE.renew ) %]<input type="submit" value="Renew item"  name="confirm" class="renew" />
296             [% ELSE %]<input type="submit" value="Renew item" class="renew" />[% END %]
297         [% END %]
298     </form>
299         </td>
300         [% UNLESS ( nofines ) %]<td>[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]</td>[% END %]</tr>
301         [% END %]
302     </tbody>
303
304         </table>
305         [% ELSE %]
306         <h3>You currently have nothing checked out.</h3>
307         [% END %]
308 </div> <!-- /yui-g -->
309         [% ELSE %]<!-- not validuser -->
310         <div class="sco_entry" >
311         <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post">
312        [% IF ( authbylogin ) %]
313         <fieldset class="checkout">
314        <legend>Please login with your username and password</legend>
315        <label for="patronlogin">Username:</label>
316         <input type="text" id="patronlogin" class="focus" size="20" name="patronlogin" />
317        <label for="patronpw">Password:</label>
318         <input type="password" id="patronpw" size="20" name="patronpw" />
319        [% ELSE %]
320         <fieldset class="checkout"><label for="patronid">Please enter your card number:</label> 
321     <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
322         [% END %]
323
324         [% FOREACH INPUT IN INPUTS %]<input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">[% END %]
325         <input type="hidden" name="op" value="login" />
326         <input type="submit" value="Submit" class="submit" /></fieldset></form>
327         </div>
328         [% END %]
329 [% END %] <!-- ( / hide main) -->       
330         
331         </div>
332 </div>
333 [% INCLUDE 'opac-bottom.inc' %]