start of Enswitch CDR import, RT#11613
[freeside.git] / FS / FS / cust_event.pm
index bf3a5b7..1407f43 100644 (file)
@@ -1,18 +1,16 @@
 package FS::cust_event;
 
 use strict;
 package FS::cust_event;
 
 use strict;
+use base qw( FS::cust_main_Mixin FS::Record );
 use vars qw( @ISA $DEBUG $me );
 use Carp qw( croak confess );
 use FS::Record qw( qsearch qsearchs dbdef );
 use vars qw( @ISA $DEBUG $me );
 use Carp qw( croak confess );
 use FS::Record qw( qsearch qsearchs dbdef );
-use FS::cust_main_Mixin;
 use FS::part_event;
 #for cust_X
 use FS::cust_main;
 use FS::cust_pkg;
 use FS::cust_bill;
 
 use FS::part_event;
 #for cust_X
 use FS::cust_main;
 use FS::cust_pkg;
 use FS::cust_bill;
 
-@ISA = qw(FS::cust_main_Mixin FS::Record);
-
 $DEBUG = 0;
 $me = '[FS::cust_event]';
 
 $DEBUG = 0;
 $me = '[FS::cust_event]';
 
@@ -224,13 +222,10 @@ sub do_event {
        " (". $part_event->action. ") $for\n"
     if $DEBUG;
 
        " (". $part_event->action. ") $for\n"
     if $DEBUG;
 
-  my $oldAutoCommit = $FS::UID::AutoCommit;
-  local $FS::UID::AutoCommit = 0;
-
   my $error;
   {
     local $SIG{__DIE__}; # don't want Mason __DIE__ handler active
   my $error;
   {
     local $SIG{__DIE__}; # don't want Mason __DIE__ handler active
-    $error = eval { $part_event->do_action($object); };
+    $error = eval { $part_event->do_action($object, $self); };
   }
 
   my $status = '';
   }
 
   my $status = '';
@@ -315,7 +310,7 @@ sub join_sql {
 
 }
 
 
 }
 
-=item search_sql HASHREF
+=item search_sql_where HASHREF
 
 Class method which returns an SQL WHERE fragment to search for parameters
 specified in HASHREF.  Valid parameters are
 
 Class method which returns an SQL WHERE fragment to search for parameters
 specified in HASHREF.  Valid parameters are
@@ -347,10 +342,10 @@ specified in HASHREF.  Valid parameters are
 #Note: validates all passed-in data; i.e. safe to use with unchecked CGI params.
 #sub 
 
 #Note: validates all passed-in data; i.e. safe to use with unchecked CGI params.
 #sub 
 
-sub search_sql {
+sub search_sql_where {
   my($class, $param) = @_;
   if ( $DEBUG ) {
   my($class, $param) = @_;
   if ( $DEBUG ) {
-    warn "$me search_sql called with params: \n".
+    warn "$me search_sql_where called with params: \n".
          join("\n", map { "  $_: ". $param->{$_} } keys %$param ). "\n";
   }
 
          join("\n", map { "  $_: ". $param->{$_} } keys %$param ). "\n";
   }
 
@@ -448,7 +443,7 @@ sub process_re_X {
 sub re_X {
   my($method, $param, $job) = @_;
 
 sub re_X {
   my($method, $param, $job) = @_;
 
-  my $search_sql = FS::cust_event->search_sql($param);
+  my $search_sql = FS::cust_event->search_sql_where($param);
 
   #maybe not...?  we do want the "re-" action to match the search more closely
   #            # yuck!  hardcoded *AND* sequential scans!
 
   #maybe not...?  we do want the "re-" action to match the search more closely
   #            # yuck!  hardcoded *AND* sequential scans!