[freeside-commits] branch 13763 updated. 5371ad9dd6bf63e29ffc85c8381f1ea2630b1749

Mark Wells mark at 420.am
Sat Apr 14 15:37:13 PDT 2012


The branch, 13763 has been updated
       via  5371ad9dd6bf63e29ffc85c8381f1ea2630b1749 (commit)
       via  5abe1300f16cf01a6311203deee29373162491c7 (commit)
       via  401ba3ab0637de1bc460370949b75dca092375d8 (commit)
       via  33013bb1ef0b5f07105fe13f5bfc06350fc4d868 (commit)
       via  2c1bad9f29492546788aa4ffa0baf8e1dc0fff58 (commit)
       via  18459c4369f63b7fda11a3ff7a0af067bed0c9bf (commit)
       via  217bd576f8024ea541bdbb967e1c53f242980e61 (commit)
       via  3ccf7174fccb0b576a8c34838b3db4a429635483 (commit)
       via  c683be2e0bc89b9d11dfd5454a6cd21161b752ef (commit)
       via  b17ce7c641ad897ec35cac0c8f8e69320c19ab0e (commit)
       via  902d15046334045b5f24c2d9e179b3db6e1ee3f4 (commit)
       via  9a4a158c7f3a0f9d2333e867f6f716ba0aef43e9 (commit)
       via  39dc3ac864bac4509c54900d952ef759b2102fb1 (commit)
       via  546fbb0c5054566e4916852403bff5f62827adf4 (commit)
       via  36b042b1f07afccc028121eef918fb3985e76eaa (commit)
       via  85ae8035888f10fd8075be3234f8e981f5004557 (commit)
       via  23b0288f93882b3de9e6531b33c76517e47353c5 (commit)
       via  43d5252f60e7322ea4a0922658939b703f304db2 (commit)
       via  aef1bdae7fb5e72b785581493901d390f2cbdac9 (commit)
       via  6cebc2154e81a0c60a8892fdac88fca5be74f75b (commit)
       via  eb1652e3e27879dc21fb5de882581b5759a66bee (commit)
       via  3de7385d0a6ad25fa300f50929473f33998ea858 (commit)
       via  af42c70c94eb8fbb363238fba056d98ee2204b8f (commit)
       via  583e90e3de4d707996084dc82b794f26063b7fea (commit)
       via  f84937b2a6cc6ba63cdab177866b1417c32b1028 (commit)
       via  59db9d8aa66fe128a26e512c5172982e041c59ae (commit)
       via  c2ee6c5c4f274bbf86729cacd2fe011ea71f725d (commit)
      from  3fd1a0086512ada7b04e211161ac699d932ae1d0 (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 5371ad9dd6bf63e29ffc85c8381f1ea2630b1749
Merge: 5abe130 401ba3a
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Apr 14 15:36:20 2012 -0700

    merge master

diff --cc FS/FS/GeocodeCache.pm
index 0000000,0000000..7829c4d
new file mode 100644
--- /dev/null
+++ b/FS/FS/GeocodeCache.pm
@@@ -1,0 -1,0 +1,209 @@@
++package FS::GeocodeCache;
++
++use strict;
++use vars qw($conf $DEBUG);
++use base qw( FS::geocode_Mixin );
++use FS::Record qw( qsearch qsearchs );
++use FS::Conf;
++use FS::Misc::Geo;
++
++use Data::Dumper;
++
++FS::UID->install_callback( sub { $conf = new FS::Conf; } );
++
++$DEBUG = 0;
++
++=head1 NAME
++
++FS::GeocodeCache - An address undergoing the geocode process.
++
++=head1 SYNOPSIS
++
++  use FS::GeocodeCache;
++
++  $record = FS::GeocodeCache->standardize(%location_hash);
++
++=head1 DESCRIPTION
++
++An FS::GeocodeCache object represents a street address in the process of 
++being geocoded.  FS::GeocodeCache inherits from FS::geocode_Mixin.
++
++Most methods on this object throw an exception on error.
++
++FS::GeocodeCache has the following fields, with the same meaning as in 
++L<FS::cust_location>:
++
++=over 4
++
++=item address1
++
++=item address2
++
++=item city
++
++=item county
++
++=item state
++
++=item zip
++
++=item latitude
++
++=item longitude
++
++=item addr_clean
++
++=item country
++
++=item censustract
++
++=item geocode
++
++=item district
++
++=back
++
++=head1 METHODS
++
++=over 4
++
++=item new HASHREF
++
++Creates a new cache object.  For internal use.  See C<standardize>.
++
++=cut
++
++# minimalist constructor
++sub new {
++  my $class = shift;
++  my $self = {
++    company     => '',
++    address1    => '',
++    address2    => '',
++    city        => '',
++    state       => '',
++    zip         => '',
++    country     => '',
++    latitude    => '',
++    longitude   => '',
++    addr_clean  => '',
++    censustract => '',
++    @_
++  };
++  bless $self, $class;
++}
++
++# minimalist accessor, for compatibility with geocode_Mixin
++sub get {
++  $_[0]->{$_[1]}
++}
++
++sub set {
++  $_[0]->{$_[1]} = $_[2];
++}
++
++sub location_hash { %{$_[0]} };
++
++=item set_censustract
++
++Look up the censustract, if it's not already filled in, and return it.
++On error, sets 'error' and returns nothing.
++
++This uses the "get_censustract_*" methods in L<FS::Misc::Geo>; currently
++the only one is 'ffiec'.
++
++=cut
++
++sub set_censustract {
++  my $self = shift;
++
++  if ( $self->get('censustract') =~ /^\d{9}\.\d{2}$/ ) {
++    return $self->get('censustract');
++  }
++  my $censusyear = $conf->config('census_year');
++  return if !$censusyear;
++
++  my $method = 'ffiec';
++  # configurable censustract-only lookup goes here if it's ever needed.
++  $method = "get_censustract_$method";
++  my $censustract = eval { FS::Misc::Geo->$method($self, $censusyear) };
++  $self->set("censustract_error", $@);
++  $self->set("censustract", $censustract);
++}
++
++=item set_coord
++
++Set the latitude and longitude fields if they're not already set.  Returns
++those values, in order.
++
++=cut
++
++sub set_coord { # the one in geocode_Mixin will suffice
++  my $self = shift;
++  if ( !$self->get('latitude') || !$self->get('longitude') ) {
++    $self->SUPER::set_coord;
++    $self->set('coord_error', $@);
++  }
++  return $self->get('latitude'), $self->get('longitude');
++}
++
++=head1 CLASS METHODS
++
++=over 4
++
++=item standardize LOCATION
++
++Given a location hash or L<FS::geocode_Mixin> object, standardize the 
++address using the configured method and return an L<FS::GeocodeCache> 
++object.
++
++The methods are the "standardize_*" functions in L<FS::Geo::Misc>.
++
++=cut
++
++sub standardize {
++  my $class = shift;
++  my $location = shift;
++  $location = { $location->location_hash }
++    if UNIVERSAL::can($location, 'location_hash');
++
++  local $Data::Dumper::Terse = 1;
++  warn "standardizing location:\n".Dumper($location) if $DEBUG;
++
++  my $method = $conf->config('address_standardize_method');
++
++  if ( $method ) {
++    $method = "standardize_$method";
++    my $new_location = eval { FS::Misc::Geo->$method( $location ) };
++    if ( $new_location ) {
++      $location = {
++        addr_clean => 'Y',
++        %$new_location
++        # standardize_* can return an address with addr_clean => '' if
++        # the address is somehow questionable
++      }
++    }
++    else {
++      # XXX need an option to decide what to do on error
++      $location->{'addr_clean'} = '';
++      $location->{'error'} = $@;
++    }
++    warn "result:\n".Dumper($location) if $DEBUG;
++  }
++  # else $location = $location
++  my $cache = $class->new(%$location);
++  return $cache;
++}
++
++=back
++
++=head1 BUGS
++
++=head1 SEE ALSO
++
++L<FS::Record>, schema.html from the base documentation.
++
++=cut
++
++1;
++
diff --cc FS/MANIFEST
index e97f870,0c9cc54..9cff856
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@@ -632,5 -632,5 +632,7 @@@ FS/h_svc_cert.p
  t/h_svc_cert.t
  FS/contact_class.pm
  t/contact_class.t
 +FS/GeocodeCache.pm
 +t/GeocodeCache.t
+ FS/upgrade_journal.pm
+ t/upgrade_journal.t
diff --cc FS/t/GeocodeCache.t
index 0000000,0000000..eae6f0d
new file mode 100644
--- /dev/null
+++ b/FS/t/GeocodeCache.t
@@@ -1,0 -1,0 +1,5 @@@
++BEGIN { $| = 1; print "1..1\n" }
++END {print "not ok 1\n" unless $loaded;}
++use FS::GeocodeCache;
++$loaded=1;
++print "ok 1\n";

commit 5abe1300f16cf01a6311203deee29373162491c7
Author: Mark Wells <mark at freeside.biz>
Date:   Sat Apr 14 15:33:39 2012 -0700

    rename geocode_cache; minor coord_auto bugfix

diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 62568eb..a45be3f 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -304,7 +304,7 @@ if ( -e $addl_handler_use_file ) {
   use FS::tower;
   use FS::tower_sector;
   use FS::contact_class;
-  use FS::geocode_cache;
+  use FS::GeocodeCache;
   # Sammath Naur
 
   if ( $FS::Mason::addl_handler_use ) {
diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm
index 174357c..c8290e7 100644
--- a/FS/FS/Misc/Geo.pm
+++ b/FS/FS/Misc/Geo.pm
@@ -354,8 +354,9 @@ sub standardize_teleatlas {
     return $location;
   }
 
-  my $path = $conf->config('teleatlas-path')
-    or die "no teleatlas-path configured";
+  if ( my $path = $conf->config('teleatlas-path') ) {
+    local @INC = (@INC, $path);
+  }
   my $userid = $conf->config('teleatlas-userid')
     or die "no teleatlas-userid configured";
   my $password = $conf->config('teleatlas-password')
diff --git a/FS/FS/geocode_cache.pm b/FS/FS/geocode_cache.pm
deleted file mode 100644
index 0041e37..0000000
--- a/FS/FS/geocode_cache.pm
+++ /dev/null
@@ -1,212 +0,0 @@
-package FS::geocode_cache;
-
-use strict;
-use vars qw($conf $DEBUG);
-use base qw( FS::geocode_Mixin );
-use FS::Record qw( qsearch qsearchs );
-use FS::Conf;
-use FS::Misc::Geo;
-
-use Data::Dumper;
-
-FS::UID->install_callback( sub { $conf = new FS::Conf; } );
-
-$DEBUG = 0;
-
-=head1 NAME
-
-FS::geocode_cache - An address undergoing the geocode process.
-
-=head1 SYNOPSIS
-
-  use FS::geocode_cache;
-
-  $record = FS::geocode_cache->standardize(%location_hash);
-
-=head1 DESCRIPTION
-
-An FS::geocode_cache object represents a street address in the process of 
-being geocoded.  FS::geocode_cache inherits from FS::geocode_Mixin.
-
-Most methods on this object throw an exception on error.
-
-FS::geocode_cache has the following fields, with the same meaning as in 
-L<FS::cust_location>:
-
-=over 4
-
-All other fields have the same meaning as in L<FS::cust_main> and 
-L<FS::cust_location>:
-
-=item address1
-
-=item address2
-
-=item city
-
-=item county
-
-=item state
-
-=item zip
-
-=item latitude
-
-=item longitude
-
-=item addr_clean
-
-=item country
-
-=item censustract
-
-=item geocode
-
-=item district
-
-=back
-
-=head1 METHODS
-
-=over 4
-
-=item new HASHREF
-
-Creates a new cache object.  For internal use.  See C<standardize>.
-
-=cut
-
-# minimalist constructor
-sub new {
-  my $class = shift;
-  my $self = {
-    company     => '',
-    address1    => '',
-    address2    => '',
-    city        => '',
-    state       => '',
-    zip         => '',
-    country     => '',
-    latitude    => '',
-    longitude   => '',
-    addr_clean  => '',
-    censustract => '',
-    @_
-  };
-  bless $self, $class;
-}
-
-# minimalist accessor, for compatibility with geocode_Mixin
-sub get {
-  $_[0]->{$_[1]}
-}
-
-sub set {
-  $_[0]->{$_[1]} = $_[2];
-}
-
-sub location_hash { %{$_[0]} };
-
-=item set_censustract
-
-Look up the censustract, if it's not already filled in, and return it.
-On error, sets 'error' and returns nothing.
-
-This uses the "get_censustract_*" methods in L<FS::Misc::Geo>; currently
-the only one is 'ffiec'.
-
-=cut
-
-sub set_censustract {
-  my $self = shift;
-
-  if ( $self->get('censustract') =~ /^\d{9}\.\d{2}$/ ) {
-    return $self->get('censustract');
-  }
-  my $censusyear = $conf->config('census_year');
-  return if !$censusyear;
-
-  my $method = 'ffiec';
-  # configurable censustract-only lookup goes here if it's ever needed.
-  $method = "get_censustract_$method";
-  my $censustract = eval { FS::Misc::Geo->$method($self, $censusyear) };
-  $self->set("censustract_error", $@);
-  $self->set("censustract", $censustract);
-}
-
-=item set_coord
-
-Set the latitude and longitude fields if they're not already set.  Returns
-those values, in order.
-
-=cut
-
-sub set_coord { # the one in geocode_Mixin will suffice
-  my $self = shift;
-  if ( !$self->get('latitude') || !$self->get('longitude') ) {
-    $self->SUPER::set_coord;
-    $self->set('coord_error', $@);
-  }
-  return $self->get('latitude'), $self->get('longitude');
-}
-
-=head1 CLASS METHODS
-
-=over 4
-
-=item standardize LOCATION
-
-Given a location hash or L<FS::geocode_Mixin> object, standardize the 
-address using the configured method and return an L<FS::geocode_cache> 
-object.
-
-The methods are the "standardize_*" functions in L<FS::Geo::Misc>.
-
-=cut
-
-sub standardize {
-  my $class = shift;
-  my $location = shift;
-  $location = { $location->location_hash }
-    if UNIVERSAL::can($location, 'location_hash');
-
-  local $Data::Dumper::Terse = 1;
-  warn "standardizing location:\n".Dumper($location) if $DEBUG;
-
-  my $method = $conf->config('address_standardize_method');
-
-  if ( $method ) {
-    $method = "standardize_$method";
-    my $new_location = eval { FS::Misc::Geo->$method( $location ) };
-    if ( $new_location ) {
-      $location = {
-        addr_clean => 'Y',
-        %$new_location
-        # standardize_* can return an address with addr_clean => '' if
-        # the address is somehow questionable
-      }
-    }
-    else {
-      # XXX need an option to decide what to do on error
-      $location->{'addr_clean'} = '';
-      $location->{'error'} = $@;
-    }
-    warn "result:\n".Dumper($location) if $DEBUG;
-  }
-  # else $location = $location
-  my $cache = $class->new(%$location);
-  return $cache;
-}
-
-=back
-
-=head1 BUGS
-
-=head1 SEE ALSO
-
-L<FS::Record>, schema.html from the base documentation.
-
-=cut
-
-1;
-
diff --git a/FS/MANIFEST b/FS/MANIFEST
index 76741ad..e97f870 100644
--- a/FS/MANIFEST
+++ b/FS/MANIFEST
@@ -632,5 +632,5 @@ FS/h_svc_cert.pm
 t/h_svc_cert.t
 FS/contact_class.pm
 t/contact_class.t
-FS/geocode_cache.pm
-t/geocode_cache.t
+FS/GeocodeCache.pm
+t/GeocodeCache.t
diff --git a/FS/t/geocode_cache.t b/FS/t/geocode_cache.t
deleted file mode 100644
index 7cbc58d..0000000
--- a/FS/t/geocode_cache.t
+++ /dev/null
@@ -1,5 +0,0 @@
-BEGIN { $| = 1; print "1..1\n" }
-END {print "not ok 1\n" unless $loaded;}
-use FS::geocode_cache;
-$loaded=1;
-print "ok 1\n";
diff --git a/httemplate/elements/order_pkg.js b/httemplate/elements/order_pkg.js
index 84c7a82..8c1efd9 100644
--- a/httemplate/elements/order_pkg.js
+++ b/httemplate/elements/order_pkg.js
@@ -19,13 +19,10 @@ function pkg_changed () {
       form.start_date_text.disabled = false;
       form.start_date.style.backgroundColor = '#ffffff';
       form.start_date_button.style.display = '';
-      //form.start_date_button_disabled.style.display = 'none';
-      //form.invoice_terms.disabled = true;
     } else {
       form.start_date_text.disabled = true;
       form.start_date.style.backgroundColor = '#dddddd';
       form.start_date_button.style.display = 'none';
-      //form.start_date_button_disabled.style.display = '';
     }
 
   } else {
diff --git a/httemplate/elements/standardize_locations.js b/httemplate/elements/standardize_locations.js
index 8bec87e..77683b9 100644
--- a/httemplate/elements/standardize_locations.js
+++ b/httemplate/elements/standardize_locations.js
@@ -45,9 +45,10 @@ function standardize_locations() {
   }
 
 %   }
-// unless they're both empty
-  if ( cf.elements['<% $pre %>latitude'] == '' &&
-       cf.elements['<% $pre %>longitude'] == '' ) {
+  // but if the coordinates have been set to null, turn coord_auto on 
+  // and standardize
+  if ( cf.elements['<% $pre %>latitude'].value == '' &&
+       cf.elements['<% $pre %>longitude'].value == '' ) {
     cf.elements['<% $pre %>coord_auto'].value = 'Y';
     changed = true;
   }
diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html
index f305a24..c2d6d7a 100644
--- a/httemplate/misc/xmlhttp-address_standardize.html
+++ b/httemplate/misc/xmlhttp-address_standardize.html
@@ -24,7 +24,7 @@ foreach my $pre ( '', 'ship_' ) {
       qw( company address1 address2 city state zip country )
   };
 
-  my $cache = eval { FS::geocode_cache->standardize($location) };
+  my $cache = eval { FS::GeocodeCache->standardize($location) };
   $cache->set_censustract if $pre;
   $cache->set_coord;
 

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

Summary of changes:
 FS/FS/AccessRight.pm                               |    5 +
 FS/FS/ClientAPI/MyAccount.pm                       |   13 +
 FS/FS/ClientAPI_XMLRPC.pm                          |   19 +-
 FS/FS/Conf.pm                                      |   64 ++++-
 FS/FS/{geocode_cache.pm => GeocodeCache.pm}        |   19 +-
 FS/FS/Mason.pm                                     |    2 +-
 FS/FS/Misc/Geo.pm                                  |    5 +-
 FS/FS/Report/Table.pm                              |   21 +-
 FS/FS/Report/Table/Monthly.pm                      |   31 +--
 FS/FS/Schema.pm                                    |   13 +
 FS/FS/Upgrade.pm                                   |    1 +
 FS/FS/access_right.pm                              |   45 +++
 FS/FS/cdr/cia.pm                                   |    4 +-
 FS/FS/cust_bill.pm                                 |   17 +-
 FS/FS/cust_main.pm                                 |   24 ++-
 FS/FS/cust_main/Search.pm                          |   36 ++-
 FS/FS/cust_pay_void.pm                             |   30 +--
 FS/FS/cust_pkg.pm                                  |    2 +-
 FS/FS/part_event/Condition.pm                      |    4 +-
 .../part_event/Condition/cust_bill_has_service.pm  |    4 +-
 FS/FS/payby.pm                                     |    5 +
 FS/FS/svc_broadband.pm                             |    9 +-
 FS/FS/upgrade_journal.pm                           |  151 ++++++++++
 FS/MANIFEST                                        |    6 +-
 FS/t/{AccessRight.t => GeocodeCache.t}             |    2 +-
 FS/t/geocode_cache.t                               |    5 -
 FS/t/{AccessRight.t => upgrade_journal.t}          |    2 +-
 bin/part_pkg-bulk_change                           |   72 +++++
 fs_selfservice/FS-SelfService/SelfService.pm       |    1 +
 .../FS-SelfService/SelfService/XMLRPC.pm           |   20 +-
 httemplate/docs/about.html                         |   50 +++-
 httemplate/docs/credits.html                       |    7 +-
 httemplate/edit/process/svc_broadband.cgi          |    6 +-
 httemplate/elements/customer-table.html            |  298 ++++++++++----------
 httemplate/elements/freeside.css                   |   28 ++
 httemplate/elements/menu.html                      |   27 ++-
 httemplate/elements/order_pkg.js                   |    3 -
 httemplate/elements/select-rt-customfield.html     |   34 +++
 httemplate/elements/standardize_locations.js       |    7 +-
 httemplate/elements/table-grid.html                |   13 +-
 httemplate/elements/tr-select-from_to.html         |    2 +-
 httemplate/elements/tr-select-router_block_ip.html |   33 ++-
 httemplate/graph/cust_signup.html                  |   29 ++-
 httemplate/graph/elements/monthly.html             |    9 +-
 httemplate/graph/report_cust_bill_pkg.html         |    6 +-
 httemplate/graph/report_cust_signup.html           |    6 +
 httemplate/misc/batch-cust_pay.html                |   24 +-
 httemplate/misc/process/batch-cust_pay.cgi         |    2 +-
 httemplate/misc/xmlhttp-address_standardize.html   |    2 +-
 .../misc/xmlhttp-cust_main-discount_terms.cgi      |   19 +-
 httemplate/misc/xmlhttp-cust_main-search.cgi       |    8 +-
 httemplate/search/cust_main.cgi                    |    2 +-
 httemplate/search/cust_pkg.cgi                     |   11 +-
 httemplate/search/cust_pkg_summary.cgi             |    2 +-
 httemplate/search/cust_pkg_summary.html            |    4 +
 httemplate/search/cust_pkg_susp.cgi                |    2 +-
 httemplate/search/cust_pkg_susp.html               |    4 +
 httemplate/search/elements/search-html.html        |    6 +-
 httemplate/search/elements/search.html             |   10 +-
 httemplate/search/report_cust_pkg.html             |   43 ++-
 httemplate/search/report_rt_ticket.html            |   32 ++-
 httemplate/search/report_rt_transaction.html       |   13 +-
 httemplate/search/rt_ticket.html                   |  125 ++++++---
 httemplate/search/rt_transaction.html              |  125 ++++++---
 httemplate/view/cust_main.cgi                      |    4 +-
 httemplate/view/cust_main/payment_history.html     |    8 +-
 httemplate/view/cust_main/tickets.html             |    9 +-
 httemplate/view/logo-agent.cgi                     |   10 +
 68 files changed, 1175 insertions(+), 480 deletions(-)
 rename FS/FS/{geocode_cache.pm => GeocodeCache.pm} (86%)
 create mode 100644 FS/FS/upgrade_journal.pm
 copy FS/t/{AccessRight.t => GeocodeCache.t} (82%)
 delete mode 100644 FS/t/geocode_cache.t
 copy FS/t/{AccessRight.t => upgrade_journal.t} (80%)
 create mode 100755 bin/part_pkg-bulk_change
 create mode 100644 httemplate/elements/select-rt-customfield.html
 create mode 100755 httemplate/view/logo-agent.cgi




More information about the freeside-commits mailing list