projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e692a3f
)
optimization to speed up new customer page when there's lots of agents, RT#10184
author
ivan
<ivan>
Mon, 11 Oct 2010 10:36:21 +0000
(10:36 +0000)
committer
ivan
<ivan>
Mon, 11 Oct 2010 10:36:21 +0000
(10:36 +0000)
FS/FS/agent_type.pm
patch
|
blob
|
history
diff --git
a/FS/FS/agent_type.pm
b/FS/FS/agent_type.pm
index
2660bb4
..
5d6b94e
100644
(file)
--- a/
FS/FS/agent_type.pm
+++ b/
FS/FS/agent_type.pm
@@
-2,7
+2,7
@@
package FS::agent_type;
use strict;
use vars qw( @ISA );
use strict;
use vars qw( @ISA );
-use FS::Record qw( qsearch );
+use FS::Record qw( qsearch
dbh
);
use FS::m2m_Common;
use FS::agent;
use FS::type_pkgs;
use FS::m2m_Common;
use FS::agent;
use FS::type_pkgs;
@@
-119,9
+119,7
@@
L<FS::part_pkg>.
sub pkgpart_hashref {
my $self = shift;
my %pkgpart;
sub pkgpart_hashref {
my $self = shift;
my %pkgpart;
- #$pkgpart{$_}++ foreach $self->pkgpart;
- # not compatible w/5.004_04 (fixed in 5.004_05)
- foreach ( $self->pkgpart ) { $pkgpart{$_}++; }
+ $pkgpart{$_}++ foreach $self->pkgpart;
\%pkgpart;
}
\%pkgpart;
}
@@
-166,7
+164,13
@@
agent type.
sub pkgpart {
my $self = shift;
sub pkgpart {
my $self = shift;
- map $_->pkgpart, $self->type_pkgs;
+
+ #map $_->pkgpart, $self->type_pkgs;
+
+ my $sql = 'SELECT pkgpart FROM type_pkgs WHERE typenum = ?';
+ my $sth = dbh->prepare($sql) or die dbh->errstr;
+ $sth->execute( $self->typenum ) or die $sth->errstr;
+ map $_->[0], @{ $sth->fetchall_arrayref };
}
=back
}
=back