diff options
Diffstat (limited to 'httemplate/misc/exchanges.cgi')
-rw-r--r-- | httemplate/misc/exchanges.cgi | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/httemplate/misc/exchanges.cgi b/httemplate/misc/exchanges.cgi new file mode 100644 index 000000000..f5860cff2 --- /dev/null +++ b/httemplate/misc/exchanges.cgi @@ -0,0 +1,24 @@ +%# [ <% join(', ', map { qq("$_") } @exchanges) %> ] +<% objToJson(\@exchanges) %> +<%init> + +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 $something = $export->get_dids('areacode'=>$areacode); + +#warn Dumper($something); + +my @exchanges = @{ $something }; + +</%init> |