summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-05-27 05:27:45 +0200
committerlpsolit%gmail.com <>2007-05-27 05:27:45 +0200
commit2bd57ce8e6f2c2bb59a99d825fc9d181ea2cb4a5 (patch)
tree6bd15d0b6062217eaf3e7f82eaff89f75715f702 /template/en/default/bug
parent9e81bb0333048f6066610f66614a1ef163917137 (diff)
downloadbugzilla-2bd57ce8e6f2c2bb59a99d825fc9d181ea2cb4a5.tar.gz
bugzilla-2bd57ce8e6f2c2bb59a99d825fc9d181ea2cb4a5.tar.xz
Bug 344965: Fix process_bug.cgi and bug/* templates to work with custom bug status workflow - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/edit.html.tmpl2
-rw-r--r--template/en/default/bug/knob.html.tmpl108
2 files changed, 33 insertions, 77 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 619c594e1..fe3adbbe9 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -595,7 +595,7 @@
<td align="right">
<b><a href="page.cgi?id=fields.html#status">Status</a></b>:
</td>
- <td>[% status_descs.${bug.bug_status} FILTER html %]</td>
+ <td>[% get_status(bug.bug_status) FILTER html %]</td>
</tr>
<tr>
diff --git a/template/en/default/bug/knob.html.tmpl b/template/en/default/bug/knob.html.tmpl
index 0e1a928f4..99aed9c22 100644
--- a/template/en/default/bug/knob.html.tmpl
+++ b/template/en/default/bug/knob.html.tmpl
@@ -18,42 +18,39 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vaskin Kissoyan <vkissoyan@yahoo.com>
+ # Frédéric Buclin <LpSolit@gmail.com>
#%]
[% PROCESS global/variables.none.tmpl %]
-[%# *** Knob *** %]
-
<br>
<div id="knob">
<div id="knob-options">
-
- [% 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>[% get_status("NEW") FILTER html %]</b>)
- </label>
- <br>
- [% knum = knum + 1 %]
- [% END %]
-
- [% IF bug.isopened && bug.bug_status != "ASSIGNED" && bug.user.canedit
- && (!bug.isunconfirmed || bug.user.canconfirm) %]
+ [%# 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.user.canedit && !bug.user.isreporter %]
+ [% NEXT IF !bug_status.is_open && bug_status.is_open && !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") %]
[% PROCESS initial_action %]
- <input type="radio" id="knob-accept" name="knob" value="accept">
- <label for="knob-accept">
- Accept [% terms.bug %] (
- [% IF bug.isunconfirmed %]confirm [% terms.bug %], and [% END %]change
- status to <b>[% get_status("ASSIGNED") FILTER html %]</b>)
+ <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}" %]
+ [% END %]
<br>
- [% knum = knum + 1 %]
[% END %]
+ [%# These actions are special and are independent of the workflow. %]
[% IF bug.user.canedit || bug.user.isreporter %]
[% IF bug.isopened %]
[% IF bug.resolution %]
@@ -64,65 +61,27 @@
<b>[% get_resolution(bug.resolution) FILTER html %]</b>)
</label>
<br>
- [% 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
- <a href="page.cgi?id=fields.html#resolution">resolution</a> to
- </label>
- [% PROCESS select_resolution %]
-
- [% PROCESS duplicate %]
[% ELSE %]
- [% IF bug.resolution != "MOVED" ||
- (bug.resolution == "MOVED" && bug.user.canmove) %]
+ [% IF 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">
+ <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 %]
-
- [% PROCESS duplicate %]
-
- <input type="radio" id="knob-reopen" name="knob" value="reopen">
- <label for="knob-reopen">
- Reopen [% terms.bug %]
- </label>
- <br>
- [% 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>[% get_status("VERIFIED") FILTER html %]</b>
- </label>
+ [% PROCESS select_resolution field = "knob_change_resolution" %]
<br>
- [% 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>[% get_status("CLOSED") FILTER html %]</b>
- </label>
- <br>
- [% knum = knum + 1 %]
[% END %]
[% END %]
+
+ [% PROCESS duplicate %]
[% END %]
</div>
<div id="knob-buttons">
- <input type="submit" value="Commit" id="commit">
+ <input type="submit" value="Commit" id="commit">
[% IF bug.user.canmove %]
- &nbsp; <font size="+1"><b> | </b></font> &nbsp;
- <input type="submit" name="action" id="action"
- value="[% Param("move-button-text") %]">
+ <input type="submit" name="action" id="action" value="[% Param("move-button-text") %]">
[% END %]
</div>
</div>
@@ -143,23 +102,20 @@
[% END %]
[% BLOCK select_resolution %]
- <select name="resolution"
- onchange="document.changeform.knob[[% knum %]].checked=true">
+ <select name="resolution_[% field FILTER html %]"
+ onchange="document.forms['changeform'].[% field FILTER html %].checked=true">
[% FOREACH r = bug.choices.resolution %]
<option value="[% r FILTER html %]">[% get_resolution(r) FILTER html %]</option>
[% END %]
</select>
- <br>
- [% knum = knum + 1 %]
[% END %]
[% BLOCK duplicate %]
- <input type="radio" id="knob-duplicate" name="knob" value="duplicate">
- <label for="knob-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.changeform.knob[[% knum %]].checked=true}">
+ onchange="if (this.value != '') {document.forms['changeform'].knob_duplicate.checked=true}">
<br>
- [% knum = knum + 1 %]
[% END %]