since we're enforcing the requiredness of address type, let's give it a default value...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Sep 2010 16:29:19 +0000 (16:29 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Sep 2010 16:29:19 +0000 (16:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18029 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/actor/nls/register.js
Open-ILS/web/js/ui/default/actor/user/register.js

index 6e0f8af..5cdc023 100644 (file)
@@ -1,4 +1,5 @@
 {
+    "DEFAULT_ADDRESS_TYPE" : "MAILING",
     "DELETE_ADDRESS" : "Delete address ${0}?",
     "NEED_ADDRESS" : "An address is required during registration.",
     "DUPE_PATRON_NAME" : "Found ${0} patron(s) with the same name",
index cff9071..eb53ecd 100644 (file)
@@ -1213,6 +1213,10 @@ function uEditNewAddr(evt, id, mkLinks) {
             if(row.getAttribute('fmclass')) {
                 var widget = fleshFMRow(row, 'aua', {addr:id});
 
+                // make new addresses a default address type
+                if(id < 0 && row.getAttribute('fmfield') == 'address_type') 
+                    widget.widget.attr('value', localeStrings.DEFAULT_ADDRESS_TYPE); 
+
                 // make new addresses valid by default
                 if(id < 0 && row.getAttribute('fmfield') == 'valid') 
                     widget.widget.attr('value', true);