On Jan 21, 9:17 am, "Chris Nelson" <chris.nel...@sixnet.com> wrote:
> Roger Oberholtzer wrote:
> > I know this question has been asked in a similar context. But I think
> > I am asking in a different context. I have two things I would like to
> > do:
>
> > 1.
>
> > When an existing ticket is being rendered to be shown in the browser,
> > is it possible to make a link reference in the rendered page that
> > uses the ticket number as part of the link? I do not mean when the
> > ticket is created, since the number does not exist. I would like to
> > point to some per-ticket place. The references are like
> > [//~data/TracData/ticket/NUM], where NUM is the ticket number. I
> > would like NUM replaced by the ticket number.
>
> > Where would I begin to look to add something like this?
>
> Do you want a $NUM like $USER?  I can think of several variables I'd
> like to be available in the ticket context like $MILESTONE, $NUM,
> $COMPONENT, etc.  But $NUM would be a great start!
>
> > 2.
>
> > When a ticket is created (the user has saved a new ticket), I would
> > like to have a directory in the Trac system's file system created. Is
> > there a hook for doing this sort of thing?
>
> > I have yet to modify/add to Trac at this level. Maybe this is the
> > time...
>
> Couldn't you register a ticket change listener?  Wouldn't it know if the
> action was "create"?  (I'm a little out of my depth here but I thought
> that's how it works.)

2.) The AdvancedTicketWorkflowPlugin has a run_external function which
I bet could do the trick.  It passes the ticket number and username.
Just create a script that first checks the user name (if you so wish)
the mkdir /usr/some/dir/ticket/%1 or similiar.

1.)
I asked about this EXACT thing a while back.  Sounds like it might be
time for me to learn how to write a plugin!

in my use case: we create a wiki page for a ticket called /wiki/
AuthorTests/HowToVerify/$NUM
in a wiki text enabled field we have a defaulted setting of
[wiki:AuthorTests/HowToVerify/NUM Verify notes for NUM]
the creator of the ticket then has to edit NUM after creating the
ticket (and thus now knowing the ticket number) to make this a wiki
link.
Later when the ticket is closed, the dev can click through the gray
link, and create the test notes page via template.
We also in our wiki template mentioned have back links to , you
guessed it NUM, which needs to edited by the dev (that is why the
naming scheme is what it is, the wiki page basename is just a
number.  ...../1 ..../2 ..../300 etc.

I was hoping/planning to find a way on render to just replace $self
with "basename"  for a ticket, that would just be the ticket number,
for a wiki page, it would be the base name of the wikipage, which in
my use case, just happens to be a number, and the creation mechanism
makes the number the same as the ticket number.

Wow, it seems much simpler in my head than the way I explained it.
I am not convinced this needs to be a plugin for my use case, but
might just be edits to the wiki and ticket template files.
But now that I seen this thread, I see $SELF as an extension to the
idea here.  I still think it is a render plugin, and not a creation
one, if that makes any sense.

There is also a plugin that lets you define "page" variables that get
replaced in the wiki which I can't find, but might be a good starting
point.
the IniGet Macro is along a similiar line as well, and may be worth
extending in a similiar manner (best of both worlds?)


-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-us...@googlegroups.com.
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en.


Reply via email to