Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
246c04a3
Commit
246c04a3
authored
Aug 26, 2015
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1196969: Custom fields whose visibility depend on the product are not…
Bug 1196969: Custom fields whose visibility depend on the product are not displayed/hidden correctly r=gerv a=sgreen
parent
7a997794
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
19 deletions
+44
-19
field.js
js/field.js
+25
-0
edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+6
-14
field.html.tmpl
template/en/default/bug/field.html.tmpl
+13
-5
No files found.
js/field.js
View file @
246c04a3
...
@@ -522,6 +522,31 @@ function handleVisControllerValueChange(e, args) {
...
@@ -522,6 +522,31 @@ function handleVisControllerValueChange(e, args) {
if
(
selected
)
{
if
(
selected
)
{
YAHOO
.
util
.
Dom
.
removeClass
(
label_container
,
'bz_hidden_field'
);
YAHOO
.
util
.
Dom
.
removeClass
(
label_container
,
'bz_hidden_field'
);
YAHOO
.
util
.
Dom
.
removeClass
(
field_container
,
'bz_hidden_field'
);
YAHOO
.
util
.
Dom
.
removeClass
(
field_container
,
'bz_hidden_field'
);
/* If a custom field such as a textarea field contains some text, then
* its content is visible by default as a readonly field (assuming that
* the field is displayed). But if such a custom field contains no text,
* then it's not displayed at all and an (edit) link is displayed instead.
* This is problematic if the custom field is mandatory, because at least
* Firefox complains that you must enter a value, but is unable to point
* to the custom field because this one is hidden, and so the user has
* to guess what the web browser is talking about, which is confusing.
* So in that case, we display the custom field automatically instead of
* the (edit) link, so that the user can enter some text in it.
*/
var
field_readonly
=
document
.
getElementById
(
controlled_id
+
'_readonly'
);
if
(
!
field_readonly
)
{
var
field_input
=
document
.
getElementById
(
controlled_id
+
'_input'
);
var
edit_container
=
document
.
getElementById
(
controlled_id
+
'_edit_container'
);
if
(
field_input
)
{
YAHOO
.
util
.
Dom
.
removeClass
(
field_input
,
'bz_default_hidden'
);
}
if
(
edit_container
)
{
YAHOO
.
util
.
Dom
.
addClass
(
edit_container
,
'bz_hidden_field'
);
}
}
// Restore the 'required' attribute for mandatory fields.
// Restore the 'required' attribute for mandatory fields.
if
(
field
.
getAttribute
(
'data-required'
)
==
"true"
)
{
if
(
field
.
getAttribute
(
'data-required'
)
==
"true"
)
{
field
.
setAttribute
(
'required'
,
'true'
);
field
.
setAttribute
(
'required'
,
'true'
);
...
...
template/en/default/bug/edit.html.tmpl
View file @
246c04a3
...
@@ -230,20 +230,12 @@
...
@@ -230,20 +230,12 @@
[%# PRODUCT #%]
[%# PRODUCT #%]
[%#############%]
[%#############%]
<tr id="field_tablerow_product">
<tr id="field_tablerow_product">
[% INCLUDE "bug/field-label.html.tmpl"
[% INCLUDE bug/field.html.tmpl
field = bug_fields.product
bug = bug, field = bug_fields.product, value = bug.product
desc_url = 'describecomponents.cgi'
override_legal_values = bug.choices.product
value = bug.product
desc_url = "describecomponents.cgi"
%]
editable = bug.check_can_change_field('product', 0, 1)
<td class="field_value" id="field_container_product">
%]
[% INCLUDE "global/product-select.html.tmpl"
id => "product"
name => "product"
value => bug.product
products => bug.choices.product
isselect => bug.check_can_change_field('product', 0, 1)
%]
</td>
</tr>
</tr>
[%# Classification is here so that it can be used in value controllers
[%# Classification is here so that it can be used in value controllers
...
...
template/en/default/bug/field.html.tmpl
View file @
246c04a3
...
@@ -91,6 +91,12 @@
...
@@ -91,6 +91,12 @@
</script>
</script>
[% CASE [ constants.FIELD_TYPE_SINGLE_SELECT
[% CASE [ constants.FIELD_TYPE_SINGLE_SELECT
constants.FIELD_TYPE_MULTI_SELECT ] %]
constants.FIELD_TYPE_MULTI_SELECT ] %]
[%# The 'product' field needs its own template if classifications are enabled. %]
[% IF field.name == "product" AND Param('useclassification') %]
[% INCLUDE "global/product-select.html.tmpl"
id = "product", name = "product", value = value
products = override_legal_values %]
[% ELSE %]
<input type="hidden" id="[% field.name FILTER html %]_dirty">
<input type="hidden" id="[% field.name FILTER html %]_dirty">
<select id="[% field.name FILTER html %]"
<select id="[% field.name FILTER html %]"
name="[% field.name FILTER html %]"
name="[% field.name FILTER html %]"
...
@@ -141,22 +147,24 @@
...
@@ -141,22 +147,24 @@
[% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %]
[% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %]
<input type="hidden" name="defined_[% field.name FILTER html %]">
<input type="hidden" name="defined_[% field.name FILTER html %]">
[% END %]
[% END %]
[% END %]
<script type="text/javascript">
<script type="text/javascript">
<!--
<!--
initHidingOptionsForIE('[% field.name FILTER js %]');
initHidingOptionsForIE('[% field.name FILTER js %]');
[%+ INCLUDE "bug/field-events.js.tmpl"
[%+ INCLUDE "bug/field-events.js.tmpl"
field = field, product = bug.product_obj %]
field = field, product = bug.product_obj %]
//-->
//-->
</script>
</script>
[% CASE constants.FIELD_TYPE_TEXTAREA %]
[% CASE constants.FIELD_TYPE_TEXTAREA %]
<div id="[% field.name FILTER html %]_edit_container" class="bz_default_hidden">
<div id="[% field.name FILTER html %]_edit_container" class="bz_default_hidden">
<div>
<div>
(<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>)
(<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>)
</div>
</div>
[% IF value %]
[% IF value %]
<pre class="field_textarea_readonly">[% value FILTER html %]</pre>
<pre id="[% field.name FILTER html %]_readonly"
class="field_textarea_readonly">[% value FILTER html %]</pre>
[% END %]
[% END %]
</div>
</div>
<div id="[% field.name FILTER html %]_input">
<div id="[% field.name FILTER html %]_input">
...
@@ -173,7 +181,7 @@
...
@@ -173,7 +181,7 @@
'',
'',
true);
true);
</script>
</script>
[% CASE constants.FIELD_TYPE_BUG_URLS %]
[% CASE constants.FIELD_TYPE_BUG_URLS %]
[% IF bug.id && value.size %]
[% IF bug.id && value.size %]
<ul class="bug_urls">
<ul class="bug_urls">
[% FOREACH bug_url = value %]
[% FOREACH bug_url = value %]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment