blob: 5b3470c06a8e8c90b58392b1bce7179e1386e94f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
<% include('/elements/header.html', 'Import') %>
<FORM ACTION="process/meta-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
Import data from a DBI data source<BR><BR>
%
% #false laziness with edit/cust_main.cgi
% my @agents = qsearch( 'agent', {} );
% die "No agents created!" unless @agents;
% my $agentnum = $agents[0]->agentnum; #default to first
%
% if ( scalar(@agents) == 1 ) {
%
<INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agentnum %>">
% } else {
<BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
% foreach my $agent (sort { $a->agent cmp $b->agent } @agents) {
<OPTION VALUE="<% $agent->agentnum %>" <% " SELECTED"x($agent->agentnum==$agentnum) %>><% $agent->agent %></OPTION>
% }
</SELECT><BR><BR>
% }
%
% my @referrals = qsearch('part_referral',{});
% die "No advertising sources created!" unless @referrals;
% my $refnum = $referrals[0]->refnum; #default to first
%
% if ( scalar(@referrals) == 1 ) {
%
<INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">
% } else {
<BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
% foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) {
<OPTION VALUE="<% $referral->refnum %>" <% " SELECTED"x($referral->refnum==$refnum) %>><% $referral->refnum %>: <% $referral->referral %></OPTION>
% }
</SELECT><BR><BR>
% }
First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) {
<OPTION VALUE="<% $part_pkg->pkgpart %>"><% $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
% }
</SELECT><BR><BR>
<table>
<tr>
<td align="right">DBI data source: </td>
<td><INPUT TYPE="text" NAME="data_source"></td>
</tr>
<tr>
<td align="right">DBI username: </td>
<td><INPUT TYPE="text" NAME="username"></td>
</tr>
<tr>
<td align="right">DBI password: </td>
<td><INPUT TYPE="text" NAME="password"></td>
</tr>
</table>
<INPUT TYPE="submit" VALUE="Import">
</FORM>
<% include('/elements/footer.html') %>
<%init>
#there's no ACL for this... haven't used in ages
die 'meta-import not enabled; remove this if you want to use it';
</%init>
|