This commit was manufactured by cvs2svn to create branch
[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', 'agentnum' ],
11               'fields'    => [ 'format', 'classnum', 'agentnum', ],
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/tr-select-agent.html',
28                'viewall_right' => 'None',
29             )
30   %>
31
32   <% include( '/elements/file-upload.html',
33                 'field' => 'file',
34                 'label' => 'Filename',
35             )
36   %>
37
38   <TR>
39     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
40       <INPUT TYPE    = "submit"
41              ID      = "submit"
42              VALUE   = "Import file"
43              onClick = "document.InventoryItemImportForm.submit.disabled=true;"
44       >
45     </TD>
46   </TR>
47
48 </TABLE>
49
50 </FORM>
51
52 <BR>
53
54 Upload file can be a text file or Excel spreadsheet.  If an Excel spreadsheet,
55  should have an .XLS extension.
56 <BR><BR>
57
58 <% include('/elements/footer.html') %>
59
60 <%init>
61
62 die "access denied"
63   unless $FS::CurrentUser::CurrentUser->access_right('Import');
64
65 $cgi->param('classnum') =~ /^(\d+)$/ or errorpage("illegal classnum");
66 my $classnum = $1;
67 my $inventory_class = qsearchs('inventory_class', { 'classnum' => $classnum } );
68
69 #my $conf = new FS::Conf;
70 #my $itembatch =
71 #  time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
72
73 </%init>