From 9d94d9bb4cfab784651981825ee7710205c7cbda Mon Sep 17 00:00:00 2001 From: pines Date: Tue, 13 Feb 2007 04:44:42 +0000 Subject: [PATCH] strip spaces from barcodes for new items and re-barcoded items git-svn-id: svn://svn.open-ils.org/ILS/trunk@6937 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/util.js | 1 + Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 933b14f30b..bceb1edae9 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -27,6 +27,7 @@ cat.util.replace_barcode = function(old_bc) { if (!copy) throw(copy); var new_bc = window.prompt('Enter the replacement barcode for the copy with barcode ' + old_bc + ':','','Replace Barcode'); + new_bc = String( new_bc ).replace(/\s/g,''); if (!new_bc) { alert('Rename aborted. Blank for barcode not allowed.'); return old_bc; 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 64c1707c38..31182163dd 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 @@ -289,7 +289,8 @@ g.render_barcode_entry = function(node,callnumber,count,ou_id) { ); //tb.addEventListener('change',ready_to_create,false); tb.addEventListener('change', function(ev) { - var barcode = ev.target.value; + var barcode = String( ev.target.value ).replace(/\s/g,''); + if (barcode != ev.target.value) ev.target.value = barcode; 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); -- 2.11.0