On Thu, Jan 26, 2006 at 09:43:59AM +1300, Felix Collins wrote: > Hi All, > I have made some changes to define three new custom field types. This > required no changes to any python code. > > Description of new types: > > integer > Allows only integer values such as "12" and "-98329847" to be entered > into the custom field. > > cumulative_integer > Like integer but only allows the user to enter a value that is added to > the current value. Useful for accumulating work done on a ticket or > dollars spent. > > set_once_integer > Like integer but only allows the user to set a value when the ticket is > created. From then on the value is fixed. > > Syntax of ini file: > > <name> = <type> > > Example: > > [ticket-custom] > mycustominteger = integer > mycustominteger_cumulative = cumulative_integer > mycustominteger_setonce = set_once_integer
This is interesting, but I think adding a new "type" for every potential use somebody comes up with for a ticket field is going to become unwieldy quite quickly. Having a ".onchange" property added to the custom fields might be a more flexible solution, allowing people to add arbitrary JS logic to their custom templates. In conjunction with the (hopefully imminent) workflow changes this would allow field validation through both JavaScript and Python. > I hope someone with commit privileges deems these additions worthy and > merges them. If someone does merge them could they let me know and I'll > update the wiki on the subject. > > If anyone finds any bugs with these fields or they would like to request > further additions to the custom fields, let me know. > > Regards, > Felix > > PS: I added a title attribute to a couple of the input fields to create > a tool-tip. Is this compatible with the Trac standards for HTML? If so > would it be considered useful to add an option to the config file to > allow the administrator to set tool tips on custom fields. Something > like... > > mycustomfield.tooltip = Please enter your value here. (numbers only) This seems like a good idea to me. -- Evolution: Taking care of those too stupid to take care of themselves. _______________________________________________ Trac-dev mailing list [email protected] http://lists.edgewall.com/mailman/listinfo/trac-dev
