diff options
author | Pami Ketolainen <pami.ketolainen@jollamobile.com> | 2015-03-13 19:23:54 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2015-03-13 19:27:47 +0100 |
commit | 1d96fa1689470945545ac8e0f239357185e832a7 (patch) | |
tree | ede67cda677cfbf63bd05dd18f7884c0d931f6dc /Bugzilla/Bug.pm | |
parent | 592e6fda4108c6241344d236a2c182bb9ce10d76 (diff) | |
download | bugzilla-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 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 73ba62a3b..2bd6fb646 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1265,7 +1265,7 @@ sub remove_from_db { ##################################################################### sub send_changes { - my ($self, $changes, $vars) = @_; + my ($self, $changes, $vars, $minor_update) = @_; my $user = Bugzilla->user; @@ -1283,15 +1283,15 @@ sub send_changes { changer => $user, ); - _send_bugmail({ id => $self->id, type => 'bug', forced => \%forced }, - $vars); + _send_bugmail({ id => $self->id, type => 'bug', forced => \%forced, + minor_update => $minor_update }, $vars); # If the bug was marked as a duplicate, we need to notify users on the # other bug of any changes to that bug. my $new_dup_id = $changes->{'dup_id'} ? $changes->{'dup_id'}->[1] : undef; if ($new_dup_id) { _send_bugmail({ forced => { changer => $user }, type => "dupe", - id => $new_dup_id }, $vars); + id => $new_dup_id, minor_update => $minor_update }, $vars); } # If there were changes in dependencies, we need to notify those @@ -1306,7 +1306,8 @@ sub send_changes { type => 'dep', dep_only => 1, blocker => $self, - changes => $changes }; + changes => $changes, + minor_update => $minor_update }; foreach my $id (@{ $self->blocked }) { $params->{id} = $id; @@ -1329,13 +1330,13 @@ sub send_changes { foreach my $id (sort { $a <=> $b } (keys %changed_deps)) { _send_bugmail({ forced => { changer => $user }, type => "dep", - id => $id }, $vars); + id => $id, minor_update => $minor_update }, $vars); } # Sending emails for the referenced bugs. foreach my $ref_bug_id (uniq @{ $self->{see_also_changes} || [] }) { _send_bugmail({ forced => { changer => $user }, - id => $ref_bug_id }, $vars); + id => $ref_bug_id, minor_update => $minor_update }, $vars); } } @@ -4221,6 +4222,12 @@ sub get_activity { return(\@operations, $incomplete_data); } +sub has_unsent_changes { + my $self = shift; + return 1 if !defined $self->lastdiffed; + return datetime_from($self->lastdiffed) < datetime_from($self->delta_ts) ? 1 : 0; +} + # Update the bugs_activity table to reflect changes made in bugs. sub LogActivityEntry { my ($bug_id, $field, $removed, $added, $user_id, $timestamp, $comment_id, @@ -4625,6 +4632,10 @@ call L<update> to make the changes permanent. Creates or updates a L<Bugzilla::BugUserLastVisit> for this bug and the supplied $user, the timestamp given as $last_visit. +=item C<has_unsent_changes()> + +Checks if this bug has changes for which bug mail has not been sent. + =back =head1 B<Methods in need of POD> |