normalize contact phone formatting
[freeside.git] / httemplate / view / cust_main / contacts_new.html
1 <BR>
2 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
3 <A HREF="<%$p%>edit/cust_main-contacts.html?<% $cust_main->custnum %>">Edit contacts</A>
4 <TABLE CLASS="fsinnerbox">
5 %   foreach my $contact ( @contacts ) {
6 %     #XXX maybe this should be a table with alternating colors instead
7       <TR>
8         <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD>
9         <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
10
11 %       my @contact_email = $contact->contact_email;
12 %       if (@contact_email) {
13           <TD ALIGN="right">&nbsp;&nbsp;&nbsp;Email</TD>
14           <TD BGCOLOR="#FFFFFF"><% join(', ', map $_->emailaddress, @contact_email) %></TD>
15 %       }
16
17 %       foreach my $phone_type (@phone_type) {
18 %         my $contact_phone =
19 %           qsearchs('contact_phone', {
20 %                      'contactnum'   => $contact->contactnum,
21 %                      'phonetypenum' => $phone_type->phonetypenum,
22 %                   })
23 %           or next;
24           <TD ALIGN="right">&nbsp;&nbsp;&nbsp;<% $phone_type->typename %> phone</TD>
25           <TD BGCOLOR="#FFFFFF"><% $contact_phone->phonenum_pretty |h %></TD>
26 %       }
27
28       </TR>
29 %   }
30 </TABLE>
31 <%once>
32
33 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
34
35 </%once>
36 <%init>
37
38 my( $cust_main ) = @_;
39 #my $conf = new FS::Conf;
40
41 my @contacts = $cust_main->cust_contact;
42
43 </%init>