X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Finventory_item-import.html;h=377943fb128e5b4b476b6d7dcc025511473ccf8a;hb=7c4c3bd3e3e2d6a820c77bec346f9d378e2761dc;hp=e98a6ed2acd7307e75410315fffebe9727a2d5ee;hpb=b9f9a5dc444a66ca138073a0e5229d85569e51b4;p=freeside.git diff --git a/httemplate/misc/process/inventory_item-import.html b/httemplate/misc/process/inventory_item-import.html index e98a6ed2a..377943fb1 100644 --- a/httemplate/misc/process/inventory_item-import.html +++ b/httemplate/misc/process/inventory_item-import.html @@ -1,27 +1,9 @@ -<% +<% $server->process %> +<%init> - my $fh = $cgi->upload('filename'); +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Import'); - my $error = defined($fh) - ? FS::inventory_item::batch_import( { - 'filehandle' => $fh, - 'classnum' => $cgi->param('classnum'), - } ) - : 'No file'; - - if ( $error ) { - %> - - <% - eidiot($error); -# $cgi->param('error', $error); -# print $cgi->redirect( "${p}cust_main-import.cgi - } else { - %> - - <%= include("/elements/header.html",'Import successful') %> - - <%= include("/elements/footer.html",'Import successful') %> <% - } -%> +my $server = new FS::UI::Web::JSRPC 'FS::inventory_item::process_batch_import', $cgi; +