[freeside-commits] freeside/FS/FS cust_pkg.pm,1.204.2.7,1.204.2.8
Ivan,,,
ivan at wavetail.420.am
Thu Aug 18 16:29:31 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv15515/FS/FS
Modified Files:
Tag: FREESIDE_2_3_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.204.2.7
retrieving revision 1.204.2.8
diff -u -w -d -r1.204.2.7 -r1.204.2.8
--- cust_pkg.pm 18 Aug 2011 21:27:52 -0000 1.204.2.7
+++ cust_pkg.pm 18 Aug 2011 23:29:29 -0000 1.204.2.8
@@ -2987,6 +2987,7 @@
} elsif ( @c_where ) {
push @where, ' ( '. join(' OR ', @c_where). ' ) ';
}
+ warn $where[-1];
}
@@ -2998,13 +2999,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,
@@ -3015,7 +3018,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