have the UI use full country names, and state names outside the US...
[freeside.git] / httemplate / view / cust_main / contacts.html
1 <%
2   my( $cust_main ) = @_;
3   my $conf = new FS::Conf;
4 %>
5
6 Billing address
7 <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
8 <TR>
9   <TD ALIGN="right">Contact&nbsp;name</TD>
10   <TD COLSPAN=3 BGCOLOR="#ffffff">
11     <%= $cust_main->last. ', '. $cust_main->first %>
12   </TD>
13 <% if ( $conf->exists('show_ss') ) { %>
14   <TD ALIGN="right">SS#</TD>
15   <TD BGCOLOR="#ffffff"><%= $cust_main->ss || '&nbsp' %></TD>
16 <% } %>
17 </TR>
18 <TR>
19   <TD ALIGN="right">Company</TD>
20   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->company %></TD>
21 </TR>
22 <TR>
23   <TD ALIGN="right">Address</TD>
24   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->address1 %></TD>
25 </TR>
26 <% if ( $cust_main->address2 ) { %>
27 <TR>
28   <TD ALIGN="right">&nbsp;</TD>
29   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->address2 %></TD>
30 </TR>
31 <% } %>
32 <TR>
33   <TD ALIGN="right">City</TD>
34   <TD BGCOLOR="#ffffff"><%= $cust_main->city %></TD>
35   <TD ALIGN="right">State</TD>
36   <TD BGCOLOR="#ffffff"><%= state_label($cust_main->state, $cust_main->country) %></TD>
37   <TD ALIGN="right">Zip</TD>
38   <TD BGCOLOR="#ffffff"><%= $cust_main->zip %></TD>
39 </TR>
40 <TR>
41   <TD ALIGN="right">Country</TD>
42   <TD BGCOLOR="#ffffff"><%= code2country($cust_main->country) %></TD>
43 </TR>
44 <%
45   my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
46                         ? 'Day&nbsp;Phone'
47                         : FS::Msgcat::_gettext('daytime');
48   my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
49                         ? 'Night&nbsp;Phone'
50                         : FS::Msgcat::_gettext('night');
51 %>
52 <TR>
53   <TD ALIGN="right"><%= $daytime_label %></TD>
54   <TD COLSPAN=6 BGCOLOR="#ffffff">
55     <%= include('/elements/phonenumber.html',
56                   $cust_main->daytime,
57                   'callable'=>1
58                )
59     %>
60   </TD>
61 </TR>
62 <TR>
63   <TD ALIGN="right"><%= $night_label %></TD>
64   <TD COLSPAN=6 BGCOLOR="#ffffff">
65     <%= include('/elements/phonenumber.html',
66                   $cust_main->night,
67                   'callable'=>1
68                )
69     %>
70   </TD>
71 </TR>
72 <TR>
73   <TD ALIGN="right">Fax</TD>
74   <TD COLSPAN=5 BGCOLOR="#ffffff">
75     <%= $cust_main->fax || '&nbsp' %>
76   </TD>
77 </TR>
78 </TABLE></TD></TR></TABLE>
79
80 <% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
81      my $pre = $cust_main->ship_last ? 'ship_' : '';
82 %>
83
84 <BR>
85 Service address
86 <%= ntable("#cccccc") %><TR><TD><%= ntable("#cccccc",2) %>
87 <TR>
88   <TD ALIGN="right">Contact name</TD>
89   <TD COLSPAN=5 BGCOLOR="#ffffff">
90     <%= $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %>
91   </TD>
92 </TR>
93 <TR>
94   <TD ALIGN="right">Company</TD>
95   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}company") %></TD>
96 </TR>
97 <TR>
98   <TD ALIGN="right">Address</TD>
99   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}address1") %></TD>
100 </TR>
101 <% if ( $cust_main->get("${pre}address2") ) { %>
102 <TR>
103   <TD ALIGN="right">&nbsp;</TD>
104   <TD COLSPAN=5 BGCOLOR="#ffffff"><%= $cust_main->get("${pre}address2") %></TD>
105 </TR>
106 <% } %>
107 <TR>
108   <TD ALIGN="right">City</TD>
109   <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}city") %></TD>
110   <TD ALIGN="right">State</TD>
111   <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}state") %></TD>
112   <TD ALIGN="right">Zip</TD>
113   <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}zip") %></TD>
114 </TR>
115 <TR>
116   <TD ALIGN="right">Country</TD>
117   <TD BGCOLOR="#ffffff"><%= $cust_main->get("${pre}country") %></TD>
118 </TR>
119 <TR>
120   <TD ALIGN="right"><%= $daytime_label %></TD>
121   <TD COLSPAN=5 BGCOLOR="#ffffff">
122     <%= include('/elements/phonenumber.html',
123                   $cust_main->get("${pre}daytime"),
124                   'callable'=>1
125                )
126     %>
127   </TD>
128 </TR>
129 <TR>
130   <TD ALIGN="right"><%= $night_label %></TD>
131   <TD COLSPAN=5 BGCOLOR="#ffffff">
132     <%= include('/elements/phonenumber.html',
133                   $cust_main->get("${pre}night"),
134                   'callable'=>1
135                )
136     %>
137   </TD>
138 </TR>
139 <TR>
140   <TD ALIGN="right">Fax</TD>
141   <TD COLSPAN=5 BGCOLOR="#ffffff">
142     <%= $cust_main->get("${pre}fax") || '&nbsp' %>
143   </TD>
144 </TR>
145 </TABLE></TD></TR></TABLE>
146
147 <% } %>