[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 3e453b1d4a41fb60812661df13bc0e23961ccb26

Mark Wells mark at 420.am
Sun Mar 24 20:32:22 PDT 2013


The branch, FREESIDE_2_3_BRANCH has been updated
       via  3e453b1d4a41fb60812661df13bc0e23961ccb26 (commit)
      from  ee08941821939b8fd1b1237634127131daa529b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3e453b1d4a41fb60812661df13bc0e23961ccb26
Author: Mark Wells <mark at freeside.biz>
Date:   Sun Mar 24 20:30:54 2013 -0700

    fix editing of customers without service addresses, from #21327

diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html
index 9a9ad88..4d2f24b 100644
--- a/httemplate/edit/cust_main/top_misc.html
+++ b/httemplate/edit/cust_main/top_misc.html
@@ -15,8 +15,8 @@ function agent_changed(what) {
   var f = what.form;
   if ( ship_locked_agents[agentnum] ) {
     f['same'].checked = false;
+    samechanged(f['same']); // enable everything, then...
     f['same'].disabled = true;
-    samechanged(f['same']);
     for(var x in ship_locked_agents[agentnum]) {
       f['ship_'+x].value = ship_locked_agents[agentnum][x];
       f['ship_'+x].disabled = true;
@@ -25,14 +25,15 @@ function agent_changed(what) {
     f['ship_address2'].disabled = false;
     f['ship_address2'].style.backgroundColor = '#ffffff';
   } else {
-    for(var i=0; i<ship_fields.length; i++) {
-      x = ship_fields[i];
-      f['ship_'+x].disabled = false;
+    if ( f['same'].disabled ) { // only if switching from a locked agent
+      f['same'].disabled = false;
+      f['same'].checked = true;
+      samechanged(f['same']); // re-enable everything
     }
-    f['same'].disabled = false;
   }
 }
 window.onload = function() {
+  samechanged(document.getElementById('same'));
   agent_changed(document.getElementById('agentnum'));
 };
 </SCRIPT>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/cust_main/top_misc.html |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list