[freeside-commits] branch master updated. d9dfa887a57eb98205f46aeeac54f413040178b4

Mitch Jackson mitch at freeside.biz
Mon Apr 1 11:18:20 PDT 2019


The branch, master has been updated
       via  d9dfa887a57eb98205f46aeeac54f413040178b4 (commit)
       via  11be416520b5c391925c05cbd6118df69218eb56 (commit)
       via  8551c2469ece9a769b52b5429574d6984cd367ed (commit)
      from  f00e8e20ff518289fb29275eb3ec51d7b6bc1e26 (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 d9dfa887a57eb98205f46aeeac54f413040178b4
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 11be416520b5c391925c05cbd6118df69218eb56
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 f25c00ef2..cb74bed66 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 8551c2469ece9a769b52b5429574d6984cd367ed
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 393f068e9..0f774d16c 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5997,12 +5997,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 8850d36a3..c8c0d4471 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