internationalization/localization, RT12515
[freeside.git] / httemplate / view / cust_main / contacts.html
1 % my %which = (
2 %   ''      => mt('Billing'),
3 %   'ship_' => mt('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">SS#</TD>
17     <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
18 % } 
19 </TR>
20 <TR>
21   <TD ALIGN="right"><% mt('Company') |h %></TD>
22   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
23 </TR>
24 <TR>
25   <TD ALIGN="right"><% mt('Address') |h %></TD>
26   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
27 </TR>
28
29 % if ( $cust_main->get("${pre}address2") ) { 
30 %   my $address2_label =
31 %     ( $conf->exists('cust_main-require_address2')
32 %       && ! ( $pre xor $cust_main->has_ship_address )
33 %     )
34 %       ? mt('Unit #')
35 %       : ' ';
36
37   <TR>
38     <TD ALIGN="right"><% $address2_label %></TD>
39     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD>
40   </TR>
41
42 % } 
43
44 <TR>
45   <TD ALIGN="right"><% mt('City') |h %></TD>
46   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD>
47 % if ( $cust_main->get("${pre}county") ) {
48     <TD ALIGN="right"><% mt('County') |h %></TD>
49     <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD>
50 % }
51   <TD ALIGN="right"><% mt('State') |h %></TD>
52   <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD>
53   <TD ALIGN="right"><% mt('Zip') |h %></TD>
54   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
55 </TR>
56 <TR>
57   <TD ALIGN="right"><% mt('Country') |h %></TD>
58   <TD BGCOLOR="#ffffff"><% code2country( $cust_main->get("${pre}country") ) %></TD>
59 </TR>
60 <TR>
61   <TD ALIGN="right"><% $daytime_label %></TD>
62   <TD COLSPAN=3 BGCOLOR="#ffffff">
63     <& /elements/phonenumber.html,
64                   $cust_main->get("${pre}daytime"),
65                   'callable'=>1
66     &>
67   </TD>
68 </TR>
69 <TR>
70   <TD ALIGN="right"><% $night_label %></TD>
71   <TD COLSPAN=3 BGCOLOR="#ffffff">
72     <& /elements/phonenumber.html,
73                   $cust_main->get("${pre}night"),
74                   'callable'=>1
75     &>
76   </TD>
77 </TR>
78 <TR>
79   <TD ALIGN="right"><% mt('Fax') |h %></TD>
80   <TD COLSPAN=3 BGCOLOR="#ffffff">
81     <% $cust_main->get("${pre}fax") || '&nbsp' %>
82   </TD>
83 </TR>
84 % if ( $which eq '' && $conf->exists('show_stateid') ) { 
85   <TR>
86     <TD ALIGN="right"><% $stateid_label %></TD>
87     <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
88     <TD ALIGN="right"><% $stateid_state_label %></TD>
89     <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
90   </TR>
91 % } 
92 </TABLE></TD></TR></TABLE>
93 % if ( $which ne 'ship_' ) {
94 <BR>
95 % }
96 % } 
97 <& contacts_new.html, $cust_main &>
98 <%once>
99
100 my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
101                       ? 'Day&nbsp;Phone'
102                       : FS::Msgcat::_gettext('daytime');
103 my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
104                       ? 'Night&nbsp;Phone'
105                       : FS::Msgcat::_gettext('night');
106 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
107                       ? 'Driver&rsquo;s&nbsp;License'
108                       : FS::Msgcat::_gettext('stateid');
109 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
110                       ? 'Driver&rsquo;s&nbsp;License State'
111                       : FS::Msgcat::_gettext('stateid_state');
112
113 </%once>
114 <%init>
115
116 my( $cust_main ) = @_;
117 my $conf = new FS::Conf;
118
119 </%init>
120