FreeBSD Bugzilla – Attachment 237634 Details for
Bug 267349
extension: Ability to suppress mail for issue changes (individual and bulk)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Bugzilla 5.0 suppress mail patch (github/keto)
suppressmail.patch (text/plain), 4.06 KB, created by
Kubilay Kocak
on 2022-10-26 00:07:52 UTC
(
hide
)
Description:
Bugzilla 5.0 suppress mail patch (github/keto)
Filename:
MIME Type:
Creator:
Kubilay Kocak
Created:
2022-10-26 00:07:52 UTC
Size:
4.06 KB
patch
obsolete
>diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm >index 110a1ffaf..ab4c61e41 100644 >--- a/Bugzilla/BugMail.pm >+++ b/Bugzilla/BugMail.pm >@@ -264,8 +264,14 @@ sub Send { > $dep_ok = $user->can_see_bug($params->{blocker}->id) ? 1 : 0; > } > >+ # suppress mail >+ my $suppress_group = Bugzilla->params->{suppressmailgroup}; >+ my $suppress_mail = ($suppress_group >+ && Bugzilla->user->in_group($suppress_group) >+ && Bugzilla->input_params->{suppress_mail}); >+ > # Email the user if the dep check passed. >- if ($dep_ok) { >+ if ($dep_ok && !$suppress_mail) { > my $sent_mail = sendMail( > { to => $user, > bug => $bug, >diff --git a/Bugzilla/Config/GroupSecurity.pm b/Bugzilla/Config/GroupSecurity.pm >index e827834a0..7abe7027b 100644 >--- a/Bugzilla/Config/GroupSecurity.pm >+++ b/Bugzilla/Config/GroupSecurity.pm >@@ -90,6 +90,14 @@ sub get_param_list { > name => 'or_groups', > type => 'b', > default => 0 >+ }, >+ >+ { >+ name => 'suppressmailgroup', >+ type => 's', >+ choices => \&_get_all_group_names, >+ default => 'admin', >+ checker => \&check_group > } ); > return @param_list; > } >diff --git a/template/en/default/admin/groups/list.html.tmpl b/template/en/default/admin/groups/list.html.tmpl >index 796872e1d..1ad41feda 100644 >--- a/template/en/default/admin/groups/list.html.tmpl >+++ b/template/en/default/admin/groups/list.html.tmpl >@@ -76,7 +76,8 @@ > %] > > [% FOREACH group IN ["chartgroup", "comment_taggers_group", "debug_group", >- "insidergroup", "querysharegroup", "timetrackinggroup"] %] >+ "insidergroup", "querysharegroup", "timetrackinggroup", >+ "suppressmailgroup"] %] > [% special_group = Param(group) %] > > [% IF special_group %] >diff --git a/template/en/default/admin/params/groupsecurity.html.tmpl b/template/en/default/admin/params/groupsecurity.html.tmpl >index 590f4da02..cd1cf4933 100644 >--- a/template/en/default/admin/params/groupsecurity.html.tmpl >+++ b/template/en/default/admin/params/groupsecurity.html.tmpl >@@ -51,6 +51,10 @@ > "view it. If it is off, a user needs to be a member of all " _ > "the $terms.bug's groups. Note that in either case, if the " _ > "user has a role on the $terms.bug (e.g. reporter) that may " _ >- "also affect their permissions." >+ "also affect their permissions.", >+ >+ suppressmailgroup => "The name of the group of users who can suppress mail " _ >+ "sending when editing bugs. Set blank, to disable mail suppressing " _ >+ "option from all.", > } > %] >diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl >index b8abe6bc5..ac23b1e97 100644 >--- a/template/en/default/bug/edit.html.tmpl >+++ b/template/en/default/bug/edit.html.tmpl >@@ -1247,6 +1247,11 @@ > <div class="knob-buttons"> > <input type="submit" value="Save Changes" > id="commit[% id FILTER css_class_quote %]"> >+ [% IF user.in_group(Param('suppressmailgroup')) %] >+ <br><input type="checkbox" name="suppress_mail" value="1"> >+ <label style="font-size: small; font-weight: normal;" >+ for="suppress_mail">Suppress mail</label> >+ [% END %] > </div> > [% END %] > [% END %] >diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl >index e581f0892..e1047a2aa 100644 >--- a/template/en/default/list/edit-multiple.html.tmpl >+++ b/template/en/default/list/edit-multiple.html.tmpl >@@ -389,6 +389,10 @@ > [%+ Hook.process('after_groups') %] > > <input type="submit" id="commit" value="Commit"> >+[% IF user.in_group(Param('suppressmailgroup')) %] >+<input type="checkbox" name="suppress_mail" value="1"> >+<label for="suppress_mail">Suppress mail</label> >+[% END %] > > [%############################################################################%] > [%# Select Menu Block #%]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 267349
: 237634