X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fconfirm-censustract.html;h=b491d49541b32591c142ed067857239fb23000fc;hb=c6d8896d882b684b1f3c7a2538a90358b27aaf89;hp=ae0ae3a6ad9636de8dd555d3c84de95bf256f899;hpb=468c9e660eb0edb2033f0f8dbb4458f20280082c;p=freeside.git diff --git a/httemplate/misc/confirm-censustract.html b/httemplate/misc/confirm-censustract.html index ae0ae3a6a..b491d4954 100644 --- a/httemplate/misc/confirm-censustract.html +++ b/httemplate/misc/confirm-censustract.html @@ -1,3 +1,10 @@ +% if ( !$error and !$new_tract ) { +% # then set_censustract returned nothing +% # because it's not relevant for this address +% # so output nothing (forces confirm_censustract() to continue) +% $m->clear_buffer; +% $m->abort; +% }

% if ( $error ) { Census tract error @@ -6,13 +13,17 @@ Census tract error Confirm census tract % }
-% my $querystring = "census_year=$year&latitude=".$cache->get('latitude').'&longitude='.$cache->get('longitude'); - <% $location{address2} |h %>
+<% $location{city} |h %>, <% $location{state} |h %> <% $location{zip} |h %>
+
+% my $querystring = "census_year=$year&address=$location{address1}, $location{address2}, $location{city}, $location{state}, $location{zip}"; +
Map service module location
-% $querystring = "census_year=$year&zip_code=".$cache->get('zip'); -get('zip'); +Map zip code center

+ @@ -21,33 +32,55 @@ Confirm census tract % if ( $error ) { - + % } else { - + % }
Entered census tract
<% $old_tract %><% $error %>
<% $error %>
<% $new_tract %>
<% $new_tract %>
- + +
+
+ <%init> local $SIG{__DIE__}; #disable Mason error trap @@ -61,12 +94,13 @@ warn $cgi->param('q') if $DEBUG; my $q = decode_json($cgi->param('q')) or die "bad argument '".$cgi->param('q')."'"; +my $pre = $q->{prefix} || ''; my %location = ( - map { $_ => $q->{'ship_'.$_} } + map { $_ => $q->{$pre.$_} } qw( company address1 address2 city state zip country latitude longitude ) ); -my $old_tract = $q->{'ship_censustract'}; +my $old_tract = $q->{$pre.'censustract'}; my $cache = eval { FS::GeocodeCache->new(%location) }; $cache->set_censustract; my $year = FS::Conf->new->config('census_year');