2 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
3 <A HREF="<%$p%>edit/cust_main-contacts.html?<% $cust_main->custnum %>">Edit contacts</A>
5 <& /elements/table-grid.html &>
6 % my $bgcolor1 = '#eeeeee';
7 % my $bgcolor2 = '#ffffff';
8 % my $bgcolor = $bgcolor2;
10 <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Type</TH>
11 <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Contact</TH>
12 <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Email</TH>
13 <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Self-service</TH>
14 % foreach my $phone_type (@phone_type) {
15 <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc"><% $phone_type->typename |h %> phone</TD>
19 % foreach my $contact ( @contacts ) {
21 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->contact_classname |h %></TD>
22 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->line |h %></TD>
24 % my @contact_email = $contact->contact_email;
25 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% join(', ', map $_->emailaddress, @contact_email) %></TD>
27 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
28 % if ( $contact->selfservice_access ) {
30 %# <FONT SIZE="-1"><A HREF="XXX">disable</A>
31 %# <A HREF="XXX">re-email</A></FONT>
34 %# <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
38 % foreach my $phone_type (@phone_type) {
40 % qsearchs('contact_phone', {
41 % 'contactnum' => $contact->contactnum,
42 % 'phonetypenum' => $phone_type->phonetypenum,
44 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
49 % if ( $bgcolor eq $bgcolor1 ) {
50 % $bgcolor = $bgcolor2;
52 % $bgcolor = $bgcolor1;
58 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
63 my( $cust_main ) = @_;
64 #my $conf = new FS::Conf;
66 my @contacts = $cust_main->cust_contact;