diff options
author | ivan <ivan> | 2009-03-30 01:05:04 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-03-30 01:05:04 +0000 |
commit | 4a525836ffb9fa8a941c11247637543d931733b8 (patch) | |
tree | cb5f2eb22335d48988189bac1a6bab73e6704a3d /httemplate | |
parent | 3b5ccffae54e59c012eb1ebb348207510ca1d5ce (diff) |
forget caching, instead scoop up cust_pkg and part_pkg in one query, RT#5083
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/view/cust_main/packages.html | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 9b1d5b317..56bc63fd0 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,7 +76,7 @@ Current packages <TH CLASS="grid" BGCOLOR="#cccccc">Services</TH> </TR> -% my %part_pkg = (); +% local($FS::cust_pkg::DEBUG) = 2; % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { @@ -85,18 +85,15 @@ Current packages % $bgcolor = $bgcolor1; % } % -% $part_pkg{$cust_pkg->pkgpart} ||= $cust_pkg->part_pkg; -% $cust_pkg->{'_pkgpart'} ||= $part_pkg{$cust_pkg->pkgpart}; #XXX cache kludge +% $cust_pkg->{'_pkgpart'} = new FS::part_pkg { $cust_pkg->hash }; #quelle klud % % my %iopt = ( % 'bgcolor' => $bgcolor, % 'cust_pkg' => $cust_pkg, -% 'part_pkg' => $part_pkg{$cust_pkg->pkgpart}, +% 'part_pkg' => $cust_pkg->part_pkg, % %conf_opt, % ); % -% my $oldDEBUG = $FS::cust_pkg::DEBUG; -% $FS::cust_pkg::DEBUG = 2; <!--pkgnum: <% $cust_pkg->pkgnum %>--> <TR> @@ -108,8 +105,6 @@ Current packages <% include('packages/services.html', %iopt) %> </TR> -% $FS::cust_pkg::DEBUG = $oldDEBUG; - % } </TABLE> @@ -174,7 +169,10 @@ sub get_packages { $method = 'all_pkgs'; } - my @packages = $cust_main->$method(); + my @packages = $cust_main->$method( { + 'select' => 'cust_pkg.*, part_pkg.*', + 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )' + } ); my $num_old_packages = scalar(@packages); unless ( $cgi->param('showoldpackages') ) { |