summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-11-03 12:23:28 -0700
committerIvan Kohler <ivan@freeside.biz>2012-11-03 12:23:28 -0700
commit60d0a2fdcf8ffbb295e6f56cbde093635b36b8dd (patch)
treeaf4207292660a6fd074dc5dca2430a671c3b7dda /FS
parentf86d0804182a0af81fdfa67bc49e79271b98457c (diff)
adding pkg_unsuspend and unsuspend actions, RT#20084
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Action/pkg_unsuspend.pm25
-rw-r--r--FS/FS/part_event/Action/unsuspend.pm23
2 files changed, 48 insertions, 0 deletions
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 000000000..894103896
--- /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 000000000..b8cfbb12c
--- /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;