summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/contacts_new.html
blob: f73483ae1e0d031f963a418ff8f9d69f4d1116d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<BR>
<FONT CLASS="fsinnerbox-title">Contacts</FONT>
<A HREF="<%$p%>edit/cust_main-contacts.html?<% $cust_main->custnum %>">Edit contacts</A>

<& /elements/table-grid.html &>
% my $bgcolor1 = '#eeeeee';
%     my $bgcolor2 = '#ffffff';
%     my $bgcolor = $bgcolor2;
<TR>
  <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Type</TH>
  <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Contact</TH>
  <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Email</TH>
  <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc">Self-service</TH>
% foreach my $phone_type (@phone_type) {
    <TH CLASS="grid" ALIGN="left" BGCOLOR="#cccccc"><% $phone_type->typename |h %> phone</TD>
% }
</TR>

%   foreach my $contact ( @contacts ) {
      <TR>
        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->contact_classname |h %></TD>
        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->line |h %></TD>

%       my @contact_email = $contact->contact_email;
        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% join(', ', map $_->emailaddress, @contact_email) %></TD>

        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
%         if ( $contact->selfservice_access ) {
            Enabled
%#            <FONT SIZE="-1"><A HREF="XXX">disable</A>
%#                            <A HREF="XXX">re-email</A></FONT>
%         } else {
            Disabled
%#            <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
%        }
       </TD>

%       foreach my $phone_type (@phone_type) {
%         my $contact_phone =
%           qsearchs('contact_phone', {
%                      'contactnum'   => $contact->contactnum,
%                      'phonetypenum' => $phone_type->phonetypenum,
%                   });
          <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
%       }

      </TR>

%     if ( $bgcolor eq $bgcolor1 ) {
%        $bgcolor = $bgcolor2;
%      } else {
%        $bgcolor = $bgcolor1;
%      }
%   }
</TABLE>
<%once>

my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});

</%once>
<%init>

my( $cust_main ) = @_;
#my $conf = new FS::Conf;

my @contacts = $cust_main->cust_contact;

</%init>