[freeside-commits] branch master updated. 5310efb6d40b32ae08ae78553fc8721693925da7

Ivan ivan at 420.am
Wed Feb 4 12:39:19 PST 2015


The branch, master has been updated
       via  5310efb6d40b32ae08ae78553fc8721693925da7 (commit)
       via  e7e800e6b2a315171d7d8a9c1ff8bc7abb82f25b (commit)
      from  559ec892b6d4eea4c07ca5ecc0b3335e3eb13ba1 (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 5310efb6d40b32ae08ae78553fc8721693925da7
Merge: e7e800e 559ec89
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Feb 4 12:07:32 2015 -0800

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit e7e800e6b2a315171d7d8a9c1ff8bc7abb82f25b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Feb 4 12:07:24 2015 -0800

    fix error editing customers w/contacts -- contacts can be shared among customers / "duplicate contact emails", RT#27943

diff --git a/httemplate/edit/cust_main/contacts_new.html b/httemplate/edit/cust_main/contacts_new.html
index f59126a..0ab02b4 100644
--- a/httemplate/edit/cust_main/contacts_new.html
+++ b/httemplate/edit/cust_main/contacts_new.html
@@ -11,6 +11,7 @@
        { 'field'             => 'contactnum',
          'type'              => 'contact',
          'colspan'           => 6,
+         'custnum'           => $opt{cust_main}->custnum,
          'm2m_method'        => 'cust_contact',
          'm2m_dstcol'        => 'contactnum',   
          'm2_label'          => 'Contact',
@@ -36,8 +37,8 @@ my $m2_error_callback = sub {
   my($cgi, $object) = @_;
 
   #process_o2m fields in process/cust_main-contacts.html
-  my @fields = qw( first last title comment );
-  my @gfields = ( '', map "_$_", @fields );
+  my $fields = FS::contact->cgi_contact_fields;
+  my @gfields = ( '', map "_$_", @$fields );
 
   map {
         if ( /^contactnum(\d+)$/ ) {
@@ -45,7 +46,7 @@ my $m2_error_callback = sub {
           if ( grep $cgi->param("contactnum$num$_"), @gfields ) {
             my $x = new FS::contact {
               'contactnum' => scalar($cgi->param("contactnum$num")),
-              map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @fields,
+              map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @$fields,
             };
             $x;
           } else {

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

Summary of changes:
 httemplate/edit/cust_main/contacts_new.html |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list