Contacts Edit contacts % foreach my $contact ( @contacts ) { % #XXX maybe this should be a table with alternating colors instead % my @contact_email = $contact->contact_email; % if (@contact_email) { % } % foreach my $phone_type (@phone_type) { % my $contact_phone = % qsearchs('contact_phone', { % 'contactnum' => $contact->contactnum, % 'phonetypenum' => $phone_type->phonetypenum, % }) % or next; % } % if ( $contact->comment ) { % } % }
<% $contact->contact_classname %> Contact <% $contact->line %>   Email <% join(', ', map $_->emailaddress, @contact_email) %>   <% $phone_type->typename %> phone <% $contact_phone->phonenum |h %>   Comment <% $contact->comment |h %>
<%once> my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'}); <%init> my( $cust_main ) = @_; #my $conf = new FS::Conf; my @contacts = $cust_main->cust_contact;