add internal did database & ability to query for availability, plus upload tool
[freeside.git] / httemplate / misc / phone_avail-import.html
1 <% include('/elements/header.html', 'Phone number (DID) import') %>
2
3 Import a file containing phone numbers (DIDs).
4 <BR><BR>
5
6 <% include( '/elements/form-file_upload.html',
7               'name'      => 'PhonenumImportForm',
8               'action'    => 'process/phone_avail-import.html',
9               'num_files' => 1,
10               'fields'    => [ 'format', 'availbatch', 'exportnum', 'countrycode' ],
11               'message'   => 'DID import successful',
12               'url'       => $p."search/phone_avail.html?availbatch=$availbatch",
13           )
14 %>
15
16 <% &ntable("#cccccc", 2) %>
17
18   <INPUT TYPE="hidden" NAME="format" VALUE="default">
19
20   <INPUT TYPE="hidden" NAME="availbatch" VALUE="<% $availbatch %>">
21
22   <INPUT TYPE="hidden" NAME="countrycode" VALUE="1">
23
24   <% include( '/elements/tr-select-table.html',
25                 'table'       => 'part_export',
26                 'name_col'    => 'machine',
27                 'label'       => 'Export',
28                 'empty_label' => 'Select export',
29                 'hashref'     => { 'exporttype' => 'internal_diddb', },
30                 #'label_callback' => 
31             )
32   %>
33
34   <% include( '/elements/file-upload.html',
35                 'field' => 'file',
36                 'label' => 'Filename',
37             )
38   %>
39
40   <TR>
41     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
42       <INPUT TYPE    = "submit"
43              ID      = "submit"
44              VALUE   = "Import file"
45              onClick = "document.PhonenumImportForm.submit.disabled=true;"
46       >
47     </TD>
48   </TR>
49
50 </TABLE>
51
52 </FORM>
53
54 <BR>
55
56 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
57 <BR><BR>
58
59 <b>Default</b> format has the following field order: <i>state, number<i></i>
60 <BR><BR>
61
62 Field information:
63 <ul>
64   <li><i>state</i>: Two-letter state code, i.e. "CA"
65   <li><i>number</i>: Phone number
66 </ul>
67
68 <% include('/elements/footer.html') %>
69
70 <%init>
71
72 die "access denied"
73   unless $FS::CurrentUser::CurrentUser->access_right('Import');
74
75 my $availbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
76
77 </%init>