From: phasefx Date: Mon, 16 Aug 2010 13:14:41 +0000 (+0000) Subject: Disable Replace Barcode button for new patrons, and disable the barcode field for... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d5e7b1c7005bcb77d01673e3668c7aec1a92cf83;p=evergreen%2Fmasslnc.git Disable Replace Barcode button for new patrons, and disable the barcode field for existing patrons. If Replace Barcode is activated, then enable the barcode field, give it focus, and disable the Replace Barcode button. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17224 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 98f9c52bf2..fd8e160437 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -132,6 +132,13 @@ function load() { dojo.connect(allCards, 'onClick', drawAllCards); if(patron.cards().length > 1) dojo.removeClass(dojo.byId('uedit-all-barcodes'), 'hidden'); + + var input = findWidget('ac', 'barcode'); + if (patron.isnew()) { + replaceBarcode.attr('disabled', true); + } else { + input.widget.attr('disabled', true).attr('readOnly', true); + } } @@ -174,7 +181,8 @@ function drawAllCards() { */ function replaceCardHandler() { var input = findWidget('ac', 'barcode'); - input.widget.attr('value', null); + input.widget.attr('disabled', false).attr('readOnly', false).attr('value', null).focus(); + replaceBarcode.attr('disabled', true); // pull old car off the cards list so we don't have a dupe sitting in there var old = patron.cards().filter(function(c){return (c.id() == patron.card().id())})[0];