Hi Woody,
Sorry for the late reply: lots of work last week, and I wanted to check some code before replying… Haven't had time to to it yet, so here are some quick replies:
About RT-Extentions-CustomFieldGroupings, I see your need, but I don't think such modifications can be written in an extension. This is about changing RT Core behaviour when CustomFields Grouppings are fetched, so most of modifications should be actually in core libraries.
But Best Practical is currently working on something which can more or less fit your request, there is a branch called "config-in-database" for the next RT release:
https://github.com/bestpractical/rt/tree/4.6/config-in-database . Also there is an extension RT-Extension-ConfigInDatabase
https://github.com/bestpractical/rt-extension-configindatabase. I've just quickly checked in the extension, and unfortunately it does not handle $CustomFieldGroupings. But I think this can be the best way to have CustomFieldGroupings editable in the Admin interface.
Le Ven 18 Mai 2018 22:22:17, woody@safarimanager.com a écrit :
Show quoted text> Hi Gérald,
>
> as an addition to the functionality of this plugin, at the moment it's
> conditional on a select field.
>
> could it condition on the existence of a value in a freeform field?
>
> eg
>
> freeform CFs - adults, children, age of children
>
> could "age of children" be conditioned by a value (>0) in the Children
> field?
>
> just an idea
This is a good idea :) I have to think how to best implement it.
I guess that it should include any kind of operation on such fields (>, <, =, !=, LIKE, STARTSWITH, ENDSWITH, IS NULL, etc.). The interface of RT Query Builder could provide some way to do this, in terms of providing an interface to specify the condition.
There is also some specifications to think about concerning how the condition is stored. The condition would be very different from the previous condition, which was only "equal to this value" (so just a value was stored) until you've requested to choose between multiple values, where it was store as an array of values. Also before your ticket, only the id of the CustomFieldValue was stored, but it doesn't work for external CF, so now we store the id of CF and an array of values as strings. If we extend the condition, we have to think about a clever way to store it (maybe storing an additional operation is enough ?)
Finally, to have editing page reacting dynamically when the condition CF is changed, there is some Ajax acting on HTML input fields. Freeform CFs are represented differently in HTML than Select CFs, so I'm afraid most of the code will ends up with a big: if ($cf->Type eq 'Select') { do as now… } else { do something else…}. So maybe it will be cleaner to develop this in a separate extension RT-ConditionalCustomField-Freeform?
That's some stuffs to think about… and unfortunatelly, I just don't know when I will have time to do this. I've just published a fix to RT-ConditionalCustomField to take into account validation (matching pattern, like (?#Mandatory).) on ConditionedBy CF only when condition is fulfilled. In my todo list, I also have to do something when the conditioned is a select with multiple values, for now it works when displayed as list, but not as selectbox (or the opposite, I don't remember).
Maybe it would be better if I create another Wishlist ticket for this ?