diff --git a/extension/Documentation/UsersManual/Index.rst b/extension/Documentation/UsersManual/Index.rst index f56153961d49ab2e27a153bf82f6907feef15936..9decea54f8ead6d4bfd6072f6fbbdff6824e59fc 100644 --- a/extension/Documentation/UsersManual/Index.rst +++ b/extension/Documentation/UsersManual/Index.rst @@ -140,11 +140,11 @@ Most fields of a form specification might contain: * Example: - *{{recordid}}* + *{{r}}* *{{SELECT name FROM person WHERE id=1234}}* - *{{SELECT name FROM person WHERE id={{recordid}} }}* + *{{SELECT name FROM person WHERE id={{r}} }}* *{{SELECT name FROM person WHERE id={{key1:C:alnumx}} }}* @@ -208,7 +208,7 @@ Only variables that are known in a specified store can be substituted. +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ | C | Client: POST variable, if not found: GET variable | Parameter sent from the Client (=Browser). | +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ - | T | Typo3: a) Bodytext (ttcontent record), b) Typo3 internal varibles like fe_user_uid, ...| See Typo3 tt_content record configuration | + | T | Typo3: a) Bodytext (ttcontent record), b) Typo3 internal varibles like feUser, ... | See Typo3 tt_content record configuration | +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ | V | Vars - Generic variables | | +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ @@ -342,8 +342,8 @@ SQL * Example:: {{SELECT id, name FROM Person}} - {{SELECT id, name, IF({{fe_user}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }} - {{SELECT id, city FROM Address AS adr WHERE adr.p_id={{SELECT id FROM Account AS acc WHERE acc.name={{fe_user}} }} }} + {{SELECT id, name, IF({{feUser}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }} + {{SELECT id, city FROM Address AS adr WHERE adr.p_id={{SELECT id FROM Account AS acc WHERE acc.name={{feUser}} }} }} * Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT: @@ -1453,7 +1453,7 @@ below. +-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+ |<page> |TYPO3 page id or page alias. |The current page: *{{pageId}}* |45 application application&N_param1=1045 | +-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+ -|<recordid> |Effective Record ID stored in hash array. |<empty> |7011 | +|<r> |Effective Record ID stored in hash array. |<empty> |7011 | +-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+ |<text> |Text, wrapped by the link. If there is an icon, text will be displayed to the right of it. |empty string | | +-------------+-------------------------------------------------------------------------------------------------+----------------------------------------------------------+---------------------------------------------------------------+ diff --git a/extension/qfq/qfq/AbstractBuildForm.php b/extension/qfq/qfq/AbstractBuildForm.php index 8925bf2b032565ffda111393cd7cec3a95f46a1f..eeeb828c63218133ce3564913108b8ac3d7138cc 100644 --- a/extension/qfq/qfq/AbstractBuildForm.php +++ b/extension/qfq/qfq/AbstractBuildForm.php @@ -31,8 +31,6 @@ abstract class AbstractBuildForm { protected $formSpec = array(); // copy of the loaded form protected $feSpecAction = array(); // copy of all formElement.class='action' of the loaded form protected $feSpecNative = array(); // copy of all formElement.class='native' of the loaded form - protected $store = null; - protected $evaluate = null; protected $buildElementFunctionName = array(); protected $pattern = array(); protected $wrap = array(); @@ -42,11 +40,18 @@ abstract class AbstractBuildForm { // protected $feDivClass = array(); // Wrap FormElements in <div class="$feDivClass[type]"> + /** + * @var Store + */ + protected $store = null; + /** + * @var Evaluate + */ + protected $evaluate = null; /** * @var string */ private $formId = null; - /** * @var Sip */ @@ -167,9 +172,9 @@ abstract class AbstractBuildForm { $json[] = $jsonTmp; } } else { - $htmlElements = $this->elements($this->store->getVar(SIP_RECORD_ID, STORE_SIP), $filter, 0, $json, $modeCollectFe, $htmlElementNameIdZero, $storeUse); + $recordId = $this->store->getVar(SIP_RECORD_ID, STORE_SIP); + $htmlElements = $this->elements($recordId, $filter, 0, $json, $modeCollectFe, $htmlElementNameIdZero, $storeUse); } - $htmlSip = $this->buildHiddenSip($json); // </form> @@ -353,8 +358,7 @@ abstract class AbstractBuildForm { $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($fe), STORE_SYSTEM); // evaluate current FormElement - $evaluate = new Evaluate($this->store, $this->db); - $formElement = $evaluate->parseArray($fe, $debugStack); + $formElement = $this->evaluate->parseArray($fe, $debugStack); // Some Defaults $formElement = Support::setFeDefaults($formElement); @@ -658,7 +662,7 @@ abstract class AbstractBuildForm { // date/datetime if ($maxLength !== false) { - if (is_numeric($formElement['maxLength'])) { + if (is_numeric($formElement['maxLength']) && $formElement['maxLength'] != 0) { if ($formElement['maxLength'] > $maxLength) { $formElement['maxLength'] = $maxLength; } @@ -687,6 +691,9 @@ abstract class AbstractBuildForm { case 'time': // hh:mm:ss return 8; default: + if (substr($typeSpec, 0, 4) === 'set(' || substr($typeSpec, 0, 5) === 'enum(') { + return $this->maxLengthSetEnum($typeSpec); + } break; } @@ -699,6 +706,29 @@ abstract class AbstractBuildForm { return false; } + /** + * Get the strlen of the longest element in enum('val1','val2',...,'valn') or set('val1','val2',...,'valn') + * + * @param string $typeSpec + * @return int + */ + private function maxLengthSetEnum($typeSpec) { + $startPos = (substr($typeSpec, 0, 4) === 'set(') ? 4 : 5; + $max = 0; + + $valueList = substr($typeSpec, $startPos, strlen($typeSpec) - $startPos - 1); + $valueArr = explode(',', $valueList); + foreach ($valueArr as $value) { + $value = trim($value, "'"); + $len = strlen($value); + if ($len > $max) { + $max = $len; + } + } + + return $max; + } + /** * Builds a HTML attribute list, based on $attributeList. * @@ -840,7 +870,7 @@ abstract class AbstractBuildForm { } if ($formElement['checkBoxMode'] === 'multi') { - $htmlFormElementId .= '[]'; +// $htmlFormElementId .= '[]'; } else { // Fill meaningfull defaults to parameter: checked|unchecked (CHECKBOX_VALUE_CHECKED|CHECKBOX_VALUE_UNCHECKED) $this->prepareCheckboxCheckedUncheckedValue($itemKey, $formElement); @@ -1080,10 +1110,10 @@ abstract class AbstractBuildForm { // Defines which of the checkboxes will be checked. $values = explode(',', $value); - $attributeBase .= Support::doAttribute('name', $htmlFormElementId); +// $attributeBase .= Support::doAttribute('name', $htmlFormElementId); $attributeBase .= Support::doAttribute('data-load', ($formElement['dynamicUpdate'] === 'yes') ? 'data-load' : ''); - $html = $this->buildNativeHidden($htmlFormElementId, ''); + $html = $this->buildNativeHidden(HelperFormElement::prependFormElementIdCheckBoxMulti($htmlFormElementId, 'h'), ''); $orientation = ($formElement['maxLength'] > 1) ? ALIGN_HORIZONTAL : ALIGN_VERTICAL; $checkboxClass = ($orientation === ALIGN_HORIZONTAL) ? 'checkbox-inline' : 'checkbox'; @@ -1093,6 +1123,8 @@ abstract class AbstractBuildForm { for ($ii = 0, $jj = 1; $ii < count($itemKey); $ii++, $jj++) { $jsonValue = false; $attribute = $attributeBase; + $htmlFormElementIdUniq = HelperFormElement::prependFormElementIdCheckBoxMulti($htmlFormElementId, $ii); + $attribute .= Support::doAttribute('name', $htmlFormElementIdUniq); // Do this only the first round. if ($flagFirst) { @@ -1114,8 +1146,6 @@ abstract class AbstractBuildForm { $htmlElement = '<input ' . $attribute . '>' . $value; -// $htmlElement = Support::wrapTag("<label class='$orientation'>", $htmlElement, true); -// $htmlElement = Support::wrapTag("<label>", $htmlElement, true); // With ALIGN_HORIZONTAL: the label causes some trouble: skip it if (($orientation === ALIGN_VERTICAL)) { $htmlElement = Support::wrapTag('<label>', $htmlElement); @@ -1123,6 +1153,7 @@ abstract class AbstractBuildForm { $htmlElement = Support::wrapTag("<div class='$checkboxClass'>", $htmlElement, true); + // control orientation if ($formElement['maxLength'] > 1) { if ($jj == $formElement['maxLength']) { @@ -1134,7 +1165,7 @@ abstract class AbstractBuildForm { } $html .= $htmlElement . $br; - $json[] = $this->getJsonElementUpdate($htmlFormElementId, $jsonValue, $formElement[FE_MODE]); + $json[] = $this->getJsonElementUpdate($htmlFormElementIdUniq, $jsonValue, $formElement[FE_MODE]); } diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index 4a03414a046f9115c731304d1c48edccb531ec63..48ea5915912da5ae3a01471d00072ed9b8556283 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -45,7 +45,7 @@ const RETURN_ARRAY = 'return_array'; const SQL_FORM_ELEMENT_SPECIFIC_CONTAINER = "SELECT *, ? AS 'nestedInFieldSet' FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted = 'no' AND FIND_IN_SET(fe.class, ? ) AND fe.feIdContainer = ? AND fe.enabled='yes' ORDER BY fe.ord, fe.id"; const SQL_FORM_ELEMENT_ALL_CONTAINER = "SELECT *, ? AS 'nestedInFieldSet' FROM FormElement AS fe WHERE fe.formId = ? AND fe.deleted = 'no' AND FIND_IN_SET(fe.class, ? ) AND fe.enabled='yes' ORDER BY fe.ord, fe.id"; -const SQL_FORM_ELEMENT_SIMPLE_ALL_CONTAINER = "SELECT fe.id, fe.name, fe.label, fe.type, fe.checkType, fe.checkPattern, fe.mode, fe.modeSql, fe.parameter FROM FormElement AS fe, Form AS f WHERE f.name = ? AND f.id = fe.formId AND fe.deleted = 'no' AND fe.class = 'native' AND fe.enabled='yes' ORDER BY fe.ord, fe.id"; +const SQL_FORM_ELEMENT_SIMPLE_ALL_CONTAINER = "SELECT fe.id, fe.name, fe.label, fe.type, fe.checkType, fe.checkPattern, fe.mode, fe.modeSql, fe.parameter, fe.dynamicUpdate FROM FormElement AS fe, Form AS f WHERE f.name = ? AND f.id = fe.formId AND fe.deleted = 'no' AND fe.class = 'native' AND fe.enabled='yes' ORDER BY fe.ord, fe.id"; // SANITIZE Classifier const SANITIZE_ALLOW_ALNUMX = "alnumx"; @@ -385,6 +385,8 @@ const FE_SUBRECORD_ROW_TITLE = '_rowTitle'; const FE_TYPE = 'type'; const FE_MODE = 'mode'; const FE_MODE_SQL = 'modeSql'; +// TODO: Konstante FE_DYNAMIC_UPDATE ueberall einsetzen +const FE_DYNAMIC_UPDATE = 'dynamicUpdate'; // FormElement columns: via parameter field const FE_DATE_FORMAT = 'dateFormat'; // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN @@ -431,3 +433,4 @@ const DB_NUM_ROWS = 'numRows'; const DB_AFFECTED_ROWS = 'affectedRows'; const DB_INSERT_ID = 'insertId'; +const COLUMN_CREATED = 'created'; \ No newline at end of file diff --git a/extension/qfq/qfq/Save.php b/extension/qfq/qfq/Save.php index 7e3e58c083ea1f7a1cf6879f4f95bb8da65b521c..56bfe155b4f0da75deaa18cba339e7f5af3e26ae 100644 --- a/extension/qfq/qfq/Save.php +++ b/extension/qfq/qfq/Save.php @@ -89,26 +89,16 @@ class Save { foreach ($tableColumns AS $column) { // Never save a predefined 'id': autoincrement values will be given by database.. - if ($column === 'id') + if ($column === 'id') { continue; + } - // Get related formElement. - $formElement = $this->getFormElementByName($column); - if ($formElement === false) + // Is there a value? Do not forget SIP values. Those do not have necessarily a FormElement. + if (!isset($formValues[$column])) { continue; - - // Some modes means: do not save this column. - switch ($formElement[FE_MODE]) { - case FE_MODE_READONLY: - case FE_MODE_HIDDEN: - continue 2; // 1 for switch, 2 for continue foreach. - default: - break; } - - // Preparation for Log, Debug - $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($formElement), STORE_SYSTEM); + $this->store->setVar(SYSTEM_FORM_ELEMENT, "Column: $column", STORE_SYSTEM); Support::setIfNotSet($formValues, $column); $newValues[$column] = $formValues[$column]; @@ -232,19 +222,6 @@ class Save { return $pathFileName; } - /** - * Get the complete FormElement for $name - * - * @param $name - * @return bool|array if found the FormElement, else false. - */ - private function getFormElementByName($name) { - foreach ($this->feSpecNative as $formElement) { - if ($formElement['name'] === $name) - return $formElement; - } - return false; - } /** * Insert new record in table $this->formSpec['tableName']. @@ -303,4 +280,18 @@ class Save { return $rc; } + /** + * Get the complete FormElement for $name + * + * @param $name + * @return bool|array if found the FormElement, else false. + */ + private function getFormElementByName($name) { + foreach ($this->feSpecNative as $formElement) { + if ($formElement['name'] === $name) + return $formElement; + } + return false; + } + } \ No newline at end of file diff --git a/extension/qfq/qfq/helper/HelperFormElement.php b/extension/qfq/qfq/helper/HelperFormElement.php index 958c4fcfad24d12fd94f60ad570c7fe9e20b824c..da5cb214d9d733f103d9e476bde56cdf5b6e6c66 100644 --- a/extension/qfq/qfq/helper/HelperFormElement.php +++ b/extension/qfq/qfq/helper/HelperFormElement.php @@ -61,8 +61,8 @@ class HelperFormElement } /** - * @param $field - * @param $id + * @param string $field + * @param string $id * @return string */ public static function buildFormElementId($field, $id) @@ -70,4 +70,13 @@ class HelperFormElement return ($field . ':' . $id); } + /** + * @param string $field + * @param string $index + * @return string + */ + public static function prependFormElementIdCheckBoxMulti($field, $index) { + return ('_' . $index . '_' . $field); + } + } \ No newline at end of file diff --git a/extension/qfq/qfq/helper/Support.php b/extension/qfq/qfq/helper/Support.php index 60fd97cf807a1f79463d2e61f5071e7f9f985991..6bf61440096103f7d2bf86df9e9488174f94913c 100644 --- a/extension/qfq/qfq/helper/Support.php +++ b/extension/qfq/qfq/helper/Support.php @@ -90,8 +90,21 @@ class Support { * @return string */ public static function doAttribute($type, $value, $flagOmitEmpty = true) { - if ($flagOmitEmpty && $value === "") + if ($flagOmitEmpty && $value === "") { return ''; + } + + switch ($type) { + case 'size': + case 'maxlength': + // empty or '0' for attributes of type 'size' or 'maxlenght' result in unsuable input elements: skip this. + if ($value === '' || $value == 0) { + return ''; + } + break; + default: + break; + } return $type . '="' . trim($value) . '" '; } diff --git a/extension/qfq/qfq/store/FillStoreForm.php b/extension/qfq/qfq/store/FillStoreForm.php index 48b66443863d889c239c093104bbabb60a7e111c..023677548e73471e1c552c39123dc0b008824d8c 100644 --- a/extension/qfq/qfq/store/FillStoreForm.php +++ b/extension/qfq/qfq/store/FillStoreForm.php @@ -31,13 +31,21 @@ class FillStoreForm { */ private $feSpecNative = array(); + /** + * @var Evaluate + */ + private $evaluate = null; + /** * */ public function __construct() { + $this->store = Store::getInstance(); $this->db = new Database(); $this->feSpecNative = $this->loadFormElementsBasedOnSIP(); + $this->evaluate = new Evaluate($this->store, $this->db); + } /** @@ -80,7 +88,7 @@ class FillStoreForm { // Retrieve SIP vars, e.g. for HIDDEN elements. $sipValues = $this->store->getStore(STORE_SIP); - // Copy SIP Values; not necessarily defines as FormElements. + // Copy SIP Values; not necessarily defined as a FormElement. foreach ($sipValues as $key => $value) { switch ($key) { case SIP_SIP: @@ -106,21 +114,16 @@ class FillStoreForm { // Preparation for Log, Debug $this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($formElement), STORE_SYSTEM); - // evaluate current FormElement: e.g. FE_MODE_SQL - $evaluate = new Evaluate($this->store, $this->db); - $formElement = $evaluate->parseArray($formElement, $debugStack); + // Evaluate current FormElement: e.g. FE_MODE_SQL + $formElement = $this->evaluate->parseArray($formElement, $debugStack); - // Get related formElement. - // construct the field name used in the form + // Get related formElement. Construct the field name used in the form. $clientFieldName = HelperFormElement::buildFormElementId($formElement['name'], $sipValues[SIP_RECORD_ID]); // Some Defaults $formElement = Support::setFeDefaults($formElement); - // Preparation for Log, Debug -// $this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM); - - if ($formElement[FE_TYPE] == 'hidden') { + if ($formElement[FE_TYPE] === 'hidden') { // Hidden 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); @@ -130,53 +133,72 @@ class FillStoreForm { continue; } + // Checkbox Multi: collect values + if ($formElement[FE_TYPE] === 'checkbox') { + $clientValues[$clientFieldName] = $this->collectMultiValues($clientFieldName, $clientValues); + } + if ($formElement[FE_MODE] === FE_MODE_REQUIRED) { if (!isset($clientValues[$clientFieldName]) || ($clientValues[$clientFieldName] === '')) { throw new UserFormException("Missing required value.", ERROR_REQUIRED_VALUE_EMPTY); } } - switch ($formElement[FE_MODE]) { - case FE_MODE_REQUIRED: - case FE_MODE_SHOW: - if (isset($clientValues[$clientFieldName])) { - - // SELECT MULTI or CHECKBOX MULTI: delivered as array - implode them. - if (is_array($clientValues[$clientFieldName])) { - // E.g. Checkboxes needs a 'HIDDEN' HTML input to detect 'unset' of values. These 'HIDDEN' element - // needs to be removed, if there is at least one checkbox is checked (=submitted) - if (count($clientValues[$clientFieldName]) > 1) - array_shift($clientValues[$clientFieldName]); - - $clientValues[$clientFieldName] = implode(',', $clientValues[$clientFieldName]); - } - - switch ($formElement[FE_TYPE]) { - case 'date': - case 'datetime': - case 'time': - if ($clientValues[$clientFieldName] !== '') // do not check empty values - $newValues[$formElement['name']] = $this->doDateTime($formElement, $clientValues[$clientFieldName]); - break; - default: - $newValues[$formElement['name']] = Sanitize::sanitize($clientValues[$clientFieldName], - $formElement['checkType'], $formElement['checkPattern'], SANATIZE_EXCEPTION); - break; - } + // copy value to $newValues + if (isset($clientValues[$clientFieldName])) { + if ($formElement[FE_DYNAMIC_UPDATE] === 'yes' || $formElement[FE_MODE] === FE_MODE_REQUIRED || $formElement[FE_MODE] === FE_MODE_SHOW) { + switch ($formElement[FE_TYPE]) { + case 'date': + case 'datetime': + case 'time': + if ($clientValues[$clientFieldName] !== '') // do not check empty values + $newValues[$formElement['name']] = $this->doDateTime($formElement, $clientValues[$clientFieldName]); + break; + default: + $newValues[$formElement['name']] = Sanitize::sanitize($clientValues[$clientFieldName], + $formElement['checkType'], $formElement['checkPattern'], SANATIZE_EXCEPTION); + break; } - break; - - case FE_MODE_READONLY: - case FE_MODE_HIDDEN: - continue; - default: - throw new CodeException("Unknown mode: " . $formElement[FE_MODE], ERROR_UNKNOWN_MODE); + } } } $this->store->setVarArray($newValues, STORE_FORM, true); } + /** + * Steps through all $clientValues (POST vars) and collect all with the name _?_${clientFieldName} in a comma seperated string (MYSQL ENUM type). + * If there is no element '_h_${clientFieldName}', than there no multi values - return the already given `$clientValues[$clientFieldName]`. + * + * @param $clientFieldName + * @param array $clientValues + * @return string + */ + private function collectMultiValues($clientFieldName, array $clientValues) { + + $checkboxKey = HelperFormElement::prependFormElementIdCheckBoxMulti($clientFieldName, 'h'); + + // Check there is a hidden value with naming in checkbox multi syntax + if (isset($clientValues[$checkboxKey])) { + $checkboxValue = $clientValues[$checkboxKey]; + + $pattern = '/' . HelperFormElement::prependFormElementIdCheckBoxMulti($clientFieldName, '\d+') . '/'; + foreach ($clientValues as $key => $value) { + if (1 === preg_match($pattern, $key)) { + $checkboxValue .= ',' . $value; + } + } + + if (isset($checkboxValue[0]) && $checkboxValue[0] === ',') { + $checkboxValue = substr($checkboxValue, 1); + } + + $clientValues[$clientFieldName] = $checkboxValue; + } + + return $clientValues[$clientFieldName]; + } + /** * Check $value as date/datime/time value and convert it to FORMAT_DATE_INTERNATIONAL. * diff --git a/extension/qfq/sql/formEditor.sql b/extension/qfq/sql/formEditor.sql index b2e52cf8e7ccfa634862a2a25008b9508876d21f..25032e777464bc8291ed71266cf28b6e323fba2d 100644 --- a/extension/qfq/sql/formEditor.sql +++ b/extension/qfq/sql/formEditor.sql @@ -209,9 +209,9 @@ VALUES (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") ) }}', - 100, '', 'yes', '', '', '', ''), - (2, 'subrecordOption', 'Subrecord Option', 'show', 'checkbox', 'all', 'native', 200, 0, 0, '', '', '', '', '', '', 100, '', 'yes', '', '', '', - '{{SELECT IF(''{{type:F:alnumx}}''=''subrecord'', ''show'',''readonly'')}}'), + 100, '', 'no', '', '', '', ''), + (2, 'subrecordOption', 'Subrecord Option', 'show', 'checkbox', 'all', 'native', 200, 0, 0, '', '', '', '', '', '', 100, '', 'no', '', '', '', + ''), (2, 'checkType', 'Check Type', 'show', 'select', 'all', 'native', 300, 0, 255, '', '', '', '', '', '', 101, '', 'no', '', '', '', ''), (2, 'checkPattern', 'Check Pattern', 'show', 'text', 'all', 'native', 310, 0, 255, '', '', '', '', '', '', 101, '', 'no', '', '', '', ''), (2, 'onChange', 'JS onChange', 'show', 'text', 'all', 'native', 320, 0, 255, '', '', '', '', '', '', 101, '', 'no', '', '', '', ''), diff --git a/extension/qfq/sql/testtables.sql b/extension/qfq/sql/testtables.sql index 82dfeb87f3aae8f55bb7f2303c096ef235fc4536..0e699149f9c453762909d9306551ebe44362192f 100644 --- a/extension/qfq/sql/testtables.sql +++ b/extension/qfq/sql/testtables.sql @@ -1,11 +1,14 @@ DROP TABLE IF EXISTS Person; CREATE TABLE Person ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(128), - firstname VARCHAR(128), - gender ENUM('', 'male', 'female') NOT NULL DEFAULT 'male', - groups SET('', 'a', 'b', 'c') NOT NULL DEFAULT '', - birthday DATE NOT NULL DEFAULT '0000-00-00' + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(128) NOT NULL DEFAULT '', + firstname VARCHAR(128) NOT NULL DEFAULT '', + picture VARCHAR(255) NOT NULL DEFAULT '', + gender ENUM('', 'male', 'female') NOT NULL DEFAULT 'male', + groups SET('', 'a', 'b', 'c') NOT NULL DEFAULT '', + birthday DATE NOT NULL DEFAULT '0000-00-00', + modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ); # @@ -17,12 +20,14 @@ INSERT INTO Person (id, name, firstname, gender, groups) VALUES DROP TABLE IF EXISTS PersFunction; CREATE TABLE PersFunction ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, personId BIGINT, type ENUM('Student', 'Assistant', 'Professor', 'Administration'), - start DATE NOT NULL DEFAULT '0000-00-00', - end DATE NOT NULL DEFAULT '0000-00-00', - note VARCHAR(255) + start DATE NOT NULL DEFAULT '0000-00-00', + end DATE NOT NULL DEFAULT '0000-00-00', + note VARCHAR(255), + modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ); # --------------------------- @@ -73,12 +78,15 @@ VALUES # DROP TABLE IF EXISTS Address; CREATE TABLE Address ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - personId BIGINT, + id BIGINT AUTO_INCREMENT PRIMARY KEY, + personId BIGINT, street VARCHAR(128), city VARCHAR(128), country ENUM('Switzerland', 'Austria', 'France', 'Germany'), - gr_id_typ BIGINT + gr_id_typ BIGINT, + modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' + ); INSERT INTO Address (personId, street, city) VALUES diff --git a/extension/qfq/tests/phpunit/fixtures/TestFormEditor.sql b/extension/qfq/tests/phpunit/fixtures/TestFormEditor.sql index dd8892992eff3cea85fc6145c3cbbb191c6454ad..2e63bda5e18add582406c73d049481390a6d996b 100644 --- a/extension/qfq/tests/phpunit/fixtures/TestFormEditor.sql +++ b/extension/qfq/tests/phpunit/fixtures/TestFormEditor.sql @@ -53,51 +53,52 @@ CREATE TABLE IF NOT EXISTS `Form` ( DROP TABLE IF EXISTS `FormElement`; CREATE TABLE IF NOT EXISTS `FormElement` ( - `id` INT(11) NOT NULL AUTO_INCREMENT, - `formId` INT(11) NOT NULL, - `feIdContainer` INT(11) NOT NULL DEFAULT '0', - `dynamicUpdate` ENUM('yes', 'no') NOT NULL DEFAULT 'no', + `id` INT(11) NOT NULL AUTO_INCREMENT, + `formId` INT(11) NOT NULL, + `feIdContainer` INT(11) NOT NULL DEFAULT '0', + `dynamicUpdate` ENUM('yes', 'no') NOT NULL DEFAULT 'no', - `enabled` ENUM('yes', 'no') NOT NULL DEFAULT 'yes', + `enabled` ENUM('yes', 'no') NOT NULL DEFAULT 'yes', - `name` VARCHAR(255) NOT NULL DEFAULT '', - `label` VARCHAR(255) NOT NULL DEFAULT '', + `name` VARCHAR(255) NOT NULL DEFAULT '', + `label` VARCHAR(255) NOT NULL DEFAULT '', - `mode` ENUM('show', 'readonly', 'required', 'lock', 'disabled') NOT NULL DEFAULT 'show', - `class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native', + `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', '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', - 'sendmail') NOT NULL DEFAULT 'text', - `subrecordOption` SET('edit', 'delete', 'new') NOT NULL DEFAULT '', - `checkType` ENUM('alnumx', 'digit', 'email', 'min|max', 'min|max date', 'pattern', 'all') NOT NULL DEFAULT 'alnumx', + 'sendmail') NOT NULL DEFAULT 'text', + `subrecordOption` SET('edit', 'delete', 'new') NOT NULL DEFAULT '', + `checkType` ENUM('alnumx', 'digit', 'email', 'min|max', 'min|max date', 'pattern', 'all') NOT NULL DEFAULT 'alnumx', - `checkPattern` VARCHAR(255) NOT NULL DEFAULT '', + `checkPattern` VARCHAR(255) NOT NULL DEFAULT '', - `onChange` VARCHAR(255) NOT NULL DEFAULT '', + `onChange` VARCHAR(255) NOT NULL DEFAULT '', - `ord` INT(11) NOT NULL DEFAULT '0', - `tabindex` INT(11) NOT NULL DEFAULT '0', + `ord` INT(11) NOT NULL DEFAULT '0', + `tabindex` INT(11) NOT NULL DEFAULT '0', - `size` VARCHAR(255) NOT NULL DEFAULT '', - `maxLength` VARCHAR(255) NOT NULL DEFAULT '', - `note` TEXT NOT NULL, - `tooltip` VARCHAR(255) NOT NULL DEFAULT '', - `placeholder` VARCHAR(255) NOT NULL DEFAULT '', + `size` VARCHAR(255) NOT NULL DEFAULT '', + `maxLength` VARCHAR(255) NOT NULL DEFAULT '', + `note` TEXT NOT NULL, + `tooltip` VARCHAR(255) NOT NULL DEFAULT '', + `placeholder` VARCHAR(255) NOT NULL DEFAULT '', - `value` TEXT NOT NULL, - `sql1` TEXT NOT NULL, - `sql2` TEXT NOT NULL, - `parameter` TEXT NOT NULL, + `value` TEXT NOT NULL, + `sql1` TEXT NOT NULL, + `sql2` TEXT NOT NULL, + `parameter` TEXT NOT NULL, `clientJs` TEXT, - `feGroup` VARCHAR(255) NOT NULL DEFAULT '', - `debug` ENUM('yes', 'no') NOT NULL DEFAULT 'no', - `deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no', - `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `feGroup` VARCHAR(255) NOT NULL DEFAULT '', + `debug` ENUM('yes', 'no') NOT NULL DEFAULT 'no', + `deleted` ENUM('yes', 'no') NOT NULL DEFAULT 'no', + `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `formId` (`formId`), @@ -126,42 +127,42 @@ INSERT INTO Form (name, title, noteInternal, tableName, permitNew, permitEdit, r 'Form', 'always', 'always', 'bootstrap', '', 'maxVisiblePill=3'); # FormEditor: FormElements -INSERT INTO FormElement (formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer) +INSERT INTO FormElement (formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer, modeSql) VALUES - (1, 'basic', 'Basic', 'show', 'pill', 'container', 10, 0, 0, '', '', '', '', '', '', 0), - (1, 'permission', 'Permission', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0), - (1, 'various', 'Various', 'show', 'pill', 'container', 30, 0, 0, '', '', '', '', '', '', 0), - (1, 'formelement', 'Formelement', 'show', 'pill', 'container', 40, 0, 0, '', '', '', '', '', '', 0), - - (1, 'id', 'id', 'readonly', 'text', 'native', 100, 10, 11, '', '', '', '', '', '', 1), - (1, 'name', 'Name', 'show', 'text', 'native', 120, 40, 255, '', '', '', '', '', 'autofocus=on', 1), - (1, 'title', 'Title', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 1), - (1, 'noteInternal', 'Note', 'show', 'text', 'native', 140, '40,3', 0, '', '', '', '', '', '', 1), - (1, 'tableName', 'Table', 'required', 'select', 'native', 150, 0, 0, '', '', '', '{{!SHOW tables}}', '', 'emptyItemAtStart', 1), - - (1, 'permitNew', 'Permit New', 'show', 'radio', 'native', 160, 0, 0, '', '', '', '', '', '', 2), - (1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'native', 170, 0, 0, '', '', '', '', '', '', 2), - (1, 'permitUrlParameter', 'Permit Url Parameter', 'show', 'text', 'native', 180, 40, 255, '', '', '', '', '', '', 2), - (1, 'render', 'Render', 'show', 'radio', 'native', 190, 0, 0, '', '', '', '', '', '', 2), - - (1, 'multi', 'Multi', 'show', 'fieldset', 'native', 210, 0, 0, '', '', '', '', '', '', 3), - (1, 'multiMode', 'Multi Mode', 'show', 'radio', 'native', 220, 0, 0, '', '', '', '', '', '', 3), - (1, 'multiSql', 'Multi SQL', 'show', 'text', 'native', 230, '40,3', 0, '', '', '', '', '', '', 3), - (1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'native', 240, 40, 255, '', '', '', '', '', '', 3), - (1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'native', 250, 40, 255, '', '', '', '', '', '', 3), - (1, 'forwardMode', 'Forward', 'show', 'radio', 'native', 260, 0, 0, '', '', '', '', '', '', 3), - (1, 'forwardPage', 'Forward Page', 'show', 'text', 'native', 270, 40, 255, '', '', '', '', '', '', 3), - (1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'native', 280, 40, 250, '', '', '', '', '', '', 3), - (1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'native', 290, 40, 250, '', '', '', '', '', '', 3), - (1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'native', 300, 40, 250, '', '', '', '', '', '', 3), - - (1, 'deleted', 'Deleted', 'show', 'checkbox', 'native', 400, 0, 0, '', '', '', '', '', '', 3), - (1, 'modified', 'Modified', 'readonly', 'text', 'native', 410, 40, 20, '', '', '', '', '', '', 3), - (1, 'created', 'Created', 'readonly', 'text', 'native', 420, 40, 20, '', '', '', '', '', '', 3), + (1, 'basic', 'Basic', 'show', 'pill', 'container', 10, 0, 0, '', '', '', '', '', '', 0, ''), + (1, 'permission', 'Permission', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, ''), + (1, 'various', 'Various', 'show', 'pill', 'container', 30, 0, 0, '', '', '', '', '', '', 0, ''), + (1, 'formelement', 'Formelement', 'show', 'pill', 'container', 40, 0, 0, '', '', '', '', '', '', 0, ''), + + (1, 'id', 'id', 'readonly', 'text', 'native', 100, 10, 11, '', '', '', '', '', '', 1, ''), + (1, 'name', 'Name', 'show', 'text', 'native', 120, 40, 255, '', '', '', '', '', 'autofocus=on', 1, ''), + (1, 'title', 'Title', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 1, ''), + (1, 'noteInternal', 'Note', 'show', 'text', 'native', 140, '40,3', 0, '', '', '', '', '', '', 1, ''), + (1, 'tableName', 'Table', 'required', 'select', 'native', 150, 0, 0, '', '', '', '{{!SHOW tables}}', '', 'emptyItemAtStart', 1, ''), + + (1, 'permitNew', 'Permit New', 'show', 'radio', 'native', 160, 0, 0, '', '', '', '', '', '', 2, ''), + (1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'native', 170, 0, 0, '', '', '', '', '', '', 2, ''), + (1, 'permitUrlParameter', 'Permit Url Parameter', 'show', 'text', 'native', 180, 40, 255, '', '', '', '', '', '', 2, ''), + (1, 'render', 'Render', 'show', 'radio', 'native', 190, 0, 0, '', '', '', '', '', '', 2, ''), + + (1, 'multi', 'Multi', 'show', 'fieldset', 'native', 210, 0, 0, '', '', '', '', '', '', 3, ''), + (1, 'multiMode', 'Multi Mode', 'show', 'radio', 'native', 220, 0, 0, '', '', '', '', '', '', 3, ''), + (1, 'multiSql', 'Multi SQL', 'show', 'text', 'native', 230, '40,3', 0, '', '', '', '', '', '', 3, ''), + (1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'native', 240, 40, 255, '', '', '', '', '', '', 3, ''), + (1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'native', 250, 40, 255, '', '', '', '', '', '', 3, ''), + (1, 'forwardMode', 'Forward', 'show', 'radio', 'native', 260, 0, 0, '', '', '', '', '', '', 3, ''), + (1, 'forwardPage', 'Forward Page', 'show', 'text', 'native', 270, 40, 255, '', '', '', '', '', '', 3, ''), + (1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'native', 280, 40, 250, '', '', '', '', '', '', 3, ''), + (1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'native', 290, 40, 250, '', '', '', '', '', '', 3, ''), + (1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'native', 300, 40, 250, '', '', '', '', '', '', 3, ''), + + (1, 'deleted', 'Deleted', 'show', 'checkbox', 'native', 400, 0, 0, '', '', '', '', '', '', 3, ''), + (1, 'modified', 'Modified', 'readonly', 'text', 'native', 410, 40, 20, '', '', '', '', '', '', 3, ''), + (1, 'created', 'Created', 'readonly', 'text', 'native', 420, 40, 20, '', '', '', '', '', '', 3, ''), (1, '', 'FormElements', 'show', 'subrecord', 'native', 500, 0, 0, '', '', '', '{{!SELECT * FROM FormElement WHERE formId={{id:R0}}}}', - '', 'form=formElement\npage=form.php', 4); + '', 'form=formElement\npage=form.php', 4, ''); # @@ -172,45 +173,45 @@ INSERT INTO Form (name, title, noteInternal, tableName, permitNew, permitEdit, r 'FormElement', 'always', 'always', 'bootstrap', '', 'maxVisiblePill=3'); # FormEditor: FormElements -INSERT INTO FormElement (id, formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer, debug) +INSERT INTO FormElement (id, formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer, debug, modeSql) VALUES - (100, 2, 'basic', 'Basic', 'show', 'pill', 'container', 10, 0, 0, '', '', '', '', '', '', 0, 'no'), - (101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no'), - (102, 2, 'layout', 'Layout', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no'), - (103, 2, 'value', 'Value', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no'), - (104, 2, 'info', 'Info', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no'), + (100, 2, 'basic', 'Basic', 'show', 'pill', 'container', 10, 0, 0, '', '', '', '', '', '', 0, 'no', ''), + (101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no', ''), + (102, 2, 'layout', 'Layout', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no', ''), + (103, 2, 'value', 'Value', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no', ''), + (104, 2, 'info', 'Info', 'show', 'pill', 'container', 20, 0, 0, '', '', '', '', '', '', 0, 'no', ''), - (110, 2, 'id', 'id', 'readonly', 'text', 'native', 100, 10, 11, '', '', '', '', '', '', 100, 'no'), - (111, 2, 'formId', 'formId', 'readonly', 'text', 'native', 120, 40, 255, '', '', '', '', '', '', 100, 'no'), + (110, 2, 'id', 'id', 'readonly', 'text', 'native', 100, 10, 11, '', '', '', '', '', '', 100, 'no', ''), + (111, 2, 'formId', 'formId', 'readonly', 'text', 'native', 120, 40, 255, '', '', '', '', '', '', 100, 'no', ''), (112, 2, 'feIdContainer', 'Container', 'show', 'select', 'native', 150, 0, 0, '', '', '', '{{!SELECT fe.id, CONCAT(fe.class, " / ", fe.label) FROM FormElement As fe WHERE fe.formId={{id}} AND fe.class="container" ORDER BY fe.ord }}', - '', 'emptyItemAtStart', 100, 'no'), - (113, 2, 'enabled', 'Enabled', 'show', 'checkbox', 'native', 120, 0, 0, '', '', '', '', '', '', 100, 'no'), - (114, 2, 'name', 'Name', 'show', 'text', 'native', 120, 40, 255, '', '', '', '', '', '', 100, 'no'), - (115, 2, 'label', 'Label', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 100, 'no'), - (116, 2, 'mode', 'Mode', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no'), - (117, 2, 'class', 'Class', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no'), - (118, 2, 'type', 'Type', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no'), - (119, 2, 'checkType', 'Check Type', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 101, 'no'), - (120, 2, 'checkPattern', 'Check Pattern', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no'), - (121, 2, 'onChange', 'JS onChange', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no'), - (122, 2, 'ord', 'Order', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no'), - (123, 2, 'tabindex', 'tabindex', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no'), - (124, 2, 'size', 'Size', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (125, 2, 'maxlenght', 'Maxlength', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (126, 2, 'note', 'note', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (127, 2, 'tooltip', 'Tooltip', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (128, 2, 'placeholder', 'Placeholder', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (129, 2, 'value', 'value', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no'), - (130, 2, 'sql1', 'sql1', 'show', 'text', 'native', 130, '40,4', 255, '', '', '', '', '', '', 103, 'no'), - (131, 2, 'parameter', 'Parameter', 'show', 'text', 'native', 130, '40,4', 255, '', '', '', '', '', '', 103, 'no'), - (132, 2, 'clientJs', 'ClientJS', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 103, 'no'), - (133, 2, 'feGroup', 'feGroup', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 104, 'no'), - (134, 2, 'debug', 'Debug', 'show', 'checkbox', 'native', 130, 0, 0, '', '', '', '', '', '', 104, 'no'), - (135, 2, 'deleted', 'Deleted', 'show', 'checkbox', 'native', 400, 0, 0, '', '', '', '', '', '', 104, 'no'), - (136, 2, 'modified', 'Modified', 'readonly', 'text', 'native', 410, 40, 20, '', '', '', '', '', '', 104, 'no'), - (137, 2, 'created', 'Created', 'readonly', 'text', 'native', 420, 40, 20, '', '', '', '', '', '', 104, 'no'); + '', 'emptyItemAtStart', 100, 'no', ''), + (113, 2, 'enabled', 'Enabled', 'show', 'checkbox', 'native', 120, 0, 0, '', '', '', '', '', '', 100, 'no', ''), + (114, 2, 'name', 'Name', 'show', 'text', 'native', 120, 40, 255, '', '', '', '', '', '', 100, 'no', ''), + (115, 2, 'label', 'Label', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 100, 'no', ''), + (116, 2, 'mode', 'Mode', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no', ''), + (117, 2, 'class', 'Class', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no', ''), + (118, 2, 'type', 'Type', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 100, 'no', ''), + (119, 2, 'checkType', 'Check Type', 'show', 'select', 'native', 120, 0, 255, '', '', '', '', '', '', 101, 'no', ''), + (120, 2, 'checkPattern', 'Check Pattern', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no', ''), + (121, 2, 'onChange', 'JS onChange', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no', ''), + (122, 2, 'ord', 'Order', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no', ''), + (123, 2, 'tabindex', 'tabindex', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 101, 'no', ''), + (124, 2, 'size', 'Size', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (125, 2, 'maxlenght', 'Maxlength', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (126, 2, 'note', 'note', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (127, 2, 'tooltip', 'Tooltip', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (128, 2, 'placeholder', 'Placeholder', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (129, 2, 'value', 'value', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 102, 'no', ''), + (130, 2, 'sql1', 'sql1', 'show', 'text', 'native', 130, '40,4', 255, '', '', '', '', '', '', 103, 'no', ''), + (131, 2, 'parameter', 'Parameter', 'show', 'text', 'native', 130, '40,4', 255, '', '', '', '', '', '', 103, 'no', ''), + (132, 2, 'clientJs', 'ClientJS', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 103, 'no', ''), + (133, 2, 'feGroup', 'feGroup', 'show', 'text', 'native', 130, 40, 255, '', '', '', '', '', '', 104, 'no', ''), + (134, 2, 'debug', 'Debug', 'show', 'checkbox', 'native', 130, 0, 0, '', '', '', '', '', '', 104, 'no', ''), + (135, 2, 'deleted', 'Deleted', 'show', 'checkbox', 'native', 400, 0, 0, '', '', '', '', '', '', 104, 'no', ''), + (136, 2, 'modified', 'Modified', 'readonly', 'text', 'native', 410, 40, 20, '', '', '', '', '', '', 104, 'no', ''), + (137, 2, 'created', 'Created', 'readonly', 'text', 'native', 420, 40, 20, '', '', '', '', '', '', 104, 'no', ''); # FormEditor: Small @@ -221,8 +222,8 @@ INSERT INTO Form (name, title, noteInternal, tableName, permitNew, permitEdit, r 'Person', 'always', 'always', 'bootstrap', '', ''); # FormEditor: FormElements -INSERT INTO FormElement (id, formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer, debug) +INSERT INTO FormElement (id, formId, name, label, mode, type, class, ord, size, maxLength, note, clientJs, value, sql1, sql2, parameter, feIdContainer, debug, modeSql) VALUES - (200, 3, 'name', 'Name', 'show', 'text', 'native', 10, 50, 255, '', '', '', '', '', '', 0, 'no'), - (201, 3, 'firstName', 'Firstname', 'show', 'text', 'native', 10, 50, 255, '', '', '', '', '', '', 0, 'no'); + (200, 3, 'name', 'Name', 'show', 'text', 'native', 10, 50, 255, '', '', '', '', '', '', 0, 'no', ''), + (201, 3, 'firstName', 'Firstname', 'show', 'text', 'native', 10, 50, 255, '', '', '', '', '', '', 0, 'no', '');