[freeside-commits] branch FREESIDE_4_BRANCH updated. 92103805f83d606f2a680040c2eca8bdd184af76

Mitch Jackson mitch at freeside.biz
Mon Apr 1 11:31:05 PDT 2019


The branch, FREESIDE_4_BRANCH has been updated
       via  92103805f83d606f2a680040c2eca8bdd184af76 (commit)
       via  5087a15be11214a144c1a7e49f21f7b320fa49dd (commit)
       via  634f70db8ca6de6776329aa3e05c16d159246546 (commit)
      from  3d864cbee010079d9062d0f8569d6d1d8ab31a1d (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 92103805f83d606f2a680040c2eca8bdd184af76
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sun Mar 31 18:53:33 2019 -0400

    RT# 81946 Implement conf-disable_counts on Service Definitions page

diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index 222433db3..8b596752f 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -64,7 +64,6 @@ function part_export_areyousure(href) {
     <TH CLASS="grid" BGCOLOR="#cccccc" STYLE="font-size: smaller;">Required</TH>
 
   </TR>
-% my $conf = FS::Conf->new;
 % foreach my $part_svc ( @part_svc ) {
 %     my $svcdb = $part_svc->svcdb;
 %     my $svc_x = "FS::$svcdb"->new( { svcpart => $part_svc->svcpart } );
@@ -137,12 +136,12 @@ function part_export_areyousure(href) {
     <TD ROWSPAN=<% $rowspan %> CLASS="grid" BGCOLOR="<% $bgcolor %>">
 % my $svcurl_active = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=0");
 % my $svcurl_cancel = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=1");
-      <FONT COLOR="#00CC00"><B><% $num_cust_svc_active{$part_svc->svcpart} %></B></FONT> <% $num_cust_svc_active{$part_svc->svcpart} ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} ? '</A>' : '' %>
-% if ( $num_cust_svc_cancelled{$part_svc->svcpart} ) { 
+      <FONT COLOR="#00CC00"><B><% $num_cust_svc_active{$part_svc->svcpart} %></B></FONT> <% $num_cust_svc_active{$part_svc->svcpart} || $disable_counts ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} || $disable_counts ? '</A>' : '' %>
+% if ( $num_cust_svc_cancelled{$part_svc->svcpart} || $disable_counts ) {
         <BR><FONT COLOR="#FF0000"><B><% $num_cust_svc_cancelled{$part_svc->svcpart} %></B></FONT> <% $svcurl_cancel %>cancelled</A>
 % }
-% if ( $num_cust_svc{$part_svc->svcpart} ) { 
-        <BR><FONT SIZE="-1">[ <A HREF="<%$p%>edit/bulk-cust_svc.html?svcpart=<% $part_svc->svcpart %>">change</A> ]</FONT>
+% if ( $num_cust_svc{$part_svc->svcpart} || $disable_counts ) {
+        <BR><FONT SIZE="-1"><nobr>[ <A HREF="<%$p%>edit/bulk-cust_svc.html?svcpart=<% $part_svc->svcpart %>">change</A> ]</nobr></FONT>
 % } 
 
     </TD>
@@ -239,6 +238,9 @@ function part_export_areyousure(href) {
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
+my $conf = FS::Conf->new;
+my $disable_counts = $conf->exists('config-disable_counts') ? 1 : 0;
+
 #code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm
 my %flag = (
   ''  => '',
@@ -276,10 +278,13 @@ my $total = scalar(@part_svc);
 my %num_cust_svc_active;
 my %num_cust_svc_cancelled;
 my %num_cust_svc;
-foreach my $part_svc (@part_svc) {
-  $num_cust_svc{$part_svc->svcpart} = $part_svc->num_cust_svc;
-  $num_cust_svc_cancelled{$part_svc->svcpart} = $part_svc->num_cust_svc_cancelled;
-  $num_cust_svc_active{$part_svc->svcpart} = $num_cust_svc{$part_svc->svcpart} - $num_cust_svc_cancelled{$part_svc->svcpart};
+
+unless ( $disable_counts ) {
+  foreach my $part_svc (@part_svc) {
+    $num_cust_svc{$part_svc->svcpart} = $part_svc->num_cust_svc;
+    $num_cust_svc_cancelled{$part_svc->svcpart} = $part_svc->num_cust_svc_cancelled;
+    $num_cust_svc_active{$part_svc->svcpart} = $num_cust_svc{$part_svc->svcpart} - $num_cust_svc_cancelled{$part_svc->svcpart};
+  }
 }
 
 if ( $cgi->param('orderby') eq 'active' ) {

commit 5087a15be11214a144c1a7e49f21f7b320fa49dd
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sun Mar 31 18:37:16 2019 -0400

    RT# 81946 Implement conf-disable_counts on Package Definitions page

diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 8bb396053..0737dcdf6 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -60,6 +60,7 @@ my $conf = new FS::Conf;
 my $taxclasses = $conf->exists('enable_taxclasses');
 my $taxvendor = $conf->config('tax_data_vendor');
 my $money_char = $conf->config('money_char') || '$';
+my $disable_counts = $conf->exists('config-disable_counts') ? 1 : 0;
 
 my $select = '*';
 my $orderby = 'pkgpart';
@@ -143,40 +144,43 @@ my $count_cust_pkg_cancel = "
       AND cust_pkg.cancel IS NOT NULL AND cust_pkg.cancel != 0
 ";
 
-$select = "
-
-  *,
-
-  ( $count_cust_pkg
-      AND ( setup IS NULL OR setup = 0 )
-      AND ( cancel IS NULL OR cancel = 0 )
-      AND ( susp IS NULL OR susp = 0 )
-  ) AS num_not_yet_billed,
-
-  ( $count_cust_pkg
-      AND setup IS NOT NULL AND setup != 0
-      AND ( cancel IS NULL OR cancel = 0 )
-      AND ( susp IS NULL OR susp = 0 )
-  ) AS num_active,
-
-  ( $count_cust_pkg
-      AND ( cancel IS NULL OR cancel = 0 )
-      AND susp IS NOT NULL AND susp != 0
-      AND setup IS NOT NULL AND setup != 0
-  ) AS num_suspended,
-
-  ( $count_cust_pkg
-      AND ( cancel IS NULL OR cancel = 0 )
-      AND susp IS NOT NULL AND susp != 0
-      AND ( setup IS NULL OR setup = 0 )
-  ) AS num_on_hold,
-
-  ( $count_cust_pkg_cancel
-      AND (cust_pkg_next.pkgnum IS NULL
-           OR cust_pkg_next.pkgpart != cust_pkg.pkgpart)
-  ) AS num_cancelled
+unless ( $disable_counts ) {
+  $select = "
+
+    *,
+
+    ( $count_cust_pkg
+        AND ( setup IS NULL OR setup = 0 )
+        AND ( cancel IS NULL OR cancel = 0 )
+        AND ( susp IS NULL OR susp = 0 )
+    ) AS num_not_yet_billed,
+
+    ( $count_cust_pkg
+        AND setup IS NOT NULL AND setup != 0
+        AND ( cancel IS NULL OR cancel = 0 )
+        AND ( susp IS NULL OR susp = 0 )
+    ) AS num_active,
+
+    ( $count_cust_pkg
+        AND ( cancel IS NULL OR cancel = 0 )
+        AND susp IS NOT NULL AND susp != 0
+        AND setup IS NOT NULL AND setup != 0
+    ) AS num_suspended,
+
+    ( $count_cust_pkg
+        AND ( cancel IS NULL OR cancel = 0 )
+        AND susp IS NOT NULL AND susp != 0
+        AND ( setup IS NULL OR setup = 0 )
+    ) AS num_on_hold,
+
+    ( $count_cust_pkg_cancel
+        AND (cust_pkg_next.pkgnum IS NULL
+            OR cust_pkg_next.pkgpart != cust_pkg.pkgpart)
+    ) AS num_cancelled
+
+  ";
+}
 
-";
 # About the num_cancelled expression: packages that were changed, but 
 # kept the same pkgpart, are considered "moved", not "canceled" (because
 # this is the part_pkg UI).  We could show the count of those but it's 
@@ -544,7 +548,7 @@ if ( $acl_edit_global ) {
                                                   : ''
                                               ),
                                  'align' => 'left',
-                                 'link'  => ( $part_pkg->get("num_$_")
+                                 'link'  => ( $part_pkg->get("num_$_") || $disable_counts
                                                 ? $cust_pkg_link.
                                                   $part_pkg->pkgpart.
                                                   ";magic=$magic"

commit 634f70db8ca6de6776329aa3e05c16d159246546
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Sun Mar 31 18:02:25 2019 -0400

    RT# 81946 Rename conf agent-disable_counts as config-disable_counts

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index e76ff4b77..d81035273 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -6048,12 +6048,19 @@ and customer address. Include units.',
 
   {
     'key'         => 'agent-disable_counts',
-    'section'     => 'scalability',
+    'section'     => 'deprecated',
     'description' => 'On the agent browse page, disable the customer and package counts.  Typically used for very large installs when this page takes too long to render.',
     'type'        => 'checkbox',
   },
 
   {
+    'key'         => 'config-disable_counts',
+    'section'     => 'scalability',
+    'description' => 'Disable the customer and package counts on the Agents, Packages, and Services pages. Use for very large installs where these pages take too long to render.',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'tollfree-country',
     'section'     => 'telephony',
     'description' => 'Country / region for toll-free recognition',
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index d33bca26b..1f62cb421 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -206,6 +206,13 @@ If you need to continue using the old Form 477 report, turn on the
     FS::upgrade_journal->set_done('deprecate_unmask_ss');
   }
 
+  # Rename agent-disable_counts as config-disable_counts, flag now
+  # affects several configuration pages
+  for my $row ( qsearch( conf => { name => 'agent-disable_counts' } )) {
+    $row->name('config-disable_counts');
+    $row->replace;
+  }
+
 }
 
 sub upgrade_overlimit_groups {
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index 751e8b69b..9c6290126 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -405,6 +405,6 @@ if ( $cgi->param('showdisabled')
 }
 
 my $conf = new FS::Conf;
-my $disable_counts = $conf->exists('agent-disable_counts');
+my $disable_counts = $conf->exists('config-disable_counts');
 
 </%init>
diff --git a/httemplate/browse/cust_class.html b/httemplate/browse/cust_class.html
index a35c045cf..93df96aa5 100644
--- a/httemplate/browse/cust_class.html
+++ b/httemplate/browse/cust_class.html
@@ -23,8 +23,7 @@ my $html_init =
   'Customer classes define groups of customer for reporting.<BR><BR>'.
   qq!<A HREF="${p}edit/cust_class.html"><I>Add a customer class</I></A><BR><BR>!;
 
-#cust_class-disable_counts?  or just migrate this to one config probably
-#my $disable_counts = $conf->exists('agent-disable_counts');
+#my $disable_counts = $conf->exists('config-disable_counts');
 my $disable_counts = 0; 
 
 my $customers_sub = sub {

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

Summary of changes:
 FS/FS/Conf.pm                     |  9 ++++-
 FS/FS/Upgrade.pm                  |  7 ++++
 httemplate/browse/agent.cgi       |  2 +-
 httemplate/browse/cust_class.html |  3 +-
 httemplate/browse/part_pkg.cgi    | 72 +++++++++++++++++++++------------------
 httemplate/browse/part_svc.cgi    | 23 ++++++++-----
 6 files changed, 69 insertions(+), 47 deletions(-)




More information about the freeside-commits mailing list