Import a file containing phone numbers (DIDs).
<BR><BR>
-<% include( '/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",
- )
-%>
+<& /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) %>
<TD><% $format %><INPUT TYPE="hidden" NAME="format" VALUE="<% $format %>"></TD>
</TR>
+% if ( scalar(@exports) == 1 ) {
+% my $export = $exports[0];
+ <TR>
+ <TD>Export</TD>
+ <TD>
+ <INPUT TYPE="hidden" name="exportnum" value="<%$export->exportnum%>">
+ <% $export->exportname %>
+ </TD>
+ </TR>
+% } else {
<% include( '/elements/tr-select-table.html',
'table' => 'part_export',
'name_col' => 'label',
#'label_callback' =>
)
%>
+% }
<TR>
<TH ALIGN="right">Country code</TH>
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Import file"
- onClick = "document.PhonenumImportForm.submit.disabled=true;"
>
</TD>
</TR>
my $availbatch =
time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
+
+my @exports = qsearch('part_export', { 'exporttype' => 'internal_diddb', });
</%init>