From 6d01972698db25da5f6285dad9d9713d1d769016 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 6 Dec 2016 19:59:01 +0000 Subject: Bug 1287461 - Can't request needinfo from someone when I'm needinfo'd on a bug --- extensions/Needinfo/Extension.pm | 3 ++- .../template/en/default/bug/needinfo.html.tmpl | 26 ++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'extensions/Needinfo') diff --git a/extensions/Needinfo/Extension.pm b/extensions/Needinfo/Extension.pm index cb897e72e..0c8c88a87 100644 --- a/extensions/Needinfo/Extension.pm +++ b/extensions/Needinfo/Extension.pm @@ -92,9 +92,10 @@ sub bug_start_of_update { Bugzilla->input_params($params); my $add_needinfo = delete $params->{needinfo}; + my $needinfo_type = delete $params->{needinfo_type} // ''; my $needinfo_from = delete $params->{needinfo_from}; my $needinfo_role = delete $params->{needinfo_role}; - my $is_redirect = delete $params->{needinfo_redirect}; + my $is_redirect = $needinfo_type eq 'redirect_to' ? 1 : 0; my $is_private = $params->{'comment_is_private'}; my @needinfo_overrides; diff --git a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl index 3a3bc7325..4d2a39f38 100644 --- a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl +++ b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl @@ -122,11 +122,15 @@ $(function() { function existing_needinfo_changed(event) { var $target = $(event.target); var is_redirect = !$target.is(':checked') && $target.data('is-self'); - $('#needinfo_from_label').text(is_redirect - ? 'Redirect my needinfo request to' - : 'Need more information from' - ); - $('#needinfo_redirect').val(is_redirect ? '1' : ''); + if (is_redirect) { + $('#needinfo_from_label').hide(); + $('#needinfo_type').show(); + $('#needinfo_type').val('redirect_to'); + } else { + $('#needinfo_from_label').show(); + $('#needinfo_type').hide(); + $('#needinfo_type').val('needinfo_from'); + } } function needinfo_role_changed() { @@ -186,18 +190,16 @@ $(function() { [% IF needinfo_flags.size == 0 || needinfo_flagtype.is_multiplicable %] - + - +