blob: 4b31deb00629cf7295147dc17017624db074d6df (
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
|
<% encode_json(\@areacodes) %>\
<%init>
my( $state, $svcpart ) = $cgi->param('arg');
my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;
my @areacodes = ();
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);
@areacodes = @{ $something };
}
</%init>
|