diff options
author | Tiago Mello <timello@linux.vnet.ibm.com> | 2010-05-19 18:28:37 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-05-19 18:28:37 +0200 |
commit | 44bc791eb3aa690940d540a7154d93dc8b10f186 (patch) | |
tree | 9d489c9a0ee037d6341fd3f03f5d86d9543a6a98 /template/en | |
parent | d614dd98c482a06459f5f6e4911e0f32de6c424b (diff) | |
download | bugzilla-44bc791eb3aa690940d540a7154d93dc8b10f186.tar.gz bugzilla-44bc791eb3aa690940d540a7154d93dc8b10f186.tar.xz |
Bug 494395: Implement the ability to mark custom fields as mandatory when
creating/changing bugs
r=mkanat, a=mkanat
Diffstat (limited to 'template/en')
-rw-r--r-- | template/en/default/admin/custom_fields/create.html.tmpl | 32 | ||||
-rw-r--r-- | template/en/default/admin/custom_fields/edit.html.tmpl | 41 | ||||
-rw-r--r-- | template/en/default/admin/custom_fields/list.html.tmpl | 4 | ||||
-rw-r--r-- | template/en/default/bug/create/create.html.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/bug/field-label.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/bug/field.html.tmpl | 20 | ||||
-rw-r--r-- | template/en/default/global/textarea.html.tmpl | 5 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 5 |
8 files changed, 72 insertions, 46 deletions
diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl index f8a3eafa2..fcdf73bc7 100644 --- a/template/en/default/admin/custom_fields/create.html.tmpl +++ b/template/en/default/admin/custom_fields/create.html.tmpl @@ -98,6 +98,24 @@ YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('ty <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6"> </td> + <th align="right"><label for="is_mandatory">Is mandatory:</label></th> + <td><input type="checkbox" id="is_mandatory" name="is_mandatory" value="1"></td> + </tr> + + <tr> + <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 + [%+ terms.abug %] with this + [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] + 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="visibility_field_id">Field only appears when:</label> </th> @@ -120,19 +138,7 @@ YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('ty </tr> <tr> - <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 - [%+ terms.abug %] with this - [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] - 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> + <td colspan="2"> </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 ebf0891c8..4c1bbbeb0 100644 --- a/template/en/default/admin/custom_fields/edit.html.tmpl +++ b/template/en/default/admin/custom_fields/edit.html.tmpl @@ -78,6 +78,29 @@ <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6" value="[% field.sortkey FILTER html %]"> </td> + <th align="right"><label for="is_mandatory">Is mandatory:</label></th> + <td><input type="checkbox" id="is_mandatory" name="is_mandatory" value="1" + [%- ' checked="checked"' IF field.is_mandatory %]></td> + </tr> + <tr> + [% IF field.type == constants.FIELD_TYPE_BUG_ID %] + <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 + [%+ terms.abug %] with this + [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] 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> + [% ELSE %] + <td colspan="2"> </td> + [% END %] <th> <label for="visibility_field_id">Field only appears when:</label> </th> @@ -141,24 +164,6 @@ </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 - [%+ terms.abug %] with this - [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] 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"> diff --git a/template/en/default/admin/custom_fields/list.html.tmpl b/template/en/default/admin/custom_fields/list.html.tmpl index dd266c759..385650a63 100644 --- a/template/en/default/admin/custom_fields/list.html.tmpl +++ b/template/en/default/admin/custom_fields/list.html.tmpl @@ -57,6 +57,10 @@ heading => "Is Obsolete" }, { + name => "is_mandatory" + heading => "Is Mandatory" + }, + { name => "action" heading => "Action" content => "" diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 983f12bb9..39f14e8de 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -218,7 +218,7 @@ TUI_hide_default('expert_fields'); describecomponents.cgi?product=[% product.name FILTER url_quote %] [% END %] [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.component editable = 1 required = 1 + field = bug_fields.component editable = 1 desc_url = component_desc_url %] <td id="field_container_component"> @@ -487,13 +487,13 @@ TUI_hide_default('expert_fields'); </tr> </tbody> -<tbody class="expert_fields"> +<tbody> [% USE Bugzilla %] [% FOREACH field = Bugzilla.active_custom_fields %] [% NEXT UNLESS field.enter_bug %] [% SET value = ${field.name}.defined ? ${field.name} : "" %] - <tr> + <tr [% 'class="expert_fields"' IF !field.is_mandatory %]> [% INCLUDE bug/field.html.tmpl bug = default, field = field, value = value, editable = 1, value_span = 3 %] @@ -505,7 +505,7 @@ TUI_hide_default('expert_fields'); <tr> [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.short_desc editable = 1 required = 1 + field = bug_fields.short_desc editable = 1 %] <td colspan="3"> <input name="short_desc" size="70" value="[% short_desc FILTER html %]" diff --git a/template/en/default/bug/field-label.html.tmpl b/template/en/default/bug/field-label.html.tmpl index c3a282701..7b63f7b8c 100644 --- a/template/en/default/bug/field-label.html.tmpl +++ b/template/en/default/bug/field-label.html.tmpl @@ -22,14 +22,13 @@ # field: a Bugzilla::Field object # desc_url: An alternate link to help for the field. # hidden: True if the field label should start hidden. - # required: True if this field must have a value. # rowspan: a "rowspan" value for the label's <th>. #%] [% PROCESS "bug/field-help.none.tmpl" %] <th class="field_label [% ' bz_hidden_field' IF hidden %] - [%- ' required' IF required %]" + [%- ' required' IF field.is_mandatory %]" id="field_label_[% field.name FILTER html %]" [% IF rowspan %] rowspan="[% rowspan FILTER html %]"[% END %]> diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 211f16b8e..97d38661c 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -48,12 +48,9 @@ [% IF NOT no_tds %] [% PROCESS "bug/field-label.html.tmpl" %] -[% END %] - -[% IF NOT no_tds %] -<td class="field_value [% ' bz_hidden_field' IF hidden %]" - id="field_container_[% field.name FILTER html %]" - [% " colspan=\"$value_span\"" FILTER none IF value_span %]> + <td class="field_value [% ' bz_hidden_field' IF hidden %]" + id="field_container_[% field.name FILTER html %]" + [% " colspan=\"$value_span\"" FILTER none IF value_span %]> [% END %] [% Hook.process('start_field_column') %] [% IF editable %] @@ -62,11 +59,13 @@ <input id="[% field.name FILTER html %]" class="text_input" name="[% field.name FILTER html %]" value="[% value FILTER html %]" size="40" - maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]"> + maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]" + [% ' aria-required="true"' IF field.is_mandatory %]> [% CASE constants.FIELD_TYPE_DATETIME %] <input name="[% field.name FILTER html %]" size="20" id="[% field.name FILTER html %]" value="[% value FILTER html %]" + [% ' aria-required="true"' IF field.is_mandatory %] onchange="updateCalendarFromField(this)"> <button type="button" class="calendar_button" id="button_calendar_[% field.name FILTER html %]" @@ -82,7 +81,9 @@ [% CASE constants.FIELD_TYPE_BUG_ID %] <span id="[% field.name FILTER html %]_input_area"> <input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" - value="[% value FILTER html %]" size="7"> + value="[% value FILTER html %]" size="7" + [% ' aria-required="true"' IF field.is_mandatory %]> + </span> [% IF value %] @@ -108,6 +109,7 @@ [% SET field_size = field.legal_values.size %] [% END %] size="[% field_size FILTER html %]" multiple="multiple" + [% ' aria-required="true"' IF field.is_mandatory %] [% END %] > [% IF allow_dont_change %] @@ -157,7 +159,7 @@ [% CASE constants.FIELD_TYPE_TEXTAREA %] [% INCLUDE global/textarea.html.tmpl id = field.name name = field.name minrows = 4 maxrows = 8 - cols = 60 defaultcontent = value %] + cols = 60 defaultcontent = value mandatory = field.is_mandatory %] [% CASE constants.FIELD_TYPE_BUG_URLS %] [% '<ul class="bug_urls">' IF value.size %] [% FOREACH url = value %] diff --git a/template/en/default/global/textarea.html.tmpl b/template/en/default/global/textarea.html.tmpl index b762f1c4f..1d8cacafb 100644 --- a/template/en/default/global/textarea.html.tmpl +++ b/template/en/default/global/textarea.html.tmpl @@ -31,6 +31,8 @@ # minrows will be used. # cols: (required) Number of columns the textarea shall have. # defaultcontent: (optional) Default content for the textarea. + # mandatory: (optional) Boolean specifying whether or not the textarea + # is mandatory. #%] <textarea [% IF name %]name="[% name FILTER html %]"[% END %] @@ -47,4 +49,7 @@ cols="[% cols FILTER html %]" [% IF maxrows && user.settings.zoom_textareas.value == 'on' %] onFocus="this.rows=[% maxrows FILTER html %]" + [% END %] + [% IF mandatory %] + aria-required="true" [% END %]>[% defaultcontent FILTER html %]</textarea> diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 279f29c71..c5667bd27 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1473,6 +1473,11 @@ [% title = "New Password Needed" %] You cannot change your password without choosing a new one. + [% ELSIF error == "required_field" %] + [% title = "Field Must Be Set" %] + A value must be set for the '[% field_descs.${field.name} FILTER html %]' + field. + [% ELSIF error == "require_summary" %] [% title = "Summary Needed" %] You must enter a summary for this [% terms.bug %]. |