X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fcontacts_new.html;h=1171e7df4d70cbbb349a47b5eae0242f3ef80acd;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hp=f59126a6662143afad69bfbbb836f1522138014c;hpb=9b4209f91ad9e3c4cef7deebfb0180f6faf1d0dc;p=freeside.git
diff --git a/httemplate/edit/cust_main/contacts_new.html b/httemplate/edit/cust_main/contacts_new.html
index f59126a66..1171e7df4 100644
--- a/httemplate/edit/cust_main/contacts_new.html
+++ b/httemplate/edit/cust_main/contacts_new.html
@@ -2,22 +2,24 @@
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,
+ '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 +38,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 +47,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 {