Cleanup of validation script. Refactor into template to allow customisation of validation.
Explicitly set error element to 'span' as per new jquery-validate support
[ref: CWPBUG-110]
When there are a lot of SubmittedForm records the UserDefinedForm
page takes a long time to load in the CMS, and oftens exceeds
the PHP memory limit well beyond 128M.
Previously UserDefinedForm::getCMSFields() would build a list of
name => value from all SubmittedFormField records, but it would
do this twice, once in getCMSFields() and another time in
UserFormsGridFieldFilterHeader. It would also use the full ORM
to build this list, when all it needs is a map of the Name
and Value columns.
This fixes that to build the columns once in getCMSFields() using
DB::query() and it'll pass those columns along to
UserFormsGridFieldFilterHeader as well so it doesn't do it twice.
- Changed configurable static variables to private as per recent API updates to 3.1
- Use of statics as configurable variables replaced with config api usage
- Make statics private
- Use Config::get rather than eval to read private statics
- Add a helper function to expose UserDefinedForm_EmailRecipient::$summary_fields
(to make them available for i18n).
Implementation of the rules required that a dependent field could only rely on one implementation. This patch joins all those dependencies together in one function to exclude. Tests / a rewrite of this behavior is on the horizon.
The specific situation this is fixing is that when server-side
validation fails and results in form having non-default values. In this
case the visibility might not be correct and will need to be updated.
Also, we cannot rely on onclick events on radio group to find out the
current value when we are loading - instead we need to actually find
out the currently selected radio button.
Fixes the IsBlank and IsNotBlank conditions as well.
The form throws a CSRF error if left for too long by itself. This is
especially important for long forms.
Use local ping function, as the CMS ping returns 403 when BasicAuth is
enabled.
Combined a few tabs so that the interface is a little less cluttered
when adding this module. When this is
fixed:http://open.silverstripe.org/ticket/7268 it is recommended that
user forms add it's own parent tab to the ui to group user forms tabs
together.