Commit 5a29f6ed authored by Carsten  Rose's avatar Carsten Rose
Browse files

FormElement 'hidden' renamed to 'extra'

UsersManual/Index.rst: updated
FillStoreManual.php, AbstractBuildForm.php: new constant FE_TYPE_EXTRA.
parent 0d45a374
......@@ -507,7 +507,7 @@ Class: Native
|class | enum('native', 'action', | Details below. |
| | 'container') | |
+---------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|type | enum('checkbox', 'date', 'time', 'datetime', 'dateJQW', 'datetimeJQW', 'gridJQW', 'hidden', 'text', 'note', 'password', |
|type | enum('checkbox', 'date', 'time', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'note', 'password', |
| | 'radio', 'select', 'subrecord', 'textarea', 'timeJQW', 'upload', 'fieldset', 'pill', 'before_load', 'before_save', |
| | 'before_insert', 'before_update', 'before_delete', 'after_load', 'after_save', 'after_insert', 'after_update', 'after_delete', |
| | 'feGroup', 'sendmail') |
......@@ -565,7 +565,7 @@ Class: Native
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| Attribute | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
| Attribute | checkbox | dateJQW | datetimeJQW | gridJQW | extra | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+==================+==========+=========+=============+==========+========+=======+======+==========+=======+========+===========+==========+=========+========+
|id |Internal id |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
......@@ -583,7 +583,7 @@ Class: Native
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|class |native |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|type | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
|type | checkbox | dateJQW | datetimeJQW | gridJQW | extra | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|checkType | | - | - | | | - | | - | | | | - | - | |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
......@@ -615,7 +615,7 @@ Class: Native
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|Additional attributes in Field 'parameter'. Typically in key=value format. |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| type | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
| type | checkbox | dateJQW | datetimeJQW | gridJQW | extra | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| accept |? |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
......@@ -709,8 +709,11 @@ Type: datetime
* *showSeconds*: 0|1 - shows the seconds. Independent if the user specifies seconds, they are displayed '1' or not '0'.
* *showZero*: 0|1 - For an empty timestamp, With '0' nothing is displayed. With '1' the string '0000-00-00 00:00:00' is displayed.
Type: hidden
^^^^^^^^^^^^
Type: extra
^^^^^^^^^^^
* Element is not shown in the browser.
* The element can be used to define / precalculate values for a column, which do not already exist as a native FormElement.
* The element is build /computed on form load.
Type: input
^^^^^^^^^^^
......
......@@ -86,7 +86,7 @@ abstract class AbstractBuildForm {
'datetimeJQW' => 'DateJQW',
'email' => 'Input',
'gridJQW' => 'GridJQW',
'hidden' => 'Hidden',
FE_TYPE_EXTRA => 'Extra',
'text' => 'Input',
'time' => 'DateTime',
'note' => 'Note',
......@@ -107,7 +107,7 @@ abstract class AbstractBuildForm {
'datetimeJQW' => 'Native',
'email' => 'Native',
'gridJQW' => 'Native',
'hidden' => 'Native',
FE_TYPE_EXTRA => 'Native',
'text' => 'Native',
'time' => 'Native',
'note' => 'Native',
......@@ -1194,7 +1194,7 @@ abstract class AbstractBuildForm {
* @throws CodeException
* @throws \qfq\UserFormException
*/
public function buildHidden(array $formElement, $htmlFormElementId, $value, array &$json, $mode = FORM_LOAD) {
public function buildExtra(array $formElement, $htmlFormElementId, $value, array &$json, $mode = FORM_LOAD) {
if ($mode === FORM_LOAD) {
// Split 'grId:0' in 'grId' and '0'
......
......@@ -420,6 +420,9 @@ const FE_MODE_SQL = 'modeSql';
// TODO: Konstante FE_DYNAMIC_UPDATE ueberall einsetzen
const FE_DYNAMIC_UPDATE = 'dynamicUpdate';
// FormElement Types
const FE_TYPE_EXTRA = 'extra';
// FormElement columns: via parameter field
const FE_DATE_FORMAT = 'dateFormat'; // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
const FE_SHOW_SECONDS = 'showSeconds'; // value: 0|1
......
......@@ -123,10 +123,10 @@ class FillStoreForm {
// Some Defaults
$formElement = Support::setFeDefaults($formElement);
if ($formElement[FE_TYPE] === 'hidden') {
// Hidden elements will be transferred by SIP
if ($formElement[FE_TYPE] === FE_TYPE_EXTRA) {
// Extra elements will be transferred by SIP
if (!isset($sipValues[$formElement['name']])) {
throw new CodeException("Missing the hidden field '" . $formElement['name'] . "' in SIP.", ERROR_MISSING_HIDDEN_FIELD_IN_SIP);
throw new CodeException("Missing the " . FE_TYPE_EXTRA . " field '" . $formElement['name'] . "' in SIP.", ERROR_MISSING_HIDDEN_FIELD_IN_SIP);
}
$newValues[$formElement['name']] = $sipValues[$formElement['name']];
......
......@@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`mode` ENUM('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'gridJQW', 'hidden', 'text', 'time',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'time',
'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
'before_load', 'before_save', 'before_insert', 'before_update', 'before_delete', 'after_load',
'after_save', 'after_insert', 'after_update', 'after_delete', 'feGroup',
......@@ -209,7 +209,7 @@ VALUES
(2, 'modeSql', 'Mode sql', 'show', 'text', 'all', 'native', 170, '70,2', 255, '', '', '', '', '', '', 100, '', 'no', '', '', '', ''),
(2, 'class', 'Class', 'show', 'select', 'all', 'native', 180, 0, 255, '', '', '{{class:FSRD0:alnumx}}', '', '', '', 100, '', 'yes', '', '', '', ''),
(2, 'type', 'Type', 'show', 'select', 'all', 'native', 190, 0, 255, '', '', '', '', '',
'itemList={{SELECT IF( "{{class:FRD0:alnumx}}"="native","checkbox,date,time,datetime,dateJQW,datetimeJQW,gridJQW,hidden,text,note,password,radio,select,subrecord,upload", IF("{{class:FRD0:alnumx}}"="action","before_load,before_save,before_insert,before_update,before_delete,after_load,after_save,after_insert,after_update,after_delete,feGroup,sendmail", "fieldset,pill") ) }}',
'itemList={{SELECT IF( "{{class:FRD0:alnumx}}"="native","checkbox,date,time,datetime,dateJQW,datetimeJQW,extra,gridJQW,text,note,password,radio,select,subrecord,upload", IF("{{class:FRD0:alnumx}}"="action","before_load,before_save,before_insert,before_update,before_delete,after_load,after_save,after_insert,after_update,after_delete,feGroup,sendmail", "fieldset,pill") ) }}',
100, '', 'no', '', '', '', ''),
(2, 'subrecordOption', 'Subrecord Option', 'show', 'checkbox', 'all', 'native', 200, 0, 0, '', '', '', '', '', '', 100, '', 'no', '', '', '',
''),
......
......@@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`mode` ENUM('show', 'readonly', 'required', 'lock', 'disabled') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'gridJQW', 'hidden', 'text', 'time',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'time',
'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
'before_load', 'before_save', 'before_insert', 'before_update', 'before_delete', 'after_load',
'after_save', 'after_insert', 'after_update', 'after_delete', 'feGroup',
......
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