1 <% include("/elements/header.html","Link to existing $svc") %>
3 <FORM ACTION="<% popurl(1) %>process/link.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
7 <INPUT TYPE="hidden" NAME="link_field" VALUE="<% $link_field %>">
8 <% $link_field %> of existing service: <INPUT TYPE="text" NAME="link_value">
10 % if ( $link_field2 ) {
12 <INPUT TYPE="hidden" NAME="link_field2" VALUE="<% $link_field2->{field} %>">
13 <% $link_field2->{'label'} %> of existing service:
14 % if ( $link_field2->{'type'} eq 'select' ) {
15 % if ( $link_field2->{'select_table'} ) {
17 <SELECT NAME="link_value2">
19 % foreach my $r ( qsearch( $link_field2->{'select_table'}, {})) {
20 % my $key = $link_field2->{'select_key'};
21 % my $label = $link_field2->{'select_label'};
23 <OPTION VALUE="<% $r->$key() %>"><% $r->$label() %></OPTION>
29 Don't know how to process secondary link field for <% $svcdb %>
30 (type=>select but no select_table)
34 Don't know how to process secondary link field for <% $svcdb %>
35 (unknown type <% $link_field2->{'type'} %>)
42 Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">
46 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
47 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
48 <BR><INPUT TYPE="submit" VALUE="Link">
51 <% include('/elements/footer.html') %>
56 unless $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services');
59 'svc_acct' => 'username',
60 'svc_domain' => 'domain',
61 'svc_phone' => 'phonenum',
65 'svc_acct' => { label => 'Domain',
68 select_table => 'svc_domain',
69 select_key => 'svcnum',
70 select_label => 'domain'
74 $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
76 $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
79 my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
80 my $svc = $part_svc->getfield('svc');
81 my $svcdb = $part_svc->getfield('svcdb');
82 my $link_field = $link_field{$svcdb};
83 my $link_field2 = $link_field2{$svcdb};