diff options
author | mkanat%bugzilla.org <> | 2009-02-08 20:42:19 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-02-08 20:42:19 +0100 |
commit | f65a3e7e20fdfe2f136ecdaa228f0784bb56b9ad (patch) | |
tree | 276bfe21eed5f29153cd15f1f7a16846b8709956 /template/en | |
parent | 88463d2b267baefbfc788f192ffa9f08ea972d51 (diff) | |
download | bugzilla-f65a3e7e20fdfe2f136ecdaa228f0784bb56b9ad.tar.gz bugzilla-f65a3e7e20fdfe2f136ecdaa228f0784bb56b9ad.tar.xz |
Bug 371995: Allow the Product field to restrict visibility of custom fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'template/en')
-rw-r--r-- | template/en/default/admin/custom_fields/cf-js.js.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 9 | ||||
-rw-r--r-- | template/en/default/bug/field.html.tmpl | 12 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 4 |
4 files changed, 16 insertions, 11 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 891f5da76..89a8529ed 100644 --- a/template/en/default/admin/custom_fields/cf-js.js.tmpl +++ b/template/en/default/admin/custom_fields/cf-js.js.tmpl @@ -27,7 +27,7 @@ var select_values = new Array(); [% FOREACH sel_field = Bugzilla.get_fields({ is_select => 1 }) %] select_values[[% sel_field.id FILTER js %]] = [ [% FOREACH legal_value = sel_field.legal_values %] - [[% legal_value.id FILTER js %], '[% legal_value.name FILTER html %]'][% ',' UNLESS loop.last %] + [[% legal_value.id FILTER js %], '[% legal_value.name FILTER js %]'][% ',' UNLESS loop.last %] [% END %] ]; [% END %] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 80c5745fc..527766357 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -369,11 +369,12 @@ [%#############%] [%# PRODUCT #%] [%#############%] + <tr> - <td class="field_label"> - <label for="product" accesskey="p"><b><u>P</u>roduct</b></label>: - </td> - [% PROCESS select selname => "product" %] + [% INCLUDE bug/field.html.tmpl + bug = bug, field = select_fields.product, + desc_url = 'describecomponents.cgi', value = bug.product + editable = bug.check_can_change_field('product', 0, 1) %] </tr> [%###############%] [%# Component #%] diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 04443579e..3ae7302c6 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -30,6 +30,10 @@ # the field value. # no_tds: boolean; if true, don't display the label <th> or the # wrapping <td> for the field. + # desc_url: string; Normally the label of a non-custom field links to + # fields.html. If you want it to link elsewhere, specify the + # relative URL you want to link to, here. Remember to call + # url_quote on any query string arguments. # bug (optional): The current Bugzilla::Bug being displayed, or a hash # with default field values being displayed on a page. #%] @@ -49,13 +53,13 @@ [% IF editable %] <label for="[% field.name FILTER html %]"> [% END %] - [% IF !field.custom %] + [% IF desc_url %] + <a href="[% desc_url FILTER html %]"> + [% ELSIF !field.custom %] <a href="page.cgi?id=fields.html#[% field.name FILTER url_quote %]"> [% END -%] [% field_descs.${field.name} FILTER html %]: - [%- IF !field.custom %] - </a> - [% END %] + [%- '</a>' IF (!field.custom || desc_url) %] [% '</label>' IF editable %] </th> [% END %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 1efee9a5e..570cdc6fe 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -475,8 +475,8 @@ [% ELSIF error == "fieldvalue_is_controller" %] [% title = "Value Controls Other Fields" %] - You cannot delete the '[% value.name FILTER html %]' value for this - field because + You cannot delete the [% value.field.description FILTER html %] + '[% value.name FILTER html %]' because [% IF fields.size %] it controls the visibility of the following fields: [%+ fields.join(', ') FILTER html %]. |