]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Patch for bug 213679: Implement a parameter that allows administrators to control...
authorjocuri%softhome.net <>
Sat, 31 Jan 2004 08:12:08 +0000 (08:12 +0000)
committerjocuri%softhome.net <>
Sat, 31 Jan 2004 08:12:08 +0000 (08:12 +0000)
defparams.pl
post_bug.cgi
template/en/default/global/user-error.html.tmpl

index 640f92b970bbec5ae76b661e05badf57e37041ba..e6cb16ac87af49b774a6880b2efe6614c6578b22 100644 (file)
@@ -843,6 +843,14 @@ Reason: %reason%
    default => 'this may indicate a bug in your browser.'
   },
 
+  {
+   name => 'commentoncreate',
+   desc => 'If this option is on, the user needs to enter a description ' .
+           'when entering a new bug',
+   type => 'b',
+   default => 0
+  },
+
   {
    name => 'commentonaccept',
    desc => 'If this option is on, the user needs to enter a short comment if ' .
index 315ff3a995a2d3be3edf543fa26661db27351906..dbc102d3eeff5272168d4e88100ef990329f0b63 100755 (executable)
@@ -76,6 +76,10 @@ my $format = GetFormat("bug/create/comment", $::FORM{'format'}, "txt");
 $template->process($format->{'template'}, $vars, \$comment)
   || ThrowTemplateError($template->error());
 
+# Check that if required a description has been provided
+if (Param("commentoncreate") && !trim($::FORM{'comment'})) {
+    ThrowUserError("description_required");
+}
 ValidateComment($comment);
 
 my $product = $::FORM{'product'};
index 1aec9b4f6eed48730b1251148acfc381160ad460..37eb7bd5b2657f6ed5f4b0a2b09267e9e70b2c2a 100644 (file)
     [% title = "Dependency Loop Detected" %]
     You can't make [% terms.abug %] blocked or dependent on itself.
 
+  [% ELSIF error == "description_required" %]
+    [% title = "Description Required" %]
+    You must provide a description of the [% terms.bug %].
+
   [% ELSIF error == "dupe_invalid_bug_id" %]
     [% title = BLOCK %]Valid [% terms.Bug %] Number Required[% END %]
     You must specify a valid [% terms.bug %] number of which this