From: phasefx Date: Fri, 4 Aug 2006 06:34:53 +0000 (+0000) Subject: checkdigit for copy creation X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0c6b725a53b61ad8e95abbe699314ca4370013fc;p=Evergreen.git checkdigit for copy creation git-svn-id: svn://svn.open-ils.org/ILS/trunk@5283 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js index d1e4b06ec9..a3480e2bde 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js @@ -258,6 +258,8 @@ g.render_barcode_entry = function(node,callnumber,count,ou_id) { document.getElementById("Create").disabled = false; } + JSAN.use('util.barcode'); + for (var i = 0; i < count; i++) { var tb = document.createElement('textbox'); node.appendChild(tb); tb.setAttribute('ou_id',ou_id); @@ -267,7 +269,14 @@ g.render_barcode_entry = function(node,callnumber,count,ou_id) { tb, function() { ready_to_create({'target':tb}); setTimeout(function(){util.widgets.vertical_tab(tb);},0); } ); - tb.addEventListener('change',ready_to_create,false); + //tb.addEventListener('change',ready_to_create,false); + tb.addEventListener('change', function(ev) { + var barcode = ev.target.value; + if ($('check_barcodes').checked && ! util.barcode.check(barcode) ) { + g.error.yns_alert( '"' + barcode + '" is an invalid barcode.','Invalid Barcode','OK',null,null,'Check here to confirm this message.'); + setTimeout( function() { ev.target.select(); ev.target.focus(); }, 0); + } + }, false); tb.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false ); } } catch(E) { diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul index c820fda923..bab5a48f5e 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.xul @@ -39,7 +39,8 @@ - + +