diff options
author | mkanat%bugzilla.org <> | 2009-12-12 22:55:15 +0100 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-12-12 22:55:15 +0100 |
commit | e1b433e3d54504dceb151213d4addac42a1e5ca9 (patch) | |
tree | fb5e009cdc8f11a7225cdf09245d8258d41c37b3 /template | |
parent | 391ea1194f07461e99cd9f680a6960bd794cfc5d (diff) | |
download | bugzilla-e1b433e3d54504dceb151213d4addac42a1e5ca9.tar.gz bugzilla-e1b433e3d54504dceb151213d4addac42a1e5ca9.tar.xz |
Bug 512606: Make statuses currently available for the user to change this bug to be controlled by Bugzilla::Bug, not the template
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'template')
-rw-r--r-- | template/en/default/bug/knob.html.tmpl | 123 |
1 files changed, 34 insertions, 89 deletions
diff --git a/template/en/default/bug/knob.html.tmpl b/template/en/default/bug/knob.html.tmpl index 10d58e51b..ac14e6dc0 100644 --- a/template/en/default/bug/knob.html.tmpl +++ b/template/en/default/bug/knob.html.tmpl @@ -23,71 +23,33 @@ [% PROCESS global/variables.none.tmpl %] <div id="status"> - [% initial_action_shown = 0 %] - [% show_resolution = 0 %] - [% bug_status_select_displayed = 0 %] + [% PROCESS bug/field.html.tmpl + no_tds = 1 + field = bug_fields.bug_status + value = bug.bug_status + override_legal_values = bug.choices.bug_status + editable = bug.choices.bug_status.size > 1 + %] - [% closed_status_array = [] %] - [%# These actions are based on the current custom workflow. %] - [% FOREACH bug_status = bug.status.can_change_to %] - [% NEXT IF bug.isunconfirmed && bug_status.is_open && !bug.user.canconfirm %] - [% NEXT IF bug.isopened && !bug.isunconfirmed && bug_status.is_open && !bug.user.canedit %] - [% NEXT IF (!bug_status.is_open || !bug.isopened) && !bug.user.canedit && !bug.user.isreporter %] - [%# Special hack to only display UNCO or REOP when reopening, but not both; - # for compatibility with older versions. %] - [% NEXT IF !bug.isopened && (bug.everconfirmed && bug_status.name == "UNCONFIRMED" - || !bug.everconfirmed && bug_status.name == "REOPENED") %] - [% IF NOT bug_status_select_displayed %] - <select name="bug_status" id="bug_status"> - [% bug_status_select_displayed = 1 %] - [% END %] - [% PROCESS initial_action %] - [% NEXT IF bug_status.name == bug.bug_status %] - <option value="[% bug_status.name FILTER html %]"> - [% display_value("bug_status", bug_status.name) FILTER html %] - </option> - [% IF !bug_status.is_open %] - [% show_resolution = 1 %] - [% filtered_status = bug_status.name FILTER js %] - [% closed_status_array.push( filtered_status ) %] - [% END %] + [% IF bug.resolution + OR bug.check_can_change_field('resolution', bug.resolution, 1) + %] + <noscript><br>resolved as </noscript> [% END %] - [%# These actions are special and are independent of the workflow. %] - [% IF bug.user.canedit || bug.user.isreporter %] - [% IF NOT bug_status_select_displayed %] - <select name="bug_status" id="bug_status"> - [% bug_status_select_displayed = 1 %] - [% END %] - [% IF bug.isopened %] - [% IF bug.resolution %] - [% PROCESS initial_action %] - [% END %] - [% ELSIF bug.resolution != "MOVED" || bug.user.canmove %] - [% PROCESS initial_action %] - [% show_resolution = 1 %] - [% END %] - [% END %] - [% IF bug_status_select_displayed %] - </select> - [% ELSE %] - [% display_value("bug_status", bug.bug_status) FILTER html %] - [% IF bug.resolution %] - [%+ display_value("resolution", bug.resolution) FILTER html %] - [% IF bug.dup_id %] - <span id="duplicate_display">of - [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]</span> - [% END %] - [% END %] - [% END %] - [% IF bug.user.canedit || bug.user.isreporter %] - [% IF show_resolution %] - <noscript><br>resolved as </noscript> - <span id="resolution_settings">[% PROCESS select_resolution %]</span> - [% END %] + <span id="resolution_settings"> + [% PROCESS bug/field.html.tmpl + no_tds = 1 + field = bug_fields.resolution + value = bug.resolution + override_legal_values = bug.choices.resolution + editable = bug.check_can_change_field('resolution', bug.resolution, 1) + %] + </span> + + [% IF bug.check_can_change_field('dup_id', 0, 1) %] <noscript><br> duplicate</noscript> - - <span id="duplicate_settings">of + <span id="duplicate_settings">of <span id="dup_id_container" class="bz_default_hidden"> [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %] (<a href="#" id="dup_id_edit_action">edit</a>) @@ -101,11 +63,20 @@ <div id="dup_id_discoverable" class="bz_default_hidden"> <a href="#" id="dup_id_discoverable_action">Mark as Duplicate</a> </div> + [% ELSIF bug.dup_id %] + <noscript><br> duplicate</noscript> + <span id="duplicate_display">of + [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]</span> [% END %] </div> + <script type="text/javascript"> - var close_status_array = new Array("[% closed_status_array.join('", "') FILTER replace(',$', '') - FILTER none %]"); + var close_status_array = [ + [% FOREACH status = bug.choices.bug_status %] + [% NEXT IF status.is_open %] + '[% status.name FILTER js %]'[% ',' UNLESS loop.last %] + [% END %] + ]; YAHOO.util.Dom.removeClass('dup_id_discoverable', 'bz_default_hidden'); hideEditableField( "dup_id_container", "dup_id", 'dup_id_edit_action', 'dup_id', '[% bug.dup_id FILTER js %]' ) @@ -127,29 +98,3 @@ [% INCLUDE "bug/field-events.js.tmpl" field = select_fields.bug_status %] [% INCLUDE "bug/field-events.js.tmpl" field = select_fields.resolution %] </script> - -[%# Common actions %] - -[% BLOCK initial_action %] - [% IF !initial_action_shown %] - <option selected value="[% bug.bug_status FILTER html %]"> - [% display_value("bug_status", bug.bug_status) FILTER html %] - </option> - [% IF !bug.isopened %] - [% show_resolution = 1 %] - [% filtered_status = bug.bug_status FILTER js %] - [% closed_status_array.push(filtered_status) %] - [% END %] - [% initial_action_shown = 1 %] - [% END %] -[% END %] - -[% BLOCK select_resolution %] - <select name="resolution" id="resolution"> - [% FOREACH r = bug.choices.resolution %] - <option value="[% r.name FILTER html %]" - [% ' selected="selected"' IF r.name == bug.resolution %]> - [% display_value("resolution", r.name) FILTER html %]</option> - [% END %] - </select> -[% END %] |