5 'svc_acct' => 'username',
6 'svc_domain' => 'domain',
10 'svc_acct' => { label => 'Domain',
13 select_table => 'svc_domain',
14 select_key => 'svcnum',
15 select_label => 'domain'
19 my($query) = $cgi->keywords;
20 my($pkgnum, $svcpart) = ('', '');
21 foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
22 $pkgnum=$1 if /^pkgnum(\d+)$/;
23 $svcpart=$1 if /^svcpart(\d+)$/;
26 my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
27 my $svc = $part_svc->getfield('svc');
28 my $svcdb = $part_svc->getfield('svcdb');
29 my $link_field = $link_field{$svcdb};
30 my $link_field2 = $link_field2{$svcdb};
34 <%= header("Link to existing $svc") %>
35 <FORM ACTION="<%= popurl(1) %>process/link.cgi" METHOD=POST>
37 <% if ( $link_field ) { %>
38 <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
39 <INPUT TYPE="hidden" NAME="link_field" VALUE="<%= $link_field %>">
40 <%= $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value">
42 <% if ( $link_field2 ) { %>
43 <INPUT TYPE="hidden" NAME="link_field2" VALUE="<%= $link_field2->{field} %>">
44 <%= $link_field2->{'label'} %> of existing service:
45 <% if ( $link_field2->{'type'} eq 'select' ) { %>
46 <% if ( $link_field2->{'select_table'} ) { %>
47 <SELECT NAME="link_value2">
49 <% foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) { %>
50 <% my $key = $link_field2->{'select_key'}; %>
51 <% my $label = $link_field2->{'select_label'}; %>
52 <OPTION VALUE="<%= $r->$key() %>"><%= $r->$label() %></OPTION>
56 Don't know how to process secondary link field for <%= $svcdb %>
57 (type=>select but no select_table)
60 Don't know how to process secondary link field for <%= $svcdb %>
61 (unknown type <%= $link_field2->{'type'} %>)
66 Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">
69 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>">
70 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $svcpart %>">
71 <BR><INPUT TYPE="submit" VALUE="Link">