diff options
author | ivan <ivan> | 2008-03-24 01:28:10 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-24 01:28:10 +0000 |
commit | f7696f45691c414aaa3c6fe48ce6e374588009f4 (patch) | |
tree | 3c359c478fee425a91a9599ff604a92a70847076 /rt/lib/RT/Record.pm | |
parent | 0b704b4eeb63358df9094b4c68cd1f47d1a9bd23 (diff) |
part two of #1160: linking a ticket to its first customer will auto-link any customerless requestors
Diffstat (limited to 'rt/lib/RT/Record.pm')
-rwxr-xr-x | rt/lib/RT/Record.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rt/lib/RT/Record.pm b/rt/lib/RT/Record.pm index 1b622739e..5207ca3d2 100755 --- a/rt/lib/RT/Record.pm +++ b/rt/lib/RT/Record.pm @@ -1211,8 +1211,37 @@ sub DependsOn { # }}} +# {{{ Customers +=head2 Customers + This returns an RT::Links object which references all the customers that this object is a member of. + +=cut + +sub Customers { + my( $self, %opt ) = @_; + my $Debug = $opt{'Debug'}; + + unless ( $self->{'Customers'} ) { + + $self->{'Customers'} = $self->MemberOf->Clone; + + $self->{'Customers'}->Limit( + FIELD => 'Target', + OPERATOR => 'STARTSWITH', + VALUE => 'freeside://freeside/cust_main/', + ); + } + + warn "->Customers method called on $self; returning ". + ref($self->{'Customers'}). ' object' + if $Debug; + + return $self->{'Customers'}; +} + +# }}} # {{{ sub _Links |