[freeside-commits] branch FREESIDE_4_BRANCH updated. 745724e03e6dcff6c8d07027d154dbcb289cd527

Christopher Burger burgerc at freeside.biz
Mon Feb 26 12:33:33 PST 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  745724e03e6dcff6c8d07027d154dbcb289cd527 (commit)
       via  1bde07fabf19b6948c3e4173d17b04db396e55bd (commit)
      from  c46aa55bdeb3e09437c7ab18288f209a6fa44796 (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 745724e03e6dcff6c8d07027d154dbcb289cd527
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Feb 26 12:11:34 2018 -0500

    RT# 79497 - removed test code

diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index ed285ca15..e1a5bc6e2 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -187,10 +187,7 @@ if ( $cgi->param('residential_commercial') eq 'Residential' ) {
     $error = 'Email address required';
   }
 
-  #$email =~ s/\s+/\, /g;
-  #$options{'invoicing_list'} = [ split(/\s*,\s*/, $email) ];
   $options{'invoicing_list'} = [ split(/[,\s]+/, $email) ];
-  #[:,\s\/]+
   # XXX really should include the phone numbers in here also
 
 } else {

commit 1bde07fabf19b6948c3e4173d17b04db396e55bd
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Feb 26 12:00:12 2018 -0500

    RT# 79497 - Changed email address check to all emails to be seperated by a space.  Added contacts to change history.

diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index 088576fe2..ed285ca15 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -187,7 +187,10 @@ if ( $cgi->param('residential_commercial') eq 'Residential' ) {
     $error = 'Email address required';
   }
 
-  $options{'invoicing_list'} = [ split(/\s*,\s*/, $email) ];
+  #$email =~ s/\s+/\, /g;
+  #$options{'invoicing_list'} = [ split(/\s*,\s*/, $email) ];
+  $options{'invoicing_list'} = [ split(/[,\s]+/, $email) ];
+  #[:,\s\/]+
   # XXX really should include the phone numbers in here also
 
 } else {
diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html
index 5fba23621..4c05f4e3a 100644
--- a/httemplate/elements/change_history_common.html
+++ b/httemplate/elements/change_history_common.html
@@ -210,6 +210,12 @@ my $tag_labelsub = sub {
   $label. ': <SPAN STYLE="background-color: #'.$part_tag->tagcolor.'">'. encode_entities($part_tag->tagname). '</SPAN>';
 };
 
+my $contact_labelsub = sub {
+  my($item, $label) = @_;
+  my $contact = qsearchs('h_contact',{ contactnum => $item->contactnum });
+  $label. ': <B>'. encode_entities($contact->first). ' ' . encode_entities($contact->last) . '</B>';
+};
+
 my %h_table_labelsub = (
   'h_cust_pkg'      => $pkg_labelsub,
   'h_svc_acct'      => $svc_labelsub,
@@ -222,6 +228,7 @@ my %h_table_labelsub = (
   'h_svc_phone'     => $svc_labelsub,
   #'h_phone_device'
   #'h_cust_tag'      => $tag_labelsub,
+  'h_contact'  => $contact_labelsub,
 );
 
 my $tag_descripsub = sub {
diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html
index f28196a5d..d8f0d1efc 100644
--- a/httemplate/view/cust_main/change_history.html
+++ b/httemplate/view/cust_main/change_history.html
@@ -48,6 +48,7 @@ tie my %tables, 'Tie::IxHash',
   'cust_pkg_discount' => 'Discount',
   #? it gets provisioned anyway 'phone_avail'         => 'Phone',
   'cust_tag'          => 'Tag',
+  'contact'           => 'Contact',
 ;
 
 my $pkg_join = "JOIN cust_pkg USING ( pkgnum )";
@@ -68,6 +69,7 @@ my %table_join = (
   'radius_usergroup' => $svc_join,
   'phone_device'     => $svc_join,
   'cust_pkg_discount'=> $pkg_join,
+  'contact'          => "JOIN cust_contact USING ( contactnum )",
 );
 
 %table_join = (%table_join, map { $_ => $svc_join } @svc_tables);
@@ -141,13 +143,16 @@ my $newer_than = int( time - $years * 31556736 ); #60*60*24*365.24
 
 local($FS::Record::nowarn_classload) = 1;
 
+my $extra_sql = ' AND custnum = '. $cust_main->custnum;
+
 my %foundsvcs;
 foreach my $table ( keys %tables ) {
+  $extra_sql = ' AND cust_contact.custnum = '. $cust_main->custnum if $table eq 'contact';
   my @items = qsearch({
     'table'     => "h_$table",
     'addl_from' => $table_join{$table},
     'hashref'   => { 'history_date' =>  { op=>'>=', value=>$newer_than }, },
-    'extra_sql' => ' AND custnum = '. $cust_main->custnum,
+    'extra_sql' => $extra_sql,
   });
   %foundsvcs = (%foundsvcs, map { $_->svcnum => 1 } @items)
     if $table =~ /^svc/;

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

Summary of changes:
 httemplate/edit/process/cust_main.cgi          | 2 +-
 httemplate/elements/change_history_common.html | 7 +++++++
 httemplate/view/cust_main/change_history.html  | 7 ++++++-
 3 files changed, 14 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list