updated the default print template to show library hours and address
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 16:20:16 +0000 (16:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 16:20:16 +0000 (16:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10401 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/extras/selfcheck/selfcheck.js
Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
Open-ILS/web/opac/locale/en-US/opac.dtd

index 9455c05..fae706a 100644 (file)
@@ -34,6 +34,8 @@ var scanTimeout = 800;
 var scanTimeoutId;
 var patronBarcodeRegex;
 var orgUnit;
+var orgUnitAddress;
+var orgUnitHours;
 
 
 function selfckInit() {
@@ -43,6 +45,7 @@ function selfckInit() {
     selfckSetupPrinter();
 
     orgUnit = findOrgUnitSN(cgi.param('l')) || globalOrgTree;
+    selfckFetchOrgDetails();
 
     var t = fetchOrgSettingDefault(orgUnit.id(), 'circ.selfcheck.patron_login_timeout');
     patronTimeout = (t) ? parseInt(t) * 1000 : patronTimeout;
@@ -82,6 +85,16 @@ function selfckInit() {
     
 }
 
+function selfckFetchOrgDetails() {
+    var hreq = new Request('open-ils.actor:open-ils.actor.org_unit.hours_of_operation.retrieve', G.user.session, orgUnit.id());
+    hreq.callback(function(r) { orgUnitHours = r.getResultObject(); });
+    hreq.send();
+
+    var areq = new Request('open-ils.actor:open-ils.actor.org_unit.address.retrieve', orgUnit.mailing_address());
+    areq.callback(function(r) { orgUnitAddress = r.getResultObject(); });
+    areq.send();
+}
+
 function selfckSetupPrinter() {
     try { // Mozilla only
                netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
@@ -379,8 +392,23 @@ function selfckRenew() {
   */
 function selfckPrint() {
     for(var x in successfulItems) { // make sure we've checked out at least one item
-        appendClear($('selfck-print-lib-name'), text(orgUnit.name()));
         appendClear($('selfck-print-date'), text(new Date().toLocaleString()));
+        appendClear($('selfck-print-lib-name'), text(orgUnit.name()));
+        if(orgUnitAddress) {
+            appendClear($('selfck-print-lib-addr-street'), text(orgUnitAddress.street1()+' '+orgUnitAddress.street2()));
+            appendClear($('selfck-print-lib-addr-city'), text(orgUnitAddress.city()));
+            appendClear($('selfck-print-lib-addr-state'), text(orgUnitAddress.state()));
+            appendClear($('selfck-print-lib-addr-post-code'), text(orgUnitAddress.post_code()));
+        }
+        appendClear($('selfck-print-lname'), text(patron.family_name()));
+        appendClear($('selfck-print-fname'), text(patron.first_given_name()));
+        appendClear($('selfck-print-lib-phone'), text(orgUnit.phone()));
+        if(orgUnitHours) {
+            for(var i in [0, 1, 2, 3, 4, 5, 6]) {
+                appendClear($('selfck-print-dow_'+i+'_open'), text(orgUnitHours['dow_'+i+'_open']()));
+                appendClear($('selfck-print-dow_'+i+'_close'), text(orgUnitHours['dow_'+i+'_close']()));
+            }
+        }
         window.print();
         return;
     }
index b5034e4..e658ae9 100644 (file)
                     <span id='selfck-print-lib-addr-state'/> 
                     <span id='selfck-print-lib-addr-post-code'/>
                 </div>
-                <div><span id='selfck-print-lname'/> <span id='selfck-print-fname'/></div>
-                You checked out the following items:
+                <br/>
+                <div><span id='selfck-print-lname'/>, <span id='selfck-print-fname'/></div>
+                &selfck.items_out;
                 <ol id='selfck-print-items-list'>
                     <li name='selfck-print-items-template'>
                         <div name='title'/>
-                        Barcode: <span name='barcode'/>
-                        Due Date: <span name='due_date'/>
+                        &selfck.barcode;: <span name='barcode'/>
+                        &selfck.due_date;: <span name='due_date'/>
                     </li>
                 </ol>
+                <br/>
+                <div>&selfck.org_phone; <span id='selfck-print-lib-phone'/></div>
+                <br/>
+                <div>
+                    <div>&selfck.org_hours;</div>
+                    <table>
+                        <tr><td>&selfck.day0;</td><td id='selfck-print-dow_0_open'/><td id='selfck-print-dow_0_close'/></tr>
+                        <tr><td>&selfck.day1;</td><td id='selfck-print-dow_1_open'/><td id='selfck-print-dow_1_close'/></tr>
+                        <tr><td>&selfck.day2;</td><td id='selfck-print-dow_2_open'/><td id='selfck-print-dow_2_close'/></tr>
+                        <tr><td>&selfck.day3;</td><td id='selfck-print-dow_3_open'/><td id='selfck-print-dow_3_close'/></tr>
+                        <tr><td>&selfck.day4;</td><td id='selfck-print-dow_4_open'/><td id='selfck-print-dow_4_close'/></tr>
+                        <tr><td>&selfck.day5;</td><td id='selfck-print-dow_5_open'/><td id='selfck-print-dow_5_close'/></tr>
+                        <tr><td>&selfck.day6;</td><td id='selfck-print-dow_6_open'/><td id='selfck-print-dow_6_close'/></tr>
+                    </table>
+                </div>
             </div>
         </div>
     </body>
index 862543a..358dd08 100644 (file)
@@ -667,4 +667,16 @@ Ensure Caps-Lock is off and try again or contact your local library.">
 <!ENTITY selfck.event.patron_not_found "The patron barcode was not found">
 <!ENTITY selfck.event.item_noncat "The requested item is not in the catalog">
 <!ENTITY selfck.event.item_nocirc "The requested item is not allowed to circulate">
+<!ENTITY selfck.items_out "You checked out the following items">
+<!ENTITY selfck.org_hours "Hours of Operation">
+<!ENTITY selfck.org_phone "Library Phone Number">
+<!ENTITY selfck.due_date "Due Date">
+<!ENTITY selfck.barcode "Barcode">
+<!ENTITY selfck.day0 "Monday">
+<!ENTITY selfck.day1 "Tuesday">
+<!ENTITY selfck.day2 "Wednesday">
+<!ENTITY selfck.day3 "Thursday">
+<!ENTITY selfck.day4 "Friday">
+<!ENTITY selfck.day5 "Saturday">
+<!ENTITY selfck.day6 "Sunday">