diff options
author | ivan <ivan> | 2002-12-24 22:41:23 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-12-24 22:41:23 +0000 |
commit | b1d4c3b5b5a05d38a4baf9c49bd7fdfb6990531d (patch) | |
tree | 0be6669217e4d1cddd996a600bb0779aa8e0605d | |
parent | 022f47d636bcec1699a0e8ebce394f5756af5f8c (diff) |
optimization for ginourmous numbers of packages for intergate, whew
-rwxr-xr-x | FS/bin/freeside-setup | 4 | ||||
-rw-r--r-- | README.1.5.0pre1 | 1 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 16 |
3 files changed, 11 insertions, 10 deletions
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 8f3d99fd5..8b7466222 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -669,7 +669,7 @@ sub tables_hash_hack { ], 'primary_key' => 'pkgpart', 'unique' => [], - 'index' => [], + 'index' => [ [ disabled ], ], }, # 'part_title' => { @@ -712,7 +712,7 @@ sub tables_hash_hack { ], 'primary_key' => 'svcpart', 'unique' => [], - 'index' => [], + 'index' => [ [ 'disabled' ] ], }, 'part_svc_column' => { diff --git a/README.1.5.0pre1 b/README.1.5.0pre1 index 57fc36af6..0de86bce0 100644 --- a/README.1.5.0pre1 +++ b/README.1.5.0pre1 @@ -7,6 +7,7 @@ schema changes: *** add column cust_main_county.taxname *** add column cust_bill_pkg.itemdesc *** drop index cust_bill_pkg1 + *** add index part_pkg1 and part_svc1 install DBIx::DBSchema 0.21 install NetAddr::IP 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; } |