[freeside-commits] freeside/FS/FS/ClientAPI Signup.pm,1.25,1.26
Ivan,,,
ivan at wavetail.420.am
Tue Sep 5 18:07:26 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail:/tmp/cvs-serv27921
Modified Files:
Signup.pm
Log Message:
less cut and paste
Index: Signup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/Signup.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Signup.pm 1 Sep 2006 01:51:46 -0000 1.25
+++ Signup.pm 6 Sep 2006 01:07:24 -0000 1.26
@@ -83,22 +83,21 @@
'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} = [];
+ my @addl = qw( signup_server-classnum2 signup_server-classnum3 );
- 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 ( grep { $conf->exists($_) } @addl ) {
+
+ $signup_info->{optional_packages} = [];
- 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;
- }
+ foreach my $addl ( @addl ) {
+ my $classnum = $conf->config($addl) or next;
+ my @pkgs = map { $_->hashref }
+ qsearch( 'part_pkg', { classnum => $classnum } );
+ push @{$signup_info->{optional_packages}}, \@pkgs;
+ }
}
More information about the freeside-commits
mailing list