From 3b5ccffae54e59c012eb1ebb348207510ca1d5ce Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 00:32:03 +0000 Subject: part_pkg caching should speedup display of lots of packages, RT#5083 --- httemplate/view/cust_main/packages.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 7643e3efd..9b1d5b317 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,6 +76,7 @@ Current packages Services +% my %part_pkg = (); % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { @@ -84,12 +85,18 @@ Current packages % $bgcolor = $bgcolor1; % } % +% $part_pkg{$cust_pkg->pkgpart} ||= $cust_pkg->part_pkg; +% $cust_pkg->{'_pkgpart'} ||= $part_pkg{$cust_pkg->pkgpart}; #XXX cache kludge +% % my %iopt = ( % 'bgcolor' => $bgcolor, % 'cust_pkg' => $cust_pkg, -% 'part_pkg' => $cust_pkg->part_pkg, +% 'part_pkg' => $part_pkg{$cust_pkg->pkgpart}, % %conf_opt, % ); +% +% my $oldDEBUG = $FS::cust_pkg::DEBUG; +% $FS::cust_pkg::DEBUG = 2; @@ -101,6 +108,8 @@ Current packages <% include('packages/services.html', %iopt) %> +% $FS::cust_pkg::DEBUG = $oldDEBUG; + % } -- cgit v1.2.1