summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorPami Ketolainen <pami.ketolainen@jollamobile.com>2015-03-13 19:23:54 +0100
committerDylan William Hardison <dylan@hardison.net>2015-03-13 19:27:47 +0100
commit1d96fa1689470945545ac8e0f239357185e832a7 (patch)
treeede67cda677cfbf63bd05dd18f7884c0d931f6dc /attachment.cgi
parent592e6fda4108c6241344d236a2c182bb9ce10d76 (diff)
downloadbugzilla-1d96fa1689470945545ac8e0f239357185e832a7.tar.gz
bugzilla-1d96fa1689470945545ac8e0f239357185e832a7.tar.xz
Bug 1062718 - add the ability to disable sending of mail when updating bugs
r=dylan,a=sgreen
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi12
1 files changed, 10 insertions, 2 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 61e6f58d8..7df230d79 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -511,6 +511,9 @@ sub insert {
@obsolete_attachments = Bugzilla::Attachment->validate_obsolete($bug, \@obsolete);
}
+ my $minor_update = $cgi->param('minor_update') ? 1 : 0;
+ $minor_update = $bug->has_unsent_changes ? 0 : $minor_update;
+
# Must be called before create() as it may alter $cgi->param('ispatch').
my $content_type = Bugzilla::Attachment::get_content_type();
@@ -586,7 +589,8 @@ sub insert {
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
my $recipients = { 'changer' => $user, 'owner' => $owner };
- $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients);
+ my $params = { 'minor_update' => $minor_update };
+ $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients, $params);
print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
@@ -677,6 +681,9 @@ sub update {
my $token = $cgi->param('token');
check_hash_token($token, [$attachment->id, $attachment->modification_time]);
+ my $minor_update = $cgi->param('minor_update') ? 1 : 0;
+ $minor_update = $bug->has_unsent_changes ? 0 : $minor_update;
+
# If the user submitted a comment while editing the attachment,
# add the comment to the bug. Do this after having validated isprivate!
my $comment = $cgi->param('comment');
@@ -739,7 +746,8 @@ sub update {
$vars->{'bugs'} = [$bug];
$vars->{'header_done'} = 1;
$vars->{'sent_bugmail'} =
- Bugzilla::BugMail::Send($bug->id, { 'changer' => $user });
+ Bugzilla::BugMail::Send($bug->id, { 'changer' => $user },
+ {'minor_update' => $minor_update });
print $cgi->header();