From dcc553538ede04c0783bc92d3942c905c29131c1 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Sep 2008 07:18:57 +0000 Subject: add internal did database & ability to query for availability, plus upload tool --- httemplate/elements/menu.html | 1 + httemplate/misc/phone_avail-import.html | 77 +++++++++++++++++++++++++ httemplate/misc/process/phone_avail-import.html | 9 +++ 3 files changed, 87 insertions(+) create mode 100644 httemplate/misc/phone_avail-import.html create mode 100644 httemplate/misc/process/phone_avail-import.html (limited to 'httemplate') diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 60ea8b22b..66e8ab6c5 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -221,6 +221,7 @@ tie my %tools_importing, 'Tie::IxHash', 'Import customer comments from CSV file' => [ $fsurl.'misc/cust_main_note-import.html', '' ], 'Import one-time charges from CSV file' => [ $fsurl.'misc/cust_main-import_charges.cgi', '' ], 'Import payments from CSV file' => [ $fsurl.'misc/cust_pay-import.cgi', '' ], + 'Import phone numbers (DIDs)' => [ $fsurl.'misc/phone_avail-import.html', '' ], 'Import Call Detail Records (CDRs) from CSV file' => [ $fsurl.'misc/cdr-import.html', '' ], 'Import tax rates from CSV files' => [ $fsurl.'misc/tax-import.cgi', '' ], ; diff --git a/httemplate/misc/phone_avail-import.html b/httemplate/misc/phone_avail-import.html new file mode 100644 index 000000000..98dcc8abb --- /dev/null +++ b/httemplate/misc/phone_avail-import.html @@ -0,0 +1,77 @@ +<% 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' ], + 'message' => 'DID import successful', + 'url' => $p."search/phone_avail.html?availbatch=$availbatch", + ) +%> + +<% &ntable("#cccccc", 2) %> + + + + + + + + <% include( '/elements/tr-select-table.html', + 'table' => 'part_export', + 'name_col' => 'machine', + 'label' => 'Export', + 'empty_label' => 'Select export', + 'hashref' => { 'exporttype' => 'internal_diddb', }, + #'label_callback' => + ) + %> + + <% 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 +

+ +Field information: + + +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Import'); + +my $availbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); + + diff --git a/httemplate/misc/process/phone_avail-import.html b/httemplate/misc/process/phone_avail-import.html new file mode 100644 index 000000000..f1a2f2493 --- /dev/null +++ b/httemplate/misc/process/phone_avail-import.html @@ -0,0 +1,9 @@ +<% $server->process %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Import'); + +my $server = new FS::UI::Web::JSRPC 'FS::phone_avail::process_batch_import', $cgi; + + -- cgit v1.2.1