blob: 2450ea31ad37d653497cb209598f15b76eb8dc35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 };
}
</%init>
|