summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/domain_record.pm26
1 files changed, 24 insertions, 2 deletions
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<FS::svc_domain) for this record.
+
+=cut
+
+sub svc_domain {
+ my $self = shift;
+ qsearchs('svc_domain', { svcnum => $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