X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fstandardize_locations.js;h=307f822c975786cbd868aa0e6b02856990e65628;hb=2d5acabf71d46aa469a6867f294706242c82db98;hp=cea59b80169559030bf4c43d944dca6e5188d6ef;hpb=8caec1039528538d542a941d58374d6045415527;p=freeside.git diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index cea59b801..307f822c9 100644 --- a/httemplate/elements/standardize_locations.js +++ b/httemplate/elements/standardize_locations.js @@ -11,26 +11,14 @@ function form_address_info() { % if ( $billship ) { returnobj['same'] = cf.elements['same'].checked; % } -% if ( $withcensus ) { -% # "entered" censustract always goes with the ship_ address if there is one -% if ( $billship ) { - returnobj['ship_censustract'] = cf.elements['enter_censustract'].value; -% } else { # there's only a package address, so it's just "censustract" - returnobj['censustract'] = cf.elements['enter_censustract'].value; -% } -% } % for my $pre (@prefixes) { - if ( <% $pre eq 'ship_' ? 1 : 0 %> && returnobj['same'] ) { -% # special case: don't include any ship_ fields, and move the entered -% # censustract over to bill_. - returnobj['bill_censustract'] = returnobj['ship_censustract']; - delete returnobj['ship_censustract']; - } else { % # normal case % for my $field (qw(address1 address2 city state zip country)) { returnobj['<% $pre %><% $field %>'] = cf.elements['<% $pre %><% $field %>'].value; % } #for $field - } // if returnobj['same'] +% if ( $withcensus ) { + returnobj['<% $pre %>censustract'] = cf.elements['<% $pre %>enter_censustract'].value; +% } % } #foreach $pre return returnobj; @@ -181,18 +169,11 @@ function confirm_manual_address() { %# not much to do in this case, just confirm the censustract % if ( $withcensus ) { var cf = document.<% $formname %>; -% if ( $billship ) { - if ( cf.elements['same'] && cf.elements['same'].checked ) { - cf.elements['bill_censustract'].value = - cf.elements['enter_censustract'].value; - } else { - cf.elements['ship_censustract'].value = - cf.elements['enter_censustract'].value; - } -% } else { - cf.elements['censustract'].value = cf.elements['enter_censustract'].value; +% foreach my $pre (@prefixes) { + cf.elements['<% $pre %>censustract'].value = + cf.elements['<% $pre %>enter_censustract'].value; % } -% } +% } # $withcensus post_standardization(); } @@ -312,10 +293,15 @@ function confirm_censustract() { '<%$p%>/misc/confirm-censustract.html', 'q=' + encodeURIComponent(JSON.stringify(address_info)), function() { - overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, - AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, - 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', - TEXTSIZE, 3 ); + if ( OLresponseAJAX ) { + overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY, + AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, + 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', + TEXTSIZE, 3 ); + } else { + // no response + <% $post_censustract %>; + } }, 0); } else {