Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / eg / part_event-Action-template.pm
1 package FS::part_event::Action::myaction;
2
3 use strict;
4
5 use base qw( FS::part_event::Action );
6
7 # see the FS::part_event::Action manpage for full documentation on each
8 # of the required and optional methods.
9
10 sub description {
11   'New action (the author forgot to change this description)';
12 }
13
14 #sub eventtable_hashref {
15 #    { 'cust_main' => 1,
16 #      'cust_bill' => 1,
17 #      'cust_pkg'  => 1,
18 #    };
19 #}
20
21 #sub option_fields {
22 #  (
23 #    'field'         => 'description',
24 #
25 #    'another_field' => { 'label'=>'Amount', 'type'=>'money', },
26 #
27 #    'third_field'   => { 'label'         => 'Types',
28 #                         'type'          => 'select',
29 #                         'options'       => [ 'h', 's' ],
30 #                         'option_labels' => { 'h' => 'Happy',
31 #                                              's' => 'Sad',
32 #                                            },
33 #  );
34 #}
35
36 #sub default_weight {
37 #  100;
38 #}
39
40
41 sub do_action {
42   my( $self, $object ) = @_;
43
44   my $cust_main = $self->cust_main($object);
45
46   my $value_of_field = $self->option('field');
47
48   #do your action
49   
50   #die "Error: $error";
51   return 'Null example action completed successfully.';
52
53 }
54
55 1;