X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=fs_signup%2FFS-SignupClient%2Fcgi%2Fsignup.cgi;h=ebdcaf0b99e4b4b5838b6b7bd6e1e438791217f2;hb=349bf226f727807000f517f5a48a806bf660290f;hp=de142a1c457cd77672c97dd838e2ee2a014e2c69;hpb=268594d99867ba0db820884ac47b652deb02e265;p=freeside.git diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi index de142a1c4..ebdcaf0b9 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.cgi +++ b/fs_signup/FS-SignupClient/cgi/signup.cgi @@ -1,9 +1,11 @@ #!/usr/bin/perl -Tw # -# $Id: signup.cgi,v 1.37 2003-06-24 15:34:45 ivan Exp $ +# $Id: signup.cgi,v 1.40 2003-07-04 01:48:24 ivan Exp $ use strict; -use vars qw( @payby $cgi $locales $packages $pops $init_data $error +use vars qw( @payby $cgi $locales $packages + $pops %pop %popnum2pop + $init_data $error $last $first $ss $company $address1 $address2 $city $state $county $country $zip $daytime $night $fax $invoicing_list $payby $payinfo $paydate $payname $referral_custnum @@ -137,6 +139,12 @@ if ( -e $decline_html ) { ( $locales, $packages, $pops, $init_data ) = signup_info(); @payby = @{$init_data->{'payby'}} if @{$init_data->{'payby'}}; $packages = $init_data->{agentnum2part_pkg}{$agentnum} if $agentnum; +%pop = (); +%popnum2pop = (); +foreach (@$pops) { + push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; + $popnum2pop{$_->{popnum}} = $_; +} $cgi = new CGI; @@ -328,7 +336,7 @@ sub print_okay { or die "fatal: invalid email_name got past FS::SignupClient::new_customer"; $email_name = $1; #global for template - my $pop = pop_info($cgi->param('popnum')); + my $pop = $popnum2pop{$cgi->param('popnum')}; #or die "fatal: invalid popnum got past FS::SignupClient::new_customer"; if ( $pop ) { ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} ); @@ -366,15 +374,6 @@ sub print_okay { } } -sub pop_info { - my $popnum = shift; - my $pop; - foreach $pop ( @{$pops} ) { - if ( $pop->{'popnum'} == $popnum ) { return $pop; } - } - ''; -} - #horrible false laziness with FS/FS/svc_acct_pop.pm::popselector sub popselector { @@ -386,10 +385,12 @@ sub popselector { '' if scalar(@$pops) == 1; - my %pop = (); - foreach (@$pops) { - push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; - } + #my %pop = (); + #my %popnum2pop = (); + #foreach (@$pops) { + # push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_; + # $popnum2pop{$_->{popnum}} = $_; + #} my $text = < @@ -401,8 +402,7 @@ sub popselector { function acstate_changed(what) { state = what.options[what.selectedIndex].text; - for (var i = what.form.popac.length;i > 0;i--) - what.form.popac.options[i] = null; + what.form.popac.options.length = 0 what.form.popac.options[0] = new Option("Area code", "-1", false, true); END @@ -422,8 +422,7 @@ END $text .= < 0;i--) - what.form.popnum.options[i] = null; + what.form.popnum.options.length = 0; what.form.popnum.options[0] = new Option("City", "-1", false, true); END @@ -462,8 +461,15 @@ END $text .= qq!