]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 121247 - enter_bug comment templates. Template method for amalgamation of free...
authorgerv%gerv.net <>
Tue, 16 Apr 2002 06:16:59 +0000 (06:16 +0000)
committergerv%gerv.net <>
Tue, 16 Apr 2002 06:16:59 +0000 (06:16 +0000)
post_bug.cgi
template/default/entry/comment.txt.tmpl [new file with mode: 0644]

index dd6b5b366fb51db43e4a4ac7f5aa6c9e9d929720..7f9f46c47b80ff936797cc74ec93227fa2120158 100755 (executable)
@@ -51,7 +51,16 @@ use vars qw($vars $template);
 
 confirm_login();
 
-ValidateComment($::FORM{'comment'});
+
+# The format of the initial comment can be structured by adding fields to the
+# enter_bug template and then referencing them in the comment template.
+my $comment;
+
+$vars->{'form'} = \%::FORM;
+$template->process("entry/comment.txt.tmpl", $vars, \$comment)
+  || ThrowTemplateError($template->error());
+
+ValidateComment($comment);
 
 my $product = $::FORM{'product'};
 
@@ -197,7 +206,6 @@ foreach my $field (@used_fields) {
     $sql .= SqlQuote($::FORM{$field}) . ",";
 }
 
-my $comment = $::FORM{'comment'};
 $comment =~ s/\r\n?/\n/g;     # Get rid of \r.
 $comment = trim($comment);
 # If comment is all whitespace, it'll be null at this point. That's
diff --git a/template/default/entry/comment.txt.tmpl b/template/default/entry/comment.txt.tmpl
new file mode 100644 (file)
index 0000000..21a9f3f
--- /dev/null
@@ -0,0 +1,21 @@
+[%# 1.0@bugzilla.org %]
+[%# The contents of this file are subject to the Mozilla Public
+  # License Version 1.1 (the "License"); you may not use this file
+  # except in compliance with the License. You may obtain a copy of
+  # the License at http://www.mozilla.org/MPL/
+  #
+  # Software distributed under the License is distributed on an "AS
+  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  # implied. See the License for the specific language governing
+  # rights and limitations under the License.
+  #
+  # The Original Code is the Bugzilla Bug Tracking System.
+  #
+  # The Initial Developer of the Original Code is Netscape Communications
+  # Corporation. Portions created by Netscape are
+  # Copyright (C) 1998 Netscape Communications Corporation. All
+  # Rights Reserved.
+  #
+  # Contributor(s): Gervase Markham <gerv@gerv.net>
+  #%]
+[% form.comment %]