Hi

I'm trying to create a custom workflow.

I want an action reqmoreinfo which sets the state back to the previous state
and defaults the user to assign it to, to the owner in the previous state.
The ownership must still be selectable.

In trac.ini I have:

workflow = ConfigurableTicketWorkflow,ReqMoreInfoActionController

requestinfo_dev = dev -> new
requestinfo_dev.default = 1
requestinfo_dev.name = request more info from
requestinfo_dev.operations = reqmoreinfo
requestinfo_dev.permissions = TICKET_REQMOREINFO

With this I get a radiobutton with my action which is nice, but I also need
an input field.. How do I do this? Can I overload set_owner somehow?

Please help! :-)

Cheers / Erik

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

from genshi.builder import tag

from trac.core import implements,Component
from trac.ticket.api import ITicketActionController
from trac.perm import IPermissionRequestor
from trac.ticket.default_workflow import ConfigurableTicketWorkflow

class ReqMoreInfoActionController(Component):
    """Provides the admin with a way to delete a ticket.

    Illustrates how to create an action controller with side-effects.

    Don't forget to add `ReqMoreInfoActionController` to the workflow
    option in [ticket].
    If there is no workflow option, the line will look like this:

    workflow = ConfigurableTicketWorkflow,ReqMoreInfoActionController
    """

    implements(ITicketActionController, IPermissionRequestor)

    # IPermissionRequestor methods

    def get_permission_actions(self):
        return ['TICKET_REQMOREINFO']

    # ITicketActionController methods

    def get_ticket_actions(self, req, ticket):
        actions_we_handle = []
        if 'TICKET_REQMOREINFO' in req.perm:
            controller = ConfigurableTicketWorkflow(self.env)
            actions_we_handle = controller.get_actions_by_operation_for_req(
                req, ticket, 'reqmoreinfo')
        self.log.debug('DEBUG: reqmoreinfo handles actions: %r' % 
actions_we_handle)
        return actions_we_handle

    def get_all_status(self):
        return []

    def render_ticket_action_control(self, req, ticket, action):
        return ("request more info from", '', "The owner will change.")

    def get_ticket_changes(self, req, ticket, action):
        return {}

    def apply_action_side_effects(self, req, ticket, action):
        self.log.debug('DEBUG: apply_action_side_effects')
        if action == 'reqmoreinfo':
            self.log.debug('DEBUG: action is reqmoreinfo!!!')

Reply via email to