X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Flink.cgi;h=f37f769bc3f48d9d1471ec09df88402f1e26817b;hp=18cd378d3691fdcf11f84d2648f48d7fa1c04258;hb=acb5db886076201922167d39d76fd9b3e9e54c9c;hpb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15 diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index 18cd378d3..f37f769bc 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,9 +1,64 @@ - -<% +<% include("/elements/header.html","Link to existing $svc") %> + +
+% if ( $link_field ) { + + + + <% $link_field %> of existing service: +
+% if ( $link_field2 ) { + + + <% $link_field2->{'label'} %> of existing service: +% if ( $link_field2->{'type'} eq 'select' ) { +% if ( $link_field2->{'select_table'} ) { + + +% } else { + + Don't know how to process secondary link field for <% $svcdb %> + (type=>select but no select_table) +% } +% } else { + + Don't know how to process secondary link field for <% $svcdb %> + (unknown type <% $link_field2->{'type'} %>) +% } + +
+% } +% } else { + + Service # of existing service: +% } + + + + +
+
+ +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View/link unlinked services'); my %link_field = ( 'svc_acct' => 'username', 'svc_domain' => 'domain', + 'svc_phone' => 'phonenum', ); my %link_field2 = ( @@ -16,12 +71,10 @@ my %link_field2 = ( }, ); -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} +$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; +my $pkgnum = $1; +$cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; +my $svcpart = $1; my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); my $svc = $part_svc->getfield('svc'); @@ -29,46 +82,4 @@ my $svcdb = $part_svc->getfield('svcdb'); my $link_field = $link_field{$svcdb}; my $link_field2 = $link_field2{$svcdb}; -%> - -<%= header("Link to existing $svc") %> -
- -<% if ( $link_field ) { %> - - - <%= $link_field %> of existing service: -
- <% if ( $link_field2 ) { %> - - <%= $link_field2->{'label'} %> of existing service: - <% if ( $link_field2->{'type'} eq 'select' ) { %> - <% if ( $link_field2->{'select_table'} ) { %> - - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> - (type=>select but no select_table) - <% } %> - <% } else { %> - Don't know how to process secondary link field for <%= $svcdb %> - (unknown type <%= $link_field2->{'type'} %>) - <% } %> -
- <% } %> -<% } else { %> - Service # of existing service: -<% } %> - - - -
-
- - +