diff options
author | Jesse Clark <jjclark1982@gmail.com> | 2010-02-08 01:10:03 +0100 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-02-08 01:10:03 +0100 |
commit | d73a83506def7c6b43e5ad720777ec700f6af2e8 (patch) | |
tree | ee858870f5355c6551ee18546a82269df2602592 /template/en/default/bug | |
parent | 463c56db162f0b6e13a87c2499557f8dba7b9644 (diff) | |
download | bugzilla-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/bug')
-rw-r--r-- | template/en/default/bug/edit.html.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/bug/field.html.tmpl | 23 | ||||
-rw-r--r-- | template/en/default/bug/show-multiple.html.tmpl | 7 |
3 files changed, 32 insertions, 6 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 63b81d733..1a35df916 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -888,10 +888,16 @@ [% USE Bugzilla %] [% FOREACH field = Bugzilla.active_custom_fields %] <tr> - [% PROCESS bug/field.html.tmpl value=bug.${field.name} + [% PROCESS bug/field.html.tmpl value = bug.${field.name} editable = bug.check_can_change_field(field.name, 0, 1) value_span = 2 %] </tr> + [% IF extra_field_item %] + <tr> + <th class="field_label">[% extra_field_item.header FILTER none %]</th> + <td>[% extra_field_item.data FILTER none %]</td> + </tr> + [% END %] [% END %] [% END %] diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index ac62bf7ba..482f88219 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -99,8 +99,8 @@ value="[% value FILTER html %]" size="7"> </span> - [% IF bug.${field.name} %] - [% bug.${field.name} FILTER bug_link(bug.${field.name}) FILTER none %] + [% IF value %] + [% value FILTER bug_link(value, use_alias => 1) FILTER none %] [% END %] <span id="[% field.name FILTER html %]_edit_container" class="edit_me bz_default_hidden"> (<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>) @@ -110,7 +110,7 @@ '[% field.name FILTER js %]_input_area', '[% field.name FILTER js %]_edit_action', '[% field.name FILTER js %]', - "[% bug.${field.name} FILTER js %]"); + "[% value FILTER js %]"); </script> [% CASE [ constants.FIELD_TYPE_SINGLE_SELECT constants.FIELD_TYPE_MULTI_SELECT ] %] @@ -198,11 +198,24 @@ <div class="uneditable_textarea">[% value FILTER wrap_comment(60) FILTER html %]</div> [% ELSIF field.type == constants.FIELD_TYPE_BUG_ID %] - [% IF bug.${field.name} %] - [% bug.${field.name} FILTER bug_link(bug.${field.name}) FILTER none %] + [% IF value %] + [% value FILTER bug_link(value, use_alias => 1) FILTER none %] [% END %] [% ELSE %] [% value.join(', ') FILTER html %] [% END %] [% Hook.process('end_field_column') %] [% '</td>' 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 %] diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index 177bea14f..0949ffc20 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -186,6 +186,13 @@ [% PROCESS bug/field.html.tmpl value=bug.${field.name} editable=0 %] [%# Even-numbered fields get a closing <tr> %] [% '</tr>' IF !(field_counter % 2) %] + [% IF extra_field_item %] + [% field_counter = field_counter + 1 %] + [% '<tr>' IF field_counter % 2 %] + <th>[% extra_field_item.header FILTER none %]</th> + <td>[% extra_field_item.data FILTER none %]</td> + [% '</tr>' IF !(field_counter % 2) %] + [% END %] [% END %] [%# And we have to finish the row if we ended on an odd number. %] [% '<th></th><td></td></tr>' IF field_counter % 2 %] |