X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fdomain_record.pm;h=4ed713c7730d39bfde44958c31f9bd09d46c9bb8;hp=44e70ade18a2c178d447476c2b51166a784869fe;hb=4920ad2671d712afe23d731e25bc5b53955397b7;hpb=23186f0338ec248d930c85db08cc997bca42525b diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm index 44e70ade1..4ed713c77 100644 --- a/FS/FS/domain_record.pm +++ b/FS/FS/domain_record.pm @@ -1,7 +1,7 @@ package FS::domain_record; use strict; -use vars qw( @ISA ); +use vars qw( @ISA $noserial_hack ); #use FS::Record qw( qsearch qsearchs ); use FS::Record qw( qsearchs dbh ); use FS::svc_domain; @@ -85,6 +85,16 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; + if ( $self->rectype eq '_mstr' ) { #delete all other records + foreach my $domain_record ( reverse $self->svc_domain->domain_record ) { + my $error = $domain_record->delete; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + } + my $error = $self->SUPER::insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -265,6 +275,7 @@ sub check { =cut sub increment_serial { + return '' if $noserial_hack; my $self = shift; my $soa = qsearchs('domain_record', { @@ -283,11 +294,22 @@ sub increment_serial { $new->replace($soa); } +=item svc_domain + +Returns the domain (see L $self->svcnum } ); +} + =back =head1 VERSION -$Id: domain_record.pm,v 1.8 2002-05-22 18:44:01 ivan Exp $ +$Id: domain_record.pm,v 1.9 2002-05-23 13:00:08 ivan Exp $ =head1 BUGS