<%doc> Example: include('/elements/select-did.html', 'field' => 'phonenum', 'svcpart' => 5, #OR 'object' => $svc_phone, ); % if ( $use_selector ) {
<% include('/elements/select-state.html', 'country' => $country, 'disable_empty' => 0, 'empty_label' => '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', ) %>
State Area code City / Exchange Phone number
% } else { <% include( '/elements/input-text.html', %opt, 'type'=>'text' ) %> % } <%init> 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 my $svcpart = $opt{'svcpart'} || $opt{'object'}->svcpart || $opt{'object'}->cust_svc->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;