import torrus 1.0.9
[freeside.git] / FS / FS / part_event / Condition / agent_type.pm
1 package FS::part_event::Condition::agent_type;
2
3 use strict;
4
5 use base qw( FS::part_event::Condition );
6
7 # see the FS::part_event::Condition manpage for full documentation on each
8 # of the required and optional methods.
9
10 sub description {
11   'Agent Type';
12 }
13
14 sub option_fields {
15   (
16     'typenum'   => { label         => 'Agent Type',
17                      type          => 'select-agent_type',
18                      disable_empty => 1,
19                    },
20   );
21 }
22
23 sub condition {
24   my($self, $object, %opt) = @_;
25
26   my $cust_main = $self->cust_main($object);
27
28   my $typenum = $self->option('typenum');
29
30   $cust_main->agent->typenum == $typenum;
31
32 }
33
34 #sub condition_sql {
35 #  my( $self, $table ) = @_;
36 #
37 #  'true';
38 #}
39
40 1;