diff options
author | jocuri%softhome.net <> | 2004-01-31 09:12:08 +0100 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-01-31 09:12:08 +0100 |
commit | 345f9df2f29d90a777051db3d34194ac04b8b637 (patch) | |
tree | 7724d113d13b92ecdf8b1cb0c32d5a28703f34b7 | |
parent | 5f12f937db422fca2979115059d580ba8a91e6db (diff) | |
download | bugzilla-345f9df2f29d90a777051db3d34194ac04b8b637.tar.gz bugzilla-345f9df2f29d90a777051db3d34194ac04b8b637.tar.xz |
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.
-rw-r--r-- | defparams.pl | 8 | ||||
-rwxr-xr-x | post_bug.cgi | 4 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 4 |
3 files changed, 16 insertions, 0 deletions
diff --git a/defparams.pl b/defparams.pl index 640f92b97..e6cb16ac8 100644 --- a/defparams.pl +++ b/defparams.pl @@ -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', desc => 'If this option is on, the user needs to enter a short comment if ' . 'he accepts the bug', diff --git a/post_bug.cgi b/post_bug.cgi index 315ff3a99..dbc102d3e 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -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'}; diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 1aec9b4f6..37eb7bd5b 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -150,6 +150,10 @@ [% 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 |