[freeside-commits] branch master updated. 36294346ecad5db4fd4e48bc9a66cacbc6a1a6a2

Mitch Jackson mitch at freeside.biz
Tue Jul 17 20:32:31 PDT 2018


The branch, master has been updated
       via  36294346ecad5db4fd4e48bc9a66cacbc6a1a6a2 (commit)
       via  2082afa31ef1e98cf2afbc7d8365935f92cc61d0 (commit)
      from  07bf36bccc4979b12db49b0f71524de4296f3717 (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 36294346ecad5db4fd4e48bc9a66cacbc6a1a6a2
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Tue Jul 17 22:31:00 2018 -0500

    freeside-upgrade - fix uninitalized value warnings

diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index c15f7ddaa..b47752de2 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -153,7 +153,7 @@ If you need to continue using the old Form 477 report, turn on the
 
   # boolean+text previous_balance-exclude_from_total is now two separate options
   my $total_new_charges = $conf->config('previous_balance-exclude_from_total');
-  if (length($total_new_charges) > 0) {
+  if ( defined $total_new_charges && length($total_new_charges) > 0 ) {
     $conf->set('previous_balance-text-total_new_charges', $total_new_charges);
     $conf->set('previous_balance-exclude_from_total', '');
   }
@@ -174,8 +174,8 @@ If you need to continue using the old Form 477 report, turn on the
     $conf->delete('unsuspendauto');
   }
 
-  if ($conf->config('cust-fields') =~ / \| Payment Type/) {
-    my $cust_fields = $conf->config('cust-fields');
+  my $cust_fields = $conf->config('cust-fields');
+  if ( defined $cust_fields && $cust_fields =~ / \| Payment Type/ ) {
     # so we can potentially use 'Payment Types' or somesuch in the future
     $cust_fields =~ s/ \| Payment Type( \|)/$1/;
     $cust_fields =~ s/ \| Payment Type$//;

commit 2082afa31ef1e98cf2afbc7d8365935f92cc61d0
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Tue Jul 17 22:14:07 2018 -0500

    RT# 32234 Change unmask_ss from global conf to group access right

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index bac6a764c..bd544c944 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2169,7 +2169,7 @@ and customer address. Include units.',
 
   {
     'key'         => 'unmask_ss',
-    'section'     => 'e-checks',
+    'section'     => 'deprecated',
     'description' => "Don't mask social security numbers in the web interface.",
     'type'        => 'checkbox',
   },
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm
index aebfc29c7..c15f7ddaa 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -192,6 +192,19 @@ If you need to continue using the old Form 477 report, turn on the
       $lh->maketext($_) if length($_);
     }
   }
+
+  unless ( FS::upgrade_journal->is_done('deprecate_unmask_ss') ) {
+    if ( $conf->config_bool( 'unmask_ss' )) {
+      warn "'unmask_ssn' deprecated from global configuration\n";
+      for my $access_group ( qsearch( access_group => {} )) {
+        $access_group->grant_access_right( 'Unmask customer SSN' );
+        warn " - 'Unmask customer SSN' access right granted to '" .
+             $access_group->groupname . "' employee group\n";
+      }
+    }
+    FS::upgrade_journal->set_done('deprecate_unmask_ss');
+  }
+
 }
 
 sub upgrade_overlimit_groups {
diff --git a/FS/FS/access_group.pm b/FS/FS/access_group.pm
index a2b977409..4f6c85b45 100644
--- a/FS/FS/access_group.pm
+++ b/FS/FS/access_group.pm
@@ -2,6 +2,7 @@ package FS::access_group;
 use base qw( FS::m2m_Common FS::m2name_Common FS::Record );
 
 use strict;
+use Carp qw( croak );
 use FS::Record qw( qsearch qsearchs );
 use FS::access_right;
 
@@ -137,6 +138,54 @@ sub access_right {
           );
 }
 
+=item grant_access_right RIGHTNAME
+
+Grant the specified specified FS::access_right record to this group.
+Return the FS::access_right record.
+
+=cut
+
+sub grant_access_right {
+  my ( $self, $rightname ) = @_;
+
+  croak "grant_access_right() requires \$rightname"
+    unless $rightname;
+
+  my $access_right = $self->access_right( $rightname );
+  return $access_right if $access_right;
+
+  $access_right = FS::access_right->new({
+    righttype   => 'FS::access_group',
+    rightobjnum => $self->groupnum,
+    rightname   => $rightname,
+  });
+  if ( my $error = $access_right->insert ) {
+    die "grant_access_right() error: $error";
+  }
+
+  $access_right;
+}
+
+=item revoke_access_right RIGHTNAME
+
+Revoke the specified FS::access_right record from this group.
+
+=cut
+
+sub revoke_access_right {
+  my ( $self, $rightname ) = @_;
+
+  croak "revoke_access_right() requires \$rightname"
+    unless $rightname;
+
+  my $access_right = $self->access_right( $rightname )
+    or return;
+
+  if ( my $error = $access_right->delete ) {
+    die "revoke_access_right() error: $error";
+  }
+}
+
 =back
 
 =head1 BUGS
@@ -148,4 +197,3 @@ L<FS::Record>, schema.html from the base documentation.
 =cut
 
 1;
-

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

Summary of changes:
 FS/FS/Conf.pm         |  2 +-
 FS/FS/Upgrade.pm      | 19 ++++++++++++++++---
 FS/FS/access_group.pm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 66 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list