X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FTicket.pm;h=4151f2b6a2852eb87f7d40289b1deaa5db287c07;hp=ff75f450ddfbea130bf749ed287018fec62cbe42;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hpb=7322f2afedcc2f427e997d1535a503613a83f088 diff --git a/rt/lib/RT/Ticket.pm b/rt/lib/RT/Ticket.pm index ff75f450d..4151f2b6a 100755 --- a/rt/lib/RT/Ticket.pm +++ b/rt/lib/RT/Ticket.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -762,13 +762,14 @@ sub DeleteWatcher { -=head2 SquelchMailTo [EMAIL] +=head2 SquelchMailTo ADDRESSES -Takes an optional email address to never email about updates to this ticket. - - -Returns an array of the RT::Attribute objects for this ticket's 'SquelchMailTo' attributes. +Takes a list of email addresses to never email about updates to this ticket. +Subsequent calls to this method add, rather than replace, the list of +squelched addresses. +Returns an array of the L objects for this ticket's +'SquelchMailTo' attributes. =cut @@ -789,7 +790,7 @@ sub SquelchMailTo { sub _SquelchMailTo { my $self = shift; - if (@_) { + while (@_) { my $attr = shift; $self->AddAttribute( Name => 'SquelchMailTo', Content => $attr ) unless grep { $_->Content eq $attr } @@ -1103,6 +1104,11 @@ sub TransactionAddresses { $attachments->Columns( qw( id Headers TransactionId)); $attachments->Limit( + FIELD => 'Parent', + VALUE => 0, + ); + + $attachments->Limit( ALIAS => $attachments->TransactionAlias, FIELD => 'Type', OPERATOR => 'IN', @@ -1221,6 +1227,23 @@ sub QueueObj { return ($self->{_queue_obj}); } +sub Subject { + my $self = shift; + + my $subject = $self->_Value( 'Subject' ); + return $subject if defined $subject; + + if ( RT->Config->Get( 'DatabaseType' ) eq 'Oracle' && $self->CurrentUserHasRight( 'ShowTicket' ) ) { + + # Oracle treats empty strings as NULL, so it returns undef for empty subjects. + # Since '' is the default Subject value, returning '' is more correct. + return ''; + } + else { + return undef; + } +} + sub SetSubject { my $self = shift; my $value = shift;