[freeside-commits] freeside/FS/FS cust_pkg.pm,1.73.2.30,1.73.2.31
Ivan,,,
ivan at wavetail.420.am
Tue Aug 11 19:36:43 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18739/FS/FS
Modified Files:
Tag: FREESIDE_1_7_BRANCH
cust_pkg.pm
Log Message:
fix multiple pkgpart search, RT#5924
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.73.2.30
retrieving revision 1.73.2.31
diff -u -d -r1.73.2.30 -r1.73.2.31
--- cust_pkg.pm 2 Jul 2009 01:30:08 -0000 1.73.2.30
+++ cust_pkg.pm 12 Aug 2009 02:36:41 -0000 1.73.2.31
@@ -1800,7 +1800,7 @@
=item pkgpart
-list specified how?
+pkgpart or arrayref or hashref of pkgparts
=item setup
@@ -1926,9 +1926,24 @@
# parse part_pkg
###
- my $pkgpart = join (' OR pkgpart=',
- grep {$_} map { /^(\d+)$/; } ($params->{'pkgpart'}));
- push @where, '(pkgpart=' . $pkgpart . ')' if $pkgpart;
+ if ( ref($params->{'pkgpart'}) ) {
+
+ my @pkgpart = ();
+ if ( ref($params->{'pkgpart'}) eq 'HASH' ) {
+ @pkgpart = grep $params->{'pkgpart'}{$_}, keys %{ $params->{'pkgpart'} };
+ } elsif ( ref($params->{'pkgpart'}) eq 'ARRAY' ) {
+ @pkgpart = @{ $params->{'pkgpart'} };
+ } else {
+ die 'unhandled pkgpart ref '. $params->{'pkgpart'};
+ }
+
+ @pkgpart = grep /^(\d+)$/, @pkgpart;
+
+ push @where, 'pkgpart IN ('. join(',', @pkgpart). ')';
+
+ } elsif ( $params->{'pkgpart'} =~ /^(\d+)$/ ) {
+ push @where, "pkgpart = $1";
+ }
###
# parse dates
More information about the freeside-commits
mailing list