package FS::part_event_condition;
use strict;
-use vars qw( @ISA $DEBUG );
-use FS::UID qw(dbh);
+use vars qw( @ISA $DEBUG @SKIP_CONDITION_SQL );
+use FS::UID qw( dbh driver_name );
use FS::Record qw( qsearch qsearchs );
use FS::option_Common;
use FS::part_event; #for order_conditions_sql...
@ISA = qw( FS::option_Common ); # FS::Record );
$DEBUG = 0;
+@SKIP_CONDITION_SQL = ();
+
=head1 NAME
FS::part_event_condition - Object methods for part_event_condition records
#warn "error using $fullmod (skipping): $@\n" if $@;
#next;
}
+ if ( $fullmod->disabled ) {
+ warn "$fullmod is disabled; skipping\n";
+ next;
+ }
#my $full_condition_sql = $fullmod. '::condition_sql';
my $condition_sql_coderef = sub { $fullmod->condition_sql(@_) };
my $order_sql_coderef = $fullmod->can('order_sql')
map {
my $conditionname = $_;
my $coderef = $conditions{$conditionname}->{condition_sql};
- my $sql = &$coderef( $eventtable, 'time'=>$time );
+ my $sql = &$coderef( $eventtable, 'time' => $time,
+ 'driver_name' => driver_name(),
+ );
die "$coderef is not a CODEREF" unless ref($coderef) eq 'CODE';
"( cond_$conditionname.conditionname IS NULL OR $sql )";
}
- keys %conditions
+ grep { my $cond = $_;
+ ! grep { $_ eq $cond } @SKIP_CONDITION_SQL
+ }
+ keys %conditions
);
$where;