<% include('/elements/header.html', 'Phone number (DID) import') %> Import a file containing phone numbers (DIDs).

<% include( '/elements/form-file_upload.html', 'name' => 'PhonenumImportForm', 'action' => 'process/phone_avail-import.html', 'num_files' => 1, 'fields' => [ 'format', 'availbatch', 'exportnum', 'countrycode', 'ordernum' ], 'message' => 'DID import successful', 'url' => $p."search/phone_avail.html?availbatch=$availbatch", ) %> <% &ntable("#cccccc", 2) %> % if ( $ordernum ) { Bulk DID Order # <% $ordernum %> % } Import Format <% $format %> <% include( '/elements/tr-select-table.html', 'table' => 'part_export', 'name_col' => 'label', 'order_by' => 'ORDER BY exportname, machine', 'label' => 'Export', 'empty_label' => 'Select export', 'hashref' => { 'exporttype' => 'internal_diddb', }, #'label_callback' => ) %> Country code <% include( '/elements/file-upload.html', 'field' => 'file', 'label' => 'Filename', ) %>
Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.

Default format has the following field order: state, number, name
Bulk format has the following field order: state, number, rate center, rate_center_abbrev

Field information:

<% include('/elements/footer.html') %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Import'); my $conf = new FS::Conf; my $ordernum = $cgi->param('ordernum'); $ordernum = '' unless $ordernum =~ /^\d+$/; die 'invalid ordernum' unless (!$ordernum || qsearchs('did_order', { 'ordernum' => $ordernum })); my $format = 'default'; $format = 'bulk' if $ordernum; my $availbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);