use File::Slurp qw(slurp);
use Date::Format;
use XML::Simple;
+use FS::Record qw(qsearch qsearchs dbh);
use FS::svc_port;
-use FS::Record qw(qsearch dbh);
+use FS::torrus_srvderive_component;
use Torrus::ConfigTree;
#$DEBUG = 0;
return $svc_port[0];
}
+sub find_torrus_srvderive_component {
+ my $self = shift;
+ my $serviceid = shift;
+ return '' unless $serviceid =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
+
+ qsearchs('torrus_srvderive_component', { 'serviceid' => $serviceid });
+}
+
sub report {
my $self = shift;
use strict;
use base qw( FS::Record );
use FS::Record qw( qsearch qsearchs );
+use FS::torrus_srvderive;
=head1 NAME
$self->SUPER::check;
}
+sub torrus_srvderive {
+ my $self = shift;
+ qsearchs('torrus_srvderive', { 'derivenum' => $self->derivenum } );
+}
+
=back
=head1 BUGS
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: HTML.pm,v 1.12 2011-02-27 19:14:47 ivan Exp $
+# $Id: HTML.pm,v 1.13 2011-02-27 19:20:37 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
package Torrus::Renderer::HTML;
"/view/svc_port.cgi?". $svc_port->svcnum;
return "<A HREF='$url'>View Service</A>";
} else {
- return 'Monitored as '. $serviceids->{$iface}.
- '; customer service not yet provisioned';
+ my $component =
+ $nms->find_torrus_srvderive_component($serviceids->{$iface});
+
+ if ($component) {
+ return $serviceids->{$iface}. ' combined into '.
+ $component->torrus_srvderive->serviceid;
+ } else {
+ return 'Monitored as '. $serviceids->{$iface}.
+ '; not yet provisioned or combined';
+ }
}
} else {