Commit 8d9074a5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 376061: Changing the requestee of a flag should not change the requester if…

Bug 376061: Changing the requestee of a flag should not change the requester if the one doing the change is the requestee himself - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=myk a=LpSolit
parent a33a5f6e
...@@ -763,6 +763,14 @@ sub modify { ...@@ -763,6 +763,14 @@ sub modify {
notify($flag, $bug, $attachment); notify($flag, $bug, $attachment);
} }
elsif ($status eq '?') { elsif ($status eq '?') {
# If the one doing the change is the requestee, then this means he doesn't
# want to reply to the request and he simply reassigns the request to
# someone else. In this case, we keep the requester unaltered.
my $new_setter = $setter;
if ($flag->requestee && $flag->requestee->id == $setter->id) {
$new_setter = $flag->setter;
}
# Get the requestee, if any. # Get the requestee, if any.
my $requestee_id; my $requestee_id;
if ($requestee_email) { if ($requestee_email) {
...@@ -782,11 +790,11 @@ sub modify { ...@@ -782,11 +790,11 @@ sub modify {
SET setter_id = ?, requestee_id = ?, SET setter_id = ?, requestee_id = ?,
status = ?, modification_date = ? status = ?, modification_date = ?
WHERE id = ?', WHERE id = ?',
undef, ($setter->id, $requestee_id, $status, undef, ($new_setter->id, $requestee_id, $status,
$timestamp, $flag->id)); $timestamp, $flag->id));
# Now update the flag object with its new values. # Now update the flag object with its new values.
$flag->{'setter'} = $setter; $flag->{'setter'} = $new_setter;
$flag->{'status'} = $status; $flag->{'status'} = $status;
# Send an email notifying the relevant parties about the request. # Send an email notifying the relevant parties about the request.
......
...@@ -29,9 +29,15 @@ ...@@ -29,9 +29,15 @@
'?' => "asked" } %] '?' => "asked" } %]
[% to_identity = "" %] [% to_identity = "" %]
[% on_behalf_of = 0 %]
[% IF flag.status == '?' %] [% IF flag.status == '?' %]
[% to_identity = flag.requestee.identity _ " for" %]
[% subject_status = "requested" %] [% subject_status = "requested" %]
[% IF flag.setter.id == user.id %]
[% to_identity = flag.requestee.identity _ " for" %]
[% ELSE %]
[% on_behalf_of = 1 %]
[% IF flag.requestee %][% to_identity = " to " _ flag.requestee.identity %][% END %]
[% END %]
[% ELSE %] [% ELSE %]
[% IF flag.requester %] [% IF flag.requester %]
[% to_identity = flag.requester.identity _ "'s request for" %] [% to_identity = flag.requester.identity _ "'s request for" %]
...@@ -48,7 +54,12 @@ X-Bugzilla-Type: request ...@@ -48,7 +54,12 @@ X-Bugzilla-Type: request
[%+ USE wrap -%] [%+ USE wrap -%]
[%- FILTER bullet = wrap(80) -%] [%- FILTER bullet = wrap(80) -%]
[% IF on_behalf_of %]
[% user.identity %] has reassigned [% flag.setter.identity %]'s request for [% flag.type.name %]
[% to_identity %]:
[% ELSE %]
[% user.identity %] has [% statuses.${flag.status} %] [%+ to_identity %] [%+ flag.type.name %]: [% user.identity %] has [% statuses.${flag.status} %] [%+ to_identity %] [%+ flag.type.name %]:
[% END %]
[% terms.Bug %] [%+ bugidsummary %] [% terms.Bug %] [%+ bugidsummary %]
[% END %] [% END %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment