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 {
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.');
}
$formId = intval($param[TOKEN_FORM_ID]);
......@@ -724,8 +724,11 @@ class FormAsFile {
ERROR_IO_WRITE_FILE);
}
// export all forms
self::exportAllForms($database);
if (FEATURE_FORM_FILE_SYNC)
{
// export all forms
self::exportAllForms($database);
}
}
return $absoluteFormPath;
}
......
......@@ -29,7 +29,7 @@
"parameterLanguageD": "",
"recordLockTimeoutSeconds": 900,
"deleted": "no",
"modified": "2021-04-08 09:41:26",
"modified": "2021-04-08 19:54:44",
"created": "2021-03-22 11:42:00",
"FormElement_ff": [
{
......@@ -69,11 +69,11 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 10:32:57",
"modified": "2021-04-08 19:54:44",
"created": "2021-03-22 11:57:51"
},
{
"dynamicUpdate": "no",
"dynamicUpdate": "yes",
"enabled": "yes",
"name": "myJson",
"label": "Json",
......@@ -95,11 +95,11 @@
"bsInputColumns": "",
"bsNoteColumns": "",
"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": "",
"tooltip": "",
"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": "",
"parameter": "",
"parameterLanguageA": "",
......@@ -109,24 +109,64 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 10:45:40",
"modified": "2021-04-09 11:06:46",
"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",
"enabled": "yes",
"name": "",
"label": "save Json",
"name": "myBackupNote",
"label": "Backups",
"mode": "show",
"modeSql": "",
"class": "action",
"type": "afterSave",
"class": "native",
"type": "note",
"subrecordOption": "",
"encode": "specialchar",
"checkType": "auto",
"checkPattern": "",
"onChange": "",
"ord": 30,
"ord": 25,
"tabindex": 0,
"size": "",
"maxLength": "",
......@@ -139,9 +179,9 @@
"adminNote": "",
"tooltip": "",
"placeholder": "",
"value": "",
"value": "{{ SELECT IF('{{id:RE}}'!='', 'Form backup location: {{qfqProjectPath:Y}}\/form\/.backup\/{{id:RE}}\/', 'Please save this form first.') }}",
"sql1": "",
"parameter": "saveFormJson={{myJson:FE:all:S}}\r\nsaveFormJsonName={{name:RE:all}}",
"parameter": "",
"parameterLanguageA": "",
"parameterLanguageB": "",
"parameterLanguageC": "",
......@@ -149,24 +189,24 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 09:41:26",
"created": "2021-03-24 14:44:04"
"modified": "2021-04-09 09:47:27",
"created": "2021-04-08 10:40:09"
},
{
"dynamicUpdate": "no",
"enabled": "yes",
"name": "",
"label": "Delete FE",
"label": "save Json",
"mode": "show",
"modeSql": "",
"class": "action",
"type": "beforeDelete",
"type": "afterSave",
"subrecordOption": "",
"encode": "specialchar",
"checkType": "auto",
"checkPattern": "",
"onChange": "",
"ord": 40,
"ord": 30,
"tabindex": 0,
"size": "",
"maxLength": "",
......@@ -181,7 +221,7 @@
"placeholder": "",
"value": "",
"sql1": "",
"parameter": "sqlAfter={{DELETE FROM FormElement WHERE formId={{id:R}} }}",
"parameter": "saveFormJson={{myJson:FE:all:S}}\r\nsaveFormJsonName={{name:RE:all}}",
"parameterLanguageA": "",
"parameterLanguageB": "",
"parameterLanguageC": "",
......@@ -189,24 +229,24 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 09:41:26",
"created": "2021-03-30 09:13:40"
"modified": "2021-04-08 19:54:44",
"created": "2021-03-24 14:44:04"
},
{
"dynamicUpdate": "no",
"enabled": "yes",
"name": "",
"label": "Check for double form name",
"label": "Delete FE",
"mode": "show",
"modeSql": "",
"class": "action",
"type": "beforeSave",
"type": "beforeDelete",
"subrecordOption": "",
"encode": "specialchar",
"checkType": "auto",
"checkPattern": "",
"onChange": "",
"ord": 50,
"ord": 40,
"tabindex": 0,
"size": "",
"maxLength": "",
......@@ -221,7 +261,7 @@
"placeholder": "",
"value": "",
"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": "",
"parameterLanguageB": "",
"parameterLanguageC": "",
......@@ -229,24 +269,24 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 09:41:26",
"created": "2021-03-30 09:14:48"
"modified": "2021-04-08 19:54:44",
"created": "2021-03-30 09:13:40"
},
{
"dynamicUpdate": "no",
"enabled": "yes",
"name": "myBackupNote",
"label": "Backups",
"name": "",
"label": "Check for double form name",
"mode": "show",
"modeSql": "",
"class": "native",
"type": "note",
"class": "action",
"type": "beforeSave",
"subrecordOption": "",
"encode": "specialchar",
"checkType": "auto",
"checkPattern": "",
"onChange": "",
"ord": 60,
"ord": 50,
"tabindex": 0,
"size": "",
"maxLength": "",
......@@ -259,9 +299,9 @@
"adminNote": "",
"tooltip": "",
"placeholder": "",
"value": "{{ SELECT IF('{{id:RE}}'!='', 'Form backup location: {{qfqProjectPath:Y}}\/form\/.backup\/{{id:RE}}\/', 'Please save this form first.') }}",
"value": "",
"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": "",
"parameterLanguageB": "",
"parameterLanguageC": "",
......@@ -269,8 +309,8 @@
"clientJs": "",
"feGroup": "",
"deleted": "no",
"modified": "2021-04-08 12:40:55",
"created": "2021-04-08 10:40:09"
"modified": "2021-04-08 19:54:44",
"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