X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcgp_rule.pm;h=1029f5a1759e136c5b523604d8253b8dd74a42a9;hp=e9c50901ade4c13631a9f9f7ed377070073f5143;hb=57bb423fe457ba4e13726877f53bcdf944f828f8;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984 diff --git a/FS/FS/cgp_rule.pm b/FS/FS/cgp_rule.pm index e9c50901a..1029f5a17 100644 --- a/FS/FS/cgp_rule.pm +++ b/FS/FS/cgp_rule.pm @@ -1,11 +1,8 @@ package FS::cgp_rule; +use base qw( FS::o2m_Common FS::Record ); use strict; -use base qw( FS::o2m_Common FS::Record ); -use FS::Record qw( qsearch qsearchs dbh ); -use FS::cust_svc; -use FS::cgp_rule_condition; -use FS::cgp_rule_action; +use FS::Record qw( dbh ); =head1 NAME @@ -80,36 +77,36 @@ otherwise returns false. =cut -sub insert { - my $self = shift; - - local $SIG{HUP} = 'IGNORE'; - local $SIG{INT} = 'IGNORE'; - local $SIG{QUIT} = 'IGNORE'; - local $SIG{TERM} = 'IGNORE'; - local $SIG{TSTP} = 'IGNORE'; - local $SIG{PIPE} = 'IGNORE'; - - my $oldAutoCommit = $FS::UID::AutoCommit; - local $FS::UID::AutoCommit = 0; - my $dbh = dbh; - - my $error = $self->SUPER::insert(@_); - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return $error; - } - - #conditions and actions not in yet - #$error = $self->svc_export; - #if ( $error ) { - # $dbh->rollback if $oldAutoCommit; - # return $error; - #} - - $dbh->commit or die $dbh->errstr if $oldAutoCommit; - ''; -} +# sub insert { +# my $self = shift; +# +# local $SIG{HUP} = 'IGNORE'; +# local $SIG{INT} = 'IGNORE'; +# local $SIG{QUIT} = 'IGNORE'; +# local $SIG{TERM} = 'IGNORE'; +# local $SIG{TSTP} = 'IGNORE'; +# local $SIG{PIPE} = 'IGNORE'; +# +# my $oldAutoCommit = $FS::UID::AutoCommit; +# local $FS::UID::AutoCommit = 0; +# my $dbh = dbh; +# +# my $error = $self->SUPER::insert(@_); +# if ( $error ) { +# $dbh->rollback if $oldAutoCommit; +# return $error; +# } +# +# #conditions and actions not in yet +# #$error = $self->svc_export; +# #if ( $error ) { +# # $dbh->rollback if $oldAutoCommit; +# # return $error; +# #} +# +# $dbh->commit or die $dbh->errstr if $oldAutoCommit; +# ''; +# } =item delete @@ -291,37 +288,11 @@ sub clone { =item cust_svc -=cut - -sub cust_svc { - my $self = shift; - qsearchs('cust_svc', { 'svcnum' => $self->svcnum } ); -} - =item cgp_rule_condition Returns the conditions associated with this rule, as FS::cgp_rule_condition objects. -=cut - -sub cgp_rule_condition { - my $self = shift; - qsearch('cgp_rule_condition', { 'rulenum' => $self->rulenum } ); -} - -=item cgp_rule_action - -Returns the actions associated with this rule, as FS::cgp_rule_action -objects. - -=cut - -sub cgp_rule_action { - my $self = shift; - qsearch('cgp_rule_action', { 'rulenum' => $self->rulenum } ); -} - =item arrayref Returns an arraref representing this rule, suitable for Communigate Pro API