Skip to content

Commit

Permalink
Merge branch '4.4/list-current-user-in-all-recipients' into 4.4-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Aug 25, 2023
2 parents 9d8c9b8 + 11e6840 commit a150ef4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/RT/Action/Notify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ NotifyActor configuration, include NeverNotifyActor in the list of arguments.
=cut

our $ALWAYS_NOTIFY_ACTOR = 0;

sub RemoveInappropriateRecipients {
my $self = shift;

Expand All @@ -237,7 +239,7 @@ sub RemoveInappropriateRecipients {
},
) if $args{NeverNotifyActor} ||
(!RT->Config->Get('NotifyActor',$TransactionCurrentUser)
&& !$args{AlwaysNotifyActor});
&& !$args{AlwaysNotifyActor}) && !$ALWAYS_NOTIFY_ACTOR;

$self->SUPER::RemoveInappropriateRecipients();
}
Expand Down
17 changes: 16 additions & 1 deletion share/html/Ticket/ModifyPeople.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@
<li>
<input type="hidden" name="autorecipient" value="<% $addr %>">
<input type="checkbox" name="checked_recipient" id="checked_recipient_<%$addr%>" value="<%$addr%>" <% $recips{$addr} ? "checked" : "" %>>
<label for="checked_recipient_<%$addr%>"><& /Elements/ShowUser, Address => Email::Address->parse($addr) &></label>
<label for="checked_recipient_<%$addr%>"><& /Elements/ShowUser, Address => Email::Address->parse($addr) &>
% if ( !$notify_actor && $addr eq ($session{CurrentUser}->EmailAddress // '') ) {
<span class="hints"><i>
<&|/l&>RT won't send you mail for ticket updates you make.</&>
% if ( $session{CurrentUser}->HasRight( Right => 'ModifySelf', Object => RT->System ) ) {
<&|/l_unsafe, '<a target="_blank" href="' . RT->Config->Get('WebPath') . '/Prefs/Other.html">' . loc('Preferences') . '</a>'&>You can adjust this setting on the [_1] page.</&>
% }
</i></span>
% }
</label>
</li>
% }
</ul>
Expand Down Expand Up @@ -114,6 +123,12 @@
}

# Use the ticket's scrips to figure out the new list of recipients.
my $notify_actor = RT->Config->Get( 'NotifyActor', $session{CurrentUser} );

# Force to notify actor to list current user
require RT::Action::Notify;
local $RT::Action::Notify::ALWAYS_NOTIFY_ACTOR = 1;

my @txns = $Ticket->DryRun(
sub {
my $MIME = MIME::Entity->build( Type => "text/plain", Data => "" );
Expand Down

0 comments on commit a150ef4

Please sign in to comment.