X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-did.html;h=6e205d8ffd2686aec8c52b32fece19cc736a7e78;hb=a72a10f754f7465121d6137bb3dcee0a21ea6443;hp=6cc63b96176ce487b2ad282d27a2b1848b1ed21d;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/elements/select-did.html b/httemplate/elements/select-did.html index 6cc63b961..6e205d8ff 100644 --- a/httemplate/elements/select-did.html +++ b/httemplate/elements/select-did.html @@ -16,54 +16,88 @@ Example: % if ( $export->option('restrict_selection') eq 'non-tollfree' % || !$export->option('restrict_selection') ) { - - - - + + + +% } else { + + - + +% } + + - - - - - - -
+ +% if ( $export->get_dids_npa_select ) { + + <% include('/elements/select-state.html', 'prefix' => 'phonenum_', #$field.'_', 'country' => $country, + 'svcpart' => $svcpart, 'disable_empty' => 0, 'empty_label' => 'Select state', ) %> +
State
- <% include('/elements/select-areacode.html', - 'state_prefix' => 'phonenum_', #$field.'_', - 'svcpart' => $svcpart, - 'empty' => 'Select area code', - ) - %> - - <% include('/elements/select-exchange.html', - 'svcpart' => $svcpart, - 'empty' => 'Select exchange', + + + <% include('/elements/select-areacode.html', + 'state_prefix' => 'phonenum_', #$field.'_', + 'svcpart' => $svcpart, + 'empty' => 'Select area code', + ) + %> +
Area code +
+ <% include('/elements/select-exchange.html', + 'svcpart' => $svcpart, + 'empty' => 'Select exchange', + ) + %> +
City / Exchange +
+ <% include('/elements/select.html', + 'field' => 'phonenum_state', + 'id' => 'phonenum_state', + 'options' => [ '', @{ $export->get_dids } ], + 'labels' => { '' => 'Select province' }, + 'onchange' => 'phonenum_state_changed(this);', ) %> +
Province
+ + + <% include('/elements/select-region.html', + 'state_prefix' => 'phonenum_', #$field.'_', + 'svcpart' => $svcpart, + 'empty' => 'Select region', + ) + %> +
Region +
<% include('/elements/select-phonenum.html', - 'svcpart' => $svcpart, - 'empty' => 'Select phone number', - 'bulknum' => $bulknum, + 'svcpart' => $svcpart, + 'empty' => 'Select phone number', + 'bulknum' => $bulknum, + 'multiple' => $multiple, + 'region' => ! $export->get_dids_npa_select, ) %> +
Phone number
StateArea codeCity / ExchangePhone number
% } -% if ( $export->option('restrict_selection') eq 'tollfree' -% || !$export->option('restrict_selection') ) { +% if ( ( $export->option('restrict_selection') eq 'tollfree' +% || !$export->option('restrict_selection') +% ) +% and $export->get_dids_can_tollfree +% ) { Toll-free <% include('/elements/select-phonenum.html', 'svcpart' => $svcpart, @@ -99,7 +133,6 @@ Example: my %opt = @_; my $conf = new FS::Conf; -my $country = $conf->config('countrydefault') || 'US'; #false laziness w/tr-select-did.html #XXX make sure this comes through on errors too @@ -114,13 +147,17 @@ my @exports = $part_svc->part_export_did; if ( scalar(@exports) > 1 ) { die "more than one DID-providing export attached to svcpart $svcpart"; } +my $export = ''; +$export = $exports[0] if scalar(@exports); my $use_selector = scalar(@exports) ? 1 : 0; -my $export; -$export = $exports[0] if scalar(@exports); +my $bulknum = $opt{'bulknum'} || 0; #Bulk DID orders via ordering system, vs. +my $multiple = $opt{'multiple'} || 0; #just selecting a bunch at a time -my $bulknum = $opt{'bulknum'} || 0; +my $country = ( $export && $export->option('country') ) + || $conf->config('countrydefault') + || 'US'; #my $field = $opt{'field'} || 'phonenum';