my $location = shift;
my $year = shift;
+ if ( length($location->{country}) and uc($location->{country}) ne 'US' ) {
+ return '';
+ }
+
warn Dumper($location, $year) if $DEBUG;
my $url = 'http://www.ffiec.gov/Geocode/default.aspx';
'<%$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
+ submit_continue();
},
0);
} else submit_continue();
'<%$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 {
-% if ($censustract) {
+% if ($location->country eq 'US' and $censustract) {
<TR>
<TD ALIGN="right"><% mt('Census tract') |h %></TD>
<TD COLSPAN=5>
+% 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;
+% }
<CENTER><BR><B>
% if ( $error ) {
Census tract error
<TH COLSPAN=5>
<DIV CLASS="<% $loc->disabled ? 'loclabel disabled' : 'loclabel' %>">
<% $loc->location_label %>
-% if ( $loc->censustract ) {
- <BR>
- <FONT SIZE=-1>
- <% $loc->censustract %> (<% $loc->censusyear %> census)
- </FONT>
-% } elsif ( $conf->exists('cust_main-require_censustract') ) {
- <BR>
- <FONT SIZE=-1 COLOR="#ee3300">
- <% emt('Census tract unknown') %>
- </FONT>
+% if ( $loc->country eq 'US' ) { # only U.S. census tracts for now
+% if ( $loc->censustract ) {
+ <BR>
+ <FONT SIZE=-1>
+ <% $loc->censustract %> (<% $loc->censusyear %> census)
+ </FONT>
+% } elsif ( $conf->exists('cust_main-require_censustract') ) {
+ <BR>
+ <FONT SIZE=-1 COLOR="#ee3300">
+ <% emt('Census tract unknown') %>
+ </FONT>
+% }
% }
</DIV>
<DIV STYLE="display: inline; float:right;">
&>
</FONT>
% }
-% if ( $loc->censustract ) {
- <BR>
- <FONT SIZE=-1>
- <% $loc->censustract %> (<% $loc->censusyear %> census)
- </FONT>
-% } elsif ( $opt{'cust_main-require_censustract'} ) {
- <BR>
- <FONT SIZE=-1 COLOR="#ee3300">
- <% emt('Census tract unknown') %>
- </FONT>
+% if ( $loc->country eq 'US' ) {
+% if ( $loc->censustract ) {
+ <BR>
+ <FONT SIZE=-1>
+ <% $loc->censustract %> (<% $loc->censusyear %> census)
+ </FONT>
+% } elsif ( $opt{'cust_main-require_censustract'} ) {
+ <BR>
+ <FONT SIZE=-1 COLOR="#ee3300">
+ <% emt('Census tract unknown') %>
+ </FONT>
+% }
% }
% if ( $default ) {