summaryrefslogtreecommitdiff
path: root/httemplate/misc/exchanges.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/exchanges.cgi')
-rw-r--r--httemplate/misc/exchanges.cgi24
1 files changed, 13 insertions, 11 deletions
diff --git a/httemplate/misc/exchanges.cgi b/httemplate/misc/exchanges.cgi
index f5860cff2..8a67f7bab 100644
--- a/httemplate/misc/exchanges.cgi
+++ b/httemplate/misc/exchanges.cgi
@@ -1,4 +1,3 @@
-%# [ <% join(', ', map { qq("$_") } @exchanges) %> ]
<% objToJson(\@exchanges) %>
<%init>
@@ -7,18 +6,21 @@ my( $areacode, $svcpart ) = $cgi->param('arg');
my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;
-my @exports = $part_svc->part_export_did;
-if ( scalar(@exports) > 1 ) {
- die "more than one DID-providing export attached to svcpart $svcpart";
-} elsif ( ! @exports ) {
- die "no DID providing export attached to svcpart $svcpart";
-}
-my $export = $exports[0];
+my @exchanges = ();
+if ( $areacode ) {
+
+ my @exports = $part_svc->part_export_did;
+ if ( scalar(@exports) > 1 ) {
+ die "more than one DID-providing export attached to svcpart $svcpart";
+ } elsif ( ! @exports ) {
+ die "no DID providing export attached to svcpart $svcpart";
+ }
+ my $export = $exports[0];
-my $something = $export->get_dids('areacode'=>$areacode);
+ my $something = $export->get_dids('areacode'=>$areacode);
-#warn Dumper($something);
+ @exchanges = @{ $something };
-my @exchanges = @{ $something };
+}
</%init>