Allow enums to be used in ticket custom value sets
|Reported by:||Colin Guthrie||Owned by:|
I am writing a plugin that just adds a custom ticket field. It is to hold a list of clients to which a ticket "belongs" but that is not really important.
The possible values for this could be quite long and using the
.options value of the .ini file doesn't seem appropriate.
So I thought a sensible route would be to use the enum table to hold the values and write a simple extension to TracWebAdmin to add another editing page page based on AbstractEnumAdminPage type (I'm not sure if this is still part of Trac 0.11 with merged TracWebAdmin tho' :))
Anyway, this patch allows easy use of the enum table and easy ways to hook up custom fields to use that list. This would not really be of use to people unless they create a plugin to admin the actual list too but it's still a useful feature IMO and the patch itself is fairly unobtrusive, so hopefully you can accept it.
The changes just allow a
.options value of "enum:name" where name is the name you give to your enum and this will load the values from the database rather than parsing a pipe-separated list.
The other change was for when an enum name is updated (name changed) and which then updates the ticket table to reflect said changes. I just added a check so that it can update the ticket_custom table instead.
Hope this is acceptable. Not adding my mail here as I don't want it spammed but I will check back for updates. Patches are against 0.10.4