[Rt-commit] rt branch 4.4/list-current-user-in-all-recipients created. rt-4.4.5-22-g093cb79215
BPS Git Server
git at git.bestpractical.com
Thu Jan 20 22:22:24 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 4.4/list-current-user-in-all-recipients has been created
at 093cb79215de9204dac0e77990e2db890517da2b (commit)
- Log -----------------------------------------------------------------
commit 093cb79215de9204dac0e77990e2db890517da2b
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jan 21 05:44:21 2022 +0800
List current user in "All Recipients" if it's a watcher
Previously when NotifyActor is false, even if current user is a watcher,
it was not listed in "Modify who receives mail ..." widget on modify
people page, which was confusing as current user would get notifications
of actions made by others.
This commit fixes this, with a hint to indicate that RT won't send
notifications of its own actions.
This also allows People to ignore specific ticket updates by unchecking
themselves there.
diff --git a/share/html/Ticket/ModifyPeople.html b/share/html/Ticket/ModifyPeople.html
index 5554972743..f017b208e1 100644
--- a/share/html/Ticket/ModifyPeople.html
+++ b/share/html/Ticket/ModifyPeople.html
@@ -74,7 +74,16 @@ my $all_recipients_checked = (grep { !$_ } values %recips) ? 0 : 1;
<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">
+ <&|/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 it on [_1] page.</&>
+% }
+ </span>
+% }
+ </label>
</li>
% }
</ul>
@@ -114,6 +123,14 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup) {
}
# Use the ticket's scrips to figure out the new list of recipients.
+my $notify_actor = RT->Config->Get( 'NotifyActor', $session{CurrentUser} );
+no warnings 'redefine';
+my $orig_get = \&RT::Config::Get;
+local *RT::Config::Get = sub {
+ return 1 if $_[1] eq 'NotifyActor';
+ return $orig_get->(@_);
+};
+
my @txns = $Ticket->DryRun(
sub {
my $MIME = MIME::Entity->build( Type => "text/plain", Data => "" );
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list