X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Finventory_item-import.html;h=377943fb128e5b4b476b6d7dcc025511473ccf8a;hb=949a80c148a8bbeeeec54c5a0be5d73b292423a5;hp=8a58203c298b262c549e116d9d9759d938f51744;hpb=6d2cd8e6fc566b4fccd0075156e3e1ddd59fa042;p=freeside.git diff --git a/httemplate/misc/process/inventory_item-import.html b/httemplate/misc/process/inventory_item-import.html index 8a58203c2..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 sucessful') %> - - <%= include("/elements/footer.html",'Import sucessful') %> <% - } -%> +my $server = new FS::UI::Web::JSRPC 'FS::inventory_item::process_batch_import', $cgi; +