X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_Common.pm;h=02e159bfa27c7a0a6c57cbf6eff4ee288da8d526;hb=3c54c844c665ed108c7892a154fd3972fab1f3e5;hp=5c6e16b826b1ddf74ce3b1e59eb844b4cccfdc46;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 5c6e16b82..02e159bfa 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -985,6 +985,26 @@ sub export_getsettings { ( \%settings, \%defaults ); } +=item export_getstatus + +Runs export_getstatus callbacks and returns a two item list consisting of an +HTML status and a status hashref. + +=cut + +sub export_getstatus { + my $self = shift; + my $html = ''; + my %hash = (); + my $error = $self->export('getstatus', \$html, \%hash); + if ( $error ) { + #XXX bubble this up better + warn "error running export_getstatus: $error"; + return ( '', {} ); + } + ( $html, \%hash ); +} + =item export HOOK [ EXPORT_ARGS ] Runs the provided export hook (i.e. "suspend", "unsuspend") for this service. @@ -1118,8 +1138,27 @@ sub find_duplicates { return grep { $conflict_svcparts{$_->cust_svc->svcpart} } @dup; } +=item getstatus_html +=cut + +sub getstatus_html { + my $self = shift; + + my $part_svc = $self->cust_svc->part_svc; + + my $html = ''; + foreach my $export ( grep $_->can('export_getstatus'), $part_svc->part_export ) { + my $export_html = ''; + my %hash = (); + $export->export_getstatus( $self, \$export_html, \%hash ); + $html .= $export_html; + } + + $html; + +} =back