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,
26 'empty_label' => 'Select state',
31 <% include('/elements/select-areacode.html',
32 'state_prefix' => 'phonenum_', #$field.'_',
33 'svcpart' => $svcpart,
34 'empty' => 'Select area code',
39 <% include('/elements/select-exchange.html',
40 'svcpart' => $svcpart,
41 'empty' => 'Select exchange',
46 <% include('/elements/select-phonenum.html',
47 'svcpart' => $svcpart,
48 'empty' => 'Select phone number',
49 'bulknum' => $bulknum,
56 <TD><FONT SIZE="-1">State</FONT></TD>
57 <TD><FONT SIZE="-1">Area code</FONT></TD>
58 <TD><FONT SIZE="-1">City / Exchange</FONT></TD>
59 <TD><FONT SIZE="-1">Phone number</FONT></TD>
65 % if ( $export->option('restrict_selection') eq 'tollfree'
66 % || !$export->option('restrict_selection') ) {
67 <font size="-1">Toll-free</font>
68 <% include('/elements/select-phonenum.html',
69 'svcpart' => $svcpart,
70 'empty' => 'Select phone number',
72 'prefix' => 'tollfree',
79 <div id="bulkdid" style="padding-top: 11px">
81 % for($i=0; $i < $bulknum; $i++) {
82 <div id="bulkdid_<%$i%>" style="display: none">
83 <input type="checkbox" id="checkbox_bulkdid_<%$i%>"
84 name="bulkdid" value="">
85 <label for="checkbox_bulkdid_<%$i%>"
86 id="label_bulkdid_<%$i%>"></label>
94 <% include( '/elements/input-text.html', %opt, 'type'=>'text' ) %>
101 my $conf = new FS::Conf;
103 #false laziness w/tr-select-did.html
104 #XXX make sure this comes through on errors too
105 my $svcpart = $opt{'svcpart'}
106 || $opt{'object'}->svcpart
107 || $opt{'object'}->cust_svc->svcpart;
109 my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
110 die "unknown svcpart $svcpart" unless $part_svc;
112 my @exports = $part_svc->part_export_did;
113 if ( scalar(@exports) > 1 ) {
114 die "more than one DID-providing export attached to svcpart $svcpart";
117 $export = $exports[0] if scalar(@exports);
119 my $use_selector = scalar(@exports) ? 1 : 0;
121 my $bulknum = $opt{'bulknum'} || 0;
123 my $country = ( $export && $export->option('country') )
124 || $conf->config('countrydefault')
127 #my $field = $opt{'field'} || 'phonenum';