683841c33a89073fc1204b69d588faaaa8d1051b
[freeside.git] / httemplate / view / cust_main / contacts_new.html
1 <BR>
2 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
3
4 <& /elements/table-grid.html &>
5 % my $bgcolor1 = '#eeeeee';
6 %     my $bgcolor2 = '#ffffff';
7 %     my $bgcolor = $bgcolor2;
8 % my $th = '<TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">';
9 <TR>
10   <%$th%>Type</TH>
11   <%$th%>Contact</TH>
12   <%$th%>Email</TH>
13   <%$th%>Self-service</TH>
14 % foreach my $phone_type (@phone_type) {
15     <%$th%><% $phone_type->typename |h %></TH>
16 % }
17   <%$th%>Comment</TH>
18 </TR>
19
20 %   foreach my $cust_contact ( @cust_contacts ) {
21 %     my $contact = $cust_contact->contact;
22 %     my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
23
24       <TR>
25         <%$td%><% $cust_contact->contact_classname |h %></TD>
26         <%$td%><% $contact->line |h %></TD>
27
28 %       my @contact_email = $contact->contact_email;
29         <%$td%><% join(', ', map $_->emailaddress, @contact_email) %></TD>
30
31         <%$td%>
32 %         if ( $cust_contact->selfservice_access ) {
33             Enabled
34 %#            <FONT SIZE="-1"><A HREF="XXX">disable</A>
35 %#                            <A HREF="XXX">re-email</A></FONT>
36 %         } else {
37             Disabled
38 %#            <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
39 %        }
40        </TD>
41
42 %       foreach my $phone_type (@phone_type) {
43 %         my $contact_phone =
44 %           qsearchs('contact_phone', {
45 %                      'contactnum'   => $contact->contactnum,
46 %                      'phonetypenum' => $phone_type->phonetypenum,
47 %                   });
48           <%$td%><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
49 %       }
50
51         <%$td%><% $cust_contact->comment |h %></TD>
52
53       </TR>
54
55 %     if ( $bgcolor eq $bgcolor1 ) {
56 %        $bgcolor = $bgcolor2;
57 %      } else {
58 %        $bgcolor = $bgcolor1;
59 %      }
60 %   }
61 </TABLE>
62 <%once>
63
64 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
65
66 </%once>
67 <%init>
68
69 my( $cust_main ) = @_;
70 #my $conf = new FS::Conf;
71
72 my @cust_contacts = $cust_main->cust_contact;
73
74 </%init>