X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontacts_new.html;h=90314258d87a5ef3cd86b205e8ece598e4c745b1;hb=c15c4b8b1afa91049915f77503487e663554938b;hp=f59126a6662143afad69bfbbb836f1522138014c;hpb=f62a68016f32b443084705b0e7851497b308f81d;p=freeside.git diff --git a/httemplate/edit/cust_main/contacts_new.html b/httemplate/edit/cust_main/contacts_new.html index f59126a66..90314258d 100644 --- a/httemplate/edit/cust_main/contacts_new.html +++ b/httemplate/edit/cust_main/contacts_new.html @@ -1,23 +1,40 @@ + + +<& '/elements/validate_password_js.html', &> +

Contacts <% include('/edit/elements/edit.html', - 'embed' => $opt{cust_main}, - 'table' => 'cust_main', - 'labels' => { 'contactnum' => 'Contact', - #'locationnum' => ' ', - }, - 'fields' => [ + 'embed' => $opt{cust_main}, + 'table' => 'cust_main', + 'agent_virt' => 1, + 'submit_id' => $opt{submit_id}, + 'html_table_class' => 'fsinnerbox', + 'labels' => { 'contactnum' => '', #'Contact', + #'locationnum' => ' ', + }, + 'fields' => [ { 'field' => 'contactnum', 'type' => 'contact', 'colspan' => 6, + 'custnum' => $opt{cust_main}->custnum, 'm2m_method' => 'cust_contact', 'm2m_dstcol' => 'contactnum', - 'm2_label' => 'Contact', + 'm2_label' => ' ', #'Contact', 'm2_error_callback' => $m2_error_callback, }, ], - 'agent_virt' => 1, ) %>
@@ -36,8 +53,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 +62,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 {