Hi Eric,

You must import Tags from genshi
from genshi.builder import tag

and try something like this at render_ticket_action_control

control = [] # controls for interface
control.append( tag( [  'to ',
                        tag.input(type='text',
                                  id=id,
                                  name=id,
                                  value='your default value')]))

return ("request more info from", tag(*control), "The owner will change.")

this ideia came from trac/ticket/default_workflow.py

I hope that this can help you

Cheers


On 9/6/07, Erik Andersson <[EMAIL PROTECTED]> wrote:
>
> 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
>
>
> >
>
> 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!!!')
>
>


-- 
Lucas Stephanou

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to