summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin/custom_fields
diff options
context:
space:
mode:
authorJesse Clark <jjclark1982@gmail.com>2010-02-08 01:10:03 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-08 01:10:03 +0100
commitd73a83506def7c6b43e5ad720777ec700f6af2e8 (patch)
treeee858870f5355c6551ee18546a82269df2602592 /template/en/default/admin/custom_fields
parent463c56db162f0b6e13a87c2499557f8dba7b9644 (diff)
downloadbugzilla-d73a83506def7c6b43e5ad720777ec700f6af2e8.tar.gz
bugzilla-d73a83506def7c6b43e5ad720777ec700f6af2e8.tar.xz
Bug 251556: Allow "Bug ID" fields to have one-way mutual relationships (like blocks/dependson)
r=mkanat, a=mkanat
Diffstat (limited to 'template/en/default/admin/custom_fields')
-rw-r--r--template/en/default/admin/custom_fields/cf-js.js.tmpl10
-rw-r--r--template/en/default/admin/custom_fields/create.html.tmpl37
-rw-r--r--template/en/default/admin/custom_fields/edit.html.tmpl36
3 files changed, 64 insertions, 19 deletions
diff --git a/template/en/default/admin/custom_fields/cf-js.js.tmpl b/template/en/default/admin/custom_fields/cf-js.js.tmpl
index 778dd3373..4c95a1690 100644
--- a/template/en/default/admin/custom_fields/cf-js.js.tmpl
+++ b/template/en/default/admin/custom_fields/cf-js.js.tmpl
@@ -50,6 +50,16 @@ function onChangeType(type_field) {
else {
value_field.disabled = true;
}
+
+ var reverse_desc = document.getElementById('reverse_desc');
+ if (type_field.value == [% constants.FIELD_TYPE_BUG_ID %])
+ {
+ reverse_desc.disabled = false;
+ }
+ else {
+ reverse_desc.disabled = true;
+ reverse_desc.value = '';
+ }
}
function onChangeVisibilityField() {
diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl
index a2db4708b..d23be0fe2 100644
--- a/template/en/default/admin/custom_fields/create.html.tmpl
+++ b/template/en/default/admin/custom_fields/create.html.tmpl
@@ -28,8 +28,14 @@
onload = "document.getElementById('new_bugmail').disabled = true;"
javascript_urls = [ 'js/util.js' ]
doc_section = "custom-fields.html#add-custom-fields"
+ style_urls = ['skins/standard/admin.css']
%]
+[%# set initial editability of fields such as Reverse Relationship Description %]
+<script type="text/javascript">
+YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('type'))});
+</script>
+
<p>
Adding custom fields can make the interface of [% terms.Bugzilla %] very
complicated. Many admins who are new to [% terms.Bugzilla %] start off
@@ -48,14 +54,14 @@
</ul>
<form id="add_field" action="editfields.cgi" method="GET">
- <table border="0" cellspacing="0" cellpadding="5">
+ <table border="0" cellspacing="0" cellpadding="5" id="edit_custom_field">
<tr>
- <th align="right"><label for="name">Name:</label></th>
+ <th class="narrow_label"><label for="name">Name:</label></th>
<td>
<input type="text" id="name" name="name" value="cf_" size="40" maxlength="64">
</td>
- <th align="right">
+ <th>
<label for="enter_bug">Can be set on [% terms.bug %] creation:</label>
</th>
<td>
@@ -64,16 +70,16 @@
</td>
</tr>
<tr>
- <th align="right"><label for="desc">Description:</label></th>
+ <th class="narrow_label"><label for="desc">Description:</label></th>
<td><input type="text" id="desc" name="desc" value="" size="40"></td>
- <th align="right">
+ <th>
<label for="new_bugmail">Displayed in [% terms.bug %]mail for new [% terms.bugs %]:</label>
</th>
<td><input type="checkbox" id="new_bugmail" name="new_bugmail" value="1"></td>
</tr>
<tr>
- <th align="right"><label for="type">Type:</label></th>
+ <th class="narrow_label"><label for="type">Type:</label></th>
<td>
<select id="type" name="type" onchange="onChangeType(this)">
[% FOREACH type = field_types.keys %]
@@ -83,16 +89,16 @@
</select>
</td>
- <th align="right"><label for="obsolete">Is obsolete:</label></th>
+ <th><label for="obsolete">Is obsolete:</label></th>
<td><input type="checkbox" id="obsolete" name="obsolete" value="1"></td>
</tr>
<tr>
- <th align="right"><label for="sortkey">Sortkey:</label></th>
+ <th class="narrow_label"><label for="sortkey">Sortkey:</label></th>
<td>
<input type="text" id="sortkey" name="sortkey" size="6" maxlength="6">
</td>
- <th align="right">
+ <th>
<label for="visibility_field_id">Field only appears when:</label>
</th>
<td>
@@ -114,7 +120,18 @@
</tr>
<tr>
- <td colspan="2">&nbsp;</td>
+ <th class="narrow_label">
+ <label for="reverse_desc">Reverse Relationship Description:</label>
+ </th>
+ <td>
+ <input type="text" id="reverse_desc" name="reverse_desc" value="" size="40" disabled="disabled">
+ <br/>
+ Use this label for the list of [% terms.bugs %] that link to a [% terms.bug %]
+ with this [% field_types.${constants.FIELD_TYPE_BUG_ID} %] field.
+ For example, if the description is "Is a duplicate of",
+ the reverse description would be "Duplicates of this [% terms.bug %]".
+ Leave blank to disable the list for this field.
+ </td>
<th>
<label for="value_field_id">
Field that controls the values<br>
diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl
index 981668260..01a8dcccb 100644
--- a/template/en/default/admin/custom_fields/edit.html.tmpl
+++ b/template/en/default/admin/custom_fields/edit.html.tmpl
@@ -32,6 +32,7 @@
onload = "toggleCheckbox(document.getElementById('enter_bug'), 'new_bugmail');"
javascript_urls = [ 'js/util.js' ]
doc_section = "custom-fields.html#edit-custom-fields"
+ style_urls = ['skins/standard/admin.css']
%]
<p>
@@ -40,12 +41,12 @@
</p>
<form id="edit_field" action="editfields.cgi" method="GET">
- <table border="0" cellspacing="0" cellpadding="5">
+ <table border="0" cellspacing="0" cellpadding="5" id="edit_custom_field">
<tr>
- <th align="right">Name:</th>
+ <th class="narrow_label">Name:</th>
<td>[% field.name FILTER html %]</td>
- <th align="right">
+ <th>
<label for="enter_bug">Can be set on [% terms.bug %] creation:</label>
</th>
<td><input type="checkbox" id="enter_bug" name="enter_bug" value="1"
@@ -53,31 +54,31 @@
onchange="toggleCheckbox(this, 'new_bugmail');"></td>
</tr>
<tr>
- <th align="right"><label for="desc">Description:</label></th>
+ <th class="narrow_label"><label for="desc">Description:</label></th>
<td><input type="text" id="desc" name="desc" size="40"
value="[% field.description FILTER html %]"></td>
- <th align="right">
+ <th>
<label for="new_bugmail">Displayed in [% terms.bug %]mail for new [% terms.bugs %]:</label>
</th>
<td><input type="checkbox" id="new_bugmail" name="new_bugmail" value="1"
[%- " checked" IF field.mailhead %]></td>
</tr>
<tr>
- <th align="right">Type:</th>
+ <th class="narrow_label">Type:</th>
<td>[% field_types.${field.type} FILTER html %]</td>
- <th align="right"><label for="obsolete">Is obsolete:</label></th>
+ <th><label for="obsolete">Is obsolete:</label></th>
<td><input type="checkbox" id="obsolete" name="obsolete" value="1"
[%- " checked" IF field.obsolete %]></td>
</tr>
<tr>
- <th align="right"><label for="sortkey">Sortkey:</label></th>
+ <th class="narrow_label"><label for="sortkey">Sortkey:</label></th>
<td>
<input type="text" id="sortkey" name="sortkey" size="6" maxlength="6"
value="[% field.sortkey FILTER html %]">
</td>
- <th align="right">
+ <th>
<label for="visibility_field_id">Field only appears when:</label>
</th>
<td>
@@ -140,6 +141,23 @@
</td>
</tr>
[% END %]
+ [% IF field.type == constants.FIELD_TYPE_BUG_ID %]
+ <tr>
+ <th class="narrow_label">
+ <label for="reverse_desc">Reverse Relationship Description:</label>
+ </th>
+ <td>
+ <input type="text" id="reverse_desc" name="reverse_desc" size="40"
+ value="[% field.reverse_desc FILTER html %]">
+ <br/>
+ Use this label for the list of [% terms.bugs %] that link to a [% terms.bug %]
+ with this [% field_types.${constants.FIELD_TYPE_BUG_ID} %] field.
+ For example, if the description is "Is a duplicate of",
+ the reverse description would be "Duplicates of this [% terms.bug %]".
+ Leave blank to disable the list for this field.
+ </td>
+ </tr>
+ [% END %]
</table>
<br>
<input type="hidden" name="action" value="update">