[%# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] [%# INTERFACE: # field: a Bugzilla::Field object # value: The value of the field for this bug. # field_hidden (optional): boolean; if true, the field is hidden by default. # override_legal_values (optional): The list of legal values, for select fields. # editable: Whether the field should be displayed as an editable # or as just the plain text of its value. # allow_dont_change: display the --do_not_change-- option for select fields. # value_span: A colspan for the table cell containing # the field value. # no_tds: boolean; if true, don't display the label or the # wrapping for the field. # bug (optional): The current Bugzilla::Bug being displayed, or a hash # with default field values being displayed on a page. #%] [% IF NOT no_tds %] [% field_hidden = 0 %] [% IF bug AND !field.is_visible_on_bug(bug) %] [% field_hidden = 1 %] [% END %] [% INCLUDE "bug/field-label.html.tmpl" hidden = field_hidden %] [% END %] [% Hook.process('start_field_column') %] [% IF editable %] [% SWITCH field.type %] [% CASE [ constants.FIELD_TYPE_FREETEXT constants.FIELD_TYPE_INTEGER ] %] [% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %] [% size = (field.type == constants.FIELD_TYPE_DATE) ? 10 : 20 %] [% CASE constants.FIELD_TYPE_BUG_ID %] [% IF value %] [% value FILTER bug_link(value, use_alias => 1) FILTER none %] [% END %] (edit) [% CASE [ constants.FIELD_TYPE_SINGLE_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 %] [%# When you pass an empty multi-select in the web interface, # it doesn't appear at all in the CGI object. Instead of # forcing all users of process_bug to always specify every # multi-select, we have this field defined if the multi-select # field is defined, and then if this is passed but the multi-select # isn't, we know that the multi-select was emptied. %] [% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %] [% END %] [% END %] [% CASE constants.FIELD_TYPE_TEXTAREA %]
(edit)
[% IF value %]
[% value FILTER html %]
[% END %]
[% INCLUDE global/textarea.html.tmpl id = field.name name = field.name minrows = 4 maxrows = 8 cols = 60 defaultcontent = value mandatory = field.is_mandatory %]
[% CASE constants.FIELD_TYPE_BUG_URLS %] [% IF bug.id && value.size %] [% END %] [% IF Param('use_see_also') %] (add)
[% IF bug.id %] [% END %] [% END %] [% CASE constants.FIELD_TYPE_KEYWORDS %] [% END %] [% ELSE %] [% SWITCH field.type %] [% CASE constants.FIELD_TYPE_TEXTAREA %]
[% value FILTER html %]
[% CASE constants.FIELD_TYPE_BUG_ID %] [% IF value %] [% value FILTER bug_link(value, use_alias => 1) FILTER none %] [% END %] [% CASE [ constants.FIELD_TYPE_SINGLE_SELECT constants.FIELD_TYPE_MULTI_SELECT ] %] [% FOREACH val = value %] [% display_value(field.name, val) FILTER html %] [% ', ' UNLESS loop.last() %] [% END %] [% CASE constants.FIELD_TYPE_BUG_URLS %] [% '' IF value.size %] [% CASE %] [% value.join(', ') FILTER html %] [% END %] [% END %] [% IF bug && field.name == 'component' %] (show other [% terms.bugs %]) [% END %] [% Hook.process('end_field_column') %] [% '' IF NOT no_tds %] [%# for reverse relationships, we show this pseudo-field after the main field %] [% IF bug.id && field.is_relationship %] [% extra_field_item = {} %] [% extra_field_item.header = field.reverse_desc _ ":" FILTER html %] [% extra_field_item.data = BLOCK %] [% FOREACH depbug = bug.related_bugs(field) %] [% depbug.id FILTER bug_link(depbug, use_alias => 1) FILTER none %][% " " %] [% END %] [% END %] [% ELSE %] [% extra_field_item = '' %] [% END %] [% BLOCK bug_url_link %] [% IF bug_url.isa('Bugzilla::BugUrl::Bugzilla::Local') %] [% bug_url.target_bug_id FILTER bug_link(bug_url.target_bug_id, use_alias => 1) FILTER none %] [% ELSE %] [% bug_url.name FILTER html %] [% END %] [% END %]