communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[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   <% include( '/elements/tr-select-table.html',
23                 'table'       => 'part_export',
24                 'name_col'    => 'machine',
25                 'label'       => 'Export',
26                 'empty_label' => 'Select export',
27                 'hashref'     => { 'exporttype' => 'internal_diddb', },
28                 #'label_callback' => 
29             )
30   %>
31
32   <TR>
33     <TH ALIGN="right">Country code</TH>
34     <TD>
35       <INPUT TYPE  = "text"
36              NAME  = "countrycode"
37              VALUE = "<% $conf->config('default_phone_countrycode') || 1 %>"
38       >
39     </TD>
40   </TR>
41
42   <% include( '/elements/file-upload.html',
43                 'field' => 'file',
44                 'label' => 'Filename',
45             )
46   %>
47
48   <TR>
49     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
50       <INPUT TYPE    = "submit"
51              ID      = "submit"
52              VALUE   = "Import file"
53              onClick = "document.PhonenumImportForm.submit.disabled=true;"
54       >
55     </TD>
56   </TR>
57
58 </TABLE>
59
60 </FORM>
61
62 <BR>
63
64 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
65 <BR><BR>
66
67 <b>Default</b> format has the following field order: <i>state, number<i></i>
68 <BR><BR>
69
70 Field information:
71 <ul>
72   <li><i>state</i>: Two-letter state code, i.e. "CA"
73   <li><i>number</i>: Phone number
74 </ul>
75
76 <% include('/elements/footer.html') %>
77
78 <%init>
79
80 die "access denied"
81   unless $FS::CurrentUser::CurrentUser->access_right('Import');
82
83 my $conf = new FS::Conf;
84
85 my $availbatch =
86   time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
87
88 </%init>