[freeside-commits] branch FREESIDE_4_BRANCH updated. b25b04ebba149ac5257a693fbcb555a46d379a0f

Christopher Burger burgerc at 420.am
Fri May 26 12:15:52 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  b25b04ebba149ac5257a693fbcb555a46d379a0f (commit)
      from  a014b7e4702aee213e31ade6cd30febd0cfd5c4f (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 b25b04ebba149ac5257a693fbcb555a46d379a0f
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Fri May 26 14:20:51 2017 -0400

    RT# 74523 - added check for status table argument for /bin/cdr-ivr.import compatibility

diff --git a/FS/FS/cdr/Import.pm b/FS/FS/cdr/Import.pm
index 35069ae..f32a7bd 100644
--- a/FS/FS/cdr/Import.pm
+++ b/FS/FS/cdr/Import.pm
@@ -71,6 +71,7 @@ sub dbi_import {
 
   my $table = $opt{T} || $args{table};
   my $pkey = $args{primary_key};
+  my $status_table = $opt{S} || $args{status_table};
 
   #just doing this manually with IVR MSSQL databases for now
   #  # check for existence of freesidestatus
@@ -91,9 +92,9 @@ sub dbi_import {
 
   #my @cols = values %{ $args{column_map} };
   my $sql = "SELECT $table.* FROM $table "; # join(',', @cols). " FROM $table ".
-  $sql .=  'LEFT JOIN '. $opt{S}.
-           " ON ( $table.$pkey = ". $opt{S}. ".$pkey )"
-    if $opt{S};
+  $sql .=  'LEFT JOIN '. $status_table.
+           " ON ( $table.$pkey = ". $status_table. ".$pkey )"
+    if $status_table;
   $sql .= ' WHERE freesidestatus IS NULL ';
 
   #$sql .= ' LIMIT '. $opt{L} if $opt{L};
@@ -141,10 +142,10 @@ sub dbi_import {
       $imported++;
 
       my $st_sql;
-      if ( $opt{S} ) {
+      if ( $status_table ) {
 
         $st_sql = 
-          'INSERT INTO '. $opt{S}. " ( $pkey, freesidestatus ) ".
+          'INSERT INTO '. $status_table. " ( $pkey, freesidestatus ) ".
             " VALUES ( ?, 'done' )";
 
       } else {
@@ -191,4 +192,4 @@ L<FS::cdr>
 
 =cut
 
-1;
+1;
\ No newline at end of file

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

Summary of changes:
 FS/FS/cdr/Import.pm |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list