diff options
author | ivan <ivan> | 2001-10-30 15:39:27 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-10-30 15:39:27 +0000 |
commit | 14655eb7b88692104732988ee9aab14a855ff752 (patch) | |
tree | 781378ca4325cda69171389afe47a2ec563267d5 /httemplate | |
parent | c14a267229fc0d6f2d2afdebab3bd34d825df2ef (diff) |
better ordering of state selection on new customer screen
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/edit/cust_main.cgi | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index d8191c7d6..cc692dd88 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_main.cgi,v 1.9 2001-10-30 14:54:07 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.10 2001-10-30 15:39:27 ivan Exp $ --> use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum $last $first $ss $company $address1 $address2 $city $zip @@ -178,11 +178,16 @@ print <<END; <TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="state" SIZE="1"> END -$cust_main->country( $conf->config('countrydefault') || 'US' ) - unless $cust_main->country; +my $countrydefault = $conf->config('countrydefault') || 'US'; +$cust_main->country( $countrydefault ) unless $cust_main->country; $cust_main->state( $conf->config('statedefault') || 'CA' ) unless $cust_main->state || $cust_main->country ne 'US'; -foreach ( qsearch('cust_main_county',{}) ) { +foreach ( sort { + $a->country eq $countrydefault <=> $b->country eq $countrydefault + or $a->country cmp $b->country + or $a->state cmp $b->state + or $a->county cmp $b->county +} qsearch('cust_main_county',{}) ) { print "<OPTION"; print " SELECTED" if ( $cust_main->state eq $_->state && $cust_main->county eq $_->county |