From d8cb6cd67cc574c90dbbfbd8db2da6711c516d65 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 28 Dec 2008 18:48:51 +0000 Subject: fix browse results for selecting counties (resulting from separating tax classes), also add dropdowns to browse by state and county, RT#4496 --- httemplate/edit/cust_main/billing.html | 4 +- httemplate/edit/cust_main/contact.html | 20 +++-- httemplate/edit/cust_main/select-country.html | 76 ----------------- httemplate/edit/cust_main/select-county.html | 113 -------------------------- httemplate/edit/cust_main/select-state.html | 4 - 5 files changed, 14 insertions(+), 203 deletions(-) delete mode 100644 httemplate/edit/cust_main/select-country.html delete mode 100644 httemplate/edit/cust_main/select-county.html delete mode 100644 httemplate/edit/cust_main/select-state.html (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index d4c503412..8724db9dc 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -199,11 +199,11 @@ % ( $conf->exists('show_bankstate') ? % qq!$paystate_label!. % qq!!. -% include('select-state.html', +% include('/elements/select-state.html', % 'empty' => '(choose)', % 'state' => $cust_main->paystate, % 'country' => $cust_main->country, -% 'prefix' => 'pay', +% 'prefix' => 'pay', % ). "" % : '' diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index 2d37dc895..d93d41728 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -54,11 +54,11 @@ ><%$r%>County - <% include('select-county.html', %select_hash ) %> + <% include('/elements/select-county.html', %select_hash ) %> <%$r%>State - <% include('select-state.html', %select_hash ) %> + <% include('/elements/select-state.html', %select_hash ) %> <%$r%>Zip @@ -68,7 +68,7 @@ <%$r%>Country - <% include('select-country.html', %select_hash ) %> + <% include('/elements/select-country.html', %select_hash ) %> % if ( !$pre ) { % } @@ -102,11 +102,15 @@ <% $stateid_label %> > <% $stateid_state_label %> - <% include('select-state.html', 'state' => $cust_main->stateid_state, - 'country' => $cust_main->country, - 'prefix' => 'stateid_', - 'onchange' => $onchange, - 'disabled' => $disabled) %> + <% include('/elements/select-state.html', + 'state' => $cust_main->stateid_state, + 'country' => $cust_main->country, + 'prefix' => 'stateid_', + 'onchange' => $onchange, + 'disabled' => $disabled, + ) + %> + % } elsif ( !$pre ) { diff --git a/httemplate/edit/cust_main/select-country.html b/httemplate/edit/cust_main/select-country.html deleted file mode 100644 index 137f61975..000000000 --- a/httemplate/edit/cust_main/select-country.html +++ /dev/null @@ -1,76 +0,0 @@ - -<% include('/elements/xmlhttp.html', - 'url' => $p.'misc/states.cgi', - 'subs' => [ $opt{'prefix'}. 'get_states' ], - ) -%> - - - - - -<%init> -my %opt = @_; -foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); -} - -my $conf = new FS::Conf; -my $countrydefault = $conf->config('countrydefault') || 'US'; - - diff --git a/httemplate/edit/cust_main/select-county.html b/httemplate/edit/cust_main/select-county.html deleted file mode 100644 index 0dc826896..000000000 --- a/httemplate/edit/cust_main/select-county.html +++ /dev/null @@ -1,113 +0,0 @@ -% if ( $countyflag ) { - - <% include('/elements/xmlhttp.html', - 'url' => $p.'misc/counties.cgi', - 'subs' => [ $opt{'prefix'}. 'get_counties' ], - ) - %> - - - - - -% } else { - - - - - - -% } - -<%init> - -my %opt = @_; -foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); -} - -my @counties = (); -if ( $countyflag ) { - - @counties = counties( $opt{'state'}, $opt{'country'} ); - - # this is very hacky - unless ( scalar(@counties) > 1 ) { - if ( $opt{'disabled'} =~ /STYLE=/i ) { - $opt{'disabled'} =~ s/STYLE="([^"]+)"/STYLE="$1; display:none"/i; - } else { - $opt{'disabled'} .= ' STYLE="display:none"'; - } - } - -} - - -<%once> - -my $sql = "SELECT COUNT(*) FROM cust_main_county". - " WHERE county IS NOT NULL AND county != ''"; -my $sth = dbh->prepare($sql) or die dbh->errstr; -$sth->execute or die $sth->errstr; -my $countyflag = $sth->fetchrow_arrayref->[0]; - - diff --git a/httemplate/edit/cust_main/select-state.html b/httemplate/edit/cust_main/select-state.html deleted file mode 100644 index ce08443e4..000000000 --- a/httemplate/edit/cust_main/select-state.html +++ /dev/null @@ -1,4 +0,0 @@ -<% include('/elements/select-state.html', @_) %> -<%init> -warn "cust_main/select-state.html depreated; use /elements/select-state.html instead"; - -- cgit v1.2.1