self-service access for contacts, RT#25533
[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
5 <& /elements/table-grid.html &>
6 % my $bgcolor1 = '#eeeeee';
7 %     my $bgcolor2 = '#ffffff';
8 %     my $bgcolor = $bgcolor2;
9 <TR>
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>
16 % }
17 </TR>
18
19 %   foreach my $contact ( @contacts ) {
20       <TR>
21         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->contact_classname |h %></TD>
22         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact->line |h %></TD>
23
24 %       my @contact_email = $contact->contact_email;
25         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% join(', ', map $_->emailaddress, @contact_email) %></TD>
26
27         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
28 %         if ( $contact->selfservice_access ) {
29             Enabled
30 %#            <FONT SIZE="-1"><A HREF="XXX">disable</A>
31 %#                            <A HREF="XXX">re-email</A></FONT>
32 %         } else {
33             Disabled
34 %#            <FONT SIZE="-1"><A HREF="XXX">enable</A></FONT>
35 %        }
36        </TD>
37
38 %       foreach my $phone_type (@phone_type) {
39 %         my $contact_phone =
40 %           qsearchs('contact_phone', {
41 %                      'contactnum'   => $contact->contactnum,
42 %                      'phonetypenum' => $phone_type->phonetypenum,
43 %                   });
44           <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $contact_phone ? $contact_phone->phonenum_pretty : '' |h %></TD>
45 %       }
46
47       </TR>
48
49 %     if ( $bgcolor eq $bgcolor1 ) {
50 %        $bgcolor = $bgcolor2;
51 %      } else {
52 %        $bgcolor = $bgcolor1;
53 %      }
54 %   }
55 </TABLE>
56 <%once>
57
58 my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
59
60 </%once>
61 <%init>
62
63 my( $cust_main ) = @_;
64 #my $conf = new FS::Conf;
65
66 my @contacts = $cust_main->cust_contact;
67
68 </%init>