summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2011-02-23 21:50:53 +0000
committerivan <ivan>2011-02-23 21:50:53 +0000
commit3f2596765e26ff30ea24bad2453fec830d1c27c5 (patch)
treef6e1c279f741119878983de812b4ee8adabb59d6 /FS
parent4798f202bfbf344a6e72c5a8ca2fe116bfe0b908 (diff)
add package suspend
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_event/Action/pkg_suspend.pm32
1 files changed, 32 insertions, 0 deletions
diff --git a/FS/FS/part_event/Action/pkg_suspend.pm b/FS/FS/part_event/Action/pkg_suspend.pm
new file mode 100644
index 000000000..e12616c54
--- /dev/null
+++ b/FS/FS/part_event/Action/pkg_suspend.pm
@@ -0,0 +1,32 @@
+package FS::part_event::Action::pkg_suspend;
+
+use strict;
+use base qw( FS::part_event::Action );
+
+sub description { 'Suspend this package'; }
+
+sub eventtable_hashref {
+ { 'cust_pkg' => 1 };
+}
+
+sub option_fields {
+ (
+ 'reasonnum' => { 'label' => 'Reason',
+ 'type' => 'select-reason',
+ 'reason_class' => 'S',
+ },
+ );
+}
+
+sub default_weight { 20; }
+
+sub do_action {
+ my( $self, $cust_pkg, $cust_event ) = @_;
+
+ my $error = $cust_pkg->suspend( 'reason' => $self->option('reasonnum') );
+ die $error if $error;
+
+ '';
+}
+
+1;