[freeside-commits] branch FREESIDE_4_BRANCH updated. 915c1adc738b5dcd8d8d28d3df6ae22ecf4fd5dc

Christopher Burger burgerc at freeside.biz
Fri Jan 4 10:01:48 PST 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  915c1adc738b5dcd8d8d28d3df6ae22ecf4fd5dc (commit)
      from  060e8d28ba3004b95e39c074285c8d26b70a4432 (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 915c1adc738b5dcd8d8d28d3df6ae22ecf4fd5dc
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Thu Jan 3 12:38:32 2019 -0500

    RT 81913 - fixed error with batch email from advanced customer reports and contacts report

diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html
index 3f8816caa..b631165dc 100644
--- a/httemplate/misc/email-customers.html
+++ b/httemplate/misc/email-customers.html
@@ -184,7 +184,7 @@ Template:
        },
      &>
    </div>
-% if ($send_to_domain) {
+% if ($send_to_domain && $cgi->param('custnum')) {
    <div>
      <INPUT TYPE="checkbox" NAME="emailtovoice"  ID="emailtovoice" VALUE="ON" onclick="toggleDiv(this)">Email to voice
    </div>
@@ -326,6 +326,15 @@ else {
   @search{keys %search} = map { /\0/ ? [ split /\0/, $_ ] : $_ } values %search;
 }
 
+# rebuild contacts hash
+delete $search{contacts}
+    if exists $search{contacts} && ref $search{contacts};
+$search{'contacts'} = {
+  map { $_ => $search{$_}, }
+    grep { /^(contacts_*)/ && $search{$_} }
+      keys %search
+};
+
 &{$opt{'post_search_hook'}}(
   'conf'   => $conf,
   'search' => \%search,
diff --git a/httemplate/search/contact.html b/httemplate/search/contact.html
index 4b3fe8399..24cb237c3 100644
--- a/httemplate/search/contact.html
+++ b/httemplate/search/contact.html
@@ -243,10 +243,15 @@ for my $col (@report) {
 
 my $classnum_url_part;
 if (@classnum) {
-  $classnum_url_part = join '', map{ "&classnums=$_" } @classnum, @dest;
+  $classnum_url_part = join '', map{ "&classnums=$_" } @classnum;
   $classnum_url_part .= '&classnums=0' if $classnum_null;
 }
 
+my $dest_url_part;
+if (@dest) {
+  $dest_url_part = join '', map{ "&dest=$_" } @dest;
+}
+
 # E-mail pipeline, from email-customers.html through to email queue job,
 # doesn't support cust_prospect table
 my $send_email_link = undef;
@@ -262,6 +267,7 @@ if ($link eq 'cust_main') {
       '&refnum=1'.
       '&with_email=on'.
       $classnum_url_part.
+      $dest_url_part.
     "\">Email a notice to these customers</a>";
 }
 
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 0a43a82dd..1cc44d68a 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -143,6 +143,8 @@ if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') )
   # URI::query_from does not support hashref
   #   results in: ...&contacts=HASH(0x55e16cb81da8)&...
   my %query_hash = %search_hash;
+  foreach (keys %{$query_hash{contacts}}) { $query_hash{$_} = $query_hash{contacts}{$_}; }
+
   delete $query_hash{contacts}
     if exists $query_hash{contacts} && ref $query_hash{contacts};
 

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

Summary of changes:
 httemplate/misc/email-customers.html | 11 ++++++++++-
 httemplate/search/contact.html       |  8 +++++++-
 httemplate/search/cust_main.html     |  2 ++
 3 files changed, 19 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list