+ 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
+ ). ' ) ';
+ }