X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts_new.html;h=94488670df7f7e9a8af76767f15727b480c1073f;hb=6e33e8af0974d49c1c0cf65b1963846d35f6c156;hp=f73483ae1e0d031f963a418ff8f9d69f4d1116d5;hpb=cb6cca67db487271ce96b49289ada58691a2067d;p=freeside.git diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html index f73483ae1..94488670d 100644 --- a/httemplate/view/cust_main/contacts_new.html +++ b/httemplate/view/cust_main/contacts_new.html @@ -1,31 +1,39 @@ +% if ( $display and @cust_contacts ) {
Contacts -Edit contacts <& /elements/table-grid.html &> -% my $bgcolor1 = '#eeeeee'; -% my $bgcolor2 = '#ffffff'; -% my $bgcolor = $bgcolor2; + +% my $th = ''; - Type - Contact - Email - Self-service + <%$th%>Type + <%$th%>Contact + <%$th%>Email + <%$th%>Send invoices + <%$th%>Self-service % foreach my $phone_type (@phone_type) { - <% $phone_type->typename |h %> phone + <%$th%><% $phone_type->typename |h %> % } + <%$th%>Comment + + +% my $bgcolor1 = '#ffffff'; +% my $bgcolor2 = '#eeeeee'; +% my $bgcolor = $bgcolor2; +% foreach my $cust_contact ( @cust_contacts ) { +% my $contact = $cust_contact->contact; +% my $td = qq(); -% foreach my $contact ( @contacts ) { - <% $contact->contact_classname |h %> - <% $contact->line |h %> + <%$td%><% $cust_contact->contact_classname |h %> + <%$td%><% $contact->line |h %> % my @contact_email = $contact->contact_email; - <% join(', ', map $_->emailaddress, @contact_email) %> - - -% if ( $contact->selfservice_access ) { + <%$td%><% join(', ', map $_->emailaddress, @contact_email) %> + <%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %> + <%$td%> +% if ( $cust_contact->selfservice_access ) { Enabled %# disable %# re-email @@ -41,9 +49,11 @@ % 'contactnum' => $contact->contactnum, % 'phonetypenum' => $phone_type->phonetypenum, % }); - <% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %> + <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %> % } + <%$td%><% $cust_contact->comment |h %> + % if ( $bgcolor eq $bgcolor1 ) { @@ -53,6 +63,7 @@ % } % } +%} <%once> my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); @@ -63,6 +74,10 @@ my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); my( $cust_main ) = @_; #my $conf = new FS::Conf; -my @contacts = $cust_main->cust_contact; +my @cust_contacts = $cust_main->cust_contact; + +# residential customers have a default "invisible" contact, but if they +# somehow get more than one contact, show them +my $display = scalar(@cust_contacts) > 1;