From 2bd57ce8e6f2c2bb59a99d825fc9d181ea2cb4a5 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 27 May 2007 03:27:45 +0000 Subject: Bug 344965: Fix process_bug.cgi and bug/* templates to work with custom bug status workflow - Patch by Frédéric Buclin r=mkanat a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en/default/admin/workflow/comment.html.tmpl | 8 +- template/en/default/admin/workflow/edit.html.tmpl | 16 +-- template/en/default/bug/edit.html.tmpl | 2 +- template/en/default/bug/knob.html.tmpl | 108 ++++++--------------- template/en/default/filterexceptions.pl | 7 +- template/en/default/global/user-error.html.tmpl | 15 ++- template/en/default/list/edit-multiple.html.tmpl | 76 +++++---------- 7 files changed, 84 insertions(+), 148 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/workflow/comment.html.tmpl b/template/en/default/admin/workflow/comment.html.tmpl index 5e9a788d6..df9d5e872 100644 --- a/template/en/default/admin/workflow/comment.html.tmpl +++ b/template/en/default/admin/workflow/comment.html.tmpl @@ -50,24 +50,24 @@   [% FOREACH status = statuses %] - [% status.value FILTER html %] + [% status.name FILTER html %] [% END %] [%# This defines the entry point in the workflow %] - [% p = [{id => 0, value => "{Start}", is_open => 1}] %] + [% p = [{id => 0, name => "{Start}", is_open => 1}] %] [% FOREACH status = p.merge(statuses) %] - [% status.value FILTER html %] + [% status.name FILTER html %] [% FOREACH new_status = statuses %] [% IF workflow.${status.id}.${new_status.id}.defined %] + title="From [% status.name FILTER html %] to [% new_status.name FILTER html %]"> diff --git a/template/en/default/admin/workflow/edit.html.tmpl b/template/en/default/admin/workflow/edit.html.tmpl index dee71c0a1..d602171a1 100644 --- a/template/en/default/admin/workflow/edit.html.tmpl +++ b/template/en/default/admin/workflow/edit.html.tmpl @@ -34,8 +34,12 @@

- This page allows you to define which status transitions are valid - in your workflow. + This page allows you to define which status transitions are valid in your workflow. + For compatibility with older versions of [% terms.Bugzilla %], reopening [% terms.abug %] + will only display either UNCONFIRMED or REOPENED (if allowed by your workflow) but not + both. The decision depends on whether the [% terms.bug %] has ever been confirmed or not. + So it is a good idea to allow both transitions and let [% terms.Bugzilla %] select the + correct one.

@@ -50,24 +54,24 @@   [% FOREACH status = statuses %] - [% status.value FILTER html %] + [% status.name FILTER html %] [% END %] [%# This defines the entry point in the workflow %] - [% p = [{id => 0, value => "{Start}", is_open => 1}] %] + [% p = [{id => 0, name => "{Start}", is_open => 1}] %] [% FOREACH status = p.merge(statuses) %] - [% status.value FILTER html %] + [% status.name FILTER html %] [% FOREACH new_status = statuses %] [% IF status.id != new_status.id %] + title="From [% status.name FILTER html %] to [% new_status.name FILTER html %]"> 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 @@ Status: - [% status_descs.${bug.bug_status} FILTER html %] + [% get_status(bug.bug_status) FILTER html %] 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 # Vaskin Kissoyan + # Frédéric Buclin #%] [% PROCESS global/variables.none.tmpl %] -[%# *** Knob *** %] -
- - [% knum = 1 %] [% initial_action_shown = 0 %] - [% IF bug.isunconfirmed && bug.user.canconfirm %] - [% PROCESS initial_action %] - - -
- [% 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 %] - -
- [% knum = knum + 1 %] [% END %] - - [% PROCESS initial_action %] - - - [% 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 %] - -
- + [% IF bug.user.canmove %] -   |   - + [% END %]
@@ -143,23 +102,20 @@ [% END %] [% BLOCK select_resolution %] - [% FOREACH r = bug.choices.resolution %] [% END %] -
- [% knum = knum + 1 %] [% END %] [% BLOCK duplicate %] - -