[open-ils-commits] r15060 - in trunk/Open-ILS/web: css/skin/default js/ui/default/circ/selfcheck templates/default/circ/selfcheck (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Dec 2 13:31:04 EST 2009
Author: erickson
Date: 2009-12-02 13:31:01 -0500 (Wed, 02 Dec 2009)
New Revision: 15060
Modified:
trunk/Open-ILS/web/css/skin/default/selfcheck.css
trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2
Log:
implemented items out page. made printing of top-level receipt optional. trimmed nav links to only include links that are not already available elsewhere.
Modified: trunk/Open-ILS/web/css/skin/default/selfcheck.css
===================================================================
--- trunk/Open-ILS/web/css/skin/default/selfcheck.css 2009-12-02 16:55:53 UTC (rev 15059)
+++ trunk/Open-ILS/web/css/skin/default/selfcheck.css 2009-12-02 18:31:01 UTC (rev 15060)
@@ -1,7 +1,7 @@
body {
font-family: Arial, Verdana;
- font-size: 14px;
+ font-size: 13px;
}
#oils-selfck-top-div {
@@ -79,8 +79,8 @@
}
#oils-selfck-info-nav span {
- padding-left: 10px;
- padding-right: 10px;
+ padding-left: 8px;
+ padding-right: 8px;
}
#oils-selfck-info-nav span.selected {
Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-02 16:55:53 UTC (rev 15059)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js 2009-12-02 18:31:01 UTC (rev 15060)
@@ -77,6 +77,9 @@
this.authtoken = openils.User.authtoken;
this.loadOrgSettings();
+ this.circTbody = dojo.byId('oils-selfck-circ-tbody');
+ this.itemsOutTbody = dojo.byId('oils-selfck-circ-out-tbody');
+
// workstation is required but none provided
if(this.orgSettings[SET_WORKSTATION_REQUIRED] && !this.workstation) {
alert(dojo.string.substitute(localeStrings.WORKSTATION_REQUIRED));
@@ -87,11 +90,13 @@
// connect onclick handlers to the various navigation links
var linkHandlers = {
'oils-selfck-hold-details-link' : function() { self.drawHoldsPage(); },
- 'oils-selfck-nav-holds' : function() { self.drawHoldsPage(); },
+ //'oils-selfck-nav-holds' : function() { self.drawHoldsPage(); },
'oils-selfck-pay-fines-link' : function() { self.drawFinesPage(); },
- 'oils-selfck-nav-fines' : function() { self.drawFinesPage(); },
+ //'oils-selfck-nav-fines' : function() { self.drawFinesPage(); },
'oils-selfck-nav-home' : function() { self.drawCircPage(); },
- 'oils-selfck-nav-logout' : function() { self.logoutPatron(); }
+ 'oils-selfck-nav-logout' : function() { self.logoutPatron(); },
+ 'oils-selfck-nav-logout-print' : function() { self.logoutPatron(true); },
+ 'oils-selfck-items-out-details-link' : function() { self.drawItemsOutPage(); }
}
for(var id in linkHandlers)
@@ -293,6 +298,11 @@
*/
SelfCheckManager.prototype.drawCircPage = function() {
+ openils.Util.show('oils-selfck-circ-tbody');
+
+ while(this.itemsOutTbody.childNodes[0])
+ this.itemsOutTbody.removeChild(this.itemsOutTbody.childNodes[0]);
+
var self = this;
this.updateScanBox({
msg : 'Please enter an item barcode', // TODO i18n
@@ -303,7 +313,6 @@
openils.Util.hide('oils-selfck-holds-page');
openils.Util.show('oils-selfck-circ-page');
- this.circTbody = dojo.byId('oils-selfck-circ-tbody');
if(!this.circTemplate)
this.circTemplate = this.circTbody.removeChild(dojo.byId('oils-selfck-circ-row'));
@@ -338,6 +347,51 @@
}
}
+SelfCheckManager.prototype.drawItemsOutPage = function() {
+ openils.Util.hide('oils-selfck-circ-tbody');
+ openils.Util.hide('oils-selfck-payment-page');
+ openils.Util.hide('oils-selfck-holds-page');
+ openils.Util.show('oils-selfck-circ-page');
+
+ while(this.itemsOutTbody.childNodes[0])
+ this.itemsOutTbody.removeChild(this.itemsOutTbody.childNodes[0]);
+
+ progressDialog.show(true);
+
+ var self = this;
+ fieldmapper.standardRequest(
+ ['open-ils.circ', 'open-ils.circ.actor.user.checked_out.atomic'],
+ {
+ async : true,
+ params : [this.authtoken, this.patron.id()],
+ oncomplete : function(r) {
+
+ var resp = openils.Util.readResponse(r);
+
+ var circs = resp.sort(
+ function(a, b) {
+ if(a.circ.due_date() > b.circ.due_date())
+ return -1;
+ return 1;
+ }
+ );
+
+ progressDialog.hide();
+
+ dojo.forEach(circs,
+ function(circ) {
+ self.displayCheckout(
+ {payload : circ},
+ (circ.circ.parent_circ()) ? 'renew' : 'checkout',
+ true
+ );
+ }
+ );
+ }
+ }
+ );
+}
+
SelfCheckManager.prototype.updateHoldsSummary = function() {
if(!this.holdsSummary) {
@@ -731,7 +785,7 @@
/**
* Display the result of a checkout or renewal in the items out table
*/
-SelfCheckManager.prototype.displayCheckout = function(evt, type) {
+SelfCheckManager.prototype.displayCheckout = function(evt, type, itemsOut) {
var copy = evt.payload.copy;
var record = evt.payload.record;
@@ -753,7 +807,9 @@
dojo.date.locale.format(date, {selector : 'date'});
// put new circs at the top of the list
- this.circTbody.insertBefore(row, this.circTbody.getElementsByTagName('tr')[0]);
+ var tbody = this.circTbody;
+ if(itemsOut) tbody = this.itemsOutTbody;
+ tbody.insertBefore(row, tbody.getElementsByTagName('tr')[0]);
}
@@ -865,8 +921,8 @@
/**
* Logout the patron and return to the login page
*/
-SelfCheckManager.prototype.logoutPatron = function() {
- if(this.checkouts.length) {
+SelfCheckManager.prototype.logoutPatron = function(print) {
+ if(print && this.checkouts.length) {
this.printReceipt(
function() {
location.href = location.href;
Modified: trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2 2009-12-02 16:55:53 UTC (rev 15059)
+++ trunk/Open-ILS/web/templates/default/circ/selfcheck/circ_page.tt2 2009-12-02 18:31:01 UTC (rev 15060)
@@ -25,5 +25,6 @@
</td>
</tr>
</tbody>
+ <tbody id='oils-selfck-circ-out-tbody' class='oils-selfck-item-table'/>
</table>
</div>
More information about the open-ils-commits
mailing list