]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1376609 - Make needinfo field more visible when filing a new bug
authorKohei Yoshino <kohei.yoshino@gmail.com>
Wed, 29 May 2019 03:14:33 +0000 (23:14 -0400)
committerGitHub <noreply@github.com>
Wed, 29 May 2019 03:14:33 +0000 (23:14 -0400)
extensions/Needinfo/Extension.pm
extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
extensions/Needinfo/template/en/default/hook/bug/create/create-after_custom_fields.html.tmpl [new file with mode: 0644]

index f9702a55fb9164955ba10d1feb1a4d440760d500..4c41852df083b60b23aa5b1619e34a2c10cd8a3f 100644 (file)
@@ -69,6 +69,20 @@ sub install_before_final_checks {
   });
 }
 
+sub bug_end_of_create {
+  my ($self, $args) = @_;
+  my $params = Bugzilla->input_params;
+
+  return unless $params->{needinfo_from};
+
+  # Add extra params
+  $params->{needinfo} = 1;
+  $params->{needinfo_role} = 'other';
+
+  # Do the rest
+  $self->bug_start_of_update($args);
+}
+
 # Clear the needinfo? flag if comment is being given by
 # requestee or someone used the override flag.
 sub bug_start_of_update {
index 43e632e6c3c6b451b83387d0245c90276b9f5498..dc03248bcccb026b6a202383ded1b0d2edc9732b 100644 (file)
@@ -184,7 +184,7 @@ $(function() {
       </td>
       <td>
         <label for="needinfo" id="needinfo_from_label">
-          Need more information from
+          Request information from
         </label>
         <select name="needinfo_type" id="needinfo_type" style="display:none;">
           <option value="needinfo_from" selected="true">Need more information from</option>
diff --git a/extensions/Needinfo/template/en/default/hook/bug/create/create-after_custom_fields.html.tmpl b/extensions/Needinfo/template/en/default/hook/bug/create/create-after_custom_fields.html.tmpl
new file mode 100644 (file)
index 0000000..9defade
--- /dev/null
@@ -0,0 +1,24 @@
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+  # License, v. 2.0. If a copy of the MPL was not distributed with this
+  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+  #
+  # This Source Code Form is "Incompatible With Secondary Licenses", as
+  # defined by the Mozilla Public License, v. 2.0.
+  #%]
+
+<tr>
+  <th>Request information from:</th>
+  <td colspan="3">
+    <span id="needinfo_from_container">
+      [% INCLUDE global/userselect.html.tmpl
+          id          => "needinfo_from"
+          name        => "needinfo_from"
+          value       => ""
+          size        => 30
+          multiple    => 5
+          field_title => "Enter one or more comma separated users to request more information from"
+          request_type => "needinfo"
+      %]
+    </span>
+  </td>
+</tr>