X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Flink.cgi;h=ef72b4a5c808eef417d4a5e2c08a343b5ea96a4a;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hp=79adce88c685c264c195997097f40c83a4f810a1;hpb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;p=freeside.git diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi index 79adce88c..ef72b4a5c 100755 --- a/httemplate/misc/link.cgi +++ b/httemplate/misc/link.cgi @@ -1,45 +1,77 @@ - -<% - -my %link_field = ( - 'svc_acct' => 'username', - 'svc_domain' => 'domain', - 'svc_charge' => '', - 'svc_wo' => '', -); - -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}; - -print header("Link to existing $svc"), - qq!
!; - -if ( $link_field ) { - print < '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}; +% + +<% include("/elements/header.html","Link to existing $svc") %> + +% if ( $link_field ) { + - - $link_field of existing service: -END -} else { - print qq!Service # of existing service: !; -} - -print < - -

+ + <% $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: +% } + + + + +
-END - -%>