summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2005-06-17 04:42:06 +0000
committerivan <ivan>2005-06-17 04:42:06 +0000
commit21e9127d3a16335907d1102793b294446e07120b (patch)
tree5a3889e294b989ba583f5f5462773ef9de0865c9
parentbeb9cc8ec5bc9ec114763d5ecb48cf674ff4de72 (diff)
add debugging for accounts picked to pick
-rwxr-xr-xhttemplate/misc/process/link.cgi22
1 files changed, 20 insertions, 2 deletions
diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi
index acdd1ad03..7768b3bd4 100755
--- a/httemplate/misc/process/link.cgi
+++ b/httemplate/misc/process/link.cgi
@@ -1,5 +1,7 @@
<%
+my $DEBUG = 0;
+
$cgi->param('pkgnum') =~ /^(\d+)$/;
my $pkgnum = $1;
$cgi->param('svcpart') =~ /^(\d+)$/;
@@ -16,14 +18,30 @@ unless ( $svcnum ) {
if ( $cgi->param('link_field2') =~ /^(\w+)$/ ) {
$search{$1} = $cgi->param('link_value2');
}
- my $svc_x = ( sort { ($b->cust_svc->pkgnum > 0) <=> ($a->cust_svc->pkgnum > 0)
+
+ 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];
+ );
+
+ if ( $DEBUG ) {
+ warn scalar(@svc_x). " candidate accounts found for linking ".
+ "(svcpart $svcpart):\n";
+ foreach my $svc_x ( @svc_x ) {
+ warn " ". $svc_x->email.
+ " (pkgnum ". $_->cust_svc->pkgnum.
+ ", svcpart ". $_->cust_svc->svcpart. ")\n";
+ }
+ }
+
+ my $svc_x = $svc_x[0];
+
eidiot("$link_field not found!") unless $svc_x;
+
$svcnum = $svc_x->svcnum;
+
}
my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum});