diff options
author | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-05-18 18:49:59 +0000 |
commit | 624b2d44625f69d71175c3348cae635d580c890b (patch) | |
tree | ed57a90db2ecbc72cea6c1d3c175c1dcd1938ab4 /rt/lib/RT/Queue_Overlay.pm | |
parent | 7f4aff45cd6ef2f630d538294fa9d9c4db4ac4aa (diff) | |
parent | e70abd21bab68b23488f7ef1ee2e693a3b365691 (diff) |
This commit was generated by cvs2svn to compensate for changes in r9232,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/RT/Queue_Overlay.pm')
-rw-r--r-- | rt/lib/RT/Queue_Overlay.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rt/lib/RT/Queue_Overlay.pm b/rt/lib/RT/Queue_Overlay.pm index a8396793d..98bdec579 100644 --- a/rt/lib/RT/Queue_Overlay.pm +++ b/rt/lib/RT/Queue_Overlay.pm @@ -636,6 +636,7 @@ sub TicketCustomFields { $cfs->SetContextObject( $self ); $cfs->LimitToGlobalOrObjectId( $self->Id ); $cfs->LimitToLookupType( 'RT::Queue-RT::Ticket' ); + $cfs->ApplySortOrder; } return ($cfs); } @@ -658,6 +659,7 @@ sub TicketTransactionCustomFields { if ( $self->CurrentUserHasRight('SeeQueue') ) { $cfs->LimitToGlobalOrObjectId( $self->Id ); $cfs->LimitToLookupType( 'RT::Queue-RT::Ticket-RT::Transaction' ); + $cfs->ApplySortOrder; } return ($cfs); } @@ -787,8 +789,15 @@ sub _AddWatcher { my $principal = RT::Principal->new( $self->CurrentUser ); if ( $args{'PrincipalId'} ) { $principal->Load( $args{'PrincipalId'} ); + if ( $principal->id and $principal->IsUser and my $email = $principal->Object->EmailAddress ) { + return (0, $self->loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email, $self->loc($args{'Type'}))) + if RT::EmailParser->IsRTAddress( $email ); + } } elsif ( $args{'Email'} ) { + if ( RT::EmailParser->IsRTAddress( $args{'Email'} ) ) { + return (0, $self->loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $args{'Email'}, $self->loc($args{'Type'}))); + } my $user = RT::User->new($self->CurrentUser); $user->LoadByEmail( $args{'Email'} ); $user->Load( $args{'Email'} ) |