1 <% include('/elements/header.html', 'Import') %>
3 <FORM ACTION="process/meta-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
4 Import data from a DBI data source<BR><BR>
6 % #false laziness with edit/cust_main.cgi
7 % my @agents = qsearch( 'agent', {} );
8 % die "No agents created!" unless @agents;
9 % my $agentnum = $agents[0]->agentnum; #default to first
11 % if ( scalar(@agents) == 1 ) {
14 <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agentnum %>">
17 <BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
18 % foreach my $agent (sort { $a->agent cmp $b->agent } @agents) {
20 <OPTION VALUE="<% $agent->agentnum %>" <% " SELECTED"x($agent->agentnum==$agentnum) %>><% $agent->agent %></OPTION>
26 % my @referrals = qsearch('part_referral',{});
27 % die "No advertising sources created!" unless @referrals;
28 % my $refnum = $referrals[0]->refnum; #default to first
30 % if ( scalar(@referrals) == 1 ) {
33 <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
36 <BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
37 % foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) {
39 <OPTION VALUE="<% $referral->refnum %>" <% " SELECTED"x($referral->refnum==$refnum) %>><% $referral->refnum %>: <% $referral->referral %></OPTION>
46 First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
47 % foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
49 <OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg_comment %></OPTION>
56 <td align="right">DBI data source: </td>
57 <td><INPUT TYPE="text" NAME="data_source"></td>
60 <td align="right">DBI username: </td>
61 <td><INPUT TYPE="text" NAME="username"></td>
64 <td align="right">DBI password: </td>
65 <td><INPUT TYPE="text" NAME="password"></td>
68 <INPUT TYPE="submit" VALUE="Import">
72 <% include('/elements/footer.html') %>
76 #there's no ACL for this... haven't used in ages
77 die 'meta-import not enabled; remove this if you want to use it';