[freeside-commits] freeside/FS/FS/ClientAPI Signup.pm,1.33,1.34
Ivan,,,
ivan at wavetail.420.am
Thu Feb 1 20:40:01 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail:/tmp/cvs-serv28033/ClientAPI
Modified Files:
Signup.pm
Log Message:
set resellser-specific advertising sources in signup
Index: Signup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/Signup.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- Signup.pm 1 Feb 2007 02:35:54 -0000 1.33
+++ Signup.pm 2 Feb 2007 04:39:59 -0000 1.34
@@ -23,28 +23,21 @@
my $conf = new FS::Conf;
- use vars qw($signup_info); #cache for performance;
- $signup_info ||= {
+ use vars qw($signup_info_cache); #cache for performance;
+ $signup_info_cache ||= {
'cust_main_county' =>
[ map { $_->hashref } qsearch('cust_main_county', {}) ],
'agent' =>
[
map { $_->hashref }
- qsearch('agent', dbdef->table('agent')->column('disabled')
- ? { 'disabled' => '' }
- : {}
- )
+ qsearch('agent', { 'disabled' => '' } )
],
'part_referral' =>
[
map { $_->hashref }
- qsearch('part_referral',
- dbdef->table('part_referral')->column('disabled')
- ? { 'disabled' => '' }
- : {}
- )
+ qsearch('part_referral', { 'disabled' => '' })
],
'agentnum2part_pkg' =>
@@ -61,10 +54,7 @@
grep { $_->svcpart('svc_acct') && $href->{ $_->pkgpart } }
qsearch( 'part_pkg', { 'disabled' => '' } )
];
- } qsearch('agent', dbdef->table('agent')->column('disabled')
- ? { 'disabled' => '' }
- : {}
- )
+ } qsearch('agent', { 'disabled' => '' })
},
'svc_acct_pop' => [ map { $_->hashref } qsearch('svc_acct_pop',{} ) ],
@@ -77,9 +67,9 @@
'card_types' => card_types(),
- 'cvv_enabled' => defined dbdef->table('cust_main')->column('paycvv'),
+ 'cvv_enabled' => defined dbdef->table('cust_main')->column('paycvv'), # 1,
- 'ship_enabled' => defined dbdef->table('cust_main')->column('ship_last'),
+ 'ship_enabled' => defined dbdef->table('cust_main')->column('ship_last'),#1,
'msgcat' => { map { $_=>gettext($_) } qw(
passwords_dont_match invalid_card unknown_card_type not_a empty_password illegal_or_empty_text
@@ -95,6 +85,8 @@
};
+ my $signup_info = { %$signup_info_cache };
+
my @addl = qw( signup_server-classnum2 signup_server-classnum3 );
if ( grep { $conf->exists($_) } @addl ) {
@@ -120,6 +112,8 @@
my $agentnum = $packet->{'agentnum'}
|| $conf->config('signup_server-default_agentnum');
+ $agentnum =~ /^(\d*)$/ or die "illegal agentnum";
+ $agentnum = $1;
my $session = '';
if ( exists $packet->{'session_id'} ) {
@@ -189,6 +183,19 @@
if ( $agentnum && ! @{ $signup_info->{'part_pkg'} } ) {
$signup_info->{'part_pkg'} = $signup_info->{'agentnum2part_pkg'}{$agentnum};
+
+ $signup_info->{'part_referral'} =
+ [
+ map { $_->hashref }
+ qsearch( {
+ 'table' => 'part_referral',
+ 'hashref' => { 'disabled' => '' },
+ 'extra_sql' => "AND ( agentnum = $agentnum ".
+ " OR agentnum IS NULL ) ",
+ },
+ )
+ ];
+
}
# else {
# delete $signup_info->{'part_pkg'};
More information about the freeside-commits
mailing list