]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 414236 Ð show_bug.cgi: Remove the knob in favor of normal <select> boxes
authorguy.pyrzak%gmail.com <>
Thu, 10 Apr 2008 21:33:15 +0000 (21:33 +0000)
committerguy.pyrzak%gmail.com <>
Thu, 10 Apr 2008 21:33:15 +0000 (21:33 +0000)
Patch By Guy Pyrzak<guy.pyrzak@gmail.com> r=mkanat, a=LpSolit.
Removes knob from edit single and edit multiple bugs.

Bugzilla/Bug.pm
buglist.cgi
js/field.js
process_bug.cgi
skins/contrib/Dusk/global.css
skins/standard/buglist.css
skins/standard/show_bug.css
template/en/default/bug/edit.html.tmpl
template/en/default/bug/knob.html.tmpl
template/en/default/global/code-error.html.tmpl
template/en/default/list/edit-multiple.html.tmpl

index e523db6aefc9d6ae0c790b5c9d7ce37c128ad7c2..0087b3b85686caee6c8b04ee5d59368e5565a7f1 100755 (executable)
@@ -2560,7 +2560,7 @@ sub choices {
     }
 
     # Hack - this array contains "". See bug 106589.
-    my @res = grep ($_, @{settable_resolutions()});
+    my @res = grep ($_, @{get_legal_field_values('resolution')});
 
     $self->{'choices'} =
       {
@@ -2579,22 +2579,6 @@ sub choices {
     return $self->{'choices'};
 }
 
-# List of resolutions that may be set directly by hand in the bug form.
-# 'MOVED' and 'DUPLICATE' are excluded from the list because setting
-# bugs to those resolutions requires a special process.
-sub settable_resolutions {
-    my $resolutions = get_legal_field_values('resolution');
-    my $pos = lsearch($resolutions, 'DUPLICATE');
-    if ($pos >= 0) {
-        splice(@$resolutions, $pos, 1);
-    }
-    $pos = lsearch($resolutions, 'MOVED');
-    if ($pos >= 0) {
-        splice(@$resolutions, $pos, 1);
-    }
-    return $resolutions;
-}
-
 sub votes {
     my ($self) = @_;
     return 0 if $self->{error};
@@ -2623,35 +2607,6 @@ sub bug_alias_to_id {
         "SELECT bug_id FROM bugs WHERE alias = ?", undef, $alias);
 }
 
-#####################################################################
-# Workflow Control routines
-#####################################################################
-
-sub process_knob {
-    my ($self, $action, $to_resolution, $dupe_of) = @_;
-    my $dbh = Bugzilla->dbh;
-
-    return if $action eq 'none';
-
-    my $dupe_move_status = Bugzilla->params->{'duplicate_or_move_bug_status'};
-    if ($action eq 'duplicate') {
-        $self->set_status($dupe_move_status,
-                          {resolution => 'DUPLICATE', dupe_of => $dupe_of});
-    }
-    elsif ($action eq 'move') {
-        $self->set_status($dupe_move_status, {resolution => 'MOVED'});
-    }
-    elsif ($action eq 'change_resolution') {
-        $self->set_resolution($to_resolution);
-    }
-    elsif ($action eq 'clearresolution') {
-        $self->clear_resolution();
-    }
-    else {
-        $self->set_status($action, {resolution => $to_resolution});
-    }
-}
-
 #####################################################################
 # Subroutines
 #####################################################################
index 43d147b82d7bfa52997c54f3970656e04af6301c..c40e65aed3ee76a2b501383fb45ee0de2b231bb6 100755 (executable)
@@ -1181,7 +1181,7 @@ if ($dotweak && scalar @bugs) {
     $vars->{'op_sys'} = get_legal_field_values('op_sys');
     $vars->{'priorities'} = get_legal_field_values('priority');
     $vars->{'severities'} = get_legal_field_values('bug_severity');
-    $vars->{'resolutions'} = Bugzilla::Bug->settable_resolutions;
+    $vars->{'resolutions'} = get_legal_field_values('resolution');
 
     $vars->{'unconfirmedstate'} = 'UNCONFIRMED';
 
index 6a8019dd57b7957ebab73f237a389961731d9dc8..044c9b6ac3dea124861dbb27f8bf33524b1426ef 100644 (file)
@@ -246,6 +246,56 @@ function initDefaultCheckbox(field_id){
                                  'set_default_' + field_id ); 
 }
 
+function showHideStatusItems(e, dupArrayInfo) {
+    var el = document.getElementById('bug_status');
+    // finish doing stuff based on the selection.
+    if ( el ) {
+        showDuplicateItem(el);
+        YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'none');
+        if (document.getElementById('resolution_settings_warning')) {
+            YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'none');
+        }
+        YAHOO.util.Dom.setStyle('duplicate_display', 'display', 'none');
+
+        if ( el.value == dupArrayInfo[1] && dupArrayInfo[0] == "is_duplicate" ) {
+            YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'inline');
+            YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'block');  
+        }
+        else if (close_status_array.indexOf(el.value) > -1) {
+            // hide duplicate and show resolution
+            YAHOO.util.Dom.setStyle('resolution_settings', 'display', 'inline');
+            YAHOO.util.Dom.setStyle('resolution_settings_warning', 'display', 'block');
+        }
+    }
+}
+
+function showDuplicateItem(e) {
+    var resolution = document.getElementById('resolution');
+    var bug_status = document.getElementById('bug_status');
+    if (resolution) {
+        if (resolution.value == 'DUPLICATE' && close_status_array.indexOf(bug_status.value) > -1 ) {
+            // hide resolution show duplicate
+            YAHOO.util.Dom.setStyle('duplicate_settings', 'display', 'inline');
+            YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'none');
+        }
+        else {
+            YAHOO.util.Dom.setStyle('duplicate_settings', 'display', 'none');
+            YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'block');
+        }
+    }
+    YAHOO.util.Event.preventDefault(e); //prevents the hyperlink from going to the url in the href.
+}
+
+function setResolutionToDuplicate(e, duplicate_or_move_bug_status) {
+    var status = document.getElementById('bug_status');
+    var resolution = document.getElementById('resolution');
+    YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'none');
+    status.value = duplicate_or_move_bug_status;
+    resolution.value = "DUPLICATE";
+    showHideStatusItems("", ["",""]);
+    YAHOO.util.Event.preventDefault(e);
+}
+
 function setDefaultCheckbox(e, field_id ) { 
     var el = document.getElementById(field_id);
     var elLabel = document.getElementById(field_id + "_label");
index 97cd3098d38db23ae3b4129b96349bd2e9641099..cf24c96c919aa3cb7444c6f4a73a7c6e88585c1b 100755 (executable)
@@ -495,23 +495,19 @@ if (!$cgi->param('id') && $cgi->param('dup_id')) {
 # down here, because the validity of status changes depends on other fields,
 # such as Target Milestone.
 foreach my $b (@bug_objects) {
-    if (should_set('knob')) {
-        # First, get the correct resolution <select>, in case there is more
-        # than one open -> closed transition allowed. Allow to fallback to
-        # 'resolution' (useful when called from email_in.pl).
-        my $knob = $cgi->param('knob');
-        my $status = new Bugzilla::Status({name => $knob});
-        my $resolution;
-        if ($status) {
-            $resolution = $cgi->param('resolution_knob_' . $status->id)
-                          || $cgi->param('resolution');
-        }
-        else {
-            $resolution = $cgi->param('resolution_knob_change_resolution');
-        }
-        
-        # Translate the knob values into new status and resolution values.
-        $b->process_knob($knob, $resolution, scalar $cgi->param('dup_id'));
+    if (should_set('bug_status')) {
+        $b->set_status(
+            scalar $cgi->param('bug_status'),
+            {resolution =>  scalar $cgi->param('resolution'),
+                dupe_of => scalar $cgi->param('dup_id')}
+            );
+    }
+    elsif (should_set('resolution')) {
+       $b->set_resolution(scalar $cgi->param('resolution'), 
+                          {dupe_of => scalar $cgi->param('dup_id')});
+    }
+    elsif (should_set('dup_id')) {
+        $b->set_dup_id(scalar $cgi->param('dup_id'));
     }
 }
 
index e13743a19c8089dfca17737a8be0eb72b62700e3..179d8f790cea5ff886c35b07f2f83f26e6a70928 100644 (file)
@@ -123,18 +123,7 @@ hr {
     border-top: 1px solid #c8c8ba;
 }
 
-/* knob */
-
-#knob {
-    background-color: #e6e6d8;
-    border: 1px solid #c8c8ba;
-    padding: 5px;
-    text-align: left;
-}
-
-#knob a {
-    color: #646456;
-}
+/* knob-buttons */
 
 #knob-buttons {
     margin-top: 10px;
index dc3db0e101f0387814f3e7ee99cd902d75ee27d7..71206fcbd915da610490d778d69942c419ab1e78 100644 (file)
@@ -60,3 +60,7 @@ tr.bz_secure_mode_implied td.first-child {
 
 tr.bz_secure_mode_manual td.first-child {
 }
+
+#commit, #action {
+  margin-top: .25em;
+}
index 624a22ee2cfd41db4ed2e444a7f6315e59a78827..cba882cbc4d7c28b17737cf71631b50760010d64 100644 (file)
@@ -36,8 +36,9 @@
     height: 1em;
 }
 
-#bz_field_status {
+#duplicate_settings, #votes_container {
     white-space: nowrap;
+    
 }
 
 .bz_time_tracking_table {
index 8e4cc9e15116e3f43f3b13f001632a248cd81dea..2b70b03a38a3edfbb0dfd06c8f8b538bb6347404 100644 (file)
                      maxrows   = 25
                      cols      = constants.COMMENT_COLS
           %]
-          [% PROCESS bug/knob.html.tmpl %]
+          <br>
+          <div id="knob-buttons">
+            <input type="submit" value="Commit" id="commit">
+            [% IF bug.user.canmove %]
+              <input type="submit" name="action" id="action" value="[% Param("move-button-text") %]">
+            [% END %]
+          </div>
         [% ELSE %]
           <fieldset>
             <legend>Note</legend>
       <td class="field_label">
         <label for="component" accesskey="m">
           <b><a href="describecomponents.cgi?product=[% bug.product FILTER url_quote %]">
-            Co<u>m</u>ponent</a>
+            Co<u>m</u>ponent</a>:
           </b>
-        </label>:
+        </label>
       </td>
       [% PROCESS select selname => "component" %]
     </tr>
         <b><a href="page.cgi?id=fields.html#status">Status</a></b>:
       </td>
       <td id="bz_field_status">
-
-        [% get_status(bug.bug_status) FILTER html %]&nbsp;&nbsp;
-        [% get_resolution(bug.resolution) FILTER html %]
-     
-        [% IF bug.resolution == "DUPLICATE" %]
-          of [% terms.bug %] [%+ "${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]
-        [% END %]
-      
+          [% PROCESS bug/knob.html.tmpl %]
       </td>
     </tr>
  [%###############################################################%]
         <label for="priority" accesskey="i"><b><u>I</u>mportance</b></label>:
       </td>
       <td>
-        <table>
-          <tr>
-            [% PROCESS select selname => "priority" %] 
-            [% PROCESS select selname = "bug_severity" %]
-            [% IF bug.use_votes %]
-            <td>
-              [% IF bug.votes %] 
-                with 
-                <a href="votes.cgi?action=show_bug&amp;bug_id=[% bug.bug_id %]">
-                  [% bug.votes %] vote[%IF bug.votes > 1 %]s[% END %]
-                </a>. 
-              [% END %]    
-            (<a href="votes.cgi?action=show_user&amp;bug_id=
-                      [% bug.bug_id %]#vote_[% bug.bug_id %]">vote</a>)
-            </td>
-            [% END %]
-          </tr>
-        </table>
+        [% PROCESS select selname => "priority" no_td=>1 %] 
+        [% PROCESS select selname = "bug_severity" no_td=>1 %]
+        [% IF bug.use_votes %]
+          <span id="votes_container">
+          [% IF bug.votes %] 
+            with 
+            <a href="votes.cgi?action=show_bug&amp;bug_id=[% bug.bug_id %]">
+              [% bug.votes %] vote[%IF bug.votes > 1 %]s[% END %]
+            </a>. 
+          [% END %]    
+          (<a href="votes.cgi?action=show_user&amp;bug_id=
+                  [% bug.bug_id %]#vote_[% bug.bug_id %]">vote</a>)
+          </span>  
+        [% END %]
       </td>
     </tr>
 
index 432e9b3099a05426051d30f8bda4f1598d0ccf4e..4cf6031e7e74dc25b865407ad91ca5ddda432236 100644 (file)
   # Contributor(s): Gervase Markham <gerv@gerv.net>
   #                 Vaskin Kissoyan <vkissoyan@yahoo.com>
   #                 Frédéric Buclin <LpSolit@gmail.com>
+  #                 Guy Pyrzak <guy.pyrzak@gmail.com>
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
-
-<br>
-<div id="knob">
-  <div id="knob-options">
+<div id="status">
   [% initial_action_shown = 0 %]
+  [% show_resolution = 0 %]
+  [% bug_status_select_displayed = 0 %]
 
+  [% 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 %]
       # 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 %]
-    <input type="radio" id="knob_[% bug_status.id FILTER html %]" name="knob"
-           value="[% bug_status.name FILTER html %]">
-    <label for="knob_[% bug_status.id FILTER html %]">
-      Change status to <b>[% get_status(bug_status.name) FILTER html %]</b>
-    </label>
-    [% IF bug.isopened && !bug_status.is_open %]
-      and set the resolution to [% PROCESS select_resolution field = "knob_${bug_status.id}" %]
+    <option value="[% bug_status.name FILTER html %]">
+      [% get_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 %]
-    <br>
   [% 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 %]
-        <input type="radio" id="knob-clear" name="knob" value="clearresolution">
-        <label for="knob-clear">
-          Clear the resolution (remove the current resolution of
-          <b>[% get_resolution(bug.resolution) FILTER html %]</b>)
-        </label>
-        <br>
       [% END %]
-    [% ELSE %]
-      [% IF bug.resolution != "MOVED" || bug.user.canmove %]
+    [% ELSIF bug.resolution != "MOVED" || bug.user.canmove  %]
         [% PROCESS initial_action %]
-        <input type="radio" id="knob_change_resolution" name="knob" value="change_resolution">
-        <label for="knob_change_resolution">
-          Change <a href="page.cgi?id=fields.html#resolution">resolution</a> to
-        </label>
-        [% PROCESS select_resolution field = "knob_change_resolution" %]
-        <br>
-      [% END %]
+        [% show_resolution = 1 %]
     [% END %]
-
-    [% PROCESS duplicate %]
+  [% END %]  
+  [% IF bug_status_select_displayed %]
+    </select>
+  [% ELSE %]
+      [% get_status(bug.bug_status) FILTER html %]
+      [% IF bug.resolution %]
+        [%+ get_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 %]
-  </div>
-
-  <div id="knob-buttons">
-    <input type="submit" value="Commit" id="commit">
-    [% IF bug.user.canmove %]
-      <input type="submit" name="action" id="action" value="[% Param("move-button-text") %]">
+  [% IF bug.user.canedit || bug.user.isreporter %]  
+    [% IF show_resolution %]
+      <noscript><br>resolved&nbsp;as&nbsp;</noscript>
+      <span id="resolution_settings">[% PROCESS select_resolution %]</span>
     [% END %]
-  </div>
+    <noscript><br> duplicate</noscript>
+    
+    <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>)
+      </span
+      ><input id="dup_id" name="dup_id" size="6"
+              value="[% bug.dup_id FILTER html %]">
+    </span>
+    <div id="dup_id_discoverable" class="bz_default_hidden">
+      <a href="#" id="dup_id_discoverable_action">Mark as Duplicate</a>
+    </div>
+  [% END %]
 </div>
+<script type="text/javascript">
+  var close_status_array = new Array("[% closed_status_array.join('", "') FILTER replace(',$', '')
+                                                                FILTER none %]");
+  YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'block');
+  hideEditableField( "dup_id_container", "dup_id", 'dup_id_edit_action',
+                     'dup_id', '[% bug.dup_id FILTER js %]' )
+  showHideStatusItems( "",  ['[% "is_duplicate" IF bug.dup_id %]',
+                             '[% bug.bug_status FILTER js %]']);
+  YAHOO.util.Event.addListener( 'bug_status', "change", showHideStatusItems,
+                                ['[% "is_duplicate" IF bug.dup_id %]',
+                                 '[% bug.bug_status FILTER js %]']);
+  YAHOO.util.Event.addListener( 'resolution', "change", showDuplicateItem);
+  YAHOO.util.Event.addListener( 'dup_id_discoverable_action',
+                                'click',
+                                setResolutionToDuplicate,
+                                '[% Param('duplicate_or_move_bug_status')
+                                                                FILTER js %]');
+  YAHOO.util.Event.addListener( window, 'load',  showHideStatusItems,
+                              ['[% "is_duplicate" IF bug.dup_id %]',
+                               '[% bug.bug_status FILTER js %]'] );
+</script>
 
 [%# Common actions %]
 
 [% BLOCK initial_action %]
-  [%# Only show 'Leave as' action in combination with another knob %]
   [% IF !initial_action_shown %]
-    <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
-    <label for="knob-leave">
-      Leave as <b>[% get_status(bug.bug_status) FILTER html %]&nbsp;
-                  [% get_resolution(bug.resolution) FILTER html %]</b>
-    </label>
-    <br>
+    <option selected value="[% bug.bug_status FILTER html %]">
+      [% get_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_[% field FILTER html %]"
-          onchange="document.forms['changeform'].[% field FILTER html %].checked=true">
+  <select name="resolution" id="resolution">
     [% FOREACH r = bug.choices.resolution %]
-      <option value="[% r FILTER html %]">[% get_resolution(r) FILTER html %]</option>
+      [% NEXT IF r == "MOVED" && bug.resolution != "MOVED" %]
+      <option value="[% r FILTER html %]"
+      [% "selected" IF r == bug.resolution %]>
+        [% get_resolution(r) FILTER html %]</option>
     [% END %]
   </select>
 [% END %]
-
-[% BLOCK duplicate %]
-  <input type="radio" id="knob_duplicate" name="knob" value="duplicate">
-  <label for="knob_duplicate">
-    Mark the [% terms.bug %] as duplicate of [% terms.bug %] #
-  </label>
-  <input name="dup_id" size="6"
-         onchange="if (this.value != '') {document.forms['changeform'].knob_duplicate.checked=true}">
-  <br>
-[% END %]
index 7e0e1cd70c3bc9d4b349ea7e3e3bba3d0b962a9f..80645a85113ed8c24e6fb7c8252c8addd7a33354 100644 (file)
 
   [% ELSIF error == "undefined_field" %]
     Form field [% field FILTER html %] was not defined.
-    [%# Useful message if browser did not select show_bug radio button %]
-    [% IF field == "knob" %]
-      Check that the "Leave as..." radio button was selected.
-    [% END %]
-
+    
   [% ELSIF error == "unknown_action" %]
     [% IF action %]
        Unknown action [% action FILTER html %]!
index 5607371eb7c7946cf370b94fe40f7c76a168bd9f..fef4c0c997e208bb9dfc72131c77a5f96bc762cc 100644 (file)
@@ -18,6 +18,7 @@
   # Contributor(s): Myk Melez <myk@mozilla.org>
   #                 Max Kanat-Alexander <mkanat@bugzilla.org>
   #                 Frédéric Buclin <LpSolit@gmail.com>
+  #                 Guy Pyrzak <guy.pyrzak@gmail.com>
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
       </td>
     [% END %]
   </tr>
-
+  
+  <tr>
+    <th><label for="bug_status">Status:</label></th>
+    <td colspan="3">[% PROCESS status_section %]</td>
+  </tr>
   [% IF user.in_group(Param("timetrackinggroup")) %]
     <tr>
       <th><label for="estimated_time">Estimated Hours:</label></th>
   [% END %]
 
 [% END %]
-
-[% all_open_bugs = !current_bug_statuses.containsany(closedstates) %]
-[% all_closed_bugs = !current_bug_statuses.containsany(openstates) %]
-[% display_warning = 0 %]
-
-<input id="knob-none" type="radio" name="knob" value="none" checked="checked">
-<label for="knob-none">Do nothing else</label><br>
-
-[% FOREACH bug_status = new_bug_statuses %]
-    <input type="radio" id="knob_[% bug_status.id FILTER html %]" name="knob"
-           value="[% bug_status.name FILTER html %]">
-    <label for="knob_[% bug_status.id FILTER html %]">
-      Change status to <b>[% get_status(bug_status.name) FILTER html %]</b>
-    </label>
-    [%# Closed bugs cannot have their resolution changed this way. %]
-    [% IF !bug_status.is_open && !all_closed_bugs %]
-      and set the resolution to [% PROCESS select_resolution id = bug_status.id %]
-      [%+ "(*)" UNLESS all_open_bugs %]
-      [% display_warning = 1 UNLESS all_open_bugs %]
-    [% END %]
-    <br>
-[% END %]
-
-[%# If all the bugs being changed are open, allow the user to clear their resolution. %]
-[% IF all_open_bugs %]
-  <input id="knob-clearresolution" type="radio" name="knob" value="clearresolution">
-  <label for="knob-clearresolution">Clear the resolution</label><br>
-[% END %]
-
-[%# If all the bugs being changed are closed, allow the user to change their resolution. %]
-[% IF all_closed_bugs %]
-  <input type="radio" id="knob_change_resolution" name="knob" value="change_resolution">
-  <label for="knob_change_resolution">Change resolution to</label>
-  [%+ PROCESS select_resolution id = "change_resolution" %]<br>
-[% END %]
-
-[% IF display_warning %]
-  <p class="box">
-    (*) Note that the resolution will only be applied to open [% terms.bugs %].
-    Already closed [% terms.bugs %] will keep their resolution unchanged.
-  </p>
-[% END %]
-
 <input type="submit" id="commit" value="Commit">
 
 [% IF Param('move-enabled') && user.is_mover %]
   </select>
 [% END %]
 
-[% BLOCK select_resolution %]
-  <select id="resolution_knob_[% id FILTER html %]" name="resolution_knob_[% id FILTER html %]"
-          onchange="document.forms['changeform'].[% "knob_$id" FILTER html %].checked=true">
+[%############################################################################%]
+[%# Status Block                                                             #%]
+[%############################################################################%]
+
+[% BLOCK status_section %]
+  [% all_open_bugs = !current_bug_statuses.containsany(closedstates) %]
+  [% all_closed_bugs = !current_bug_statuses.containsany(openstates) %]
+  [% closed_status_array = [] %]
+  
+  <select name="bug_status" id="bug_status"> 
+    <option value="[% dontchange FILTER html %]" selected="selected">[% dontchange FILTER html %]</option>
+  
+    [% FOREACH bug_status = new_bug_statuses %]
+      <option value="[% bug_status.name FILTER html %]">
+        [% get_status(bug_status.name) FILTER html %]
+      </option>
+      [% IF !bug_status.is_open %]
+        [% filtered_status =  bug_status.name FILTER js %]
+        [% closed_status_array.push( filtered_status ) %]
+      [% END %]
+    [% END %]
+  
+  [%# If all the bugs being changed are closed, allow the user to change their resolution. %]
+  [% IF all_closed_bugs %]
+    [% filtered_status = dontchange FILTER js %]
+    [% closed_status_array.push( filtered_status ) %]
+  [% END %]
+  </select>
+  
+  <span id="resolution_settings">
+  <select id="resolution" name="resolution">
+      <option value="[% dontchange FILTER html %]" selected >[% dontchange FILTER html %]</option>
     [% FOREACH r = resolutions %]
       [% NEXT IF !r %]
+      [% NEXT IF r == "DUPLICATE" || r == "MOVED" %]
       <option value="[% r FILTER html %]">[% get_resolution(r) FILTER html %]</option>
     [% END %]
   </select>
+  </span>
+
+  <script type="text/javascript">
+  var close_status_array = new Array("[% closed_status_array.join('", "') FILTER none %]");
+    YAHOO.util.Event.addListener('bug_status', "change", showHideStatusItems, '[% "is_duplicate" IF bug.dup_id %]');
+    YAHOO.util.Event.onDOMReady( showHideStatusItems );
+  </script>
+
 [% END %]