From 918bbc9ce36a3dc5943f521e26751ea94a5a5539 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 30 Jul 2004 04:54:41 +0000 Subject: svcpart changes now trigger all necessary export actions, manual svcpart changing on svc_acct view, linking changes svcpart if you ask it to, closes: Bug#671, Bug#644 --- httemplate/misc/process/link.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi index 32a5360d9..acdd1ad03 100755 --- a/httemplate/misc/process/link.cgi +++ b/httemplate/misc/process/link.cgi @@ -16,8 +16,11 @@ unless ( $svcnum ) { if ( $cgi->param('link_field2') =~ /^(\w+)$/ ) { $search{$1} = $cgi->param('link_value2'); } - my $svc_x = ( grep { $_->cust_svc->svcpart == $svcpart } - qsearch( $svcdb, \%search ) + my $svc_x = ( sort { ($b->cust_svc->pkgnum > 0) <=> ($a->cust_svc->pkgnum > 0) + or ($b->cust_svc->svcpart == $svcpart) + <=> ($a->cust_svc->svcpart == $svcpart) + } + qsearch( $svcdb, \%search ) )[0]; eidiot("$link_field not found!") unless $svc_x; $svcnum = $svc_x->svcnum; -- cgit v1.2.1