Commit 624a10d8 authored by Marc Egger's avatar Marc Egger
Browse files

Refs #12346 add new formJson.json to system forms

parent 6a2a35d8
Pipeline #5124 passed with stages
in 3 minutes and 58 seconds
...@@ -520,7 +520,7 @@ class FormAsFile { ...@@ -520,7 +520,7 @@ class FormAsFile {
Thrower::userFormException('Rendering Json Form failed.', "Token '$key' not recognized for column _" . COLUMN_FORM_JSON); Thrower::userFormException('Rendering Json Form failed.', "Token '$key' not recognized for column _" . COLUMN_FORM_JSON);
} }
} }
if (empty($param[TOKEN_FORM_ID]) || !ctype_digit($param[TOKEN_FORM_ID])) { if (!key_exists(TOKEN_FORM_ID, $param) || !ctype_digit($param[TOKEN_FORM_ID])) {
Thrower::userFormException('Rendering Json Form failed.', "The special column '_" . COLUMN_FORM_JSON . "' expects token " . TOKEN_FORM_ID . ' with an integer value.'); Thrower::userFormException('Rendering Json Form failed.', "The special column '_" . COLUMN_FORM_JSON . "' expects token " . TOKEN_FORM_ID . ' with an integer value.');
} }
$formId = intval($param[TOKEN_FORM_ID]); $formId = intval($param[TOKEN_FORM_ID]);
...@@ -724,8 +724,11 @@ class FormAsFile { ...@@ -724,8 +724,11 @@ class FormAsFile {
ERROR_IO_WRITE_FILE); ERROR_IO_WRITE_FILE);
} }
// export all forms if (FEATURE_FORM_FILE_SYNC)
self::exportAllForms($database); {
// export all forms
self::exportAllForms($database);
}
} }
return $absoluteFormPath; return $absoluteFormPath;
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
"parameterLanguageD": "", "parameterLanguageD": "",
"recordLockTimeoutSeconds": 900, "recordLockTimeoutSeconds": 900,
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 09:41:26", "modified": "2021-04-08 19:54:44",
"created": "2021-03-22 11:42:00", "created": "2021-03-22 11:42:00",
"FormElement_ff": [ "FormElement_ff": [
{ {
...@@ -69,11 +69,11 @@ ...@@ -69,11 +69,11 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 10:32:57", "modified": "2021-04-08 19:54:44",
"created": "2021-03-22 11:57:51" "created": "2021-03-22 11:57:51"
}, },
{ {
"dynamicUpdate": "no", "dynamicUpdate": "yes",
"enabled": "yes", "enabled": "yes",
"name": "myJson", "name": "myJson",
"label": "Json", "label": "Json",
...@@ -95,11 +95,11 @@ ...@@ -95,11 +95,11 @@
"bsInputColumns": "", "bsInputColumns": "",
"bsNoteColumns": "", "bsNoteColumns": "",
"rowLabelInputNote": "row,label,\/label,input,\/input,note,\/note,\/row", "rowLabelInputNote": "row,label,\/label,input,\/input,note,\/note,\/row",
"note": "#!report\r\n\r\n# Use Data URI to download given base64 encoded json string as text file\r\n\r\n10.sql = SELECT \r\n '<a download=\"{{name:R}}.json\" class=\"btn btn-default\" href=\"data:application\/octet-stream;base64,'\r\n , {{r:S0}} AS _formJsonBase64\r\n , '\"><i class=\"fas fa-file-download\"><\/i><\/a>'\r\n FROM (SELECT '') AS _fake WHERE {{r:S0}}!=0", "note": "#!report\r\n\r\n# Use Data URI to download given base64 encoded json string as text file\r\n\r\n10.sql = SELECT \r\n '<a download=\"{{name:R}}.json\" class=\"btn btn-default\" href=\"data:application\/octet-stream;base64,'\r\n , 'fid:{{r:S0}}|b64' AS _formJson\r\n , '\"><i class=\"fas fa-file-download\"><\/i><\/a>'\r\n FROM (SELECT '') AS _fake WHERE {{r:S0}}!=0",
"adminNote": "", "adminNote": "",
"tooltip": "", "tooltip": "",
"placeholder": "", "placeholder": "",
"value": "#!report\r\n\r\n10.sql = SELECT {{r:S0}} AS _formJson\r\n\r\n15.sql = SELECT IF({{r:S0}}=0, 'Please save this form first.', '')", "value": "#!report\r\n\r\n10.sql = SELECT CONCAT('fid:{{r:S0}}', IF('{{myReduce:FE:alnumx}}'='yes', '|reduce', '')) AS _formJson\r\n\r\n15.sql = SELECT IF({{r:S0}}=0, 'Please save this form first.', '')",
"sql1": "", "sql1": "",
"parameter": "", "parameter": "",
"parameterLanguageA": "", "parameterLanguageA": "",
...@@ -109,24 +109,64 @@ ...@@ -109,24 +109,64 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 10:45:40", "modified": "2021-04-09 11:06:46",
"created": "2021-03-22 11:44:22" "created": "2021-03-22 11:44:22"
}, },
{
"dynamicUpdate": "yes",
"enabled": "yes",
"name": "myReduce",
"label": "Filter keys",
"mode": "show",
"modeSql": "",
"class": "native",
"type": "radio",
"subrecordOption": "",
"encode": "specialchar",
"checkType": "auto",
"checkPattern": "",
"onChange": "",
"ord": 22,
"tabindex": 0,
"size": "",
"maxLength": "",
"labelAlign": "default",
"bsLabelColumns": "",
"bsInputColumns": "col-md-1",
"bsNoteColumns": "col-md-10",
"rowLabelInputNote": "row,label,\/label,input,\/input,note,\/note,\/row",
"note": "Filter out 'modified' and 'created' as well as all keys holding default values. \r\n<br><b>Caution:<\/b> Edits to the json above are lost on switch.",
"adminNote": "",
"tooltip": "",
"placeholder": "",
"value": "no",
"sql1": "",
"parameter": "buttonClass\r\nitemList=yes,no",
"parameterLanguageA": "",
"parameterLanguageB": "",
"parameterLanguageC": "",
"parameterLanguageD": "",
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-09 11:18:52",
"created": "2021-04-09 09:46:38"
},
{ {
"dynamicUpdate": "no", "dynamicUpdate": "no",
"enabled": "yes", "enabled": "yes",
"name": "", "name": "myBackupNote",
"label": "save Json", "label": "Backups",
"mode": "show", "mode": "show",
"modeSql": "", "modeSql": "",
"class": "action", "class": "native",
"type": "afterSave", "type": "note",
"subrecordOption": "", "subrecordOption": "",
"encode": "specialchar", "encode": "specialchar",
"checkType": "auto", "checkType": "auto",
"checkPattern": "", "checkPattern": "",
"onChange": "", "onChange": "",
"ord": 30, "ord": 25,
"tabindex": 0, "tabindex": 0,
"size": "", "size": "",
"maxLength": "", "maxLength": "",
...@@ -139,9 +179,9 @@ ...@@ -139,9 +179,9 @@
"adminNote": "", "adminNote": "",
"tooltip": "", "tooltip": "",
"placeholder": "", "placeholder": "",
"value": "", "value": "{{ SELECT IF('{{id:RE}}'!='', 'Form backup location: {{qfqProjectPath:Y}}\/form\/.backup\/{{id:RE}}\/', 'Please save this form first.') }}",
"sql1": "", "sql1": "",
"parameter": "saveFormJson={{myJson:FE:all:S}}\r\nsaveFormJsonName={{name:RE:all}}", "parameter": "",
"parameterLanguageA": "", "parameterLanguageA": "",
"parameterLanguageB": "", "parameterLanguageB": "",
"parameterLanguageC": "", "parameterLanguageC": "",
...@@ -149,24 +189,24 @@ ...@@ -149,24 +189,24 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 09:41:26", "modified": "2021-04-09 09:47:27",
"created": "2021-03-24 14:44:04" "created": "2021-04-08 10:40:09"
}, },
{ {
"dynamicUpdate": "no", "dynamicUpdate": "no",
"enabled": "yes", "enabled": "yes",
"name": "", "name": "",
"label": "Delete FE", "label": "save Json",
"mode": "show", "mode": "show",
"modeSql": "", "modeSql": "",
"class": "action", "class": "action",
"type": "beforeDelete", "type": "afterSave",
"subrecordOption": "", "subrecordOption": "",
"encode": "specialchar", "encode": "specialchar",
"checkType": "auto", "checkType": "auto",
"checkPattern": "", "checkPattern": "",
"onChange": "", "onChange": "",
"ord": 40, "ord": 30,
"tabindex": 0, "tabindex": 0,
"size": "", "size": "",
"maxLength": "", "maxLength": "",
...@@ -181,7 +221,7 @@ ...@@ -181,7 +221,7 @@
"placeholder": "", "placeholder": "",
"value": "", "value": "",
"sql1": "", "sql1": "",
"parameter": "sqlAfter={{DELETE FROM FormElement WHERE formId={{id:R}} }}", "parameter": "saveFormJson={{myJson:FE:all:S}}\r\nsaveFormJsonName={{name:RE:all}}",
"parameterLanguageA": "", "parameterLanguageA": "",
"parameterLanguageB": "", "parameterLanguageB": "",
"parameterLanguageC": "", "parameterLanguageC": "",
...@@ -189,24 +229,24 @@ ...@@ -189,24 +229,24 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 09:41:26", "modified": "2021-04-08 19:54:44",
"created": "2021-03-30 09:13:40" "created": "2021-03-24 14:44:04"
}, },
{ {
"dynamicUpdate": "no", "dynamicUpdate": "no",
"enabled": "yes", "enabled": "yes",
"name": "", "name": "",
"label": "Check for double form name", "label": "Delete FE",
"mode": "show", "mode": "show",
"modeSql": "", "modeSql": "",
"class": "action", "class": "action",
"type": "beforeSave", "type": "beforeDelete",
"subrecordOption": "", "subrecordOption": "",
"encode": "specialchar", "encode": "specialchar",
"checkType": "auto", "checkType": "auto",
"checkPattern": "", "checkPattern": "",
"onChange": "", "onChange": "",
"ord": 50, "ord": 40,
"tabindex": 0, "tabindex": 0,
"size": "", "size": "",
"maxLength": "", "maxLength": "",
...@@ -221,7 +261,7 @@ ...@@ -221,7 +261,7 @@
"placeholder": "", "placeholder": "",
"value": "", "value": "",
"sql1": "", "sql1": "",
"parameter": "sqlValidate={{!SELECT f.id FROM Form AS f WHERE f.name!=\"\" AND f.name=\"{{name:F:alnumx}}\" AND f.id!={{id:R0}} }}\r\nexpectRecords=0\r\nmessageFail=There is already another form with the name \"{{name:F:alnumx}}\".", "parameter": "sqlAfter={{DELETE FROM FormElement WHERE formId={{id:R}} }}",
"parameterLanguageA": "", "parameterLanguageA": "",
"parameterLanguageB": "", "parameterLanguageB": "",
"parameterLanguageC": "", "parameterLanguageC": "",
...@@ -229,24 +269,24 @@ ...@@ -229,24 +269,24 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 09:41:26", "modified": "2021-04-08 19:54:44",
"created": "2021-03-30 09:14:48" "created": "2021-03-30 09:13:40"
}, },
{ {
"dynamicUpdate": "no", "dynamicUpdate": "no",
"enabled": "yes", "enabled": "yes",
"name": "myBackupNote", "name": "",
"label": "Backups", "label": "Check for double form name",
"mode": "show", "mode": "show",
"modeSql": "", "modeSql": "",
"class": "native", "class": "action",
"type": "note", "type": "beforeSave",
"subrecordOption": "", "subrecordOption": "",
"encode": "specialchar", "encode": "specialchar",
"checkType": "auto", "checkType": "auto",
"checkPattern": "", "checkPattern": "",
"onChange": "", "onChange": "",
"ord": 60, "ord": 50,
"tabindex": 0, "tabindex": 0,
"size": "", "size": "",
"maxLength": "", "maxLength": "",
...@@ -259,9 +299,9 @@ ...@@ -259,9 +299,9 @@
"adminNote": "", "adminNote": "",
"tooltip": "", "tooltip": "",
"placeholder": "", "placeholder": "",
"value": "{{ SELECT IF('{{id:RE}}'!='', 'Form backup location: {{qfqProjectPath:Y}}\/form\/.backup\/{{id:RE}}\/', 'Please save this form first.') }}", "value": "",
"sql1": "", "sql1": "",
"parameter": "", "parameter": "sqlValidate={{!SELECT f.id FROM Form AS f WHERE f.name!=\"\" AND f.name=\"{{name:F:alnumx}}\" AND f.id!={{id:R0}} }}\r\nexpectRecords=0\r\nmessageFail=There is already another form with the name \"{{name:F:alnumx}}\".",
"parameterLanguageA": "", "parameterLanguageA": "",
"parameterLanguageB": "", "parameterLanguageB": "",
"parameterLanguageC": "", "parameterLanguageC": "",
...@@ -269,8 +309,8 @@ ...@@ -269,8 +309,8 @@
"clientJs": "", "clientJs": "",
"feGroup": "", "feGroup": "",
"deleted": "no", "deleted": "no",
"modified": "2021-04-08 12:40:55", "modified": "2021-04-08 19:54:44",
"created": "2021-04-08 10:40:09" "created": "2021-03-30 09:14:48"
} }
] ]
} }
\ No newline at end of file
Supports Markdown
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