[freeside-commits] freeside/FS/FS cust_pkg.pm, 1.179.2.31, 1.179.2.32
Ivan,,,
ivan at wavetail.420.am
Thu Aug 18 16:29:28 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15516/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cust_pkg.pm
Log Message:
fix 477 package links, RT#13922
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.179.2.31
retrieving revision 1.179.2.32
diff -u -w -d -r1.179.2.31 -r1.179.2.32
--- cust_pkg.pm 18 Aug 2011 21:27:49 -0000 1.179.2.31
+++ cust_pkg.pm 18 Aug 2011 23:29:25 -0000 1.179.2.32
@@ -2981,6 +2981,7 @@
} elsif ( @c_where ) {
push @where, ' ( '. join(' OR ', @c_where). ' ) ';
}
+ warn $where[-1];
}
@@ -2992,13 +2993,15 @@
###
my @report_option = ();
- if ( exists($params->{'report_option'})
- && $params->{'report_option'} =~ /^([,\d]*)$/
- )
- {
+ if ( exists($params->{'report_option'}) ) {
+ if ( ref($params->{'report_option'}) eq 'ARRAY' ) {
+ @report_option = @{ $params->{'report_option'} };
+ } elsif ( $params->{'report_option'} =~ /^([,\d]*)$/ ) {
@report_option = split(',', $1);
}
+ }
+
if (@report_option) {
# this will result in the empty set for the dangling comma case as it should
push @where,
@@ -3009,7 +3012,26 @@
} @report_option;
}
- #eslaf
+ my @report_option_any = ();
+ if ( exists($params->{'report_option_any'}) ) {
+ if ( ref($params->{'report_option_any'}) eq 'ARRAY' ) {
+ @report_option_any = @{ $params->{'report_option_any'} };
+ } elsif ( $params->{'report_option_any'} =~ /^([,\d]*)$/ ) {
+ @report_option_any = split(',', $1);
+ }
+
+ }
+
+ if (@report_option_any) {
+ # this will result in the empty set for the dangling comma case as it should
+ push @where, ' ( '. join(' OR ',
+ map{ "0 < ( SELECT count(*) FROM part_pkg_option
+ WHERE part_pkg_option.pkgpart = part_pkg.pkgpart
+ AND optionname = 'report_option_$_'
+ AND optionvalue = '1' )"
+ } @report_option_any
+ ). ' ) ';
+ }
###
# parse custom
More information about the freeside-commits
mailing list