summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2002-12-24 22:41:23 +0000
committerivan <ivan>2002-12-24 22:41:23 +0000
commitb1d4c3b5b5a05d38a4baf9c49bd7fdfb6990531d (patch)
tree0be6669217e4d1cddd996a600bb0779aa8e0605d /httemplate
parent022f47d636bcec1699a0e8ebce394f5756af5f8c (diff)
optimization for ginourmous numbers of packages for intergate, whew
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/view/cust_main.cgi16
1 files changed, 8 insertions, 8 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 62e961dfa..6fe759bd9 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -280,14 +280,14 @@ print '<BR>'.
qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!.
'<SELECT NAME="pkgpart"><OPTION> ';
-foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
- my $pkgpart = $type_pkgs->pkgpart;
-# my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } )
-# or do { warn "unknown type_pkgs.pkgpart $pkgpart"; next; };
- my $part_pkg =
- qsearchs('part_pkg', { 'pkgpart' => $pkgpart, 'disabled' => '' } )
- or next;
- print qq!<OPTION VALUE="$pkgpart">!. $part_pkg->pkg. ' - '.
+foreach my $part_pkg (
+ qsearch( 'part_pkg', { 'disabled' => '' }, '',
+ ' AND 0 < ( SELECT COUNT(*) FROM type_pkgs '.
+ ' WHERE typenum = '. $agent->typenum.
+ ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'
+ )
+) {
+ print '<OPTION VALUE="'. $part_pkg->pkgpart. '">'. $part_pkg->pkg. ' - '.
$part_pkg->comment;
}