Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / FS / FS / part_export.pm
index 28cb141..9d261f0 100644 (file)
@@ -1,16 +1,15 @@
 package FS::part_export;
+use base qw( FS::option_Common FS::m2m_Common );
 
 use strict;
 use vars qw( @ISA @EXPORT_OK $DEBUG %exports );
 use Exporter;
 use Tie::IxHash;
-use base qw( FS::option_Common FS::m2m_Common );
 use FS::Record qw( qsearch qsearchs dbh );
 use FS::part_svc;
 use FS::part_export_option;
 use FS::part_export_machine;
 use FS::svc_export_machine;
-use FS::export_svc;
 
 #for export modules, though they should probably just use it themselves
 use FS::queue;
@@ -162,6 +161,10 @@ sub delete {
     'link_table'    => 'export_nas',
     'target_table'  => 'nas',
     'params'        => [],
+  ) || $self->process_m2m(
+    'link_table'    => 'export_svc',
+    'target_table'  => 'part_svc',
+    'params'        => [],
   ) || $self->SUPER::delete;
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
@@ -449,24 +452,10 @@ sub part_export_machine {
 
 Returns a list of associated FS::export_svc records.
 
-=cut
-
-sub export_svc {
-  my $self = shift;
-  qsearch('export_svc', { 'exportnum' => $self->exportnum } );
-}
-
 =item export_device
 
 Returns a list of associated FS::export_device records.
 
-=cut
-
-sub export_device {
-  my $self = shift;
-  qsearch('export_device', { 'exportnum' => $self->exportnum } );
-}
-
 =item part_export_option
 
 Returns all options as FS::part_export_option objects (see
@@ -695,6 +684,7 @@ sub info {
 }
 
 #default fallbacks... FS::part_export::DID_Common ?
+sub can_get_dids { 0; }
 sub get_dids_can_tollfree { 0; }
 sub get_dids_can_manual   { 0; }
 sub get_dids_can_edit     { 0; } #don't use without can_manual, otherwise the