[freeside-commits] freeside/httemplate/view/cust_main contacts.html, 1.5, 1.6

Ivan,,, ivan at wavetail.420.am
Tue Dec 26 17:36:01 PST 2006


Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail:/tmp/cvs-serv3593

Modified Files:
	contacts.html 
Log Message:
show county on customer view

Index: contacts.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/contacts.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- contacts.html	23 Aug 2006 22:25:38 -0000	1.5
+++ contacts.html	27 Dec 2006 01:35:59 -0000	1.6
@@ -1,122 +1,47 @@
-%
-%  my( $cust_main ) = @_;
-%  my $conf = new FS::Conf;
-%
-
-
-Billing address
-<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
-<TR>
-  <TD ALIGN="right">Contact&nbsp;name</TD>
-  <TD COLSPAN=3 BGCOLOR="#ffffff">
-    <% $cust_main->last. ', '. $cust_main->first %>
-  </TD>
-% if ( $conf->exists('show_ss') ) { 
-
-  <TD ALIGN="right">SS#</TD>
-  <TD BGCOLOR="#ffffff"><% $cust_main->ss || '&nbsp' %></TD>
-% } 
-
-</TR>
-<TR>
-  <TD ALIGN="right">Company</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->company %></TD>
-</TR>
-<TR>
-  <TD ALIGN="right">Address</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->address1 %></TD>
-</TR>
-% if ( $cust_main->address2 ) { 
-
-<TR>
-  <TD ALIGN="right">&nbsp;</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->address2 %></TD>
-</TR>
-% } 
-
-<TR>
-  <TD ALIGN="right">City</TD>
-  <TD BGCOLOR="#ffffff"><% $cust_main->city %></TD>
-  <TD ALIGN="right">State</TD>
-  <TD BGCOLOR="#ffffff"><% state_label($cust_main->state, $cust_main->country) %></TD>
-  <TD ALIGN="right">Zip</TD>
-  <TD BGCOLOR="#ffffff"><% $cust_main->zip %></TD>
-</TR>
-<TR>
-  <TD ALIGN="right">Country</TD>
-  <TD BGCOLOR="#ffffff"><% code2country($cust_main->country) %></TD>
-</TR>
-%
-%  my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
-%                        ? 'Day&nbsp;Phone'
-%                        : FS::Msgcat::_gettext('daytime');
-%  my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
-%                        ? 'Night&nbsp;Phone'
-%                        : FS::Msgcat::_gettext('night');
-%
-
-<TR>
-  <TD ALIGN="right"><% $daytime_label %></TD>
-  <TD COLSPAN=6 BGCOLOR="#ffffff">
-    <% include('/elements/phonenumber.html',
-                  $cust_main->daytime,
-                  'callable'=>1
-               )
-    %>
-  </TD>
-</TR>
-<TR>
-  <TD ALIGN="right"><% $night_label %></TD>
-  <TD COLSPAN=6 BGCOLOR="#ffffff">
-    <% include('/elements/phonenumber.html',
-                  $cust_main->night,
-                  'callable'=>1
-               )
-    %>
-  </TD>
-</TR>
-<TR>
-  <TD ALIGN="right">Fax</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff">
-    <% $cust_main->fax || '&nbsp' %>
-  </TD>
-</TR>
-</TABLE></TD></TR></TABLE>
-% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
-%     my $pre = $cust_main->ship_last ? 'ship_' : '';
-%
-
+% my %which = (
+%   ''      => 'Billing',
+%   'ship_' => 'Service',
+% );
+% foreach my $which ( '', 'ship_' ) {
+%   my $pre = $cust_main->get("${which}last") ? $which : '';
 
-<BR>
-Service address
+<% $which{$which} %> address
 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
 <TR>
   <TD ALIGN="right">Contact name</TD>
   <TD COLSPAN=5 BGCOLOR="#ffffff">
     <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %>
   </TD>
+% if ( $which eq '' && $conf->exists('show_ss') ) { 
+    <TD ALIGN="right">SS#</TD>
+    <TD BGCOLOR="#ffffff"><% $cust_main->ss || '&nbsp' %></TD>
+% } 
 </TR>
 <TR>
   <TD ALIGN="right">Company</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") %></TD>
+  <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") %></TD>
 </TR>
 <TR>
   <TD ALIGN="right">Address</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") %></TD>
+  <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") %></TD>
 </TR>
 % if ( $cust_main->get("${pre}address2") ) { 
 
 <TR>
   <TD ALIGN="right">&nbsp;</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") %></TD>
+  <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") %></TD>
 </TR>
 % } 
 
 <TR>
   <TD ALIGN="right">City</TD>
   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") %></TD>
+% if ( $cust_main->county ) { 
+    <TD ALIGN="right">County</TD>
+    <TD BGCOLOR="#ffffff"><% $cust_main->county %></TD>
+% }
   <TD ALIGN="right">State</TD>
-  <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}state") %></TD>
+  <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) %></TD>
   <TD ALIGN="right">Zip</TD>
   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
 </TR>
@@ -126,7 +51,7 @@
 </TR>
 <TR>
   <TD ALIGN="right"><% $daytime_label %></TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff">
+  <TD COLSPAN=3 BGCOLOR="#ffffff">
     <% include('/elements/phonenumber.html',
                   $cust_main->get("${pre}daytime"),
                   'callable'=>1
@@ -136,7 +61,7 @@
 </TR>
 <TR>
   <TD ALIGN="right"><% $night_label %></TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff">
+  <TD COLSPAN=3 BGCOLOR="#ffffff">
     <% include('/elements/phonenumber.html',
                   $cust_main->get("${pre}night"),
                   'callable'=>1
@@ -146,10 +71,30 @@
 </TR>
 <TR>
   <TD ALIGN="right">Fax</TD>
-  <TD COLSPAN=5 BGCOLOR="#ffffff">
+  <TD COLSPAN=3 BGCOLOR="#ffffff">
     <% $cust_main->get("${pre}fax") || '&nbsp' %>
   </TD>
 </TR>
 </TABLE></TD></TR></TABLE>
+% if ( $which ne 'ship_' ) {
+<BR>
+% }
 % } 
 
+<%once>
+
+my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
+                      ? 'Day&nbsp;Phone'
+                      : FS::Msgcat::_gettext('daytime');
+my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
+                      ? 'Night&nbsp;Phone'
+                      : FS::Msgcat::_gettext('night');
+
+</%once>
+<%init>
+
+my( $cust_main ) = @_;
+my $conf = new FS::Conf;
+
+</%init>
+



More information about the freeside-commits mailing list