From 2c729df6fa6769f050ac27c0ab234aa3abcea5be Mon Sep 17 00:00:00 2001
From: Scott Prater <sprater@gmail.com>
Date: Wed, 21 Mar 2012 21:44:23 -0500
Subject: [PATCH] Patron Stat Cat Enhancements: Only show default entry for new
 patrons

Only display the default entry when registering new patrons.
Otherwise, display the saved value for the patron or nothing.

Signed-off-by: Scott Prater <sprater@gmail.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
---
 Open-ILS/web/js/ui/default/actor/user/register.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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 765467e02b..dd0a735dfb 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -860,11 +860,11 @@ function loadStatCats() {
         sc_widget._wtype = 'statcat';
         sc_widget._statcat = stat.id();
 
-        // set default value:  first choice is patron table entry,
-        // then the default entry for the stat_cat
+        // set value:  first choice is patron table entry,
+        // then the default entry for the stat_cat if new patron
         if(patmap) {
             sc_widget.attr(p_opt, patmap.stat_cat_entry()); 
-        } else if(entrymap) {
+        } else if(entrymap && patron.isnew()) {
             sc_widget.attr('value', e_field); 
         }
 
-- 
2.11.0