This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / lib / RT / ScripConditions.pm
1 #$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripConditions.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
2
3 =head1 NAME
4
5   RT::ScripConditions - Collection of Action objects
6
7 =head1 SYNOPSIS
8
9   use RT::ScripConditions;
10
11
12 =head1 DESCRIPTION
13
14
15
16 =begin testing
17
18 ok (require RT::TestHarness);
19 ok (require RT::ScripConditions);
20
21 =end testing
22
23 =head1 METHODS
24
25 =cut
26
27 package RT::ScripConditions;
28 use RT::EasySearch;
29 use RT::ScripCondition;
30 @ISA= qw(RT::EasySearch);
31
32 # {{{ sub _Init
33 sub _Init { 
34   my $self = shift;
35   $self->{'table'} = "ScripConditions";
36   $self->{'primary_key'} = "id";
37   return ( $self->SUPER::_Init(@_));
38 }
39 # }}}
40
41 # {{{ sub LimitToType 
42 sub LimitToType  {
43   my $self = shift;
44   my $type = shift;
45   $self->Limit (ENTRYAGGREGATOR => 'OR',
46                 FIELD => 'Type',
47                 VALUE => "$type")
48       if defined $type;
49   $self->Limit (ENTRYAGGREGATOR => 'OR',
50                 FIELD => 'Type',
51                 VALUE => "Correspond")
52       if $type eq "Create";
53   $self->Limit (ENTRYAGGREGATOR => 'OR',
54                 FIELD => 'Type',
55                 VALUE => 'any');
56   
57 }
58 # }}}
59
60 # {{{ sub NewItem 
61 sub NewItem  {
62   my $self = shift;
63   return(RT::ScripCondition->new($self->CurrentUser));
64 }
65 # }}}
66
67
68 1;
69