diff options
author | ivan <ivan> | 2002-11-26 11:58:14 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-11-26 11:58:14 +0000 |
commit | 69a956aecd4bc89c683e60f9ec3fe0c9e11ea0d7 (patch) | |
tree | 1a481d6e8e82969bd054668939928ca9d46b0f62 /httemplate/misc/process/link.cgi | |
parent | 3ac3bd76d4716016ba3a51f51a83a02732d9d2de (diff) |
link by username now only links to same svcpart
Diffstat (limited to 'httemplate/misc/process/link.cgi')
-rwxr-xr-x | httemplate/misc/process/link.cgi | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi index 4b220a867..5d80adeb9 100755 --- a/httemplate/misc/process/link.cgi +++ b/httemplate/misc/process/link.cgi @@ -8,12 +8,15 @@ $cgi->param('svcnum') =~ /^(\d*)$/; my $svcnum = $1; unless ( $svcnum ) { - my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart}); - my($svcdb) = $part_svc->getfield('svcdb'); - $cgi->param('link_field') =~ /^(\w+)$/; my($link_field)=$1; - my($svc_x)=qsearchs($svcdb,{$link_field => $cgi->param('link_value') }); + my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart}); + my $svcdb = $part_svc->getfield('svcdb'); + $cgi->param('link_field') =~ /^(\w+)$/; + my $link_field = $1; + my $svc_x = ( grep { $_->cust_svc->svcpart == $svcpart } + qsearch( $svcdb, { $link_field => $cgi->param('link_value') }) + )[0]; eidiot("$link_field not found!") unless $svc_x; - $svcnum=$svc_x->svcnum; + $svcnum = $svc_x->svcnum; } my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum}); |