]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 314789: 'Leave as {CURRENT STATE}' should not appear unless there is another...
authorolav%bkor.dhs.org <>
Tue, 17 Oct 2006 02:22:57 +0000 (02:22 +0000)
committerolav%bkor.dhs.org <>
Tue, 17 Oct 2006 02:22:57 +0000 (02:22 +0000)
Patch By Olav Vitters <olav@bkor.dhs.org> r=timeless a=myk

template/en/default/bug/knob.html.tmpl

index 00ffcb053c0e433191f17cc98d23afdeb2740081..02b5bed8aba6378ffc98dda3872fd55cfc3e3cf9 100644 (file)
 [%# *** Knob *** %]
 
   <br>
-  <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
-  <label for="knob-leave">
-    Leave as <b>[% status_descs.${bug.bug_status} FILTER html %]&nbsp;
-                [% get_resolution(bug.resolution) FILTER html %]</b>
-  </label>
-  <br>
 
   [% knum = 1 %]
+  [% initial_action_shown = 0 %]
 
   [% IF bug.isunconfirmed && bug.user.canconfirm %]
+    [% PROCESS initial_action %]
     <input type="radio" id="knob-confirm" name="knob" value="confirm">
     <label for="knob-confirm">
       Confirm [% terms.bug %] (change status to <b>[% status_descs.NEW FILTER html %]</b>)
@@ -45,6 +41,7 @@
 
   [% IF bug.isopened && bug.bug_status != "ASSIGNED" && bug.user.canedit
         && (!bug.isunconfirmed || bug.user.canconfirm) %]
+    [% PROCESS initial_action %]
     <input type="radio" id="knob-accept" name="knob" value="accept">
     <label for="knob-accept">
       Accept [% terms.bug %] (
@@ -58,6 +55,7 @@
   [% IF bug.user.canedit || bug.user.isreporter %]
     [% 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
@@ -67,6 +65,7 @@
         [% knum = knum + 1 %]
       [% END %]
 
+      [% PROCESS initial_action %]
       <input type="radio" id="knob-resolve" name="knob" value="resolve">
       <label for="knob-resolve">
         Resolve [% terms.bug %], changing 
     [% ELSE %]
       [% IF bug.resolution != "MOVED" ||
            (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
         [% knum = knum + 1 %]
       [% END %]
       [% IF bug.bug_status == "RESOLVED" %]
+        [% PROCESS initial_action %]
         <input type="radio" id="knob-verify" name="knob" value="verify">
         <label for="knob-verify">
           Mark [% terms.bug %] as <b>[% status_descs.VERIFIED FILTER html %]</b>
         [% knum = knum + 1 %]
       [% END %]
       [% IF bug.bug_status != "CLOSED" %]
+        [% PROCESS initial_action %]
         <input type="radio" id="knob-close" name="knob" value="close">
         <label for="knob-close">
           Mark [% terms.bug %] as <b>[% status_descs.CLOSED FILTER html %]</b>
     [% END %]
   </p>
 
-
 [%# 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>[% status_descs.${bug.bug_status} FILTER html %]&nbsp;
+                  [% get_resolution(bug.resolution) FILTER html %]</b>
+    </label>
+    <br>
+    [% initial_action_shown = 1 %]
+  [% END %]
+[% END %]
+
 [% BLOCK select_resolution %]
   <select name="resolution"
           onchange="document.changeform.knob[[% knum %]].checked=true">