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.cgi26
1 files changed, 26 insertions, 0 deletions
diff --git a/httemplate/misc/exchanges.cgi b/httemplate/misc/exchanges.cgi
new file mode 100644
index 000000000..8a67f7bab
--- /dev/null
+++ b/httemplate/misc/exchanges.cgi
@@ -0,0 +1,26 @@
+<% 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 @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);
+
+ @exchanges = @{ $something };
+
+}
+
+</%init>