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 %> phone</TH>
22 % my $bgcolor1 = '#ffffff';
23 % my $bgcolor2 = '#eeeeee';
24 % my $bgcolor = $bgcolor2;
26 % foreach my $cust_contact ( @cust_contacts ) {
27 % my $contact = $cust_contact->contact;
28 % my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
31 <%$td%><% $cust_contact->contact_classname |h %></TD>
32 <%$td%><% $contact->line |h %></TD>
34 % my @contact_email = $contact->contact_email;
35 <%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
36 <%$td%><% $cust_contact->invoice_dest eq 'Y' ? 'Yes' : 'No' %></TD>
37 <%$td%><% $cust_contact->message_dest eq 'Y' ? 'Yes' : 'No' %></TD>
39 % if ( $cust_contact->selfservice_access ) {
41 %# <FONT SIZE="-1"><A HREF="XXX">disable</A>
42 %# <A HREF="XXX">re-email</A></FONT>
44 <& /elements/change_password.html,
45 'contact_num' => $cust_contact->contactnum,
46 'custnum' => $cust_contact->custnum,
47 'no_label_display' => '',
48 'label' => 'change password',
50 'pre_pwd_field_label' => 'contact'.$count.'_',
55 %# <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
59 % foreach my $phone_type (@phone_type) {
61 % qsearchs('contact_phone', {
62 % 'contactnum' => $contact->contactnum,
63 % 'phonetypenum' => $phone_type->phonetypenum,
65 <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
68 <%$td%><% $cust_contact->comment |h %></TD>
72 % if ( $bgcolor eq $bgcolor1 ) {
73 % $bgcolor = $bgcolor2;
75 % $bgcolor = $bgcolor1;
83 my @phone_type = FS::phone_type->get_phone_types();
88 my( $cust_main ) = @_;
89 #my $conf = new FS::Conf;
91 my @cust_contacts = $cust_main->cust_contact;
93 # residential customers have a default "invisible" contact, but if they
94 # somehow get more than one contact, show them
95 my $display = scalar(@cust_contacts) > 0;