This commit was generated by cvs2svn to compensate for changes in r8690,
[freeside.git] / httemplate / misc / inventory_item-import.html
1 <% include("/elements/header.html", PL($inventory_class->classname)) %>
2
3 Import a file containing <% PL($inventory_class->classname) %>, one per line.
4 <BR><BR>
5
6 <% include( '/elements/form-file_upload.html',
7               'name'      => 'InventoryItemImportForm',
8               'action'    => 'process/inventory_item-import.html',
9               'num_files' => 1,
10               #'fields'    => [ 'format', 'itembatch', 'classnum', ],
11               'fields'    => [ 'format', 'classnum', ],
12               'message'   => 'Inventory import successful',
13               #XXX redirect via $itembatch?  or just back to class browse?
14               #'url'       => $p."search/phone_avail.html?availbatch=$availbatch",
15               'url'       => $p."search/inventory_item.html?classnum=$classnum;avail=1",
16           )
17 %>
18
19 <% &ntable("#cccccc", 2) %>
20
21   <INPUT TYPE="hidden" NAME="format" VALUE="default">
22
23   <INPUT TYPE="hidden" NAME="classnum" VALUE="<% $classnum %>">
24
25 %#  <INPUT TYPE="hidden" NAME="itembatch" VALUE="<% $itembatch %>">
26
27   <% include( '/elements/file-upload.html',
28                 'field' => 'file',
29                 'label' => 'Filename',
30             )
31   %>
32
33   <TR>
34     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
35       <INPUT TYPE    = "submit"
36              ID      = "submit"
37              VALUE   = "Import file"
38              onClick = "document.InventoryItemImportForm.submit.disabled=true;"
39       >
40     </TD>
41   </TR>
42
43 </TABLE>
44
45 </FORM>
46
47 <BR>
48
49 Upload file can be a text file or Excel spreadsheet.  If an Excel spreadsheet,
50  should have an .XLS extension.
51 <BR><BR>
52
53 <% include('/elements/footer.html') %>
54
55 <%init>
56
57 die "access denied"
58   unless $FS::CurrentUser::CurrentUser->access_right('Import');
59
60 $cgi->param('classnum') =~ /^(\d+)$/ or errorpage("illegal classnum");
61 my $classnum = $1;
62 my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } );
63
64 #my $conf = new FS::Conf;
65 #my $itembatch =
66 #  time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
67
68 </%init>