Alec Thomas wrote:
...
One thing that cboos suggested is to have the default
ITicketActionController allow extra state transitions to be
configurable in trac.ini. Basically dynamically adding to the "actions"
table in DefaultTicketActionController.

In the default workflow, does the 'leave' action really needs
to be explicitly specified?
Or, putting it differently, is there a situation in which
a state transition should be forced?

I think leaving the state unchanged should be always possible.

Index: trac/ticket/api.py
===================================================================
--- trac/ticket/api.py  (revision 2845)
+++ trac/ticket/api.py  (working copy)
@@ -54,12 +54,12 @@
    # ITicketWorkflow methods
    def get_ticket_actions(self, req, ticket):
        ticket_status = ticket['status']
-        default_actions = ['leave', 'reopen']
+        default_actions = ['reopen']
        status_actions = {
-            'new':      ['leave', 'accept', 'resolve', 'reassign' ],
-            'assigned': ['leave',           'resolve', 'reassign' ],
-            'reopened': ['leave',           'resolve', 'reassign' ],
-            'closed':   ['leave', 'reopen'                        ],
+            'new':      ['accept', 'resolve', 'reassign' ],
+            'assigned': [          'resolve', 'reassign' ],
+            'reopened': [          'resolve', 'reassign' ],
+            'closed':   ['reopen'                        ],
        }
action_perms = {'resolve': 'TICKET_MODIFY', 'reassign': 'TICKET_CHGPROP',
                 'accept': 'TICKET_CHGPROP', 'reopen': 'TICKET_CREATE'}
@@ -75,7 +75,7 @@
                         self.config.options('ticket-actions')
                         if action.endswith('.permission')]))

-        return [action for action in status_actions.get(
+        return ['leave'] + [action for action in status_actions.get(
                ticket_status, default_actions)
                if action not in action_perms
                or req.perm.has_permission(action_perms[action])]


-- Christian
_______________________________________________
Trac-dev mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-dev

Reply via email to