summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/create/create.html.tmpl
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-10-25 06:14:56 +0200
committermkanat%bugzilla.org <>2008-10-25 06:14:56 +0200
commita9822ceefb563a54420f13b2395b8c1359833778 (patch)
treeb860dd7ab0cf156734d8eddd5d680bab587f4185 /template/en/default/bug/create/create.html.tmpl
parent5323ab05caef4b7a5c44fb567b412a3917272f33 (diff)
downloadbugzilla-a9822ceefb563a54420f13b2395b8c1359833778.tar.gz
bugzilla-a9822ceefb563a54420f13b2395b8c1359833778.tar.xz
Bug 458436: Allow standard global select fields to control visibility of custom fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'template/en/default/bug/create/create.html.tmpl')
-rw-r--r--template/en/default/bug/create/create.html.tmpl48
1 files changed, 35 insertions, 13 deletions
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index aaf2de5a6..0b941cc35 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -162,6 +162,14 @@ function handleWantsAttachment(wants_attachment) {
-->
</script>
+[% USE Bugzilla %]
+[% SET select_fields = {} %]
+[% FOREACH field = Bugzilla.get_fields(
+ { type => constants.FIELD_TYPE_SINGLE_SELECT, custom => 0 })
+%]
+ [% select_fields.${field.name} = field %]
+[% END %]
+
<form name="Create" id="Create" method="post" action="post_bug.cgi"
enctype="multipart/form-data">
<input type="hidden" name="product" value="[% product.name FILTER html %]">
@@ -235,18 +243,21 @@ function handleWantsAttachment(wants_attachment) {
</select>
</td>
- [% sel = { description => 'Severity', name => 'bug_severity' } %]
- [% INCLUDE select %]
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = select_fields.bug_severity, editable = 1,
+ value = default.bug_severity %]
</tr>
<tr>
- [% sel = { description => 'Platform', name => 'rep_platform' } %]
- [% INCLUDE select %]
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = select_fields.rep_platform, editable = 1,
+ value = default.rep_platform %]
</tr>
<tr>
- [% sel = { description => 'OS', name => 'op_sys' } %]
- [% INCLUDE select %]
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = select_fields.op_sys, editable = 1,
+ value = default.op_sys %]
</tr>
</tbody>
@@ -260,12 +271,11 @@ function handleWantsAttachment(wants_attachment) {
[% END %]
[% IF Param('letsubmitterchoosepriority') %]
- [% sel = { description => 'Priority', name => 'priority' } %]
- [% INCLUDE select %]
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = select_fields.priority, editable = 1,
+ value = default.priority %]
[% ELSE %]
- <td colspan="2">
- <input type="hidden" name="priority" value="[% default.priority FILTER html %]">
- </td>
+ <td colspan="2">&nbsp;</td>
[% END %]
</tr>
</tbody>
@@ -437,7 +447,9 @@ function handleWantsAttachment(wants_attachment) {
[% NEXT UNLESS field.enter_bug %]
[% SET value = ${field.name}.defined ? ${field.name} : "" %]
<tr>
- [% PROCESS bug/field.html.tmpl editable=1 value_span=3 %]
+ [% INCLUDE bug/field.html.tmpl
+ bug = default, field = field, value = value, editable = 1,
+ value_span = 3 %]
</tr>
[% END %]
@@ -617,7 +629,7 @@ function handleWantsAttachment(wants_attachment) {
[% END %]
<td>
- <select name="[% sel.name %]">
+ <select name="[% sel.name %]" id="[% sel.name %]">
[%- FOREACH x = ${sel.name} %]
<option value="[% x FILTER html %]"
[% " selected=\"selected\"" IF x == default.${sel.name} %]>
@@ -628,5 +640,15 @@ function handleWantsAttachment(wants_attachment) {
[% END %]</option>
[% END %]
</select>
+
+ [% IF sel.name == "bug_status" %]
+ [% FOREACH controlled = select_fields.bug_status.controls_visibility_of %]
+ <script type="text/javascript">
+ showFieldWhen('[% controlled.name FILTER js %]',
+ 'bug_status',
+ '[% controlled.visibility_value.name FILTER js %]');
+ </script>
+ [% END %]
+ [% END %]
</td>
[% END %]