[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 76f705b6b855b4e27bdbdb16dd2e06430b458082

Ivan ivan at 420.am
Fri Feb 24 16:21:51 PST 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  76f705b6b855b4e27bdbdb16dd2e06430b458082 (commit)
      from  47a5a10d363c2ff97b060916f735f2debc840ce8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 76f705b6b855b4e27bdbdb16dd2e06430b458082
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Feb 24 16:21:51 2012 -0800

    fix latitude/longitude w/cust_main-require_censustract, RT#16479

diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index e823f7c..14825d0 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -31,15 +31,6 @@
   <& 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') || '';
-  <INPUT NAME="latitude" TYPE="hidden" VALUE="<% $latitude |h %>">
-  <INPUT NAME="longitude" TYPE="hidden" VALUE="<% $longitude |h %>">
-% }
-
 %# contact info
 
 %  my $same_checked = '';
diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js
index bcddd7e..6b30cbc 100644
--- a/httemplate/edit/cust_main/bottomfixup.js
+++ b/httemplate/edit/cust_main/bottomfixup.js
@@ -76,7 +76,7 @@ function update_censustract(arg) {
 
   set_censustract = function () {
 
-    cf.elements['censustract'].value = newcensus
+    cf.elements['censustract'].value = newcensus;
     cf.submit();
 
   }
@@ -87,12 +87,15 @@ function update_censustract(arg) {
     if (error) { newcensus = error; }
     newcensus.replace(/.*ndefined.*/, 'Not found');
 
+    var latitude = cf.elements['latitude' ].value || '<% $company_latitude %>';
+    var longitude= cf.elements['longitude'].value || '<% $company_longitude %>';
+
     var choose_censustract =
       '<CENTER><BR><B>Confirm censustract</B><BR>' +
       '<A href="http://maps.ffiec.gov/FFIECMapper/TGMapSrv.aspx?' +
       'census_year=<% $conf->config('census_year') || '2012' %>' +
-      '&latitude=' + cf.elements['latitude'].value +
-      '&longitude=' + cf.elements['longitude'].value +
+      '&latitude=' + latitude +
+      '&longitude=' + longitude +
       '" target="_blank">Map service module location</A><BR>' +
       '<A href="http://maps.ffiec.gov/FFIECMapper/TGMapSrv.aspx?' +
       'census_year=<% $conf->config('census_year') || '2012' %>' +
@@ -154,4 +157,8 @@ function copyelement(from, to) {
 
 my $conf = new FS::Conf;
 
+my $company_latitude  = $conf->config('company_latitude');
+my $company_longitude = $conf->config('company_longitude');
+
+
 </%init>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/edit/cust_main.cgi            |    9 ---------
 httemplate/edit/cust_main/bottomfixup.js |   13 ++++++++++---
 2 files changed, 10 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list