5 include('/elements/select-did.html',
6 #can't actuall change from phonenum yet# 'field' => 'phonenum',
10 'object' => $svc_phone,
14 % if ( $use_selector ) {
16 % if ( $export->option('restrict_selection') eq 'non-tollfree'
17 % || !$export->option('restrict_selection') ) {
21 % if ( $export->get_dids_npa_select ) {
24 <% include('/elements/select-state.html',
25 'prefix' => 'phonenum_', #$field.'_',
26 'country' => $country,
27 'svcpart' => $svcpart,
29 'empty_label' => 'Select state',
32 <BR><FONT SIZE="-1">State</FONT>
36 <% include('/elements/select-areacode.html',
37 'state_prefix' => 'phonenum_', #$field.'_',
38 'svcpart' => $svcpart,
39 'empty' => 'Select area code',
42 <BR><FONT SIZE="-1">Area code</FONT>
46 <% include('/elements/select-exchange.html',
47 'svcpart' => $svcpart,
48 'empty' => 'Select exchange',
51 <BR><FONT SIZE="-1">City / Exchange</FONT>
57 <% include('/elements/select.html',
58 'field' => 'phonenum_state',
59 'id' => 'phonenum_state',
60 'options' => [ '', @{ $export->get_dids } ],
61 'labels' => { '' => 'Select province' },
62 'onchange' => 'phonenum_state_changed(this);',
65 <BR><FONT SIZE="-1">Province</FONT>
69 <% include('/elements/select-region.html',
70 'state_prefix' => 'phonenum_', #$field.'_',
71 'svcpart' => $svcpart,
72 'empty' => 'Select region',
75 <BR><FONT SIZE="-1">Region</FONT>
81 <% include('/elements/select-phonenum.html',
82 'svcpart' => $svcpart,
83 'empty' => 'Select phone number',
84 'bulknum' => $bulknum,
85 'multiple' => $multiple,
86 'region' => ! $export->get_dids_npa_select,
89 <BR><FONT SIZE="-1">Phone number</FONT>
96 % if ( ( $export->option('restrict_selection') eq 'tollfree'
97 % || !$export->option('restrict_selection')
99 % and $export->get_dids_can_tollfree
101 <font size="-1">Toll-free</font>
102 <% include('/elements/select-phonenum.html',
103 'svcpart' => $svcpart,
104 'empty' => 'Select phone number',
106 'prefix' => 'tollfree',
113 <div id="bulkdid" style="padding-top: 11px">
115 % for($i=0; $i < $bulknum; $i++) {
116 <div id="bulkdid_<%$i%>" style="display: none">
117 <input type="checkbox" id="checkbox_bulkdid_<%$i%>"
118 name="bulkdid" value="">
119 <label for="checkbox_bulkdid_<%$i%>"
120 id="label_bulkdid_<%$i%>"></label>
128 <% include( '/elements/input-text.html', %opt, 'type'=>'text' ) %>
135 my $conf = new FS::Conf;
137 #false laziness w/tr-select-did.html
138 #XXX make sure this comes through on errors too
139 my $svcpart = $opt{'svcpart'}
140 || $opt{'object'}->svcpart
141 || $opt{'object'}->cust_svc->svcpart;
143 my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
144 die "unknown svcpart $svcpart" unless $part_svc;
146 my @exports = $part_svc->part_export_did;
147 if ( scalar(@exports) > 1 ) {
148 die "more than one DID-providing export attached to svcpart $svcpart";
151 $export = $exports[0] if scalar(@exports);
153 my $use_selector = scalar(@exports) ? 1 : 0;
155 my $bulknum = $opt{'bulknum'} || 0; #Bulk DID orders via ordering system, vs.
156 my $multiple = $opt{'multiple'} || 0; #just selecting a bunch at a time
158 my $country = ( $export && $export->option('country') )
159 || $conf->config('countrydefault')
162 #my $field = $opt{'field'} || 'phonenum';