From 9c7dee35f91a386fcce14cb6c3e9d23ba3eee8af Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 28 Jun 2008 23:03:10 +0000 Subject: get DIDs from globalpops --- httemplate/elements/select-did.html | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 httemplate/elements/select-did.html (limited to 'httemplate/elements/select-did.html') diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html new file mode 100644 index 000000000..999274fea --- /dev/null +++ b/httemplate/elements/select-did.html @@ -0,0 +1,80 @@ +<%doc> + +Example: + + include('/elements/select-did.html', + 'field' => 'phonenum', + 'svcpart' => 5, + ); + + +% if ( $use_selector ) { + + + + + + + + + + + + + + + + + +
+ <% include('/elements/select-state.html', + 'country' => $country, + 'empty' => 'Select state', + ) + %> + + <% include('/elements/select-areacode.html', + 'svcpart' => $svcpart, + 'empty' => 'Select area code', + ) + %> + + <% include('/elements/select-exchange.html', + 'svcpart' => $svcpart, + 'empty' => 'Select exchange', + ) + %> + + <% include('/elements/select-phonenum.html', + 'svcpart' => $svcpart, + 'empty' => 'Select phone number', + ) + %> +
StateArea codeCity / ExchangePhone number
+ +% } else { + + <% include( '/elements/input-text.html', %opt, 'type'=>'text' ) %> + +% } +<%init> + +my %opt = @_; + +my $conf = new FS::Conf; +my $country = $conf->config('countrydefault') || 'US'; + +#XXX make sure this comes through on errors too +my $svcpart = $opt{'object'}->svcpart; + +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"; +} + +my $use_selector = scalar(@exports) ? 1 : 0; + + -- cgit v1.2.1