[freeside-commits] freeside/httemplate/misc areacodes.cgi, NONE, 1.1 exchanges.cgi, NONE, 1.1 phonenums.cgi, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Sat Jun 28 16:03:11 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv26113/httemplate/misc
Added Files:
areacodes.cgi exchanges.cgi phonenums.cgi
Log Message:
get DIDs from globalpops
--- NEW FILE: exchanges.cgi ---
%# [ <% 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>
--- NEW FILE: areacodes.cgi ---
%# [ <% join(', ', map { qq("$_") } @areacodes) %> ]
<% objToJson(\@areacodes) %>
<%init>
my( $state, $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('state'=>$state);
#warn Dumper($something);
my @areacodes = @{ $something };
</%init>
--- NEW FILE: phonenums.cgi ---
%# [ <% join(', ', map { qq("$_") } @exchanges) %> ]
<% objToJson(\@exchanges) %>
<%init>
my( $exchangestring, $svcpart ) = $cgi->param('arg');
$exchangestring =~ /\((\d{3})-(\d{3})-XXXX\)\s*$/i
or die "unparsable exchange: $exchangestring";
my( $areacode, $exchange ) = ( $1, $2 );
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,
'exchange'=>$exchange,
);
#warn Dumper($something);
my @exchanges = @{ $something };
</%init>
More information about the freeside-commits
mailing list