[freeside-commits] branch FREESIDE_3_BRANCH updated. 213d2aee192d0aa9ccf5d2caa6bdb09611686901

Ivan ivan at 420.am
Fri Feb 5 05:32:11 PST 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  213d2aee192d0aa9ccf5d2caa6bdb09611686901 (commit)
      from  248adb2dc574b01909b85088144e5bedd661ee27 (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 213d2aee192d0aa9ccf5d2caa6bdb09611686901
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Fri Feb 5 05:32:07 2016 -0800

    zip email CDRs, RT#40112

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 4daa637..76cadc3 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2251,7 +2251,7 @@ sub generate_email {
   my @otherparts = ();
   if ( ref($self) eq 'FS::cust_bill' && $cust_main->email_csv_cdr ) {
 
-    if ( $conf->exists('voip-cust_email_csv_cdr_zip') ) {
+    if ( $conf->config('voip-cdr_email_attach') eq 'zip' ) {
 
       my $data = join('', map "$_\n",
                    $self->call_details(prepend_billed_number=>1)
@@ -2267,13 +2267,14 @@ sub generate_email {
       die "Error zipping CDR attachment: $!" unless $status == AZ_OK;
 
       push @otherparts, build MIME::Entity
-        'Type'       => 'application/zip',
-        'Encoding'   => 'base64',
-        'Data'       => $zipdata,
+        'Type'        => 'application/zip',
+        'Encoding'    => 'base64',
+        'Data'        => $zipdata,
+        'Disposition' => 'attachment',
         'Filename'    => 'usage-'. $self->invnum. '.zip',
       ;
 
-    } else {
+    } else { # } elsif ( $conf->config('voip-cdr_email_attach') eq 'csv' ) {
  
       push @otherparts, build MIME::Entity
         'Type'        => 'text/csv',
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index c4b66c8..519f2f8 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -597,9 +597,9 @@ function toggle(obj) {
       <INPUT TYPE="hidden" NAME="squelch_cdr" VALUE="<% $cust_main->squelch_cdr %>">
 % }
 
-% if ( $conf->config('voip-cdr_email_attach') ) { 
+% if ( my $attach = $conf->config('voip-cdr_email_attach') ) {
       <TR>
-       <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="email_csv_cdr" VALUE="Y" <% $cust_main->email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as CSV to emailed invoices') |h %></TD>
+       <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="email_csv_cdr" VALUE="Y" <% $cust_main->email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as '. uc($attach). ' to emailed invoices') |h %></TD>
       </TR>
 % } else { 
       <INPUT TYPE="hidden" NAME="email_csv_cdr" VALUE="<% $cust_main->email_csv_cdr %>">
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 39f0324..3d0983e 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -385,9 +385,9 @@
    </TR>
 % }
 
-% if ( $conf->config('voip-cdr_email_attach') ) { 
+% if ( my $attach = $conf->config('voip-cdr_email_attach') ) { 
   <TR>
-    <TD ALIGN="right"><% mt('Email CDRs as CSV') |h %></TD>
+    <TD ALIGN="right"><% mt('Email CDRs as '.uc($attach)) |h %></TD>
     <TD BGCOLOR="#ffffff"><% $cust_main->email_csv_cdr ? $yes : $no %></TD>
   </TR>
 % } 

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

Summary of changes:
 FS/FS/Template_Mixin.pm                |   11 ++++++-----
 httemplate/edit/cust_main/billing.html |    4 ++--
 httemplate/view/cust_main/billing.html |    4 ++--
 3 files changed, 10 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list