Commit 70ddd6cb authored by Carsten  Rose's avatar Carsten Rose
Browse files

Implements #9617. Add documentation for 'skipRequiredCheck:S' & 'allRequiredGiven:V'

parent 2e0e3a4d
Pipeline #2748 passed with stages
in 3 minutes and 8 seconds
......@@ -1911,6 +1911,9 @@ Store: *VARS* - V
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| slaveId | see `slaveId`_ |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| allRequiredGiven | Form save - Set during check of all required FE. If every *required* FE is given: *1*. Else: *0*. If there is no required FE: *1*. |
| | Even with 'formModeGlobal=skipRequiredCheck', the variable will be set. |
+-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _`store_vars_form_element_upload`:
......@@ -2698,11 +2701,29 @@ Optional it might be defined via *Form.parameter* ::
* `skipRequiredCheck`:
* All `FormElement` with `mode=required`, will switch to `mode=show`.
* The user might save the form without providing all necessary data.
* Calling the form without this mode (regular), the form can only be saved with all data given. Than, e.g. an
action-FormElement 'afterSave' can be used to detect the final submit situation and do some extra stuff,
necessary for a final submit.
* All `FormElement` with `mode=required`, will be handled as `mode=show`.
* The user can save the form without providing all necessary data!
* The user will see complains about missing data - but again, the form data is saved!
* Check `STORE_VARS`_ for the variable `{{allRequiredGiven:V}}` - even without forcing the user to fill out all data,
this variable will show if the form has been filled completely.
* Scenario 1:
* A form has one or more FormElement with 'fe.type=required'.
* Calling the form with `formModeGlobal=skipRequiredCheck` will allow the user to save the form, even if not all
FE.type=required elements are given. Name this the 'draft' mode.
* Calling the form without `formModeGlobal=skipRequiredCheck` (this is the default), forces the user to fill out
all FE.type=required fields. Name this the 'final submit' mode.
* Scenario 2:
* A form has one or more FormElement with 'fe.type=required'.
* Calling the form with `formModeGlobal=skipRequiredCheck` will allow the user to save the form, even if not all
FE.type=required elements are given.
* Define an FE-Action 'afterSave', and do some action on `{{allRequiredGiven:V0}}` like::
{{UPDATE <table> SET dataValid={{allRequiredGiven:V0}} WHERE id={{id:R}} }}
* In your report, mark a button green or red, depending on the saved state.
* `requiredOff` is a deprecated synonym of `skipRequiredCheck`.
......
......@@ -723,7 +723,7 @@ const VAR_FILENAME_BASE = 'filenameBase'; // Original filename of an uploaded fi
const VAR_FILENAME_EXT = 'filenameExt'; // Extension of the original filename of an uploaded file, .
const VAR_FILE_MIME_TYPE = 'mimeType';
const VAR_FILE_SIZE = 'fileSize';
const VAR_ALL_REQUIRED_GIVEN = 'allRequiredGiven'; // 0 if at least one FE is required and value is missing, else 1.
const VAR_ALL_REQUIRED_GIVEN = 'allRequiredGiven'; // If all required FE are given: 1, else: 0. If there is no required FE: 1
// PHP class Typeahead
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment