X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Finventory_item-import.html;h=37898739ad8d46a34f7777eb8193a1a2623650bc;hp=87c6af34c0170fde508db20c3f5e87b27ede4af5;hb=b282a5536ad5145f956ef27704e2267a124aacf5;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0 diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html index 87c6af34c..37898739a 100644 --- a/httemplate/misc/inventory_item-import.html +++ b/httemplate/misc/inventory_item-import.html @@ -1,21 +1,73 @@ -% -% -%my $classnum = $cgi->param('classnum'); -%$classnum =~ /^(\d+)$/ or eidiot "illegal classnum $classnum"; -%$classnum = $1; -%my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } ); -% -% -<% include("/elements/header.html", $inventory_class->classname. 's') %> - -
- -Import a file containing <% $inventory_class->classname %>s, one per line.

- -Filename:

- - +<% include("/elements/header.html", PL($inventory_class->classname)) %> + +Import a file containing <% PL($inventory_class->classname) %>, one per line. +

+ +<& /elements/form-file_upload.html, + 'name' => 'InventoryImportForm', + 'action' => 'process/inventory_item-import.html', + 'num_files' => 1, + #'fields' => [ 'format', 'itembatch', 'classnum', 'agentnum' ], + 'fields' => [ 'format', 'classnum', 'agentnum', ], + 'message' => 'Inventory import successful', + #XXX redirect via $itembatch? or just back to class browse? + #'url' => $p."search/phone_avail.html?availbatch=$availbatch", + 'url' => $p."search/inventory_item.html?classnum=$classnum;avail=1", + 'onsubmit' => "document.InventoryImportForm.submitButton.disabled=true;", +&> + +<% &ntable("#cccccc", 2) %> + + + + + +%# + + <% include('/elements/tr-select-agent.html', + 'viewall_right' => 'None', + ) + %> + + <% include( '/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + ) + %> + + + + + + + + +
+
+ +Upload file can be a text file or Excel spreadsheet. If an Excel spreadsheet, + should have an .XLS extension. +

+ <% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Import'); + +$cgi->param('classnum') =~ /^(\d+)$/ or errorpage("illegal classnum"); +my $classnum = $1; +my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } ); + +#my $conf = new FS::Conf; +#my $itembatch = +# time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); + +