allow signup to specify agentnum
authorivan <ivan>
Tue, 16 Apr 2002 00:02:26 +0000 (00:02 +0000)
committerivan <ivan>
Tue, 16 Apr 2002 00:02:26 +0000 (00:02 +0000)
fs_signup/FS-SignupClient/SignupClient.pm
fs_signup/FS-SignupClient/cgi/signup.cgi
fs_signup/fs_signup_server

index 7c9d46d..de269e1 100644 (file)
@@ -61,6 +61,7 @@ FS::SignupClient - Freeside signup client API
     '_password'        => $password,
     'sec_phrase'       => $sec_phrase,
     'popnum'           => $popnum,
+    'agentnum'         => $agentnum, #optional
   } );
 
 =head1 DESCRIPTION
@@ -163,6 +164,8 @@ sub new_customer {
     referral_custnum pkgpart username _password sec_phrase popnum
   ) };
 
+  $signup_data->{agentnum} = $hashref->{agentnum} if $hashref->{agentnum}
+
   nstore_fd($signup_data, \*SOCK) or die "can't send customer signup: $!";
   SOCK->flush;
 
index 284237d..f13dd43 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -Tw
 #
-# $Id: signup.cgi,v 1.20 2002-04-10 13:42:48 ivan Exp $
+# $Id: signup.cgi,v 1.21 2002-04-16 00:02:26 ivan Exp $
 
 use strict;
 use vars qw( @payby $cgi $locales $packages $pops $init_data $error
@@ -8,6 +8,7 @@ use vars qw( @payby $cgi $locales $packages $pops $init_data $error
              $country $zip $daytime $night $fax $invoicing_list $payby $payinfo
              $paydate $payname $referral_custnum
              $pkgpart $username $password $password2 $sec_phrase $popnum
+             $agentnum
              $ieak_file $ieak_template $cck_file $cck_template
              $signup_html $signup_template $success_html $success_template
              $ac $exch $loc
@@ -164,6 +165,7 @@ if ( defined $cgi->param('magic') ) {
         'sec_phrase'       => $sec_phrase       = $cgi->param('sec_phrase'),
         '_password'        => $password         = $cgi->param('_password'),
         'popnum'           => $popnum           = $cgi->param('popnum'),
+        'agentnum'         => $agentnum         = $cgi->param('agentnum'),
       } );
 
     }
index 41fed9a..12f1e5e 100755 (executable)
@@ -105,7 +105,7 @@ while (1) {
     # common that are still here and library them.
     my $cust_main = new FS::cust_main ( {
       #'custnum'          => '',
-      'agentnum'         => $agentnum,
+      'agentnum'         => $signup-data->{agentnum} || $agentnum,
       'refnum'           => $refnum,
 
       map { $_ => $signup_data->{$_} } qw(