X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Finventory_item-import.html;h=990c14ffc5e4bc291127c255ecfedba3fd197716;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=f3636c0e7ed4df922f9d8a06b8efc3066b83784c;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html index f3636c0e7..990c14ffc 100644 --- a/httemplate/misc/inventory_item-import.html +++ b/httemplate/misc/inventory_item-import.html @@ -1,14 +1,57 @@ -<% include("/elements/header.html", $inventory_class->classname. 's') %> +<% include("/elements/header.html", PL($inventory_class->classname)) %> -
- -Import a file containing <% $inventory_class->classname %>s, one per line.

+Import a file containing <% PL($inventory_class->classname) %>, one per line. +

-Filename:

+<% include( '/elements/form-file_upload.html', + 'name' => 'InventoryItemImportForm', + '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", + ) +%> + +<% &ntable("#cccccc", 2) %> + + + + + +%# + + <% include('/elements/tr-select-agent.html') %> + + <% 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> @@ -16,8 +59,12 @@ Filename:

die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Import'); -$cgi->param =~ /^(\d+)$/ or errorpage("illegal classnum"); +$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); +