X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-torrus_serviceid.html;h=e13a6e80d1b1a44dffa64de48a94b342624fac8d;hb=7516e3da0f17eeecba27219ef96a8b5f46af2083;hp=a8cfca8b8528c75545c0b7f8c8f3407f6472065f;hpb=69b3b149f2a83cf280022388b1cd37e62990c721;p=freeside.git
diff --git a/httemplate/elements/select-torrus_serviceid.html b/httemplate/elements/select-torrus_serviceid.html
index a8cfca8b8..e13a6e80d 100644
--- a/httemplate/elements/select-torrus_serviceid.html
+++ b/httemplate/elements/select-torrus_serviceid.html
@@ -4,8 +4,10 @@
% }
-% foreach my $serviceid ( keys %serviceid ) {
-
+% foreach my $serviceid ( @serviceids ) {
+
% }
@@ -14,15 +16,9 @@
my %opt = @_;
-#is this going to get too slow or will the index make it okay?
-my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport")
- or die dbh->errstr;
-$sth->execute or die $sth->errstr;
-my %serviceid = ();
-while ( my $row = $sth->fetchrow_arrayref ) {
- my $serviceid = $row->[0];
- $serviceid =~ s/_(IN|OUT)$//;
- $serviceid{$serviceid}=1;
-}
+my $value = $opt{'curr_value'} || $opt{'value'};
+
+my $nms = new FS::NetworkMonitoringSystem;
+my @serviceids = $nms->torrus_serviceids;
%init>