Opened 13 years ago
Closed 13 years ago
#8962 closed enhancement (fixed)
[PATCH] root=self option to automatically refer to current ticket when used within a ticket
Reported by: | Patrick Schaaf | Owned by: | Chris Nelson |
---|---|---|---|
Priority: | normal | Component: | TracJsGanttPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
This patch enables a special value for the root=ID
macro option,
written as root=self
. It can be used (and only makes sense) when the macro is embedded within a ticket, e.g. in the description of the parent of a tree of child/sub tickets.
Using root=self
automatically determines the ticket ID of the current ticket by looking at the URL path_info (numeric stuff after /ticket/), and then uses that as the single root for the display.
While it is possibly for users with TICKET_EDIT_DESCRIPTION permission to edit the description after ticket creation, when they know the ticket ID, that is not the case for some users. This patch helps that situation, as the macro can be put into the description during ticket creation.
Also, when using clone, or other kinds of description-inheriting other-ticket creation, a description-embedded gantt macro call with root=self
will continue to work, without having to adapt the root=ID
to the newly created ticket.
The patch is patterned after a patch I did for ProgressMeterMacro, for the same reasons - see #8917
Attachments (1)
Change History (7)
Changed 13 years ago by
Attachment: | tracjsganttplugin-root-self.patch added |
---|
comment:1 Changed 13 years ago by
Status: | new → assigned |
---|
Replying to bof:
This patch enables a special value for the
root=ID
macro option, written asroot=self
. It can be used (and only makes sense) when the macro is embedded within a ticket, e.g. in the description of the parent of a tree of child/sub tickets. ...
Nice! Thanks.
comment:2 Changed 13 years ago by
Note https://trac-hacks.org/ticket/8961#comment:4 - when my options handling rework is applied, the condition for testing whether root has been specified, must change - but it isn't changed in the patch in this ticket (which was created against the still unchanged svn of this afternoon).
Hope this is not too confusing. I'll stop working on four fronts at once, now :)
Oh, and thanks a lot for the fast accepting of the tickets and initial feedback - it's the first time I get feedback on trac-hacks tickets, after five or six other patches to other plugins just sit in the databases...
comment:3 Changed 13 years ago by
(For some reason, my commit didn't link here automatically.)
(In [10408]) Allow "self" as a value for "root". Refs #8962.
When including a Gantt in a ticket description, root=self will show the children without an explicit ticket ID. This is useful in ticket templates and when cloning tickets so they don't need to be edited.
Thanks to bof for the patch!
comment:4 follow-up: 5 Changed 13 years ago by
Thanks for including all my patches! I'll replace my current local stuff tomorrow and test it through under 0.11.7 and 0.12.2.
Your last changeset, for setup.py, looks fishy - some cryptic stuff appears before the shebang.
comment:5 Changed 13 years ago by
Replying to bof:
Thanks for including all my patches! I'll replace my current local stuff tomorrow and test it through under 0.11.7 and 0.12.2.
I didn't include the openClosedTickets
change since I'm going to do something else with that.
Your last changeset, for setup.py, looks fishy - some cryptic stuff appears before the shebang.
Fixed. Thanks. (You wouldn't believe the setup I'm working in right now. Verrrrrrry slow network.)
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
root=self macro argument to refer to current ticket (when used in ticket description)