remove an inadvertant debugging call left in, allow an agentnum to be specfied for...
authorivan <ivan>
Sat, 24 Oct 2009 02:04:41 +0000 (02:04 +0000)
committerivan <ivan>
Sat, 24 Oct 2009 02:04:41 +0000 (02:04 +0000)
FS/FS/ClientAPI/MyAccount.pm
fs_selfservice/FS-SelfService/cgi/decline.html
fs_selfservice/FS-SelfService/cgi/login.html
fs_selfservice/FS-SelfService/cgi/selfservice.cgi
fs_selfservice/FS-SelfService/cgi/signup.cgi
fs_selfservice/FS-SelfService/cgi/signup.html
fs_selfservice/FS-SelfService/cgi/success.html

index a651a83..1e029ed 100644 (file)
@@ -74,8 +74,10 @@ sub skin_info {
     $agentnum = $sth->fetchrow_arrayref->[0]
       or die "no agentnum for custnum $custnum";
 
+  #} elsif ( $context eq 'agent' ) {
+  } elsif ( $p->{'agentnum'} =~ /^(\d+)$/ ) {
+    $agentnum = $1;
   }
-  # elsif ( $context eq 'agent' ) {
 
   my $conf = new FS::Conf;
 
@@ -94,6 +96,7 @@ sub skin_info {
       if $DEBUG > 1;
 
     $skin_info_cache_agent = {
+      'agentnum' => $agentnum,
       ( map { $_ => scalar( $conf->config($_, $agentnum) ) }
         qw( company_name ) ),
       ( map { $_ => scalar( $conf->config("selfservice-$_", $agentnum ) ) }
@@ -106,9 +109,6 @@ sub skin_info {
 
   }
 
-  use Data::Dumper;
-  warn Dumper($skin_info_cache_agent);
-
   #{ %$skin_info_cache_agent };
   $skin_info_cache_agent;
 
index a37ba3a..c50081e 100644 (file)
@@ -1,5 +1,14 @@
-<HTML><HEAD><TITLE>Processing error</TITLE></HEAD>
-<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Processing error</FONT><BR><BR>
+<HTML>
+  <HEAD>
+    <TITLE>Processing error</TITLE>
+    <%= $head %>
+  </HEAD>
+  <BODY BGCOLOR="<%= $body_bgcolor || '#eeeeee' %>">
+  <%= $body_header %>
+
+
+<FONT SIZE=7>Processing error</FONT><BR><BR>
 There has been an error processing your account.  Please contact customer
 support.
-</BODY></HTML>
+
+<%= $body_footer %>
index eef412d..f7473b1 100644 (file)
@@ -11,6 +11,7 @@
 
 <FORM ACTION="<%= $self_url %>" METHOD=POST>
 <INPUT TYPE="hidden" NAME="session" VALUE="login">
+<INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
 
 <TABLE BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>" BORDER=0 CELLSPACING=2 CELLPADDING=0>
 
index ec8d6d8..734563b 100644 (file)
@@ -29,7 +29,7 @@ $form_max = 255;
 $cgi = new CGI;
 
 unless ( defined $cgi->param('session') ) {
-  my $login_info = login_info();
+  my $login_info = login_info( 'agentnum' => scalar($cgi->param('agentnum')) );
 
   do_template('login', $login_info );
   exit;
@@ -55,7 +55,7 @@ if ( $cgi->param('session') eq 'login' ) {
     'password' => $password,
   );
   if ( $rv->{error} ) {
-    my $login_info = login_info();
+    my $login_info = login_info( 'agentnum' => $cgi->param('agentnum') );
     do_template('login', {
       'error'    => $rv->{error},
       'username' => $username,
index da59543..7d1679b 100755 (executable)
@@ -141,7 +141,7 @@ if ( -e $decline_html ) {
 
 $cgi = new CGI;
 
-$init_data = signup_info( 'agentnum'   => $agentnum,
+$init_data = signup_info( 'agentnum'   => $agentnum || scalar($cgi->param('agentnum')),
                           'promo_code' => scalar($cgi->param('promo_code')),
                           'reg_code'   => uc(scalar($cgi->param('reg_code'))),
                         );
@@ -320,8 +320,14 @@ sub print_collect {
 }
 
 sub print_decline {
+  my $r = {
+    %{$init_data},
+  };
+
   print $cgi->header( '-expires' => 'now' ),
-        $decline_template->fill_in();
+        $decline_template->fill_in( PACKAGE => 'FS::SelfService::_signupcgi',
+                                    HASH    => $r
+                                  );
 }
 
 sub print_okay {
@@ -389,6 +395,8 @@ sub print_okay {
     print $cgi->header( '-expires' => 'now' ),
           $success_template->fill_in( HASH => {
 
+            %{$init_data},
+
             email_name     => $email_name,
             pkg            => $pkg,
             part_pkg       => \$part_pkg,
index 9ee0cab..375137b 100755 (executable)
@@ -30,6 +30,7 @@
 <FORM NAME="OneTrueForm" ACTION="<%= $self_url %>" METHOD=POST onSubmit="document.OneTrueForm.signup.disabled=true">
 <INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
 <INPUT TYPE="hidden" NAME="action" VALUE="process_signup">
+<INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
 <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<%= $referral_custnum %>">
 <INPUT TYPE="hidden" NAME="ss" VALUE="">
 <input type="hidden" name="payby">
index 8105e41..ccbcc62 100644 (file)
@@ -1,10 +1,10 @@
 <HTML>
-
-<HEAD>
-  <TITLE>Signup successful</TITLE>
-</HEAD>
-
-<BODY BGCOLOR="#e8e8e8">
+  <HEAD>
+    <TITLE>Signup successful</TITLE>
+    <%= $head %>
+  </HEAD>
+  <BODY BGCOLOR="<%= $body_bgcolor || '#eeeeee' %>">
+  <%= $body_header %>
 
 <FONT SIZE=7>Signup successful</FONT><BR><BR>
 
@@ -37,5 +37,4 @@ END
 
   Package: <%= $pkg %><BR>
 
-</BODY>
-</HTML>
+<%= $body_footer %>