Commit 345f9df2 authored by jocuri%softhome.net's avatar jocuri%softhome.net

Patch for bug 213679: Implement a parameter that allows administrators to…

Patch for bug 213679: Implement a parameter that allows administrators to control whether blank comments are allowed when filling new bugs; code by Dave Swegen <dswegen@software.plasmon.com>; r=myk; a=myk.
parent 5f12f937
...@@ -844,6 +844,14 @@ Reason: %reason% ...@@ -844,6 +844,14 @@ Reason: %reason%
}, },
{ {
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', name => 'commentonaccept',
desc => 'If this option is on, the user needs to enter a short comment if ' . desc => 'If this option is on, the user needs to enter a short comment if ' .
'he accepts the bug', 'he accepts the bug',
......
...@@ -76,6 +76,10 @@ my $format = GetFormat("bug/create/comment", $::FORM{'format'}, "txt"); ...@@ -76,6 +76,10 @@ my $format = GetFormat("bug/create/comment", $::FORM{'format'}, "txt");
$template->process($format->{'template'}, $vars, \$comment) $template->process($format->{'template'}, $vars, \$comment)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
# Check that if required a description has been provided
if (Param("commentoncreate") && !trim($::FORM{'comment'})) {
ThrowUserError("description_required");
}
ValidateComment($comment); ValidateComment($comment);
my $product = $::FORM{'product'}; my $product = $::FORM{'product'};
......
...@@ -150,6 +150,10 @@ ...@@ -150,6 +150,10 @@
[% title = "Dependency Loop Detected" %] [% title = "Dependency Loop Detected" %]
You can't make [% terms.abug %] blocked or dependent on itself. 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" %] [% ELSIF error == "dupe_invalid_bug_id" %]
[% title = BLOCK %]Valid [% terms.Bug %] Number Required[% END %] [% title = BLOCK %]Valid [% terms.Bug %] Number Required[% END %]
You must specify a valid [% terms.bug %] number of which this You must specify a valid [% terms.bug %] number of which this
......
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