From: ivan Date: Thu, 14 Aug 2008 11:44:52 +0000 (+0000) Subject: customer import: add progress bar & redirect to a search of the imported customers... X-Git-Tag: root_of_webpay_support~436 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5d4d60dd8cbe71a96256b6c375f01e0182296f18 customer import: add progress bar & redirect to a search of the imported customers, #3475 --- diff --git a/FS/FS/tax_rate.pm b/FS/FS/tax_rate.pm index 69dc12821..0601032ee 100644 --- a/FS/FS/tax_rate.pm +++ b/FS/FS/tax_rate.pm @@ -719,7 +719,7 @@ sub batch_import { =item process_batch -Load an batch import as a queued JSRPC job +Load a batch import as a queued JSRPC job =cut @@ -752,7 +752,7 @@ sub process_batch { $error = "No $name supplied"; next; } - my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc; + my $dir = '%%%FREESIDE_CACHE%%%/cache.'. $FS::UID::datasrc; my $filename = "$dir/". $files{$file}; open my $fh, "< $filename" or $error ||= "Can't open $name file: $!"; @@ -781,7 +781,7 @@ sub process_batch { 'PLUS4', 'plus4file', \&FS::cust_tax_location::batch_import, 'TXMATRIX', 'txmatrix', \&FS::part_pkg_taxrate::batch_import, ); - my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc; + my $dir = '%%%FREESIDE_CACHE%%%/cache.'. $FS::UID::datasrc; while( scalar(@list) ) { my ($name, $file, $import_sub) = (shift @list, shift @list, shift @list); unless ($files{$file}) { diff --git a/httemplate/misc/tax-import.cgi b/httemplate/misc/tax-import.cgi index 9044ac9eb..15f09d518 100644 --- a/httemplate/misc/tax-import.cgi +++ b/httemplate/misc/tax-import.cgi @@ -3,63 +3,50 @@ Import a CSV file set containing tax rate records.

-<% include( '/elements/progress-init.html', - 'TaxRateUpload', - [ 'format', 'uploaded_files' ], - 'process/tax-import.cgi', - { 'message' => 'Tax rates imported' }, +<% include( '/elements/form-file_upload.html', + 'name' => 'TaxRateUpload', + 'action' => 'process/tax-import.cgi', + 'num_files' => 4, + 'fields' => [ 'format', ], + 'message' => 'Tax rates imported', ) %> - - -
-
- <% &ntable("#cccccc", 2) %> - - Format - - - - - -<% include('/elements/file-upload.html', 'field' => [ 'codefile', - 'plus4file', - 'txmatrix', - 'detail', - ], - 'label' => [ 'code CSV filename', - 'plus4 CSV filename', - 'txmatrix CSV filename', - 'detail CSV filename', - ], - 'callback' => 'gotLoaded', - 'debug' => 0, - ) -%> - + + Format + + + + + + <% include( '/elements/file-upload.html', + 'field' => [ 'codefile', + 'plus4file', + 'txmatrix', + 'detail', + ], + 'label' => [ 'code CSV filename', + 'plus4 CSV filename', + 'txmatrix CSV filename', + 'detail CSV filename', + ], + 'debug' => 0, + ) + %> + + + + + +