Bug 9052 - followup: fix the YUI CSS locations for SCO
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / sco / sco-main.tt
index f7d2c4f..3fdf2f4 100644 (file)
@@ -1,8 +1,14 @@
-[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self Checkout </title>
+[% USE KohaDates %]
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
 <link rel="shortcut icon" href="[% themelang %]/includes/favicon.ico" type="image/x-icon" />
+<!-- yui js -->
+<script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
+<script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
+<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">//<![CDATA[
 function sco_init(valid_session) {
@@ -14,7 +20,12 @@ function dofocus() {    // named function req'd for body onload event by some FF
     // alert("dofocus called");
     $(".focus:last").select();
 }
+var slip_re = /slip/;
+function printx_window(print_type) {
+  var handler = print_type.match(slip_re) ? "printslip" : "moremember";
 
+  return false;
+}
 function checkout_confirm(patronid) {
     var   barcode = $("#barcode").val();
     // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
@@ -33,6 +44,35 @@ function checkout_confirm(patronid) {
     return true;
 }
 
+// build Change Language menus
+YAHOO.util.Event.onContentReady("changelanguage", function () {
+  $(".sublangs").each(function(){
+    var menuid = $(this).attr("id");
+    var menuid = menuid.replace("show","");
+
+    var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
+    function positionoMenu() {
+      oMenu.align("bl", "tl");
+    }
+    oMenu.subscribe("beforeShow", function () {
+    if (this.getRoot() == this) {
+      positionoMenu();
+    }
+    });
+    oMenu.render();
+    oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
+    function onYahooClick(p_oEvent) {
+      // Position and display the menu
+      positionoMenu();
+      oMenu.show();
+      // Stop propagation and prevent the default "click" behavior
+      YAHOO.util.Event.stopEvent(p_oEvent);
+    }
+    YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
+    YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
+  });
+});
+
 $.tablesorter.addParser({
     id: 'articles',
     is: function(s) {return false;  },
@@ -58,14 +98,27 @@ $(document).ready(function() {
     });
 });
 //]]>
+$(document).ready(function(){
+    $("#logout_form").submit(function(){
+        if(confirm("Would you like to print a receipt?")){
+            window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
+        }
+        return true;
+    });
+});
 </script>
+[% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %]
+
+
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" />
+[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
+
 </head>
 <body onload="dofocus();">
 
 <div id="doc" class="yui-t7">
 
-<div id="masthead"><h1>[% LibraryName %] Self Checkout System</h1></div>
+<div id="masthead"><h1>[% LibraryName %] Self checkout system</h1></div>
 <div id="bd">
 
 [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
@@ -128,22 +181,22 @@ $(document).ready(function() {
 <input type="hidden" name="confirmed" value="" />
 [% IF ( renew ) %]
 [% IF ( AllowSelfCheckReturns ) %]
-<input type="button" value="Return Item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
+<input type="button" value="Return item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
 [% END %]
 [% END %]
-[% UNLESS ( renew ) %]<input type="button" value="Renew Item" name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
-[% ELSE %]<input type="button" value="Renew Item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
+[% UNLESS ( renew ) %]<input type="button" value="Renew item" name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
+[% ELSE %]<input type="button" value="Renew item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
 <input type="button" value="Cancel" class="cancel" onclick="this.form.op.value='';this.form.submit();return true;"  />
 </form>
 </div>
 [% END %]
 
-[% IF ( nopermission ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access Denied</h3>
-Sorry, This Self-Checkout Station has lost authentication.  Please contact the administrator to resolve this problem. </div>
+[% IF ( nopermission ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access denied</h3>
+Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem. </div>
 [% END %]
 [% IF ( timed_out ) %]<!-- This is what is displayed if login has timed out -->
 <div class="dialog alert"><h3>Session timed out</h3>Sorry, your session has timed out, please log in again.</div>[% END %]
-[% 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 %]
+[% 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 %]
 [% IF ( invalid_username_or_password ) %]
 <!-- 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,7 +204,7 @@ Sorry, This Self-Checkout Station has lost authentication.  Please contact the a
 [% UNLESS ( hide_main ) %]
        <div class="sco_head">
        [% UNLESS ( validuser ) %] 
-       <h3>Self Checkout</h3>
+    <h3>Self checkout</h3>
        [% END %]
 
        <div id="checkouthelp">
@@ -185,7 +238,7 @@ Sorry, This Self-Checkout Station has lost authentication.  Please contact the a
        <input type="hidden" name="valid_session" value="1" />
        <input type="submit" value="Submit" class="submit" /></fieldset>
        </form>
-       <div><form method="post" action="/cgi-bin/koha/sco/sco-main.pl?op=logout" ><input type="submit" value="Finish" class="finish" /></form></div>
+    <div><form method="post" action="#" id="logout_form"><input type="submit" value="Finish" class="finish" /></form></div>
        </div> <!-- sco_entry --> <!-- newcheckout -->
   [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
   [% IF ( display_patron_image ) %]
@@ -200,7 +253,7 @@ Sorry, This Self-Checkout Station has lost authentication.  Please contact the a
        <table id="loanTable"><caption>Checkouts for [% borrowername %] <span class="count">([% issues_count %] total)</span></caption>
        <!-- ISSUES TABLE ROWS -->
     <thead>
-       <tr><th>Title</th><th>Call No.</th><th>Due</th><th>Renew</th>[% UNLESS ( nofines ) %]<th>Fines</th>[% END %]</tr>
+        <tr><th>Title</th><th>Call no.</th><th>Due</th><th>Renew</th>[% UNLESS ( nofines ) %]<th>Fines</th>[% END %]</tr>
     </thead>
 
     <tbody>
@@ -210,7 +263,7 @@ Sorry, This Self-Checkout Station has lost authentication.  Please contact the a
        <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">
        [% ISSUE.author %]</span> ([% ISSUE.barcode %])</td>
        <td>[% ISSUE.itemcallnumber %]</td>
-       [% IF ( ISSUE.overdue ) %]<td class="overdue">[% ISSUE.date_due_display %]</td>[% ELSE %]<td>[% ISSUE.date_due_display %]</td>[% END %]
+       [% IF ( ISSUE.overdue ) %]<td class="overdue">[% ISSUE.date_due | $KohaDates %]</td>[% ELSE %]<td>[% ISSUE.date_due | $KohaDates %]</td>[% END %]
        <td>
     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
     <input type="hidden" name="op" value="checkout" />