more refresh testing
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Sep 2006 17:10:51 +0000 (17:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Sep 2006 17:10:51 +0000 (17:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6001 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 30eb748..3583e6b 100644 (file)
@@ -487,26 +487,40 @@ function uEditSaveUser(cloneme) {
                else cloneme = newuser.id();
        }
 
-       if(window.xulG &&
+
+       if( cloneme ) {
+
+               if(window.xulG &&
                        typeof window.xulG.spawn_editor == 'function' && 
-                       !patron.isnew() && cloneme ) {
 
-               _debug("xulG clone spawning new interface...");
-               window.xulG.spawn_editor({ses:cgi.param('ses'),clone:cloneme});
+                       !patron.isnew() ) {
+                               _debug("xulG clone spawning new interface...");
+                               window.xulG.spawn_editor({ses:cgi.param('ses'),clone:cloneme});
+                               uEditRefresh();
 
-       } else {
+               } else {
 
-               _debug("xulG funcs not defined, refreshing page..");
-               var href = location.href;
+                       var href = location.href;
+                       href = href.replace(/\&?usr=\d+/, '');
+                       href = href.replace(/\&?clone=\d+/, '');
+                       href += '&clone=' + cloneme;
+                       location.href = href;
+               }
 
-               if( cloneme ) href = href.replace(/\&?usr=\d+/, '');
-               href = href.replace(/\&?clone=\d+/, '');
+       } else {
 
-               if( cloneme ) href += '&clone=' + cloneme;
-               location.href = href;
+               uEditRefresh();
        }
 }
 
+
+function uEditRefresh() {
+       var href = location.href;
+       href = href.replace(/\&?clone=\d+/, '');
+       location.href = href;
+}
+
+
 function uEditCancel() {
        var href = location.href;
        href = href.replace(/\&?usr=\d+/, '');