[freeside-commits] branch FREESIDE_3_BRANCH updated. 28ba028563d62f19f1cc2bd1160dd8c5d7e9d960

Ivan ivan at 420.am
Tue May 6 05:35:54 PDT 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  28ba028563d62f19f1cc2bd1160dd8c5d7e9d960 (commit)
      from  c66b0e5ab92b16ca50bad5f8388a4e428be89f68 (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 28ba028563d62f19f1cc2bd1160dd8c5d7e9d960
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue May 6 05:35:52 2014 -0700

    optimize package list with lots of packages, RT#28526

diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 566ab29..9eef6ac 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -249,4 +249,9 @@ sub get_packages {
   ( \@packages, $num_old_packages );
 }
 
+foreach my $cust_pkg ( @packages ) {
+  $cust_pkg->{'_cust_pkg_discount_active'} =
+   [ $cust_pkg->cust_pkg_discount_active ];
+}
+
 </%init>
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 1209446..ac559bf 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -56,7 +56,7 @@
 %
 %             if ( $curuser->access_right('Discount customer package')
 %                  && $part_pkg->can_discount
-%                  && ! scalar($cust_pkg->cust_pkg_discount_active)
+%                  && ! scalar( @{ $cust_pkg->{_cust_pkg_discount_active} } )
 %                  && ! scalar($cust_pkg->part_pkg->part_pkg_discount)
 %                )
 %             {
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index b58f1f3..9bd0079 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -492,7 +492,7 @@ sub pkg_status_row_discount {
 
   my $html;
 
-  foreach my $cust_pkg_discount ( $cust_pkg->cust_pkg_discount_active ) {
+  foreach my $cust_pkg_discount (@{ $cust_pkg->{_cust_pkg_discount_active} }) {
 
     my $discount = $cust_pkg_discount->discount;
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/cust_main/packages.html         |    5 +++++
 httemplate/view/cust_main/packages/package.html |    2 +-
 httemplate/view/cust_main/packages/status.html  |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list