[open-ils-commits] r10400 - in branches/rel_1_2/Open-ILS/web/opac:
extras/selfcheck locale/en-US
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 21 12:20:15 EDT 2008
Author: erickson
Date: 2008-08-21 12:20:12 -0400 (Thu, 21 Aug 2008)
New Revision: 10400
Modified:
branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd
Log:
updated the default print template to show library hours and address
Modified: branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.js
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2008-08-21 16:19:34 UTC (rev 10399)
+++ branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.js 2008-08-21 16:20:12 UTC (rev 10400)
@@ -34,6 +34,8 @@
var scanTimeoutId;
var patronBarcodeRegex;
var orgUnit;
+var orgUnitAddress;
+var orgUnitHours;
function selfckInit() {
@@ -43,6 +45,7 @@
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 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 selfckPrint() {
for(var x in successfulItems) { // make sure we've checked out at least one item
+ appendClear($('selfck-print-date'), text(new Date().toLocaleString()));
appendClear($('selfck-print-lib-name'), text(orgUnit.name()));
- appendClear($('selfck-print-date'), text(new Date().toLocaleString()));
+ 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;
}
Modified: branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2008-08-21 16:19:34 UTC (rev 10399)
+++ branches/rel_1_2/Open-ILS/web/opac/extras/selfcheck/selfcheck.xml 2008-08-21 16:20:12 UTC (rev 10400)
@@ -164,15 +164,31 @@
<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>
Modified: branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-08-21 16:19:34 UTC (rev 10399)
+++ branches/rel_1_2/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-08-21 16:20:12 UTC (rev 10400)
@@ -667,4 +667,16 @@
<!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">
More information about the open-ils-commits
mailing list