]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1287461 - Can't request needinfo from someone when I'm needinfo'd on a bug
authorDavid Lawrence <dkl@mozilla.com>
Tue, 6 Dec 2016 19:59:01 +0000 (19:59 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Tue, 6 Dec 2016 19:59:01 +0000 (19:59 +0000)
extensions/Needinfo/Extension.pm
extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl

index cb897e72e48cb9339850f56c3ef36cbbae3e27f6..0c8c88a87d791233c5236e5d69abfc38dfb8d368 100644 (file)
@@ -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;
index 3a3bc7325b627a56d137055f7e838aabd2b561c1..4d2a39f385816a24d4b8b86082b9c53c0f08f92b 100644 (file)
@@ -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 %]
     <tr>
       <td class="needinfo-cb-td">
-        <input
-          type="checkbox"
-          name="needinfo"
-          id="needinfo"
-          value="1"
-        >
+        <input type="checkbox" name="needinfo" id="needinfo" value="1">
       </td>
       <td>
-        <input type="hidden" name="needinfo_redirect" id="needinfo_redirect" value="">
         <label for="needinfo" id="needinfo_from_label">
           Need more information from
         </label>
+        <select name="needinfo_type" id="needinfo_type" style="display:none;">
+          <option value="needinfo_from" selected="true">Need more information from</option>
+          <option value="redirect_to">Redirect needinfo request to</option>
+        </select>
         <select name="needinfo_role" id="needinfo_role">
           <option value="other">other</option>
           [% IF NOT bug.reporter.needinfo_blocked %]