[freeside-commits] branch FREESIDE_3_BRANCH updated. 3e4d22b2cd42755981754f95de97f915a31f8233

Christopher Burger burgerc at freeside.biz
Mon Feb 26 16:44:39 PST 2018


The branch, FREESIDE_3_BRANCH has been updated
       via  3e4d22b2cd42755981754f95de97f915a31f8233 (commit)
       via  cedd94d2315b9c20f939a9619ba83156e7765b8b (commit)
      from  3120e258a9a859bba3b64e493cf6d922d8b49e4c (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 3e4d22b2cd42755981754f95de97f915a31f8233
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Feb 26 19:43:07 2018 -0500

    RT# 79497 - change on v3 to carry over contacts on edit customer error.  V3 fix for displaying contacts in change history

diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index fbd292ffb..7c0eb4d58 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -402,7 +402,8 @@ if ( $cgi->param('error') ) {
 }
 
 my %keep = map { $_=>1 } qw( error tagnum lock_agentnum lock_pkgpart );
-$cgi->delete( grep { !$keep{$_} && $_ !~ /^tax_/ } $cgi->param );
+#$cgi->delete( grep { !$keep{$_} && $_ !~ /^tax_/ } $cgi->param );
+$cgi->delete( grep { !$keep{$_} && $_ !~ /^tax_/ && $_ !~ /^contactnum/ } $cgi->param );
 
 my $title = $custnum ? 'Edit Customer' : 'Add Customer';
 $title = mt($title);
diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html
index 95fdc4e20..52edca424 100644
--- a/httemplate/view/cust_main/change_history.html
+++ b/httemplate/view/cust_main/change_history.html
@@ -68,7 +68,6 @@ 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);
@@ -146,7 +145,6 @@ 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},

commit cedd94d2315b9c20f939a9619ba83156e7765b8b
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.
    
    Conflicts:
            httemplate/edit/process/cust_main.cgi

diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index a86819f4b..e3fa4e6f8 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -62,7 +62,7 @@ if ( $payby ) {
     $cgi->param( 'exp_month' ). '-'. $cgi->param( 'exp_year' ) );
 }
 
-my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
+my @invoicing_list = split( /[,\s]+/, $cgi->param('invoicing_list') );
 push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
 push @invoicing_list, 'FAX' if $cgi->param('invoicing_list_FAX');
 $cgi->param('invoicing_list', join(',', @invoicing_list) );
diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html
index 63337cb6a..a526493ce 100644
--- a/httemplate/elements/change_history_common.html
+++ b/httemplate/elements/change_history_common.html
@@ -208,6 +208,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,
@@ -220,6 +226,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 a781c7372..95fdc4e20 100644
--- a/httemplate/view/cust_main/change_history.html
+++ b/httemplate/view/cust_main/change_history.html
@@ -47,6 +47,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 )";
@@ -67,6 +68,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);
@@ -140,13 +142,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/cust_main.cgi                  | 3 ++-
 httemplate/edit/process/cust_main.cgi          | 2 +-
 httemplate/elements/change_history_common.html | 7 +++++++
 httemplate/view/cust_main/change_history.html  | 5 ++++-
 4 files changed, 14 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list