[freeside-commits] branch FREESIDE_3_BRANCH updated. d0166fb1f52865916575ac6aa0eb043d792fe18b

Ivan ivan at 420.am
Tue Nov 19 21:56:08 PST 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  d0166fb1f52865916575ac6aa0eb043d792fe18b (commit)
      from  f212cce3b3d07f5050b4c6bd649d2aa5fd2a0c49 (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 d0166fb1f52865916575ac6aa0eb043d792fe18b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Nov 19 21:56:07 2013 -0800

    prohibit self-service changing of suspended packages, RT#26140

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index c5a8316..db9ae5a 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2316,6 +2316,11 @@ sub change_pkg {
   my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $p->{pkgnum} } )
     or return { 'error' => "unknown package $p->{pkgnum}" };
 
+  #if someone does need self-service package change of suspended packages,
+  # figure out how to be more discriminating
+  return { error=>"Can't change a suspended package", pkgnum=>$cust_pkg->pkgnum}
+    if $cust_pkg->status eq 'suspended';
+
   my @newpkg;
   my $error = FS::cust_pkg::order( $custnum,
                                    [$p->{pkgpart}],
diff --git a/fs_selfservice/FS-SelfService/cgi/provision_list.html b/fs_selfservice/FS-SelfService/cgi/provision_list.html
index 2a3a8e9..24d6ff4 100644
--- a/fs_selfservice/FS-SelfService/cgi/provision_list.html
+++ b/fs_selfservice/FS-SelfService/cgi/provision_list.html
@@ -9,10 +9,14 @@ foreach my $pkg (
            || scalar(@{$_->{cust_svc}})
          } @cust_pkg
     ) {
+
   my $susp = $pkg->{'susp'} || '';
-  my @pkg_actions = ( [ 'customer_change_pkg' => 'change' ] );
-  push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] 
-    if $self_suspend_reason and !$susp;
+  my @pkg_actions = ();
+  if ( ! $susp ) {
+    push @pkg_actions, [ 'customer_change_pkg' => 'change' ];
+    push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] 
+      if $self_suspend_reason;
+  }
 
   my $bgcolor = $susp ? '"#ff9900"' : '"#8888ff"';
   $OUT .= #'<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#ffffff">'.

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

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                       |    5 +++++
 .../FS-SelfService/cgi/provision_list.html         |   10 +++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list