4.x styling customer edit cleanup
[freeside.git] / httemplate / view / cust_main / contacts.html
index 83a6380..1660c1c 100644 (file)
@@ -10,7 +10,7 @@
 %   if ( $this eq 'ship' and 
 %       $cust_main->bill_locationnum == $cust_main->ship_locationnum )
 %   {
- (<% mt('same as billing') %>)
+ (<% emt('same as billing') %>)
 %   }
 </FONT>
 %   if (
                     $cust_main->spouse_last, $cust_main->spouse_first) %>
     </TD>
   </TR>
-% }
-%   if ( $conf->exists('cust-email-high-visibility') ) {
+%   }
+%
+%   # invoicing email
+%   if ( scalar(@invoicing_list) == 1 ) { # typical individual user; show here
   <TR>
-    <TH ALIGN="right"><% mt('Email address(es)') |h %></TH>
-    <TD BGCOLOR="#ffff00">
-      <% $cust_main->invoicing_list_emailonly_scalar || $no %>
+    <TH ALIGN="right"><% mt('Email address') |h %></TH>
+    <TD>
+      <% $invoicing_list[0] %>
     </TD>
   </TR>
-%   }
+%   } elsif ( scalar(@invoicing_list) > 1 ) {
+%   # business customer with a contact list
+%   # show nothing here
+%
+%   } else { # there is no invoice email for them
+  <TR>
+    <TH ALIGN="right"><% mt('Email address') |h %></TH>
+%     if ( !$cust_main->postal_invoice or
+%          $conf->exists('cust_main-require_invoicing_list_email',
+%                        $cust_main->agentnum)
+%     ) {
+%       # we need a contact email for this customer (either because that's
+%       # policy, or because otherwise they won't receive invoices) but we
+%       # don't have one.
+    <TD CLASS="error"><% emt('none') %></TD>
+%     } else {
+    <TD><% emt('no') %></TD>
+%     }
+%   } # end of invoicing email
 %   if ( $cust_main->company ) {
   <TR>
     <TH ALIGN="right"><% mt('Company') |h %></TH>
@@ -61,7 +82,7 @@
 % } elsif ( $this eq 'ship' ) {
 %   if ( $cust_main->ship_company ) { # mostly obsolete these days...
   <TR>
-    <TD ALIGN="right"><% mt('Company') |h %></TD>
+    <TH ALIGN="right"><% mt('Company') |h %></TH>
     <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
   </TR>
 %   }
@@ -72,7 +93,7 @@
 
 %   if ( $location->locationname ) {
       <TR>
-        <TD ALIGN="right"><% mt('Location ID') |h %></TD>
+        <TH ALIGN="right"><% mt('Location ID') |h %></TH>
         <TD COLSPAN=7><% $location->locationname |h %></TD>
       </TR>
 %   }
 % if ( $location->county ) {
  (<% $location->county |h %> county)\
 % }
-,<% state_label( $location->state, $location->country ) |h %>
-  <% $location->zip %>
+<% ($location->city || $location->county) ? ', ' : ''%><% state_label( $location->state, $location->country ) |h %>
+  <% $location->zip |h %>
 </TD>
 </TR>
 <TR>
   <TH></TH>
-  <TD><% code2country( $location->country ) %></TD>
+  <TD><% $location->country_full |h %></TD>
 </TR>
 
 % if ( $location->latitude && $location->longitude ) {
 %   foreach my $phone (qw(daytime night mobile)) {
 %     next if !$cust_main->get($phone);
 <TR>
-  <TD ALIGN="right"><% $phone_label{$phone} %></TD>
+  <TH ALIGN="right"><% $phone_label{$phone} %></TD>
   <TD COLSPAN=3>
     <& /elements/phonenumber.html,
         $cust_main->get($phone),
 %   if ( $cust_main->get('fax') ) {
 
   <TR>
-    <TD ALIGN="right"><% mt('Fax') |h %></TD>
+    <TH ALIGN="right"><% mt('Fax') |h %></TH>
     <TD COLSPAN=3>
       <% $cust_main->get('fax') || '&nbsp;' %>
     </TD>
 %   if ( $conf->exists('show_stateid') ) { 
 
 <TR>
-    <TD ALIGN="right"><% $stateid_label %></TD>
+    <TH ALIGN="right"><% $stateid_label %></TH>
     <TD><% $cust_main->masked('stateid') || '&nbsp' %></TD>
-    <TD ALIGN="right"><% $stateid_state_label %></TD>
+    <TH ALIGN="right"><% $stateid_state_label %></TH>
     <TD><% $cust_main->stateid_state || '&nbsp' %></TD>
   </TR>
 
@@ -195,8 +216,6 @@ my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_st
 
 my $cust_main = shift;
 my $conf = new FS::Conf;
-my @invoicing_list = $cust_main->invoicing_list;
-my $no = emt('no');
+my @invoicing_list = $cust_main->invoicing_list_emailonly;
 
 </%init>
-