diff options
author | ivan <ivan> | 2005-07-12 09:22:18 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-07-12 09:22:18 +0000 |
commit | 1c7f3b811c8ab9c7ebe89ff080c333cbdf99d78a (patch) | |
tree | e3327a1851aa4e83499cc2f53d8d0a1d38e439ef /httemplate/edit | |
parent | 06707641b711d9218aba36dc70cf86146fa2acef (diff) |
<rjbs> This patch is part of my continuing effort to avoid using SQL and qsearch from templates to find the pkg_svc records for a package.
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 128775619..e6e10e73f 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -187,22 +187,20 @@ if ( $pkgpart ) { )"; } my @part_svc = qsearch('part_svc', {}, '', $where); +my %pkg_svc = map { $_->svcpart => $_ } $part_pkg->pkg_svc; my @fixups = (); my $count = 0; my $columns = 3; foreach my $part_svc ( @part_svc ) { my $svcpart = $part_svc->svcpart; - my $pkg_svc = $pkgpart && qsearchs( 'pkg_svc', { - 'pkgpart' => $pkgpart, - 'svcpart' => $svcpart, - } ) || new FS::pkg_svc ( { - 'pkgpart' => $pkgpart, - 'svcpart' => $svcpart, - 'quantity' => 0, - 'primary_svc' => '', - }); - #? #next unless $pkg_svc; + my $pkg_svc = $pkg_svc{$svcpart} + || new FS::pkg_svc ( { + 'pkgpart' => $pkgpart, + 'svcpart' => $svcpart, + 'quantity' => 0, + 'primary_svc' => '', + } ); push @fixups, "pkg_svc$svcpart"; |