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