diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-01-24 00:39:53 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-01-24 00:39:53 -0800 |
commit | 8d6ea7d8fddec3fd471a0e68f297d20e191c6f11 (patch) | |
tree | 9275a4f7ccaf32b07a5ba14cbe513d10e30617e1 /httemplate/elements | |
parent | f3ac48703be75c0e2aec161487057eafeb8fc74f (diff) | |
parent | 777a6997a004dc4ea99bccabe494f77f114db1a3 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/location.html | 6 | ||||
-rw-r--r-- | httemplate/elements/standardize_locations.js | 33 |
2 files changed, 11 insertions, 28 deletions
diff --git a/httemplate/elements/location.html b/httemplate/elements/location.html index a820bf2a6..799531e01 100644 --- a/httemplate/elements/location.html +++ b/httemplate/elements/location.html @@ -213,7 +213,8 @@ Example: <TD ALIGN="right">Census tract</TD> <TD COLSPAN=8> <INPUT TYPE="text" SIZE=15 - NAME="enter_censustract" + ID="<% $pre %>enter_censustract" + NAME="<% $pre %>enter_censustract" VALUE="<% $object->censustract |h %>"> <% '(automatic)' %> </TD> @@ -250,7 +251,8 @@ Example: var clear_coords_ids = [ '<%$pre%>latitude', '<%$pre%>longitude', - 'enter_censustract', + '<%$pre%>enter_censustract', + '<%$pre%>censustract', '<%$pre%>district' ]; function clear_coords() { diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js index cea59b801..2d1fc7423 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(); } |