firing onchange events for cloned phone numbers to make sure they propogate
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Feb 2007 15:19:31 +0000 (15:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 13 Feb 2007 15:19:31 +0000 (15:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6940 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/xul/staff_client/server/patron/ue.js
Evergreen/xul/staff_client/server/patron/ue_config.js

index c51b919..9e297f3 100644 (file)
@@ -31,15 +31,18 @@ function uEditInit() {
 
 function uEditSetUnload() {
    _debug('setting window unload event');
+   /*
    window.onbeforeunload = function(evt) { 
-      //evt.returnValue = ('ue_unsaved_changes').innerHTML; 
       return $('ue_unsaved_changes').innerHTML; 
    };
+   */
 }
 
 function uEditClearUnload() {
    _debug('clearing window unload event');
+   /*
    window.onbeforeunload = null;
+   */
 }
 
 /* ------------------------------------------------------------------------------ */
@@ -202,19 +205,27 @@ function uEditClone(clone) {
        var cloneUser = fetchFleshedUser(clone);
        patron.usrgroup(cloneUser.usrgroup());
 
-       if( cloneUser.day_phone() )
+       if( cloneUser.day_phone() ) {
                $('ue_day_phone').value = cloneUser.day_phone();
-       if( cloneUser.evening_phone() )
+           $('ue_day_phone').onchange();
+    }
+
+       if( cloneUser.evening_phone() ) {
                $('ue_night_phone').value = cloneUser.evening_phone();
-       if( cloneUser.other_phone() )
-               $('ue_other_phone').value = cloneUser.other_phone();
-       setSelector($('ue_org_selector'), cloneUser.home_ou());
+               $('ue_night_phone').onchange();
+    }
 
+       if( cloneUser.other_phone() ) {
+               $('ue_other_phone').value = cloneUser.other_phone();
+               $('ue_other_phone').onchange();
+    }
 
+       setSelector($('ue_org_selector'), cloneUser.home_ou());
        setSelector($('ue_profile'), cloneUser.profile());
 
        /* force the expire date to be set */
        $('ue_profile').onchange();
+       $('ue_org_selector').onchange();
 
        for( var a in cloneUser.addresses() ) {
                var addr = cloneUser.addresses()[a];
index 1d6a3cc..688852c 100644 (file)
@@ -1009,6 +1009,7 @@ function uEditCheckSharedAddr(patron, address, tbody, row) {
                                                function() { window.xulG.spawn_editor({ses:cgi.param('ses'),usr:id}) };
                                
                                        if( userCache[id] ) {
+                        var usr = userCache[id];
                                                nnode.appendChild(text(
                                                        usr.first_given_name() + ' ' +  usr.family_name()));