Closed Bug 121247 Opened 23 years ago Closed 22 years ago

enter_bug comment templates

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: paul.thomas, Assigned: gerv)

References

Details

Attachments

(1 file)

following on from a post I made to the webtools group and the comments I got 
back hows about .....

here a suggestion to some functionality that I think is useful ..........

I've implemented this on my system my manually changing the enter_bug.cgi so
that each link on the "pick a product" page includes text like
"&comment=TEMPLATE%20FOR%20EACH%20PRODUCT" at the end of the query string.
This way I can end up with say the following automatically appearing in the
comment field...

----------------------
Database :
Test-up : webserver on machine.myorg.com
Some Other1 :
Some Other2 :

Bug Details :

----------------------

It would be nice to have another field in the product table to store the
template for each product and then a little cgi to edit the templates......
the default template for each product would of course be blank.

myk@mozilla.org agreed that "Still, these templates could be useful for, among 
other things, imposing the kind of structure on bug submissions that is called 
for in b.m.o.'s bug writing guidelines or created by the Bugzilla helper."
Yes, if I understand this correctly, it's the sort of thing we would need to
make Bugzilla Helper work without JS.
Bugzilla Helper as-is will never work without JS. There will be a new
enter_bug.cgi template, which requires JS, which is laid out like the Helper.
When I have some time, I'm going to write it. :-)

Gerv
It doesn't matter if I call it Bugzilla Helper or Corny Widgets Incorporated.  I
believe this feature would allow the functionality currently embodied in the
Bugzilla Helper to be implemented without JS.
Priority: -- → P2
Target Milestone: --- → Bugzilla 2.18
The right way to do this for the new helper enter_bug page is (IMHO) as follows:

- make a template with a separate text box, and descriptive text, for each of
the new, structured fields. Each of those text boxes has an internal name
"comment_X", where X is a digit. They can have a default value in the template
if necessary. They might be "Description", "Steps to Reproduce", etc.

- enter_bug.cgi concatenates all "comment_X" fields it gets in numerical order
into the initial bug comment. 

Gerv
No that's the wrong way.  =)

The right way is to call the individual fields field_XXX, field_YYY, etc, and
pass them through as XXX, YYY, etc respectively to a TT template whose name is
also passed, which returns the resulting comment.
Er... yes. That. :-)

Anyway, I don't think this bug should be fixed in the way suggested. An
alternative method of doing what he wants would be to change the
enter_bug.html.tmpl template:

<textfield id="description">
[% IF product == "FooProduct" %]
Name:
Age:
Sex:
[% ELSIF product == "BarProduct" %]
Computer name:
Keyboard key count:
[% END %]
</textfield>

Gerv
Yes, we could definitely make the post_bug.cgi template conditional, especially
on product.
I'm about to attach a small patch which enables part of what we discussed - the
format of the initial comment is got from a text template. This can be made
conditional on product, or anything else in the enter_bug submission. This patch
is required for making Bugzilla Helper an enter_bug template, so I'd like it in
for 2.16 if possible.

paul.thomas@sse.ie - I've sort of hijacked your bug :-) The way you'd do what
_you_ want is that your enter_bug template would have (line 172):

<textarea wrap="hard" name="comment" rows="10" cols="80">
[% IF product = "FooProduct" %]
Some 
template 
here
[% ELSIF product = "BarProduct" %]
Some 
more 
template
[% END %]
</textarea>

If your enter_bug has custom fields which don't depend on the product, you can
have a separate text box for each, and format them into the initial comment
using the mechanism this patch creates.

Gerv
Assignee: myk → gerv
Target Milestone: Bugzilla 2.18 → Bugzilla 2.16
Attached patch Patch v.1Splinter Review
Here it is.

Gerv
Attachment #79194 - Flags: review+
Comment on attachment 79194 [details] [diff] [review]
Patch v.1

Works, trivial. 2xr=myk.
Fixed.

Checking in post_bug.cgi;
/cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v  <--  post_bug.cgi
new revision: 1.46; previous revision: 1.45
done
RCS file:
/cvsroot/mozilla/webtools/bugzilla/template/default/entry/comment.txt.tmpl,v
done
Checking in template/default/entry/comment.txt.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/default/entry/comment.txt.tmpl,v 
<--  comment.txt.tmpl
initial revision: 1.1
done

Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 95972 has been marked as a duplicate of this bug. ***
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: