summaryrefslogtreecommitdiffstats
path: root/template/en/default/admin/custom_fields
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/admin/custom_fields')
-rw-r--r--template/en/default/admin/custom_fields/create.html.tmpl111
-rw-r--r--template/en/default/admin/custom_fields/edit.html.tmpl99
-rw-r--r--template/en/default/admin/custom_fields/list.html.tmpl63
3 files changed, 273 insertions, 0 deletions
diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl
new file mode 100644
index 000000000..b366371bd
--- /dev/null
+++ b/template/en/default/admin/custom_fields/create.html.tmpl
@@ -0,0 +1,111 @@
+[%# 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.
+ #
+ # Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
+ #%]
+
+[%# INTERFACE:
+ # none
+ #%]
+
+[% PROCESS "global/field-descs.none.tmpl" %]
+
+[% PROCESS global/header.html.tmpl
+ title = "Add a new Custom Field"
+ onload = "document.getElementById('new_bugmail').disabled = true;" %]
+
+<script type="text/javascript">
+ <!--
+ // Disable a checkbox based on the state of another one.
+ function toggleCheckbox(this_checkbox, other_checkbox_id) {
+ var other_checkbox = document.getElementById(other_checkbox_id);
+ other_checkbox.disabled = !this_checkbox.checked;
+ }
+ //-->
+</script>
+
+<p>
+ Adding custom fields can make the interface of [% terms.Bugzilla %] very
+ complicated. Many admins who are new to [% terms.Bugzilla %] start off
+ adding many custom fields, and then their users complain that the interface
+ is "too complex". Please think carefully before adding any custom fields.
+ It may be the case that [% terms.Bugzilla %] already does what you need,
+ and you just haven't enabled the correct feature yet.
+
+ <ul>
+ <li>Custom field names must begin with "cf_" to distinguish them from standard
+ fields. If you omit "cf_" from the name, it will automatically be appended.</li>
+ <li>Descriptions are a very short string describing the field and will be used
+ as the label for this field in the user interface.</li>
+ </ul>
+ <br>
+</p>
+
+<form id="add_field" action="editfields.cgi" method="GET">
+ <table border="0" cellspacing="0" cellpadding="5">
+ <tr>
+ <th align="right"><label for="name">Name:</label></th>
+ <td>
+ <input type="text" id="name" name="name" value="cf_" size="40" maxlength="64">
+ </td>
+
+ <th align="right">
+ <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"
+ onchange="toggleCheckbox(this, 'new_bugmail');">
+ </td>
+ </tr>
+ <tr>
+ <th align="right"><label for="desc">Description:</label></th>
+ <td><input type="text" id="desc" name="desc" value="" size="40"></td>
+
+ <th align="right">
+ <label for="new_bugmail">Displayed in bugmail 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>
+ <td>
+ [%# Only one field type is valid right now. But let's prepare the UI
+ # for future new types. %]
+ <select id="type" name="type">
+ <option value="FIELD_TYPE_FREETEXT">Free Text</option>
+ </select>
+ </td>
+
+ <th align="right"><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>
+ <td>
+ <input type="text" id="sortkey" name="sortkey" value="0" size="6" maxlength="6">
+ </td>
+
+ <th>&nbsp;</th>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ <br>
+ <input type="hidden" name="action" value="new">
+ <input type="submit" id="create" value="Create">
+</form>
+
+<p>
+ <a href="editfields.cgi">Back to the list of existing custom fields</a>
+</p>
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl
new file mode 100644
index 000000000..cb7b56a0a
--- /dev/null
+++ b/template/en/default/admin/custom_fields/edit.html.tmpl
@@ -0,0 +1,99 @@
+[%# 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.
+ #
+ # Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
+ #%]
+
+[%# INTERFACE:
+ # none
+ #%]
+
+[% PROCESS "global/field-descs.none.tmpl" %]
+
+[% title = BLOCK %]
+ Edit the Custom Field '[% field.name FILTER html %]' ([% field.description FILTER html %])
+[% END %]
+
+[% PROCESS global/header.html.tmpl
+ title = title
+ onload = "toggleCheckbox(document.getElementById('enter_bug'), 'new_bugmail');" %]
+
+<script type="text/javascript">
+ <!--
+ // Disable a checkbox based on the state of another one.
+ function toggleCheckbox(this_checkbox, other_checkbox_id) {
+ var other_checkbox = document.getElementById(other_checkbox_id);
+ other_checkbox.disabled = !this_checkbox.checked;
+ }
+ //-->
+</script>
+
+<p>
+ Descriptions are a very short string describing the field and will be used as
+ the label for this field in the user interface.
+</p>
+
+<form id="edit_field" action="editfields.cgi" method="GET">
+ <table border="0" cellspacing="0" cellpadding="5">
+ <tr>
+ <th align="right">Name:</th>
+ <td>[% field.name FILTER html %]</td>
+
+ <th align="right">
+ <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"
+ [%- " checked" IF field.enter_bug %]
+ onchange="toggleCheckbox(this, 'new_bugmail');"></td>
+ </tr>
+ <tr>
+ <th align="right"><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">
+ <label for="new_bugmail">Displayed in bugmail 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>
+ <td>Free Text</td>
+
+ <th align="right"><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>
+ <td>
+ <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6"
+ value="[% field.sortkey FILTER html %]">
+ </td>
+
+ <th>&nbsp;</th>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ <br>
+ <input type="hidden" name="action" value="update">
+ <input type="hidden" name="name" value="[% field.name FILTER html %]">
+ <input type="submit" id="edit" value="Submit" disabled="disabled">
+</form>
+
+<p>
+ <a href="editfields.cgi">Back to the list of existing custom fields</a>
+</p>
+
+[% PROCESS global/footer.html.tmpl %]
diff --git a/template/en/default/admin/custom_fields/list.html.tmpl b/template/en/default/admin/custom_fields/list.html.tmpl
new file mode 100644
index 000000000..e02609dd3
--- /dev/null
+++ b/template/en/default/admin/custom_fields/list.html.tmpl
@@ -0,0 +1,63 @@
+[%# 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.
+ #
+ # Contributor(s): Frédéric Buclin <LpSolit@gmail.com>
+ #%]
+
+[%# INTERFACE:
+ # custom_fields: a list of Bugzilla::Field objects, representing custom fields.
+ #%]
+
+[% PROCESS "global/field-descs.none.tmpl" %]
+
+[% PROCESS global/header.html.tmpl title = "Custom Fields" %]
+
+[% columns = [
+ {
+ name => "name"
+ heading => "Edit custom field..."
+ contentlink => "editfields.cgi?action=edit&amp;name=%%name%%"
+ },
+ {
+ name => "description"
+ heading => "Description"
+ },
+ {
+ name => "sortkey"
+ heading => "Sortkey"
+ },
+ {
+ name => "enter_bug"
+ heading => "Editable on Bug Creation"
+ },
+ {
+ name => "mailhead"
+ heading => "In Bugmail on Bug Creation"
+ },
+ {
+ name => "obsolete"
+ heading => "Is Obsolete"
+ }
+ ]
+%]
+
+[% PROCESS admin/table.html.tmpl
+ columns = columns
+ data = custom_fields
+%]
+
+<p>
+ <a href="editfields.cgi?action=add">Add a new custom field</a>
+</p>
+
+[% PROCESS global/footer.html.tmpl %]