Modify

Opened 3 years ago

Closed 3 years ago

#8962 closed enhancement (fixed)

[PATCH] root=self option to automatically refer to current ticket when used within a ticket

Reported by: bof Owned by: ChrisNelson
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)

tracjsganttplugin-root-self.patch (1.3 KB) - added by bof 3 years ago.
root=self macro argument to refer to current ticket (when used in ticket description)

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by bof

root=self macro argument to refer to current ticket (when used in ticket description)

comment:1 in reply to: ↑ description Changed 3 years ago by ChrisNelson

  • Status changed from new to assigned

Replying to bof:

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

Nice! Thanks.

comment:2 Changed 3 years ago by bof

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 3 years ago by ChrisNelson

(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: Changed 3 years ago by 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.

Your last changeset, for setup.py, looks fishy - some cryptic stuff appears before the shebang.

comment:5 in reply to: ↑ 4 Changed 3 years ago by ChrisNelson

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 3 years ago by ChrisNelson

  • Resolution set to fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.