This commit was generated by cvs2svn to compensate for changes in r2523,
[freeside.git] / rt / lib / RT / ScripActions.pm
1 #$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripActions.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
2
3 =head1 NAME
4
5   RT::ScripActions - Collection of Action objects
6
7 =head1 SYNOPSIS
8
9   use RT::ScripActions;
10
11
12 =head1 DESCRIPTION
13
14
15 =begin testing
16
17 ok (require RT::TestHarness);
18 ok (require RT::ScripActions);
19
20 =end testing
21
22 =head1 METHODS
23
24 =cut
25
26 package RT::ScripActions;
27 use RT::EasySearch;
28 use RT::ScripAction;
29
30 @ISA= qw(RT::EasySearch);
31
32 # {{{ sub _Init
33 sub _Init { 
34   my $self = shift;
35   $self->{'table'} = "ScripActions";
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::ScripAction->new($self->CurrentUser));
64
65 }
66 # }}}
67
68
69 1;
70