[freeside-commits] branch FREESIDE_3_BRANCH updated. b04dfa7c78a316b6b00afa17903424d71ba18cc4

Ivan ivan at 420.am
Fri Apr 4 17:30:45 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  b04dfa7c78a316b6b00afa17903424d71ba18cc4 (commit)
       via  5b7eefb9f9f6f0fb6bcb6ef3767cbbabd638c29f (commit)
       via  217b9fde1435d6c9f6530402035d13fbd0fde6be (commit)
      from  c6ae656552061c0b0c239aafa5512df18bdf01b3 (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 b04dfa7c78a316b6b00afa17903424d71ba18cc4
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Apr 4 17:30:44 2014 -0700

    fix db profling on pages that put javascript after </html>, like edit/part_event.html.  huh.  RT#27396

diff --git a/httemplate/autohandler b/httemplate/autohandler
index c326e3e..b278193 100644
--- a/httemplate/autohandler
+++ b/httemplate/autohandler
@@ -41,7 +41,7 @@ if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
 
   dbh->{'private_profile'} = {};
 
-  s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;
+  s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)/$profile$1/i;
 }
 
 </%filter>

commit 5b7eefb9f9f6f0fb6bcb6ef3767cbbabd638c29f
Merge: 217b9fd c6ae656
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Apr 4 17:30:38 2014 -0700

    Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_3_BRANCH


commit 217b9fde1435d6c9f6530402035d13fbd0fde6be
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Mar 31 16:53:22 2014 -0700

    freeside v3 separate export for e911-only provisioning to voip innovations api 2.0, RT#27691

diff --git a/FS/FS/part_export/voip_innovations2_e911.pm b/FS/FS/part_export/voip_innovations2_e911.pm
new file mode 100644
index 0000000..a40a785
--- /dev/null
+++ b/FS/FS/part_export/voip_innovations2_e911.pm
@@ -0,0 +1,147 @@
+package FS::part_export::voip_innovations2_e911;
+
+use vars qw(@ISA %info);
+use Tie::IxHash;
+use FS::Record qw(qsearch dbh);
+use FS::part_export;
+use FS::phone_avail;
+use Data::Dumper;
+
+ at ISA = qw(FS::part_export);
+
+tie my %options, 'Tie::IxHash',
+  'login'         => { label=>'VoIP Innovations API login' },
+  'password'      => { label=>'VoIP Innovations API password' },
+  'endpointgroup' => { label=>'VoIP Innovations endpoint group number' },
+  'dry_run'       => { label=>"Test mode - don't actually provision",
+                       type=>'checkbox',
+                     },
+;
+
+%info = (
+  'svc'     => 'svc_phone',
+  'desc'    => 'Provision E911 only to VoIP Innovations (API 2.0)',
+  'options' => \%options,
+  'no_machine' => 1,
+  'notes'   => <<'END'
+Requires installation of
+<a href="http://search.cpan.org/dist/Net-VoIP_Innovations">Net::VoIP_Innovations</a>
+from CPAN.
+END
+);
+
+sub rebless { shift; }
+
+sub gp_command {
+  my( $self, $command, @args ) = @_;
+
+  eval "use Net::VoIP_Innovations 2.00;";
+  if ( $@ ) {
+    warn $@;
+    die $@;
+  }
+
+  my $gp = Net::VoIP_Innovations->new(
+    'login'    => $self->option('login'),
+    'password' => $self->option('password'),
+    #'debug'    => $debug,
+  );
+
+  $gp->$command(@args);
+}
+
+
+sub _export_insert {
+  my( $self, $svc_phone ) = (shift, shift);
+
+  return '' if $self->option('dry_run');
+
+  #we want to provision and catch errors now, not queue
+
+  ###
+  # 911Insert
+  ###
+
+  my %location_hash = $svc_phone->location_hash;
+  my( $zip, $plus4 ) = split('-', $location_hash->{zip});
+  my $e = $self->gp_command('911Insert',
+    'did'        => $svc_phone->phonenum,
+    'Address1'   => $location_hash{address1},
+    'Address2'   => $location_hash{address2},
+    'City'       => $location_hash{city},
+    'State'      => $location_hash{state},
+    'ZipCode'    => $zip,
+    'PlusFour'   => $plus4,
+    'CallerName' =>
+      $svc_phone->phone_name
+        || $svc_phone->cust_svc->cust_pkg->cust_main->contact_firstlast,
+  );
+
+  my $edid = $e->{did};
+
+  if ( $edid->{'statuscode'} != 100 ) {
+    return "Error running VoIP Innovations 911Insert: ".
+           $edid->{'statuscode'}. ': '. $edid->{'status'};
+  }
+
+  '';
+}
+
+sub _export_replace {
+  my( $self, $new, $old ) = (shift, shift, shift);
+
+  #hmm, anything to change besides E911 data?
+
+  ###
+  # 911Update
+  ###
+
+  my %location_hash = $svc_phone->location_hash;
+  my( $zip, $plus4 ) = split('-', $location_hash->{zip});
+  my $e = $self->gp_command('911Update',
+    'did'        => $svc_phone->phonenum,
+    'Address1'   => $location_hash{address1},
+    'Address2'   => $location_hash{address2},
+    'City'       => $location_hash{city},
+    'State'      => $location_hash{state},
+    'ZipCode'    => $zip,
+    'PlusFour'   => $plus4,
+    'CallerName' =>
+      $svc_phone->phone_name
+        || $svc_phone->cust_svc->cust_pkg->cust_main->contact_firstlast,
+  );
+
+  my $edid = $e->{did};
+
+  if ( $edid->{'statuscode'} != 100 ) {
+    return "Error running VoIP Innovations 911Update: ".
+           $edid->{'statuscode'}. ': '. $edid->{'status'};
+  }
+
+  '';
+}
+
+sub _export_delete {
+  my( $self, $svc_phone ) = (shift, shift);
+
+  return '' if $self->option('dry_run');
+
+  #XXX delete e911 information
+
+  '';
+}
+
+sub _export_suspend {
+  my( $self, $svc_phone ) = (shift, shift);
+  #nop for now
+  '';
+}
+
+sub _export_unsuspend {
+  my( $self, $svc_phone ) = (shift, shift);
+  #nop for now
+  '';
+}
+
+1;
+

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

Summary of changes:
 FS/FS/part_export/voip_innovations2_e911.pm |  147 +++++++++++++++++++++++++++
 httemplate/autohandler                      |    2 +-
 2 files changed, 148 insertions(+), 1 deletions(-)
 create mode 100644 FS/FS/part_export/voip_innovations2_e911.pm




More information about the freeside-commits mailing list