Adding Custom Field Types (specifically: Date)

I’m interested in adding a Date type for custom fields. However, I’m not
entirely sure how this might be done. Is it as simple as adding the type
to the hash defined in lib/RT/CustomField_Overlay.pm (which modified
would, of course, be lib/RT/CustomField_Local.pm) and then creating the
appropriate local/html/Elements/EditCustomFieldDate file?

Also, I noticed in the docs/design_docs/evil_plans file it mentions that
this would be a ‘Nice’ feature to have. Does that mean there is already
work happening on this at BP? If anyone is working on this, I would be
willing to help.

Thanks.

Joshua Colson jcolson@realm.ination.cc

I’m interested in adding a Date type for custom fields. However, I’m not
entirely sure how this might be done. Is it as simple as adding the type
to the hash defined in lib/RT/CustomField_Overlay.pm (which modified
would, of course, be lib/RT/CustomField_Local.pm) and then creating the
appropriate local/html/Elements/EditCustomFieldDate file?

That sounds about right. I think you want a viewer component for it too.

Also, I noticed in the docs/design_docs/evil_plans file it mentions that
this would be a ‘Nice’ feature to have. Does that mean there is already
work happening on this at BP? If anyone is working on this, I would be
willing to help.

We’re not currently doing anything along these lines. My humble request
would be “start with 3.6”, as it’s had a lot of CF work that might be
useful to you.

We’re not currently doing anything along these lines. My humble request
would be “start with 3.6”, as it’s had a lot of CF work that might be
useful to you.

I already have. As it will be going gold soon, why would I start any
place else. :slight_smile:

Thanks

Joshua Colson jcolson@realm.ination.cc

Also, I noticed in the docs/design_docs/evil_plans file it mentions that
this would be a ‘Nice’ feature to have. Does that mean there is already
work happening on this at BP? If anyone is working on this, I would be
willing to help.

We’re not currently doing anything along these lines. My humble request
would be “start with 3.6”, as it’s had a lot of CF work that might be
useful to you.

I’ve gotten a Custom Field of Type ‘Date’ working in my development
environment. However, it is fairly simple (as the Custom Fields are just
varchar/text fields) and only stores what you put in the text box (which
may not be a date). Effectively the only advantage is that it is now
consistent with the other Date fields in that you can click the adjacent
link to select a date from the Calendar Pop-up. In the interest of
getting a patch accepted, what else would BP like for it to do, if
anything? My thoughts were to add some code such as
ProcessCustomFieldDates() in Web.pm to mimic the behavior of the
ProcessTicketDates() sub for the true Date types.

Thoughts, suggestions, criticism appreciated.

Thanks.

Joshua Colson jcolson@realm.ination.cc

[Sorry for the delay in my reply. I’ve been working nights to get Date
support in Jifty better. So dates have been on my mind, if not exactly
these dates]

I’ve gotten a Custom Field of Type ‘Date’ working in my development
environment. However, it is fairly simple (as the Custom Fields are just
varchar/text fields) and only stores what you put in the text box (which
may not be a date). Effectively the only advantage is that it is now
consistent with the other Date fields in that you can click the adjacent
link to select a date from the Calendar Pop-up. In the interest of
getting a patch accepted, what else would BP like for it to do, if
anything?

I think we might want to add hooks to RT::CustomField to let it
Canonicalize and Validate fields of a certain type, that way they’ll
work right at all API levels.

We’ll eventually want to have the search operators for certain custom
field types hooked too. So you can search for before/after on custom
field dates.