[freeside-commits] branch master updated. 7313b39b6d60bea8c5bd9712527a08093bb337af

Ivan ivan at 420.am
Sat Nov 3 12:23:24 PDT 2012


The branch, master has been updated
       via  7313b39b6d60bea8c5bd9712527a08093bb337af (commit)
      from  c9e1692c66627ff8cb06be4c556c5b77b30d2b59 (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 7313b39b6d60bea8c5bd9712527a08093bb337af
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Nov 3 12:23:23 2012 -0700

    adding pkg_unsuspend and unsuspend actions, RT#20084

diff --git a/FS/FS/part_event/Action/pkg_unsuspend.pm b/FS/FS/part_event/Action/pkg_unsuspend.pm
new file mode 100644
index 0000000..8941038
--- /dev/null
+++ b/FS/FS/part_event/Action/pkg_unsuspend.pm
@@ -0,0 +1,25 @@
+package FS::part_event::Action::pkg_unsuspend;
+
+use strict;
+use base qw( FS::part_event::Action );
+
+sub description { 'Unsuspend this package'; }
+
+sub eventtable_hashref {
+  { 'cust_pkg' => 1,
+    'svc_acct' => 1, };
+}
+
+sub default_weight { 20; }
+
+sub do_action {
+  my( $self, $object, $cust_event ) = @_;
+  my $cust_pkg = $self->cust_pkg($object);
+
+  my $error = $cust_pkg->unsuspend();
+  die $error if $error;
+  
+  '';
+}
+
+1;
diff --git a/FS/FS/part_event/Action/unsuspend.pm b/FS/FS/part_event/Action/unsuspend.pm
new file mode 100644
index 0000000..b8cfbb1
--- /dev/null
+++ b/FS/FS/part_event/Action/unsuspend.pm
@@ -0,0 +1,23 @@
+package FS::part_event::Action::unsuspend;
+
+use strict;
+use base qw( FS::part_event::Action );
+
+sub description { 'Unsuspend all of this customer\'s suspended packages'; }
+
+sub default_weight { 11; }
+
+sub do_action {
+  my( $self, $cust_object ) = @_;
+
+  my $cust_main = $self->cust_main($cust_object);
+
+  my @err = $cust_main->unsuspend();
+
+  die join(' / ', @err) if scalar(@err);
+
+  '';
+
+}
+
+1;

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

Summary of changes:
 FS/FS/part_event/Action/pkg_unsuspend.pm |   25 +++++++++++++++++++++++++
 FS/FS/part_event/Action/unsuspend.pm     |   23 +++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)
 create mode 100644 FS/FS/part_event/Action/pkg_unsuspend.pm
 create mode 100644 FS/FS/part_event/Action/unsuspend.pm




More information about the freeside-commits mailing list