add package suspend
authorivan <ivan>
Wed, 23 Feb 2011 21:50:52 +0000 (21:50 +0000)
committerivan <ivan>
Wed, 23 Feb 2011 21:50:52 +0000 (21:50 +0000)
FS/FS/part_event/Action/pkg_suspend.pm [new file with mode: 0644]

diff --git a/FS/FS/part_event/Action/pkg_suspend.pm b/FS/FS/part_event/Action/pkg_suspend.pm
new file mode 100644 (file)
index 0000000..e12616c
--- /dev/null
@@ -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;