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') ) {
22 <% include('/elements/select-state.html',
23 'prefix' => 'phonenum_', #$field.'_',
24 'country' => $country,
25 'svcpart' => $svcpart,
27 'empty_label' => 'Select state',
30 <BR><FONT SIZE="-1">State</FONT>
33 <% include('/elements/select-areacode.html',
34 'state_prefix' => 'phonenum_', #$field.'_',
35 'svcpart' => $svcpart,
36 'empty' => 'Select area code',
39 <BR><FONT SIZE="-1">Area code</FONT>
42 <% include('/elements/select-exchange.html',
43 'svcpart' => $svcpart,
44 'empty' => 'Select exchange',
47 <BR><FONT SIZE="-1">City / Exchange</FONT>
50 <% include('/elements/select-phonenum.html',
51 'svcpart' => $svcpart,
52 'empty' => 'Select phone number',
53 'bulknum' => $bulknum,
54 'multiple' => $multiple,
57 <BR><FONT SIZE="-1">Phone number</FONT>
64 % if ( $export->option('restrict_selection') eq 'tollfree'
65 % || !$export->option('restrict_selection') ) {
66 <font size="-1">Toll-free</font>
67 <% include('/elements/select-phonenum.html',
68 'svcpart' => $svcpart,
69 'empty' => 'Select phone number',
71 'prefix' => 'tollfree',
78 <div id="bulkdid" style="padding-top: 11px">
80 % for($i=0; $i < $bulknum; $i++) {
81 <div id="bulkdid_<%$i%>" style="display: none">
82 <input type="checkbox" id="checkbox_bulkdid_<%$i%>"
83 name="bulkdid" value="">
84 <label for="checkbox_bulkdid_<%$i%>"
85 id="label_bulkdid_<%$i%>"></label>
93 <% include( '/elements/input-text.html', %opt, 'type'=>'text' ) %>
100 my $conf = new FS::Conf;
102 #false laziness w/tr-select-did.html
103 #XXX make sure this comes through on errors too
104 my $svcpart = $opt{'svcpart'}
105 || $opt{'object'}->svcpart
106 || $opt{'object'}->cust_svc->svcpart;
108 my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
109 die "unknown svcpart $svcpart" unless $part_svc;
111 my @exports = $part_svc->part_export_did;
112 if ( scalar(@exports) > 1 ) {
113 die "more than one DID-providing export attached to svcpart $svcpart";
116 $export = $exports[0] if scalar(@exports);
118 my $use_selector = scalar(@exports) ? 1 : 0;
120 my $bulknum = $opt{'bulknum'} || 0; #Bulk DID orders via ordering system, vs.
121 my $multiple = $opt{'multiple'} || 0; #just selecting a bunch at a time
123 my $country = ( $export && $export->option('country') )
124 || $conf->config('countrydefault')
127 #my $field = $opt{'field'} || 'phonenum';