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