[freeside-commits] branch FREESIDE_3_BRANCH updated. 0f59c23578f08581b6f9dd4104d5ddcfe3d3dbc0
Ivan
ivan at 420.am
Mon Jan 6 21:28:55 PST 2014
The branch, FREESIDE_3_BRANCH has been updated
via 0f59c23578f08581b6f9dd4104d5ddcfe3d3dbc0 (commit)
from 3edb5935b6ecc1194c53d16002f018caab039f5d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0f59c23578f08581b6f9dd4104d5ddcfe3d3dbc0
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon Jan 6 21:28:53 2014 -0800
backport cust_svc_unsorted method from master, RT#26097
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 025da48..2bfe6ee 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2705,14 +2705,30 @@ sub num_cust_event {
=item cust_svc [ OPTION => VALUE ... ] (current usage)
+=item cust_svc_unsorted [ OPTION => VALUE ... ]
+
Returns the services for this package, as FS::cust_svc objects (see
L<FS::cust_svc>). Available options are svcpart and svcdb. If either is
spcififed, returns only the matching services.
+As an optimization, use the cust_svc_unsorted version if you are not displaying
+the results.
+
=cut
sub cust_svc {
my $self = shift;
+ cluck "cust_pkg->cust_svc called" if $DEBUG > 2;
+ $self->_sort_cust_svc( $self->cust_svc_unsorted_arrayref(@_) );
+}
+
+sub cust_svc_unsorted {
+ my $self = shift;
+ @{ $self->cust_svc_unsorted_arrayref(@_) };
+}
+
+sub cust_svc_unsorted_arrayref {
+ my $self = shift;
return () unless $self->num_cust_svc(@_);
@@ -2737,13 +2753,7 @@ sub cust_svc {
$search{extra_sql} = ' AND svcdb = '. dbh->quote( $opt{'svcdb'} );
}
- cluck "cust_pkg->cust_svc called" if $DEBUG > 2;
-
- #if ( $self->{'_svcnum'} ) {
- # values %{ $self->{'_svcnum'}->cache };
- #} else {
- $self->_sort_cust_svc( [ qsearch(\%search) ] );
- #}
+ [ qsearch(\%search) ];
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_pkg.pm | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
More information about the freeside-commits
mailing list