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%>Send messages</TH>
14 <%$th%>Self-service</TH>
15 % foreach my $phone_type (@phone_type) {
16 <%$th%><% $phone_type->typename |h %></TH>
22 % my $bgcolor1 = '#ffffff';
23 % my $bgcolor2 = '#eeeeee';
24 % my $bgcolor = $bgcolor2;
25 % foreach my $cust_contact ( @cust_contacts ) {
26 % my $contact = $cust_contact->contact;
27 % my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
30 <%$td%><% $cust_contact->contact_classname |h %></TD>
31 <%$td%><% $contact->line |h %></TD>
33 % my @contact_email = $contact->contact_email;
34 <%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
35 <%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
36 <%$td%><% $cust_contact->message_dest eq 'Y' ? 'Yes' : 'No' %></TD>
38 % if ( $cust_contact->selfservice_access ) {
40 %# <FONT SIZE="-1"><A HREF="XXX">disable</A>
41 %# <A HREF="XXX">re-email</A></FONT>
44 %# <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
48 % foreach my $phone_type (@phone_type) {
50 % qsearchs('contact_phone', {
51 % 'contactnum' => $contact->contactnum,
52 % 'phonetypenum' => $phone_type->phonetypenum,
54 <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
57 <%$td%><% $cust_contact->comment |h %></TD>
61 % if ( $bgcolor eq $bgcolor1 ) {
62 % $bgcolor = $bgcolor2;
64 % $bgcolor = $bgcolor1;
71 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
76 my( $cust_main ) = @_;
77 #my $conf = new FS::Conf;
79 my @cust_contacts = $cust_main->cust_contact;
81 # residential customers have a default "invisible" contact, but if they
82 # somehow get more than one contact, show them
83 my $display = scalar(@cust_contacts) > 1;