X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event_condition.pm;h=32f19a3aead0db1ae516354fd08f8ff7f0de6e4b;hb=3c54c844c665ed108c7892a154fd3972fab1f3e5;hp=200d4fcd6bee70294b886df068bfd56c828d6228;hpb=49db59d3a1fad43b35295d89c71141b79c70c1de;p=freeside.git diff --git a/FS/FS/part_event_condition.pm b/FS/FS/part_event_condition.pm index 200d4fcd6..32f19a3ae 100644 --- a/FS/FS/part_event_condition.pm +++ b/FS/FS/part_event_condition.pm @@ -2,7 +2,7 @@ package FS::part_event_condition; use strict; use vars qw( @ISA $DEBUG @SKIP_CONDITION_SQL ); -use FS::UID qw(dbh); +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... @@ -191,6 +191,10 @@ foreach my $INC ( @INC ) { #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') @@ -281,7 +285,9 @@ sub where_conditions_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 )"; }