1 % if ( $display and @cust_contacts ) {
3 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
5 <& /elements/table-grid.html &>
7 % my $th = '<TH CLASS="grid" ALIGN="left">';
12 <%$th%>Send invoices</TH>
13 <%$th%>Self-service</TH>
14 % foreach my $phone_type (@phone_type) {
15 <%$th%><% $phone_type->typename |h %></TH>
21 % my $bgcolor1 = '#ffffff';
22 % my $bgcolor2 = '#eeeeee';
23 % my $bgcolor = $bgcolor2;
24 % foreach my $cust_contact ( @cust_contacts ) {
25 % my $contact = $cust_contact->contact;
26 % my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
29 <%$td%><% $cust_contact->contact_classname |h %></TD>
30 <%$td%><% $contact->line |h %></TD>
32 % my @contact_email = $contact->contact_email;
33 <%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
34 <%$td%><% $contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
36 % if ( $cust_contact->selfservice_access ) {
38 %# <FONT SIZE="-1"><A HREF="XXX">disable</A>
39 %# <A HREF="XXX">re-email</A></FONT>
42 %# <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
46 % foreach my $phone_type (@phone_type) {
48 % qsearchs('contact_phone', {
49 % 'contactnum' => $contact->contactnum,
50 % 'phonetypenum' => $phone_type->phonetypenum,
52 <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
55 <%$td%><% $cust_contact->comment |h %></TD>
59 % if ( $bgcolor eq $bgcolor1 ) {
60 % $bgcolor = $bgcolor2;
62 % $bgcolor = $bgcolor1;
69 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
74 my( $cust_main ) = @_;
75 #my $conf = new FS::Conf;
77 my @cust_contacts = $cust_main->cust_contact;
79 # residential customers have a default "invisible" contact, but if they
80 # somehow get more than one contact, show them
81 my $display = scalar(@cust_contacts) > 1;