2b10b9dfd5e1a6212bf4fce906c5e581a5b07063
[freeside.git] / httemplate / view / cust_main / contacts.html
1 % my %which = (
2 %   ''      => emt('Billing'),
3 %   'ship_' => emt('Service'),
4 % );
5 % foreach my $which ( '', 'ship_' ) {
6 %   my $pre = $cust_main->get("${which}last") ? $which : '';
7
8 <% $which{$which} %> <% mt('address') |h %>
9 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
10 <TR>
11   <TD ALIGN="right"><% mt('Contact name') |h %></TD>
12   <TD COLSPAN=5 BGCOLOR="#ffffff">
13     <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %>
14   </TD>
15 % if ( $which eq '' && $conf->exists('show_ss') ) { 
16     <TD ALIGN="right"><% mt('SS#') |h %></TD>
17     <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
18 % } 
19 </TR>
20
21 % if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
22   <TR>
23     <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
24     <TD BGCOLOR="#ffff00">
25       <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
26     </TD>
27   </TR>
28 % }
29
30 <TR>
31   <TD ALIGN="right"><% mt('Company') |h %></TD>
32   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
33 </TR>
34 <TR>
35   <TD ALIGN="right"><% mt('Address') |h %></TD>
36   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
37 </TR>
38
39 % if ( $cust_main->get("${pre}address2") ) { 
40 %   my $address2_label =
41 %     ( $conf->exists('cust_main-require_address2')
42 %       && ! ( $pre xor $cust_main->has_ship_address )
43 %     )
44 %       ? emt('Unit #')
45 %       : ' ';
46
47   <TR>
48     <TD ALIGN="right"><% $address2_label %></TD>
49     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD>
50   </TR>
51
52 % } 
53
54 <TR>
55   <TD ALIGN="right"><% mt('City') |h %></TD>
56   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD>
57 % if ( $cust_main->get("${pre}county") ) {
58     <TD ALIGN="right"><% mt('County') |h %></TD>
59     <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD>
60 % }
61   <TD ALIGN="right"><% mt('State') |h %></TD>
62   <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD>
63   <TD ALIGN="right"><% mt('Zip') |h %></TD>
64   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
65 </TR>
66 <TR>
67   <TD ALIGN="right"><% mt('Country') |h %></TD>
68   <TD BGCOLOR="#ffffff"><% code2country( $cust_main->get("${pre}country") ) %></TD>
69 </TR>
70
71 % if ( $cust_main->get($pre.'latitude') && $cust_main->get($pre.'longitude') ) {
72   <& /elements/tr-coords.html, $cust_main->get($pre.'latitude'),
73                                $cust_main->get($pre.'longitude'),
74                                $cust_main->name_short,
75                                $cust_main->agentnum,
76   &>
77 % }
78
79 <TR>
80   <TD ALIGN="right"><% $daytime_label %></TD>
81   <TD COLSPAN=3 BGCOLOR="#ffffff">
82     <& /elements/phonenumber.html,
83                   $cust_main->get("${pre}daytime"),
84                   'callable'=>1,
85                   'calling_list_exempt'=>$cust_main->calling_list_exempt,
86     &>
87   </TD>
88 </TR>
89 <TR>
90   <TD ALIGN="right"><% $night_label %></TD>
91   <TD COLSPAN=3 BGCOLOR="#ffffff">
92     <& /elements/phonenumber.html,
93                   $cust_main->get("${pre}night"),
94                   'callable'=>1,
95                   'calling_list_exempt'=>$cust_main->calling_list_exempt,
96     &>
97   </TD>
98 </TR>
99 <TR>
100   <TD ALIGN="right"><% $mobile_label %></TD>
101   <TD COLSPAN=3 BGCOLOR="#ffffff">
102     <& /elements/phonenumber.html,
103                   $cust_main->get("${pre}mobile"),
104                   'callable'=>1,
105                   'calling_list_exempt'=>$cust_main->calling_list_exempt,
106     &>
107   </TD>
108 </TR>
109 <TR>
110   <TD ALIGN="right"><% mt('Fax') |h %></TD>
111   <TD COLSPAN=3 BGCOLOR="#ffffff">
112     <% $cust_main->get("${pre}fax") || '&nbsp' %>
113   </TD>
114 </TR>
115 % if ( $which eq '' && $conf->exists('show_stateid') ) { 
116   <TR>
117     <TD ALIGN="right"><% $stateid_label %></TD>
118     <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
119     <TD ALIGN="right"><% $stateid_state_label %></TD>
120     <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
121   </TR>
122 % } 
123 </TABLE></TD></TR></TABLE>
124 % if ( $which ne 'ship_' ) {
125 <BR>
126 % }
127 % } 
128 <& contacts_new.html, $cust_main &>
129 <%once>
130
131 my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
132                       ? 'Day&nbsp;Phone'
133                       : FS::Msgcat::_gettext('daytime');
134 my $night_label   = FS::Msgcat::_gettext('night') =~ /^(night)?$/
135                       ? 'Night&nbsp;Phone'
136                       : FS::Msgcat::_gettext('night');
137 my $mobile_label = FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
138                       ? 'Mobile&nbsp;Phone'
139                       : FS::Msgcat::_gettext('Mobile');
140
141 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
142                       ? 'Driver&rsquo;s&nbsp;License'
143                       : FS::Msgcat::_gettext('stateid');
144 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
145                       ? 'Driver&rsquo;s&nbsp;License State'
146                       : FS::Msgcat::_gettext('stateid_state');
147
148 </%once>
149 <%init>
150
151 my( $cust_main ) = @_;
152 my $conf = new FS::Conf;
153 my @invoicing_list = $cust_main->invoicing_list;
154 my $no = emt('no');
155
156 </%init>
157