diff options
author | wicked%sci.fi <> | 2009-02-14 10:45:44 +0100 |
---|---|---|
committer | wicked%sci.fi <> | 2009-02-14 10:45:44 +0100 |
commit | 7d2c22642310a85bb0ffd8d7c47ac8a62dea860e (patch) | |
tree | 2ee18cecc8259a70a70badcc8afe193ce10c8320 /Bugzilla/Flag.pm | |
parent | 1708f41aa376f3385f1bd0b90e3b1741961ec89d (diff) | |
download | bugzilla-7d2c22642310a85bb0ffd8d7c47ac8a62dea860e.tar.gz bugzilla-7d2c22642310a85bb0ffd8d7c47ac8a62dea860e.tar.xz |
Bug 333648: Add flag change to activity log and bugmail when only setter is changed - Patch by Teemu Mannermaa <wicked@sci.fi> r/a=LpSolit
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r-- | Bugzilla/Flag.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 618cd3ef4..f0286575f 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -515,7 +515,7 @@ sub snapshot { 'attach_id' => $attach_id }); my @summaries; foreach my $flag (@$flags) { - my $summary = $flag->type->name . $flag->status; + my $summary = $flag->setter->nick . ':' . $flag->type->name . $flag->status; $summary .= "(" . $flag->requestee->login . ")" if $flag->requestee; push(@summaries, $summary); } @@ -625,10 +625,13 @@ sub update_activity { my ($bug_id, $attach_id, $timestamp, $old_summaries, $new_summaries) = @_; my $dbh = Bugzilla->dbh; - $old_summaries = join(", ", @$old_summaries); - $new_summaries = join(", ", @$new_summaries); - my ($removed, $added) = diff_strings($old_summaries, $new_summaries); - if ($removed ne $added) { + my ($removed, $added) = diff_arrays($old_summaries, $new_summaries); + if (scalar @$removed || scalar @$added) { + # Remove flag requester/setter information + foreach (@$removed, @$added) { s/^\S+:// } + + $removed = join(", ", @$removed); + $added = join(", ", @$added); my $field_id = get_field_id('flagtypes.name'); $dbh->do('INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added) |