X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export.pm;h=4b60953cf902e5300620032c55a79127e4ce855d;hb=dafdfc24616b04a5ff594da31e2cdd03f58634b6;hp=890c522f66646fd902ac44dd567a177b461d62de;hpb=4665d5af02f915679207a369222472a25e137c9d;p=freeside.git diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 890c522f6..4b60953cf 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -4,8 +4,8 @@ use strict; use vars qw( @ISA @EXPORT_OK $DEBUG %exports ); use Exporter; use Tie::IxHash; +use base qw( FS::option_Common FS::m2m_Common ); # m2m for 'export_nas' use FS::Record qw( qsearch qsearchs dbh ); -use FS::option_Common; use FS::part_svc; use FS::part_export_option; use FS::export_svc; @@ -13,7 +13,6 @@ use FS::export_svc; #for export modules, though they should probably just use it themselves use FS::queue; -@ISA = qw( FS::option_Common ); @EXPORT_OK = qw(export_info); $DEBUG = 0; @@ -129,7 +128,12 @@ sub delete { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my $error = $self->SUPER::delete; + # clean up export_nas records + my $error = $self->process_m2m( + 'link_table' => 'export_nas', + 'target_table' => 'nas', + 'params' => [], + ) || $self->SUPER::delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -401,6 +405,18 @@ or hidden by default). =cut +=item weight + +Returns the 'weight' element from the export's %info hash, or 0 if there is +no weight defined. + +=cut + +sub weight { + my $self = shift; + export_info()->{$self->exporttype}->{'weight'} || 0; +} + =back =head1 SUBROUTINES