X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Flink.cgi;h=ef72b4a5c808eef417d4a5e2c08a343b5ea96a4a;hb=83e4d401f0cb6007ce91427434aa756a933691cc;hp=e2bdda7d5b61bfce20ef157ef5bd878bd814d076;hpb=c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9;p=freeside.git diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index e2bdda7d5..ef72b4a5c 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,73 +1,76 @@ - -<% +%my %link_field = ( +% 'svc_acct' => 'username', +% 'svc_domain' => 'domain', +%); +% +%my %link_field2 = ( +% 'svc_acct' => { label => 'Domain', +% field => 'domsvc', +% type => 'select', +% select_table => 'svc_domain', +% select_key => 'svcnum', +% select_label => 'domain' +% }, +%); +% +%$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'); +%my $svcdb = $part_svc->getfield('svcdb'); +%my $link_field = $link_field{$svcdb}; +%my $link_field2 = $link_field2{$svcdb}; +% -my %link_field = ( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', -); +<% include("/elements/header.html","Link to existing $svc") %> +
+% if ( $link_field ) { -my %link_field2 = ( - 'svc_acct' => { label => 'Domain', - field => 'domsvc', - type => 'select', - select_table => 'svc_domain', - select_key => 'svcnum', - select_label => 'domain' - }, -); - -my($query) = $cgi->keywords; -my($pkgnum, $svcpart) = ('', ''); -foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart - $pkgnum=$1 if /^pkgnum(\d+)$/; - $svcpart=$1 if /^svcpart(\d+)$/; -} - -my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); -my $svc = $part_svc->getfield('svc'); -my $svcdb = $part_svc->getfield('svcdb'); -my $link_field = $link_field{$svcdb}; -my $link_field2 = $link_field2{$svcdb}; - -%> - -<%= include("/elements/header.html","Link to existing $svc") %> - - -<% if ( $link_field ) { %> - - <%= $link_field %> of existing service: + + <% $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'} ) { %> +% 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 %> +% } 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 { + + Don't know how to process secondary link field for <% $svcdb %> + (unknown type <% $link_field2->{'type'} %>) +% } +
- <% } %> -<% } else { %> +% } +% } else { + Service # of existing service: -<% } %> +% } + - - + +