summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorlawrence <lawrence>2006-09-01 01:51:46 +0000
committerlawrence <lawrence>2006-09-01 01:51:46 +0000
commit1720200cdbbd73919d3b25e221f3d47cdd12032d (patch)
tree12d15eefdb1b1f12d673249605366947c312f69e /FS
parent514bcfc98bba47b1cc0a117fcd1f1ab5c21b9f65 (diff)
Progress checkpoint on improved signup stuff for additional services
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/Signup.pm18
-rw-r--r--FS/FS/Conf.pm21
2 files changed, 38 insertions, 1 deletions
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 5d6eb0e24..7589f16fc 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -83,9 +83,25 @@ sub signup_info {
'countrydefault' => $conf->config('countrydefault') || 'US',
'refnum' => $conf->config('signup_server-default_refnum'),
-
};
+
+
+ if ($conf->exists('signup_server-classnum2') || $conf->exists('signup_server-classnum3')) {
+ $signup_info->{optional_packages} = [];
+
+ if (my $classnum = $conf->config('signup_server-classnum2')) {
+ my @pkgs = map { $_->hashref } FS::Record::qsearch( 'part_pkg', { classnum => $classnum } );
+ push @{$signup_info->{optional_packages}}, \@pkgs;
+ }
+
+ if (my $classnum = $conf->config('signup_server-classnum3')) {
+ my @pkgs = map { $_->hashref } FS::Record::qsearch( 'part_pkg', { classnum => $classnum } );
+ push @{$signup_info->{optional_packages}}, \@pkgs;
+ }
+
+ }
+
my $agentnum = $conf->config('signup_server-default_agentnum');
my $session = '';
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index f6495119e..ee1692a62 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1201,6 +1201,26 @@ httemplate/docs/config.html
'description' => 'Run billing for signup server signups immediately, and do not provision accounts which subsequently have a balance.',
'type' => 'checkbox',
},
+ {
+ key => 'signup_server-classnum2',
+ section => '',
+ description => 'Package Class for first optional purchase',
+ type => 'select-sub',
+ options_sub => sub { my @o = map { $_->{classnum} => $_->{classname} } map { $_->hashref } FS::Record::qsearch('pkg_class',{});
+ } ,
+ option_sub => sub { return map { $_->hashref->{classname}} FS::Record::qsearchs('pkg_class', { classnum => shift } ); },
+
+ },
+
+ {
+ key => 'signup_server-classnum3',
+ section => '',
+ description => 'Package Class for second optional purchase',
+ type => 'select-sub',
+ options_sub => sub { my @o = map { $_->{classnum} => $_->{classname} } map { $_->hashref } FS::Record::qsearch('pkg_class',{});
+ } ,
+ option_sub => sub { return map { $_->hashref->{classname}} FS::Record::qsearchs('pkg_class', { classnum => shift } ); },
+ },
{
'key' => 'backend-realtime',
@@ -1752,6 +1772,7 @@ httemplate/docs/config.html
'type' => 'text',
},
+
);
1;