diff options
author | Mark Wells <mark@freeside.biz> | 2015-10-30 22:38:01 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-10-30 23:11:49 -0700 |
commit | cfbcb8867b15c66c279816bce91a69c5ee9b2710 (patch) | |
tree | 13ffaf7fac5cb9d8f540a345806eb181d63e203c /httemplate/elements | |
parent | ce3cc284f71f2439f473c22c6d160ac45ea3b94a (diff) |
allow separate address standardization of billing and service addresses, #38646
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/standardize_locations.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index 1a01daa6f..b824fb249 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -129,7 +129,7 @@ function confirm_standardize(arg) { function() { overlib( OLresponseAJAX, CAPTION, 'Address standardization', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, - 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', + 650, HEIGHT, 368, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); }, 0); @@ -141,10 +141,15 @@ function replace_address() { var newaddr = returned['new']; var cf = document.<% $formname %>; + var crf = document.forms['confirm_replace_form']; % foreach my $pre (@prefixes) { var clean = newaddr['<% $pre %>addr_clean'] == 'Y'; + var replace = true; // auto_standardize_address won't load the form, so just do it + if ( crf && crf['<% $pre %>replace'] ) { + replace = crf['<% $pre %>replace'].value == 'Y'; + } var error = newaddr['<% $pre %>error']; - if ( clean ) { + if ( clean && replace ) { % foreach my $field (qw(address1 address2 state zip addr_clean ),($conf->exists('cust_main-no_city_in_address') ? () : 'city')) { cf.elements['<% $pre %><% $field %>'].value = newaddr['<% $pre %><% $field %>']; % } #foreach $field @@ -154,7 +159,12 @@ function replace_address() { cf.elements['<% $pre %>longitude'].value = newaddr['<% $pre %>longitude']; } % if ( $withcensus ) { - if ( clean && newaddr['<% $pre %>censustract'] ) { + var census_replace = true; + if ( crf && crf['census_replace'] ) { + census_replace = crf['census_replace'].value == 'Y'; + } + + if ( clean && census_replace && newaddr['<% $pre %>censustract'] ) { cf.elements['<% $pre %>censustract'].value = newaddr['<% $pre %>censustract']; } % } #if $withcensus |