From: Scott Prater <sprater@gmail.com>
Date: Thu, 22 Mar 2012 02:44:23 +0000 (-0500)
Subject: Patron Stat Cat Enhancements: Only show default entry for new patrons
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2c729df6fa6769f050ac27c0ab234aa3abcea5be;p=evergreen%2Fmasslnc.git

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>
---

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); 
         }