X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fregions.cgi;fp=httemplate%2Fmisc%2Fregions.cgi;h=2450ea31ad37d653497cb209598f15b76eb8dc35;hb=7c3806cdbb65e125227fc78a3acbf188097a7e33;hp=0000000000000000000000000000000000000000;hpb=3bed798b18bf3a01343cd53fd3cfdf3463041bea;p=freeside.git diff --git a/httemplate/misc/regions.cgi b/httemplate/misc/regions.cgi new file mode 100644 index 000000000..2450ea31a --- /dev/null +++ b/httemplate/misc/regions.cgi @@ -0,0 +1,26 @@ +<% objToJson(\@regions) %> +<%init> + +my( $state, $svcpart ) = $cgi->param('arg'); + +my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } ); +die "unknown svcpart $svcpart" unless $part_svc; + +my @regions = (); +if ( $state ) { + + 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('state'=>$state); + + @regions = @{ $something }; + +} + +