[open-ils-commits] r17224 - trunk/Open-ILS/web/js/ui/default/actor/user (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 16 09:14:43 EDT 2010


Author: phasefx
Date: 2010-08-16 09:14:41 -0400 (Mon, 16 Aug 2010)
New Revision: 17224

Modified:
   trunk/Open-ILS/web/js/ui/default/actor/user/register.js
Log:
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.

Modified: trunk/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/register.js	2010-08-15 02:27:01 UTC (rev 17223)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/register.js	2010-08-16 13:14:41 UTC (rev 17224)
@@ -132,6 +132,13 @@
     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 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];



More information about the open-ils-commits mailing list