JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.network'); this.network = new util.network();
+ JSAN.use('util.barcode');
JSAN.use('util.date');
this.OpenILS = {}; JSAN.use('OpenILS.data'); this.OpenILS.data = new OpenILS.data(); this.OpenILS.data.init({'via':'stash'});
this.data = this.OpenILS.data;
},
+ 'test_barcode' : function(bc) {
+ var obj = this;
+ var good = util.barcode.check(bc);
+ if (good) {
+ return true;
+ } else {
+ if ( 1 == obj.error.yns_alert(
+ 'Bad checkdigit; possible mis-scan. Use this barcode ("' + bc + '") anyway?',
+ 'Bad Barcode',
+ 'Cancel',
+ 'Accept Barcode',
+ null,
+ 'Check here to confirm this action',
+ '/xul/server/skin/media/images/bad_barcode.png'
+ ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+
'checkin' : function() {
var obj = this;
try {
var barcode = obj.controller.view.checkin_barcode_entry_textbox.value;
if (!barcode) return;
+ if (barcode) {
+ if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
+ }
var backdate = obj.controller.view.checkin_effective_date_textbox.value;
var auto_print = document.getElementById('checkin_auto');
if (auto_print) auto_print = auto_print.checked;
JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.network'); this.network = new util.network();
JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
+ JSAN.use('util.barcode');
}
circ.checkout.prototype = {
}
},
+ 'test_barcode' : function(bc) {
+ var obj = this;
+ var good = util.barcode.check(bc);
+ if (good) {
+ return true;
+ } else {
+ if ( 1 == obj.error.yns_alert(
+ 'Bad checkdigit; possible mis-scan. Use this barcode ("' + bc + '") anyway?',
+ 'Bad Barcode',
+ 'Cancel',
+ 'Accept Barcode',
+ null,
+ 'Check here to confirm this action',
+ '/xul/server/skin/media/images/bad_barcode.png'
+ ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+
'checkout' : function(params) {
var obj = this;
if (! (params.barcode||params.noncat)) return;
+ if (params.barcode) {
+ if ( obj.test_barcode(params.barcode) ) { /* good */ } else { /* bad */ return; }
+ }
+
/**********************************************************************************************************************/
/* Permissibility test before checkout */
JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.network'); this.network = new util.network();
+ JSAN.use('util.barcode');
JSAN.use('util.date');
JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
}
},
+ 'test_barcode' : function(bc) {
+ var obj = this;
+ var good = util.barcode.check(bc);
+ if (good) {
+ return true;
+ } else {
+ if ( 1 == obj.error.yns_alert(
+ 'Bad checkdigit; possible mis-scan. Use this barcode ("' + bc + '") anyway?',
+ 'Bad Barcode',
+ 'Cancel',
+ 'Accept Barcode',
+ null,
+ 'Check here to confirm this action',
+ '/xul/server/skin/media/images/bad_barcode.png'
+ ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+
'copy_status' : function(barcode) {
var obj = this;
try {
try { document.getElementById('last_scanned').setAttribute('value',''); } catch(E) {}
if (!barcode) barcode = obj.controller.view.copy_status_barcode_entry_textbox.value;
if (!barcode) return;
+ if (barcode) {
+ if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
+ }
JSAN.use('circ.util');
var copy = obj.network.simple_request( 'FM_ACP_RETRIEVE_VIA_BARCODE', [ barcode ]);
if (copy == null) {
JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.network'); this.network = new util.network();
+ JSAN.use('util.barcode');
JSAN.use('util.date');
JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
}
},
+ 'test_barcode' : function(bc) {
+ var obj = this;
+ var good = util.barcode.check(bc);
+ if (good) {
+ return true;
+ } else {
+ if ( 1 == obj.error.yns_alert(
+ 'Bad checkdigit; possible mis-scan. Use this barcode ("' + bc + '") anyway?',
+ 'Bad Barcode',
+ 'Cancel',
+ 'Accept Barcode',
+ null,
+ 'Check here to confirm this action',
+ '/xul/server/skin/media/images/bad_barcode.png'
+ ) ) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+
'in_house_use' : function() {
var obj = this;
try {
var barcode;
if (obj.controller.view.in_house_use_menu.value == '' || obj.controller.view.in_house_use_menu.value == 'barcode') {
barcode = obj.controller.view.in_house_use_barcode_entry_textbox.value;
+ if (barcode) {
+ if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
+ }
} else {
barcode = ( obj.controller.view.in_house_use_menu.value );
//barcode = obj.data.hash.cnct[ obj.controller.view.in_house_use_menu.value ].name()