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};
35 <% include("/elements/header.html","Link to existing $svc") %>
36 <FORM ACTION="<% popurl(1) %>process/link.cgi" METHOD=POST>
37 % if ( $link_field ) {
39 <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
40 <INPUT TYPE="hidden" NAME="link_field" VALUE="<% $link_field %>">
41 <% $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value">
43 % if ( $link_field2 ) {
45 <INPUT TYPE="hidden" NAME="link_field2" VALUE="<% $link_field2->{field} %>">
46 <% $link_field2->{'label'} %> of existing service:
47 % if ( $link_field2->{'type'} eq 'select' ) {
48 % if ( $link_field2->{'select_table'} ) {
50 <SELECT NAME="link_value2">
52 % foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) {
53 % my $key = $link_field2->{'select_key'};
54 % my $label = $link_field2->{'select_label'};
56 <OPTION VALUE="<% $r->$key() %>"><% $r->$label() %></OPTION>
62 Don't know how to process secondary link field for <% $svcdb %>
63 (type=>select but no select_table)
67 Don't know how to process secondary link field for <% $svcdb %>
68 (unknown type <% $link_field2->{'type'} %>)
75 Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">
79 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
80 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
81 <BR><INPUT TYPE="submit" VALUE="Link">