X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fphone_avail-import.html;h=0febfbcf5db25de8bf885ba3adab4effb3457087;hb=5027e0e807b38364fc10c992ea50a2ad7d934986;hp=1f4d8caaecbfd5b8138ee4998a8b9264af2dbe4d;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git
diff --git a/httemplate/misc/phone_avail-import.html b/httemplate/misc/phone_avail-import.html
index 1f4d8caae..0febfbcf5 100644
--- a/httemplate/misc/phone_avail-import.html
+++ b/httemplate/misc/phone_avail-import.html
@@ -3,31 +3,70 @@
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",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'PhonenumImportForm',
+ 'action' => 'process/phone_avail-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'format', 'availbatch', 'exportnum', 'countrycode',
+ 'ordernum', 'confirmed', 'vendor_order_id' ],
+ 'message' => 'DID import successful',
+ 'url' => $p."search/phone_avail.html?availbatch=$availbatch",
+ 'onsubmit' => "document.PhonenumImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
-
+% if ( $ordernum ) {
+
+ Bulk DID Order #
+ <% $ordernum %>
+
+
+
+
+ Vendor Order #
+
+
+
+
+
+ <% include( '/elements/tr-input-date-field.html', {
+ 'name' => 'confirmed',
+ 'label' => 'Order Confirmed',
+ 'value' => $confirmed,
+ })
+ %>
+
+% }
+
+ Import Format
+ <% $format %>
+
+
+% if ( scalar(@exports) == 1 ) {
+% my $export = $exports[0];
+
+ Export
+
+
+ <% $export->exportname %>
+
+
+% } else {
<% include( '/elements/tr-select-table.html',
'table' => 'part_export',
- 'name_col' => 'machine',
+ 'name_col' => 'label',
+ 'order_by' => 'ORDER BY exportname, machine',
'label' => 'Export',
'empty_label' => 'Select export',
'hashref' => { 'exporttype' => 'internal_diddb', },
#'label_callback' =>
)
%>
+% }
Country code
@@ -48,9 +87,9 @@ Import a file containing phone numbers (DIDs).
@@ -64,14 +103,27 @@ Import a file containing phone numbers (DIDs).
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
+% if ( $ordernum ) {
+ Bulk format has the following field order: state, number, rate center, rate_center_abbrev, msa, latanum
+% } else {
+ Default format has the following field order: state, number, name
+% }
-
Field information:
state : Two-letter state code, i.e. "CA"
number : Phone number
+
+% if ( $ordernum ) {
+ rate center : rate center (required)
+ rate_center_abbrev : rate center abbreviation
+ msa : MSA
+ latanum : LATA #
+% } else {
+ name : optional, rate center
+% }
+
<% include('/elements/footer.html') %>
@@ -82,7 +134,30 @@ die "access denied"
my $conf = new FS::Conf;
+my $ordernum = $cgi->param('ordernum');
+$ordernum = '' unless $ordernum =~ /^\d+$/;
+
+my $vendor_order_id = '';
+my $confirmed = '';
+
+my $order = '';
+$order = qsearchs('did_order', { 'ordernum' => $ordernum } )
+ if $ordernum;
+
+die 'invalid ordernum' unless (!$ordernum || $order);
+
+my $format = 'default';
+
+if ( $order ) {
+ $format = 'bulk';
+ $confirmed = $order->confirmed;
+ $vendor_order_id = $order->vendor_order_id;
+}
+
+
my $availbatch =
time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
+my @exports = qsearch('part_export', { 'exporttype' => 'internal_diddb', });
%init>