projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75989a3
)
part_pkg caching should speedup display of lots of packages, RT#5083
author
ivan
<ivan>
Mon, 30 Mar 2009 00:32:03 +0000
(
00:32
+0000)
committer
ivan
<ivan>
Mon, 30 Mar 2009 00:32:03 +0000
(
00:32
+0000)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
httemplate/view/cust_main/packages.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
f2e0005
..
44e1210
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-1220,8
+1220,10
@@
L<FS::part_pkg>).
=cut
=cut
+use Carp qw(cluck);
sub part_pkg {
my $self = shift;
sub part_pkg {
my $self = shift;
+ cluck "part_pkg called" if $DEBUG > 1 && ! $self->{'_pkgpart'};
#exists( $self->{'_pkgpart'} )
$self->{'_pkgpart'}
? $self->{'_pkgpart'}
#exists( $self->{'_pkgpart'} )
$self->{'_pkgpart'}
? $self->{'_pkgpart'}
diff --git
a/httemplate/view/cust_main/packages.html
b/httemplate/view/cust_main/packages.html
index
7643e3e
..
9b1d5b3
100755
(executable)
--- a/
httemplate/view/cust_main/packages.html
+++ b/
httemplate/view/cust_main/packages.html
@@
-76,6
+76,7
@@
Current packages
<TH CLASS="grid" BGCOLOR="#cccccc">Services</TH>
</TR>
<TH CLASS="grid" BGCOLOR="#cccccc">Services</TH>
</TR>
+% my %part_pkg = ();
% foreach my $cust_pkg (@$packages) {
%
% if ( $bgcolor eq $bgcolor1 ) {
% foreach my $cust_pkg (@$packages) {
%
% if ( $bgcolor eq $bgcolor1 ) {
@@
-84,12
+85,18
@@
Current packages
% $bgcolor = $bgcolor1;
% }
%
% $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,
% my %iopt = (
% 'bgcolor' => $bgcolor,
% 'cust_pkg' => $cust_pkg,
-% 'part_pkg' => $
cust_pkg->part_pkg
,
+% 'part_pkg' => $
part_pkg{$cust_pkg->pkgpart}
,
% %conf_opt,
% );
% %conf_opt,
% );
+%
+% my $oldDEBUG = $FS::cust_pkg::DEBUG;
+% $FS::cust_pkg::DEBUG = 2;
<!--pkgnum: <% $cust_pkg->pkgnum %>-->
<TR>
<!--pkgnum: <% $cust_pkg->pkgnum %>-->
<TR>
@@
-101,6
+108,8
@@
Current packages
<% include('packages/services.html', %iopt) %>
</TR>
<% include('packages/services.html', %iopt) %>
</TR>
+% $FS::cust_pkg::DEBUG = $oldDEBUG;
+
% }
</TABLE>
% }
</TABLE>