[freeside-commits] freeside/httemplate/edit cust_main_county-expand.cgi, 1.14, 1.15 cust_main.cgi, 1.102, 1.103

Ivan,,, ivan at wavetail.420.am
Sun Oct 11 18:45:14 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv1395/httemplate/edit

Modified Files:
	cust_main_county-expand.cgi cust_main.cgi 
Log Message:
UI for per-city taxes (setup and assigning to customers/package locations), RT#5852

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main.cgi,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- cust_main.cgi	7 Aug 2009 23:08:03 -0000	1.102
+++ cust_main.cgi	12 Oct 2009 01:45:12 -0000	1.103
@@ -45,9 +45,11 @@
 
 %  my $same_checked = '';
 %  my $ship_disabled = '';
+%  my @ship_style = ();
 %  unless ( $cust_main->ship_last && $same ne 'Y' ) {
 %    $same_checked = 'CHECKED';
-%    $ship_disabled = 'DISABLED STYLE="background-color: #dddddd"';
+%    $ship_disabled = 'DISABLED';
+%    push @ship_style, 'background-color:#dddddd';
 %    foreach (
 %      qw( last first company address1 address2 city county state zip country
 %          daytime night fax )
@@ -74,14 +76,20 @@
 function bill_changed(what) {
   if ( what.form.same.checked ) {
 % for (qw( last first company address1 address2 city zip daytime night fax )) { 
-
     what.form.ship_<%$_%>.value = what.form.<%$_%>.value;
 % } 
 
     what.form.ship_country.selectedIndex = what.form.country.selectedIndex;
 
+    function fix_ship_city() {
+      what.form.ship_city_select.selectedIndex = what.form.city_select.selectedIndex;
+      what.form.ship_city.style.display = what.form.city.style.display;
+      what.form.ship_city_select.style.display = what.form.city_select.style.display;
+    }
+
     function fix_ship_county() {
       what.form.ship_county.selectedIndex = what.form.county.selectedIndex;
+      ship_county_changed(what.form.ship_county, fix_ship_city );
     }
 
     function fix_ship_state() {
@@ -97,7 +105,8 @@
   if ( what.checked ) {
     bill_changed(what);
 
-%   for (qw( last first company address1 address2 city county state zip country daytime night fax )) { 
+%   my @fields = qw( last first company address1 address2 city city_select county state zip country daytime night fax );
+%   for (@fields) { 
       what.form.ship_<%$_%>.disabled = true;
       what.form.ship_<%$_%>.style.backgroundColor = '#dddddd';
 %   } 
@@ -111,7 +120,7 @@
 
   } else {
 
-%   for (qw( last first company address1 address2 city county state zip country daytime night fax )) { 
+%   for (@fields) { 
       what.form.ship_<%$_%>.disabled = false;
       what.form.ship_<%$_%>.style.backgroundColor = '#ffffff';
 %   } 
@@ -136,6 +145,7 @@
              'pre'       => 'ship_',
              'onchange'  => '',
              'disabled'  => $ship_disabled,
+             'style'     => \@ship_style
           )
 %>
 

Index: cust_main_county-expand.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main_county-expand.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cust_main_county-expand.cgi	20 Feb 2008 01:10:31 -0000	1.14
+++ cust_main_county-expand.cgi	12 Oct 2009 01:45:12 -0000	1.15
@@ -37,9 +37,11 @@
 
 my $title;
 
-die "Can't expand entry!" if $cust_main_county->county;
+die "Can't expand entry!" if $cust_main_county->city;
 
-if ( $cust_main_county->state ) {
+if ( $cust_main_county->county ) {
+  $title = 'Cities';
+} elsif ( $cust_main_county->state ) {
   $title = 'Counties';
 } else {
   $title = 'States/Provinces';



More information about the freeside-commits mailing list