From f3717767d19f9da888e190f87a04dfa245d658b4 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 27 Jul 2009 03:26:47 +0000 Subject: FCC from 477 improvements #4912 --- httemplate/edit/cust_main.cgi | 9 ++++++ httemplate/edit/cust_main/bottomfixup.js | 48 +++++++++++++++++++------------- httemplate/edit/cust_main/contact.html | 4 +++ 3 files changed, 41 insertions(+), 20 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 575131424..8b1d2b59c 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -32,6 +32,15 @@ <% include('cust_main/birthdate.html', $cust_main) %> % } +%# latitude and longitude +% if ( $conf->exists('cust_main-require_censustract') ) { +% my ($latitude, $longitude) = $cust_main->service_coordinates; +% $latitude ||= $conf->config('company_latitude') || ''; +% $longitude ||= $conf->config('company_longitude') || ''; + + +% } + %# contact info % my $same_checked = ''; diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 822f98d39..06e8b13b6 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -242,7 +242,7 @@ function post_geocode() { var cf = document.CustomerForm; var state_el = cf.elements['ship_state']; var census_data = new Array( - 'year', '2008', // from config value? + 'year', <% $conf->config('census_year') || '2008' %>, 'address', cf.elements['ship_address1'].value, 'city', cf.elements['ship_city'].value, 'state', state_el.options[ state_el.selectedIndex ].value, @@ -296,44 +296,52 @@ function update_censustract(arg) { var tractcode = argsHash['tractcode']; var error = argsHash['error']; + var newcensus = + new String(statecode) + + new String(countycode) + + new String(tractcode).replace(/\s$/, ''); // JSON 1 workaround + set_censustract = function () { - cf.elements['censustract'].value = - document.forms.popupcensustract.elements.censustract.value; + cf.elements['censustract'].value = newcensus cf.submit(); } - if (error) { + if (error || cf.elements['censustract'].value != newcensus) { // popup an entry dialog var choose_censustract = - '

Enter census tract

' + - '
' + + '

Confirm censustract
' + + 'Map service module location

' + ''; choose_censustract = choose_censustract + - '' + - '' + - '' + - ''; - - choose_censustract = choose_censustract + + '' + + '' + + '' + + ''; + + choose_censustract = choose_censustract + '' + + '' + - '
Census Tract:
  
Entered census tractCalculated census tract
' + cf.elements['censustract'].value + + '' + newcensus + '
  
' + - '' + + '' + '' + + '' + + '
' + '
'; + + '
'; - overlib( choose_censustract, CAPTION, 'Choose a census tract', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); + overlib( choose_censustract, CAPTION, 'Confirm censustract', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 ); - setTimeout("document.forms.popupcensustract.elements.censustract.focus()",1); } else { - cf.elements['censustract'].value = - new String(statecode) + - new String(countycode) + - new String(tractcode); cf.submit(); } diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index 2691da652..3bed54b85 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -111,6 +111,10 @@ $cust_main->set($pre.'state', $statedefault ) $cust_main->set('stateid_state', $cust_main->state ) unless $pre || $cust_main->get('stateid_state'); +if ( $conf->exists('cust_main-require_censustract') ) { + $opt{censustract} ||= $cust_main->censustract; +} + #my($county_html, $state_html, $country_html) = # FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), # $cust_main->get($pre.'state'), -- cgit v1.2.1