Constants.php 81.1 KB
Newer Older
1
2
3
4
5
6
7
8
<?php
/**
 * Created by PhpStorm.
 * User: crose
 * Date: 1/1/16
 * Time: 8:35 PM
 */

9
const EXT_KEY = 'qfq';
10

11
// Feature Flags
12
const FEATURE_FORM_FILE_SYNC = false; // Enable automatic form sync between database and form files.
13

14
15
const PROJECT_PATH_PHP_FILE = 'qfq.project.path.php';

16
17
const CONFIG_QFQ_PHP = "config.qfq.php";   // QFQ configuration file: db access - deprecated
const CONFIG_QFQ_JSON = "qfq.json"; // QFQ configuration file: db access + what used to be in LocalConfig.php
18
const CONFIG_QFQ_JSON_EXAMPLE = "example.qfq.json";
19
const CONFIG_T3 = 'LocalConfiguration.php'; // T3 config file
Carsten  Rose's avatar
Carsten Rose committed
20

21
22
const QFQ_TEMP_FILE_PATTERN = 'qfq.split.XXXXX';
const QFQ_TEMP_SOURCE = '.temp.source';
Carsten  Rose's avatar
Carsten Rose committed
23

24
const MAX_LENGTH_IPV6 = 45;
25
const LENGTH_HEX_COLOR = 6; // 'ffeedd'
26
const SESSION_NAME = 'qfq';
27
28
29
const SESSION_FE_USER_UID = 'feUserUid';
const SESSION_FE_USER = 'feUser';
const SESSION_FE_USER_GROUP = 'feUserGroup';
30
const SESSION_BE_USER = 'beUser';
31

Carsten  Rose's avatar
Carsten Rose committed
32
33
const TABLE_NAME_FORM = 'Form';
const TABLE_NAME_FORM_ELEMENT = 'FormElement';
34
const TABLE_NAME_SPLIT = 'Split';
Carsten  Rose's avatar
Carsten Rose committed
35

36
// Form Mode
37
38
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';
Carsten  Rose's avatar
Carsten Rose committed
39
const FORM_UPDATE = 'form_update';
40
const FORM_DELETE = 'form_delete';
41
const FORM_DRAG_AND_DROP = 'form_drag_and_drop';
42
43
const FORM_REST = 'form_rest';

44
45
46
47
48
const FORM_PERMISSION_SIP = 'sip';
const FORM_PERMISSION_LOGGED_IN = 'logged_id';
const FORM_PERMISSION_LOGGED_OUT = 'logged_out';
const FORM_PERMISSION_ALWAYS = 'always';
const FORM_PERMISSION_NEVER = 'never';
49
const FORM_PERMISSION_REST = 'rest';
50
51
const FORM_BUTTON_NEW = 'new';
const FORM_BUTTON_DELETE = 'delete';
52
53
const FORM_BUTTON_CLOSE = 'close';
const FORM_BUTTON_SAVE = 'save';
54

55
const REPORT_SAVE = 'reportSave';
56
const REPORT_SAVE_FILE = 'reportSaveFile'; // 0|1 whether report is saved in file instead of DB
57

58
59
const F_BS_COLUMNS = 'bsColumns';

60
61
62
63
const F_BS_LABEL_COLUMNS = 'bsLabelColumns';
const F_BS_INPUT_COLUMNS = 'bsInputColumns';
const F_BS_NOTE_COLUMNS = 'bsNoteColumns';

64
65
const RETURN_URL = 'return_url';
const RETURN_SIP = 'return_sip';
66
const RETURN_ARRAY = 'return_array';
67

68
69
70
71
72
73
74
const SQL_FORM_ELEMENT_BY_ID = "SELECT * FROM `FormElement` AS fe WHERE `fe`.`id` = ?";
const SQL_FORM_ELEMENT_RAW = "SELECT * FROM `FormElement` AS `fe` WHERE `fe`.`formId` = ? AND `fe`.`deleted` = 'no' AND `fe`.`enabled`='yes' ORDER BY `fe`.`ord`, `fe`.`id`";
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`.`feIdContainer`, `fe`.`name`, `fe`.`value`, `fe`.`label`, `fe`.`type`, `fe`.`encode`, `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`";
const SQL_FORM_ELEMENT_CONTAINER_TEMPLATE_GROUP = "SELECT `fe`.`id`, `fe`.`name`, `fe`.`label`, `fe`.`maxLength`, `fe`.`parameter` FROM `FormElement` AS fe, `Form` AS f WHERE `f`.`name` = ? AND `f`.`id` = `fe`.`formId` AND `fe`.`deleted` = 'no' AND `fe`.`class` = 'container' AND `fe`.`type`='templateGroup' AND `fe`.`enabled`='yes' ORDER BY `fe`.`ord`, `fe`.`id`";
const SQL_FORM_ELEMENT_TEMPLATE_GROUP_FE_ID = "SELECT * FROM `FormElement` AS fe WHERE `fe`.`id` = ? AND `fe`.`deleted` = 'no' AND `fe`.`class` = 'container' AND `fe`.`type`='templateGroup' AND `fe`.`enabled`='yes' ";
75
//const SQL_FORM_ELEMENT_NATIVE_TG_COUNT = "SELECT fe.*, IFNULL(feTg.maxLength,0) AS _tgCopies FROM FormElement AS fe LEFT JOIN FormElement AS feTg ON fe.feIdContainer=feTg.id AND feTg.deleted = 'no' AND feTg.class = 'container' AND feTg.type='templateGroup' AND feTg.enabled='yes' WHERE fe.formId = ? AND fe.deleted = 'no' AND fe.class = 'native' AND fe.enabled='yes'";
76
const SQL_FORM_ELEMENT_NATIVE_TG_COUNT = "SELECT `fe`.*, IFNULL(`feTg`.`maxLength`,0) AS _tgCopies FROM `FormElement` AS fe LEFT JOIN `FormElement` AS feTg ON `fe`.`feIdContainer`=`feTg`.`id` AND `feTg`.`deleted` = 'no' AND `feTg`.`class` = 'container' AND `feTg`.`type`='templateGroup' AND `feTg`.`enabled`='yes' WHERE `fe`.`formId` = ? AND `fe`.`deleted` = 'no' AND (`fe`.`class` = 'native' OR (`fe`.`class` = 'container' AND `fe`.`type`='pill')) AND `fe`.`enabled`='yes'";
77

Carsten  Rose's avatar
Carsten Rose committed
78
const NAME_TG_COPIES = '_tgCopies';  // Number of templatesGroup copies to create on the fly. Also used in SQL_FORM_ELEMENT_NATIVE_TG_COUNT.
79
const FE_TG_INDEX = '_tgIndex'; // Index of the current copy of a templateGroup FE.
80

Carsten  Rose's avatar
Carsten Rose committed
81
// SANITIZE Classifier
82
const SANITIZE_ALLOW_AUTO = "auto"; // Default for FormElements
Carsten  Rose's avatar
Carsten Rose committed
83
84
const SANITIZE_ALLOW_ALNUMX = "alnumx";
const SANITIZE_ALLOW_DIGIT = "digit";
85
const SANITIZE_ALLOW_NUMERICAL = "numerical";
86
const SANITIZE_ALLOW_EMAIL = "email";
87
const SANITIZE_ALLOW_PATTERN = "pattern";
Carsten  Rose's avatar
Carsten Rose committed
88
const SANITIZE_ALLOW_ALLBUT = "allbut";
Carsten  Rose's avatar
Carsten Rose committed
89
const SANITIZE_ALLOW_ALL = "all";
90
const SANITIZE_DEFAULT = SANITIZE_ALLOW_DIGIT; // for {{variable}} expressions without checkType
91

92
93
const SANITIZE_EXCEPTION = 'exception';
const SANITIZE_EMPTY_STRING = 'empty string';
94

95
96
const SANITIZE_VIOLATE = '!!';

97
98
99
100
101
102
const SANITIZE_ALLOW_ALNUMX_MESSAGE = 'Allowed characters: 0...9, [latin character], @-_.m;: /()';
const SANITIZE_ALLOW_DIGIT_MESSAGE = 'Allowed characters: 0...9';
const SANITIZE_ALLOW_NUMERICAL_MESSAGE = 'Allowed characters: 0...9 and .+-';
const SANITIZE_ALLOW_EMAIL_MESSAGE = 'Requested format: string@domain.tld';
const SANITIZE_ALLOW_ALLBUT_MESSAGE = 'Forbidden characters: ^[]{}%\#';

103
104
105
const SANITIZE_TYPE_MESSAGE_VIOLATE_EMPTY = 'e';
const SANITIZE_TYPE_MESSAGE_VIOLATE_ZERO = '0';
const SANITIZE_TYPE_MESSAGE_VIOLATE_CLASS = 'c';
106

Marc Egger's avatar
Marc Egger committed
107
const PATTERN_ALNUMX = '^[@\-_\.,;: \/\(\)a-zA-Z0-9ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüÿçß]*$';
108
109
const PATTERN_DIGIT = '^[\d]*$';
const PATTERN_NUMERICAL = '^[\d.+-]*$';
110
const PATTERN_EMAIL = '^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$';
111
112
113
114
const PATTERN_ALLBUT = '^[^\[\]{}%\\\\#]*$';
const PATTERN_ALL = '.*';


115
116
117
118
119
120
// Index wrap setup table
const WRAP_SETUP_TITLE = 'title';
const WRAP_SETUP_ELEMENT = 'element';
const WRAP_SETUP_LABEL = 'label';
const WRAP_SETUP_INPUT = 'input';
const WRAP_SETUP_NOTE = 'note';
121
const WRAP_SETUP_SUBRECORD = 'subrecord';
122
const WRAP_SETUP_IN_FIELDSET = 'inFieldset';
123
const WRAP_SETUP_IN_TEMPLATE_GROUP = 'inTemplateGroup';
124
const WRAP_SETUP_START = 'start';
125
const WRAP_SETUP_CLASS = 'class';
126
127
const WRAP_SETUP_END = 'end';

128
129
130
// dbQuerySimple
const ROW_REGULAR = "regular";
const ROW_IMPLODE_ALL = "implode_all";
131
132
133
134
const ROW_EXPECT_0 = "expect_0";
const ROW_EXPECT_1 = "expect_1";
const ROW_EXPECT_0_1 = "expect_0_1";
const ROW_EXPECT_GE_1 = "expect_ge_1";
135
const ROW_KEYS = "keys";
136

137
// KeyValueParser
138
139
const KVP_IF_VALUE_EMPTY_COPY_KEY = 'if_value_empty_copy_key';
const KVP_VALUE_GIVEN = 'value_given';
140

141
// https://lib2.colostate.edu/wildlife/atoz.php?letter=ALL
142
143
// JSON encoded messages thrown through an exception:
const ERROR_MESSAGE_TO_USER = 'toUser'; // always shown to the user.
Marc Egger's avatar
Marc Egger committed
144
const ERROR_MESSAGE_TO_DEVELOPER = 'support'; // Message to help the developer to understand the problem.
145
const ERROR_MESSAGE_TO_DEVELOPER_SANITIZE = 'support_sanitize'; // Typically 'true' or missing. If 'false' then content of 'support' won't be html encoded.
146
const ERROR_MESSAGE_OS = 'os'; // Error message from the OS - like 'file not found' or specific SQL problem
147
const ERROR_MESSAGE_HTTP_STATUS = 'httpStatus'; // HTTP Status Code to report
148

149
// QFQ Error Codes
Carsten  Rose's avatar
Carsten Rose committed
150
const ERROR_UNKNOW_SANITIZE_CLASS = 1001;
151
const ERROR_QUIT_QFQ_REGULAR = 1001;
152
const ERROR_WIPE_NOT_IMPLEMENTED_FOR_STORE = 1002;
153
const ERROR_CODE_SHOULD_NOT_HAPPEN = 1003;
154
const ERROR_PHP_VERSION = 1005;
155
const ERROR_SIP_INVALID = 1006;
156
const ERROR_MISSING_RECORD_ID = 1007;
157
const ERROR_IN_SQL_STATEMENT = 1008;
158
const ERROR_MISSING_REQUIRED_PARAMETER = 1009;
159
const ERROR_FE_NESTED_TOO_MUCH = 1010;
160
161
162
163
164
const ERROR_BROKEN_PARAMETER = 1011;
const ERROR_FE_USER_UID_CHANGED = 1012;
const ERROR_SIP_NOT_FOUND = 1013;
const ERROR_SIP_NOT_ALLOWED_AS_PARAM = 1014;
const ERROR_SIP_NEEDED_FOR_THIS_FORM = 1015;
Carsten  Rose's avatar
Carsten Rose committed
165
166
167
168
const ERROR_SIP_EXIST_BUT_OTHER_PARAM_GIVEN_BY_CLIENT = 1016;
const ERROR_USER_NOT_LOGGED_IN = 1017;
const ERROR_USER_LOGGED_IN = 1018;
const ERROR_FORM_FORBIDDEN = 1019;
169
const ERROR_FORM_UNKNOWN_PERMISSION_MODE = 1020;
170
const ERROR_FORMELEMENT_EDITOR_TYPE = 1021;
171
const ERROR_TOKEN_MISSING = 1022;
Carsten  Rose's avatar
Carsten Rose committed
172
const ERROR_RECURSION_TOO_DEEP = 1023;
173
const ERROR_CHECKBOXMODE_UNKNOWN = 1024;
174
const ERROR_MISSING_SQL1 = 1025;
175
const ERROR_CHECKBOX_EQUAL = 1026;
176
const ERROR_MISSING_ITEM_LIST = 1027;
177
const ERROR_UNKNOWN_FORM_RENDER = 1028;
Carsten  Rose's avatar
Carsten Rose committed
178
const ERROR_NAME_LABEL_EMPTY = 1029;
179
const ERROR_BROKEN_JSON_STRUCTURE = 1030;
Carsten  Rose's avatar
Carsten Rose committed
180
const ERROR_DEBUG = 1031;
181
182
183
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
const ERROR_RESERVED_KEY_NAME = 1034;
184
const ERROR_MISSING_FORM = 1035;
185
const ERROR_UNKNOWN_FORWARD_MODE = 1036;
186
187
188
const ERROR_MISSING_MESSAGE_FAIL = 1037;
const ERROR_MISSING_EXPECT_RECORDS = 1038;
const ERROR_MISSING_HIDDEN_FIELD_IN_SIP = 1039;
Carsten  Rose's avatar
Carsten Rose committed
189
const ERROR_MISSING_PARAMETER_FILE = 1040;
190
const ERROR_NO_BE_USER_LOGGED = 1041;
Carsten  Rose's avatar
Carsten Rose committed
191
192
193
194
195
const ERROR_UNKNOWN_CHECKTYPE = 1042;
const ERROR_PATTERN_VIOLATION = 1043;
const ERROR_RECORDID_0_FORBIDDEN = 1044;
const ERROR_LOG_NOT_WRITABLE = 1045;
const ERROR_UNNOWN_STORE = 1046;
196
const ERROR_GET_INVALID_STORE = 1047;
Carsten  Rose's avatar
Carsten Rose committed
197
const ERROR_SET_STORE_ZERO = 1048;
198
const ERROR_INVALID_OR_MISSING_PARAMETER = 1050;
199
const ERROR_UNKNOWN_SQL_LOG_MODE = 1051;
Carsten  Rose's avatar
Carsten Rose committed
200
const ERROR_FORM_NOT_FOUND = 1052;
201
const ERROR_DATE_TIME_FORMAT_NOT_RECOGNISED = 1053;
202
const ERROR_SANITIZE_INVALID_VALUE = 1054;
203
const ERROR_REQUIRED_VALUE_EMPTY = 1055;
204
const ERROR_DATE_UNEXPECTED_FORMAT = 1056;
205
const ERROR_UNEXPECTED_TYPE = 1057;
206
const ERROR_NOT_APPLICABLE = 1058;
207
208
209
210
211
const ERROR_FORMELEMENT_TYPE = 1059;
const ERROR_MISSING_OPEN_DELIMITER = 1060;
const ERROR_MISSING_CLOSE_DELIMITER = 1061;
const ERROR_EXPECTED_ARRAY = 1062;
const ERROR_REPORT_FAILED_ACTION = 1063;
212
const ERROR_MISSING_CONTENT = 1064;
213
214
215
216
217
218
219
220
221
const ERROR_MISSING_TABLE_NAME = 1065;
const ERROR_MISSING_TABLE = 1066;
const ERROR_RECORD_NOT_FOUND = 1067;
const ERROR_INVALID_EDITOR_PROPERTY_NAME = 1068;
const ERROR_UNKNOWN_ESCAPE_MODE = 1069;
const ERROR_MISSING_CONFIG_INI_VALUE = 1070;
const ERROR_SENDMAIL = 1071;
const ERROR_SENDMAIL_MISSING_VALUE = 1072;
const ERROR_OVERWRITE_RECORD_ID = 1073;
222
const ERROR_MISSING_SLAVE_ID_DEFINITION = 1074;
223
const ERROR_MISSING_INTL = 1075;
224
const ERROR_HTML_TOKEN_TOO_SHORT = 1076;
225
const ERROR_MISSING_PRINTF_ARGUMENTS = 1077;
226
const ERROR_MISSING_DEFINITON = 1078;
227
const ERROR_QFQ_VERSION = 1079;
Carsten  Rose's avatar
Carsten Rose committed
228
const ERROR_PLAY_SQL_FILE = 1080;
229
const ERROR_MISSING_FILE_NAME = 1081;
230
const ERROR_MAX_FILE_SIZE_TOO_BIG = 1082;
Elias Villiger's avatar
Elias Villiger committed
231
const ERROR_SMALLER_THAN_MIN = 1083;
Elias Villiger's avatar
Elias Villiger committed
232
const ERROR_LARGER_THAN_MAX = 1084;
233
const ERROR_INVALID_DECIMAL_FORMAT = 1085;
234
const ERROR_INVALID_DATE = 1086;
Marc Egger's avatar
Marc Egger committed
235
const ERROR_PLAY_SQL_MULTIQUERY = 1087;
236

237
// Subrecord
238
const ERROR_SUBRECORD_MISSING_COLUMN_ID = 1100;
239
const ERROR_SUBRECORD_DETAIL_COLUMN_NOT_FOUND = 'Column not found in primary record or current row (or missed & to indicate a constant?)';
240

241
// Store
242
243
const ERROR_STORE_VALUE_ALREADY_CODPIED = 1200;
const ERROR_STORE_KEY_EXIST = 1201;
244

245
// I/O Error
Carsten  Rose's avatar
Carsten Rose committed
246
const ERROR_IO_COPY = 1300;
247
const ERROR_IO_ZIP_OPEN = 1301;
248
const ERROR_IO_RMDIR = 1302;
249
250
251
252
253
254
255
256
const ERROR_IO_WRITE = 1303;
const ERROR_IO_OPEN = 1304;
const ERROR_IO_UNLINK = 1305;
const ERROR_IO_FILE_EXIST = 1306;
const ERROR_IO_RENAME = 1307;
const ERROR_IO_INVALID_LINK = 1308;
const ERROR_IO_DIR_EXIST_AS_FILE = 1309;
const ERROR_IO_CHDIR = 1310;
257
const ERROR_IO_CREATE_FILE = 1311;
Carsten  Rose's avatar
Carsten Rose committed
258
const ERROR_IO_COPY_FILE = 1312;
259
const ERROR_IO_FILE_NOT_FOUND = 1313;
260
const ERROR_IO_CHMOD = 1314;
Carsten  Rose's avatar
Carsten Rose committed
261
262
263
const ERROR_IO_READ_FILE = 1315;
const ERROR_IO_WRITE_FILE = 1316;

264
265
const ERROR_PATH_INVALID = 1317;

266
const ERROR_PDF_SPLIT = 1320;
Carsten  Rose's avatar
Carsten Rose committed
267
const ERROR_PDF2JPEG = 1321;
268

269
//Report
270
271
const ERROR_UNKNOWN_LINK_QUALIFIER = 1400;
const ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION = 1401;
272
273
274
275
276
277
278
279
const ERROR_MISSING_REQUIRED_DELETE_QUALIFIER = 1402;
const ERROR_MISSING_VALUE = 1403;
const ERROR_INVALID_VALUE = 1404;
const ERROR_MULTIPLE_DEFINITION = 1405;
const ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION = 1406;
const ERROR_UNKNOWN_TOKEN = 1407;
const ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL = 1408;
const ERROR_TOO_MANY_PARAMETER = 1409;
280
const ERROR_INVALID_SAVE_PDF_FILENAME = 1410;
Nicola Chiapolini's avatar
Nicola Chiapolini committed
281
const ERROR_TWIG_COLUMN_NOT_UNIQUE = 1411;
282
const ERROR_DOUBLE_DEFINITION = 1412;
283

284
// Upload
285
const ERROR_UPLOAD = 1500;
286
287
288
const ERROR_UPLOAD_TOO_BIG = 1501;
const ERROR_UPLOAD_FILE_TYPE = 1502;
const ERROR_UPLOAD_GET_MIME_TYPE = 1503;
Carsten  Rose's avatar
Carsten Rose committed
289
const ERROR_UPLOAD_UNKNOWN_ACTION = 1504;
290
const ERROR_NO_TARGET_PATH_FILE_NAME = 1505;
291
const ERROR_UPLOAD_FILES_BROKEN = 1506;
292
const ERROR_UNKNOWN_EXCEL_IMPORT_TYPE = 1507;
293

294
// LDAP / typeahead
295
const ERROR_LDAP_CONNECT = 1600;
296
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH = 1601;
297
298
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH_PREFETCH = 1602;
const ERROR_LDAP_BIND = 1603;
299
const ERROR_MISSING_TYPE_AHEAD_SQL_PREFETCH = 1604;
300

Carsten  Rose's avatar
Carsten Rose committed
301
302
303
304
// Download
const ERROR_DOWNLOAD_CREATE_NEW_FILE = 1700;
const ERROR_DOWNLOAD_NO_FILES = 1701;
const ERROR_DOWNLOAD_NOTHING_TO_DO = 1702;
305
const ERROR_DOWNLOAD_UNEXPECTED_MIME_TYPE = 1703;
Carsten  Rose's avatar
Carsten Rose committed
306
const ERROR_DOWNLOAD_UNEXPECTED_NUMBER_OF_SOURCES = 1704;
307
const ERROR_DOWNLOAD_FILE_NOT_READABLE = 1705;
308
const ERROR_DOWNLOAD_FOPEN_BLOCKED = 1706;
309
const ERROR_DOWNLOAD_JSON_CONVERT = 1707;
310
const ERROR_DOWNLOAD_MERGE_FAILED = 1708;
311
const ERROR_DOWNLOAD_CONVERT_FAILED = 1709;
Carsten  Rose's avatar
Carsten Rose committed
312

313
314
// Excel
const ERROR_EXCEL_POSITION_ARGUMENT_EMPTY = 1800;
315
const ERROR_EXCEL_INVALID_COORDINATES = 1801;
316

317
318
// KeyValueParser
const ERROR_KVP_VALUE_HAS_NO_KEY = 1900;
319

320
// DB Errors
321
322
323
324
325
326
327
328
329
330
331
332
const ERROR_DB_OPEN = 2000;
const ERROR_DB_EXECUTE = 2001;
const ERROR_DB_PREPARE = 2002;
const ERROR_DB_BIND = 2003;
const ERROR_DB_QUERY = 2004;
const ERROR_DB_GENERIC_CHECK = 2005;
const ERROR_DB_TOO_FEW_ROWS = 2006;
const ERROR_DB_TOO_MANY_ROWS = 2007;
const ERROR_DB_COUNT_DO_NOT_MATCH = 2008;
const ERROR_DB_CLOSE_MYSQLI_RESULT = 2009;
const ERROR_DB_CLOSE_MYSQLI_STMT = 2010;
const ERROR_DB_UNKNOWN_COLUMN = 2011;
333
const ERROR_DB_UNKNOWN_COMMAND = 2012;
334

335
const ERROR_DB_COLUMN_NOT_FOUND_IN_TABLE = 2014;
336
const ERROR_DB_SET_CHARSET = 2015;
Carsten  Rose's avatar
Carsten Rose committed
337
const ERROR_DB_MULTI_QUERY_FAILED = 2016;
Carsten  Rose's avatar
Carsten Rose committed
338
339
340
341

// onArray
const ERROR_SUBSTITUTE_FOUND = 2100;

Carsten  Rose's avatar
Carsten Rose committed
342
// Dirty
Carsten  Rose's avatar
Carsten Rose committed
343
344
345
const ERROR_DIRTY_MISSING_FORM_IN_SIP = 2200;
const ERROR_DIRTY_DELETE_RECORD = 2201;
const ERROR_DIRTY_UNKNOWN_ACTION = 2202;
346
347
const ERROR_DIRTY_MISSING_LOCK = 2203;
const ERROR_DIRTY_ALREADY_LOCKED = 2204;
Carsten  Rose's avatar
Carsten Rose committed
348
const ERROR_DIRTY_RECORD_MODIFIED = 2205;
Carsten  Rose's avatar
Carsten Rose committed
349

350
351
352
// Language
const ERROR_LANGUAGE_NOT_CONFIGURED_IN_QFQ = 2300;

353
354
355
356
// Session
const ERROR_MISSING_SESSIONNAME = 2400;
const ERROR_QFQ_SESSION_MISSING = 2401;
const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402;
357
const ERROR_MISSING_COOKIE = 2403;
358
const ERROR_SESSION_EXPIRED = 2404;
359

360
361
362
const ERROR_HTML2PDF_MISSING_CONFIG = 2500;
const ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE = 2501;
const ERROR_HTML2PDF_WKHTML_FAILED = 2502;
363

364
// Thumbnail
365
const ERROR_THUMBNAIL_RENDER = 2600;
366
367
368

// Drag and Drop
const ERROR_DND_EMPTY_REORDER_SQL = 2700;
369
370
371

// Form
const ERROR_FORM_RESERVED_NAME = 2800;
372
const ERROR_FORM_INVALID_NAME = 2801;
373

374
375
376
377
// Import (Excel, ODS, ...)
const ERROR_IMPORT_MISSING_EXPLICIT_TYPE = 2900;
const ERROR_IMPORT_LIST_SHEET_NAMES = 2901;

Carsten  Rose's avatar
Carsten Rose committed
378
379
380
// REST
const ERROR_FORM_REST = 3000;
const ERROR_REST_AUTHORIZATION = 3001;
381
const ERROR_REST_INVALID_ID = 3002;
382
383
384
385
386
387
388
389

// Tablesorter
const ERROR_TABLESORTER_SIP_NOT_FOUND = 3100;
const ERROR_TABLESORTER_INVALID_CHAR = 3101;
const ERROR_TABLESORTER_NAME_TOO_LONG = 3102;
const ERROR_SETTING_RECORD_TOO_MUCH = 3103;
const ERROR_SETTING_SYSTEM = 3104;

390
391
392
//
// Store Names: Identifier
//
393
const STORE_ADDITIONAL_FORM_ELEMENTS = "A"; // Internal Store to collect FormElements. Typically for 'hidden' elements of radio and checkbox. Helps render those elements at the end of the whole form rendering.
394
const STORE_BEFORE = "B"; // selected record from primary table before any modifcations.
395
const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable
396
const STORE_TABLE_DEFAULT = "D"; // definition of primary table.
397
398
399
const STORE_EMPTY = "E"; // value: '', might helpfull if variable is not defined and should result in an empty string instead of {{...}} (cause not replaced)
const STORE_FORM = "F";  // form, still not saved in database
const STORE_LDAP = "L";
400
const STORE_TABLE_COLUMN_TYPES = "M"; // column types of primary table.
401
402
403
const STORE_PARENT_RECORD = "P"; // on autoCron, copy/paste & multi forms the recent record of the outer query (multi).
const STORE_RECORD = "R"; // selected record from primary table.
const STORE_SIP = "S"; // SIP
404
const STORE_TYPO3 = "T"; // Typo3 > Page content record > bodytext
405
const STORE_USER = "U"; // Like STORE_EXTRA, but for user use.
406
const STORE_VAR = "V"; // Generic Vars
407
408
#const STORE_WIPE_SIP = "W"; // Like SIP, but will remove the entry after reading from STORE_SIP as well as from SESSION-SIP table.
const STORE_EXTRA = "X"; // Persistent Store: contains arrays! Used by QFQ system - not used by user.
Carsten  Rose's avatar
Carsten Rose committed
409
const STORE_SYSTEM = "Y"; // various system values like db connection credentials
410
const STORE_ZERO = "0"; // value: 0, might helpfull if variable is empty but used in an SQL statement, which might produce a SQL error otherwise if substituted with an empty string
411

412
const STORE_USE_DEFAULT = "FSRVD";
413

414
//
Carsten  Rose's avatar
Carsten Rose committed
415
// Store: Definitions / Members
416
417
//

Carsten  Rose's avatar
Carsten Rose committed
418
// URL variables
419
420
const CLIENT_FORM = 'form';
const CLIENT_SIP = 's';
421
const CLIENT_RECORD_ID = 'r';
422
423
const CLIENT_KEY_SEM_ID = 'keySemId';
const CLIENT_KEY_SEM_ID_USER = 'keySemIdUser';
424
425
426
const CLIENT_PAGE_ID = 'id';
const CLIENT_PAGE_TYPE = 'type';
const CLIENT_PAGE_LANGUAGE = 'L';
427
const CLIENT_UPLOAD_FE_NAME = 'name';
Carsten  Rose's avatar
Carsten Rose committed
428

429
430
const CLIENT_SIP_FOR_FORM = '_sipForForm';
const CLIENT_FE_NAME = '_feName';
431
const CLIENT_TYPO3VARS = '_sipForTypo3Vars';
432

433
434
435
436
// ALL $_SERVER variables: http://php.net/manual/en/reserved.variables.server.php
// The following exist and might be the most used ones.
const CLIENT_SCRIPT_URL = 'SCRIPT_URL';
const CLIENT_SCRIPT_URI = 'SCRIPT_URI';
437
const CLIENT_HTTP_COOKIE = 'HTTP_COOKIE';
438
439
440
const CLIENT_HTTP_HOST = 'HTTP_HOST';
const CLIENT_HTTP_USER_AGENT = 'HTTP_USER_AGENT';
const CLIENT_SERVER_NAME = 'SERVER_NAME';
441
const CLIENT_SERVER_ADDRESS = 'SERVER_ADDR';
442
const CLIENT_SERVER_PORT = 'SERVER_PORT';
443
const CLIENT_REMOTE_ADDRESS = 'REMOTE_ADDR';
444
const CLIENT_REQUEST_SCHEME = 'REQUEST_SCHEME';
445
const CLIENT_REQUEST_METHOD = 'REQUEST_METHOD';
446
447
448
449
450
451
const CLIENT_SCRIPT_FILENAME = 'SCRIPT_FILENAME';
const CLIENT_QUERY_STRING = 'QUERY_STRING';
const CLIENT_REQUEST_URI = 'REQUEST_URI';
const CLIENT_SCRIPT_NAME = 'SCRIPT_NAME';
const CLIENT_PHP_SELF = 'PHP_SELF';

452
453
454
455
456
const REQUEST_METHOD_GET = 'GET';
const REQUEST_METHOD_POST = 'POST';
const REQUEST_METHOD_PUT = 'PUT';
const REQUEST_METHOD_DELETE = 'DELETE';

457
// _COOKIE
Carsten  Rose's avatar
Carsten Rose committed
458
459
const CLIENT_COOKIE_QFQ = 'cookieQfq';

Carsten  Rose's avatar
Carsten Rose committed
460
// T3 Bodytext Keywords
461
const TYPO3_FORM = CLIENT_FORM;
462
const TYPO3_RECORD_ID = CLIENT_RECORD_ID;
463
const TYPO3_BE_USER_LOGGED_IN = 'beUserLoggedIn';   // 'yes' | 'no'
464
const TYPO3_BE_USER = 'beUser';   // 'yes' | 'no'
465
466
467
const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
468
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
469
const TYPO3_PAGE_ID = 'pageId';
470
471
const TYPO3_PAGE_ALIAS = 'pageAlias';
const TYPO3_PAGE_TITLE = 'pageTitle';
472
const TYPO3_PAGE_TYPE = 'pageType';
473

474
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
475
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
476
const TYPO3_SQL_LOG_ABSOLUTE = 'sqlLog';
477
const TYPO3_SQL_LOG_MODE = 'sqlLogMode';
478

479
// Deprecated: legacy config - still used to read old configuration file.
480
481
482
483
const SYSTEM_DB_USER = 'DB_USER';
const SYSTEM_DB_SERVER = 'DB_SERVER';
const SYSTEM_DB_PASSWORD = 'DB_PASSWORD';
const SYSTEM_DB_NAME = 'DB_NAME';
484

485
// Recent DB config
486
487
488
489
490
const SYSTEM_DB_1_USER = 'DB_1_USER';
const SYSTEM_DB_1_SERVER = 'DB_1_SERVER';
const SYSTEM_DB_1_PASSWORD = 'DB_1_PASSWORD';
const SYSTEM_DB_1_NAME = 'DB_1_NAME';

491
const SYSTEM_DB_INIT = 'init';
492

493
494
495
const SYSTEM_DB_INDEX_DATA = "indexData";
const SYSTEM_DB_INDEX_QFQ = "indexQfq";

496
497
498
499
500
// Automatically filled by QFQ
const SYSTEM_DB_NAME_DATA = 'dbNameData';
const SYSTEM_DB_NAME_QFQ = 'dbNameQfq';
const SYSTEM_DB_NAME_T3 = 'dbNameT3';

501
const SYSTEM_QFQ_LOG_PATHFILENAME = 'qfqLog'; // absolute or relative to app
502

503
504
505
const SYSTEM_MAIL_LOG_PATHFILENAME = 'mailLog';  // absolute or relative to app

const SYSTEM_SQL_LOG_PATHFILENAME = 'sqlLog';  // absolute or relative to app
506
const SYSTEM_SQL_LOG_MODE = 'sqlLogMode'; // Mode, which statements to log.
507
const SYSTEM_SQL_LOG_MODE_AUTOCRON = 'sqlLogModeAutoCron'; // Mode, which statements to log in AutoCron Environments.
508

509
510
511
512
const SYSTEM_FORM_SUBMIT_LOG_MODE = 'formSubmitLogMode';
const FORM_SUBMIT_LOG_MODE_ALL = 'all';
const FORM_SUBMIT_LOG_MODE_NONE = 'none';

513
514
const SYSTEM_DATE_FORMAT = 'dateFormat';
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'redirectAllMailTo';
515

516
517
const SYSTEM_THROW_GENERAL_ERROR = 'throwExceptionGeneralError';
const SYSTEM_FLAG_PRODUCTION = 'flagProduction';
518
const SYSTEM_RENDER = 'render';
519
520
const SYSTEM_RENDER_SINGLE = 'single';
const SYSTEM_RENDER_BOTH = 'both';
521
const SYSTEM_RENDER_API = 'api';
522
const SYSTEM_REPORT_AS_FILE_AUTO_EXPORT = 'reportAsFileAutoExport';
523

524
const SYSTEM_SHOW_DEBUG_INFO = 'showDebugInfo';
525
const SYSTEM_SHOW_DEBUG_INFO_YES = 'yes';
526
const SYSTEM_SHOW_DEBUG_INFO_AUTO = 'auto'; // Remains on value 'auto' as long as there is no BE User logged in. In other words: 'auto'='no'. #5031
527
528
const SYSTEM_SHOW_DEBUG_INFO_DOWNLOAD = 'download';

529
530
531
532
533
const SYSTEM_REPORT_MIN_PHP_VERSION = 'reportMinPhpVersion';
const SYSTEM_REPORT_MIN_PHP_VERSION_YES = 'yes';
const SYSTEM_REPORT_MIN_PHP_VERSION_AUTO = 'auto'; // Remains on value 'auto' as long as there is no BE User logged in. In other words: 'auto'='no'.
const MIN_PHP_VERSION = "7.2.0"; // Currently the PHP Spreadsheet library needs at least 7.2

534
535
536
537
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'cssClassQfqContainer';
const SYSTEM_CSS_CLASS_QFQ_FORM = 'cssClassQfqForm';
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'cssClassQfqFormPill';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'cssClassQfqFormBody';
538

539
const SYSTEM_CSS_CLASS_COLUMN_ID = 'cssClassColumnId';
540

541
// Textmessages used for Form validation.
542
543
544
545
const SYSTEM_FORM_DATA_PATTERN_ERROR = 'formDataPatternError';
const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'formDataRequiredError';
const SYSTEM_FORM_DATA_MATCH_ERROR = 'formDataMatchError';
const SYSTEM_FORM_DATA_ERROR = 'formDataError';
546

547
const SYSTEM_FORM_BS_COLUMNS = 'formBsColumns';
548

549
550
551
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'formBsLabelColumns';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'formBsInputColumns';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'formBsNoteColumns';
552

553
const SYSTEM_BASE_URL = 'baseUrl';
554

555
const SYSTEM_SEND_E_MAIL_OPTIONS = 'sendEMailOptions';
556

557
const SYSTEM_EDIT_FORM_PAGE = 'editFormPage';
558

559
560
561
const SYSTEM_LDAP_1_RDN = 'LDAP_1_RDN'; // Credentials to access LDAP
const SYSTEM_LDAP_1_PASSWORD = 'LDAP_1_PASSWORD'; // Credentials to access LDAP

562
563
const SYSTEM_ESCAPE_TYPE_DEFAULT = 'escapeTypeDefault';
const SYSTEM_SECURITY_VARS_HONEYPOT = 'securityVarsHoneypot'; // Fake variables
564
565
const SYSTEM_SECURITY_VARS_HONEYPOT_NAMES = 'email,username,password'; // Fake variables

566
const SYSTEM_SECURITY_ATTACK_DELAY = 'securityAttackDelay'; // Detected attack causes x seconds delay
567
const SYSTEM_SECURITY_ATTACK_DELAY_DEFAULT = 5; // Detected attack causes x seconds delay
568
569
const SYSTEM_SECURITY_SHOW_MESSAGE = 'securityShowMessage'; // Detected attack shows an error message
const SYSTEM_SECURITY_GET_MAX_LENGTH = 'securityGetMaxLength'; // Trim every character (before conversion) to SECURITY_GET_MAX_LENGTH chars;
570
const SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT = 50; // Default max length for get variables
Carsten  Rose's avatar
Carsten Rose committed
571
const SYSTEM_SECURITY_FAILED_AUTH_DELAY = 'securityFailedAuthDelay'; // Failed auth causes x seconds delay
572
573
574

const GET_EXTRA_LENGTH_TOKEN = '_';

575
576
577
const SYSTEM_LABEL_ALIGN = 'labelAlign';
const SYSTEM_LABEL_ALIGN_LEFT = 'left';

578
579
580
const SYSTEM_EXTRA_BUTTON_INFO_INLINE = 'extraButtonInfoInline';
const SYSTEM_EXTRA_BUTTON_INFO_BELOW = 'extraButtonInfoBelow';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'extraButtonInfoPosition';
581
582
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_AUTO = 'auto';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_BELOW = 'below';
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
const SYSTEM_EXTRA_BUTTON_INFO_CLASS = 'extraButtonInfoClass';

const SYSTEM_SAVE_BUTTON_TEXT = 'saveButtonText';
const SYSTEM_SAVE_BUTTON_TOOLTIP = 'saveButtonTooltip';
const SYSTEM_SAVE_BUTTON_CLASS = 'saveButtonClass';
const SYSTEM_SAVE_BUTTON_GLYPH_ICON = 'saveButtonGlyphIcon';
const SYSTEM_SAVE_BUTTON_CLASS_ON_CHANGE = 'saveButtonClassOnChange';

const SYSTEM_CLOSE_BUTTON_TEXT = 'closeButtonText';
const SYSTEM_CLOSE_BUTTON_TOOLTIP = 'closeButtonTooltip';
const SYSTEM_CLOSE_BUTTON_CLASS = 'closeButtonClass';
const SYSTEM_CLOSE_BUTTON_GLYPH_ICON = 'closeButtonGlyphIcon';

const SYSTEM_DELETE_BUTTON_TEXT = 'deleteButtonText';
const SYSTEM_DELETE_BUTTON_TOOLTIP = 'deleteButtonTooltip';
const SYSTEM_DELETE_BUTTON_CLASS = 'deleteButtonClass';
const SYSTEM_DELETE_BUTTON_GLYPH_ICON = 'deleteButtonGlyphIcon';

const SYSTEM_NEW_BUTTON_TEXT = 'newButtonText';
const SYSTEM_NEW_BUTTON_TOOLTIP = 'newButtonTooltip';
const SYSTEM_NEW_BUTTON_CLASS = 'newButtonClass';
const SYSTEM_NEW_BUTTON_GLYPH_ICON = 'newButtonGlyphIcon';

const SYSTEM_DB_UPDATE = 'update';
607
608
609
610
const SYSTEM_DB_UPDATE_ALWAYS = 'always';
const SYSTEM_DB_UPDATE_NEVER = 'never';
const SYSTEM_DB_UPDATE_AUTO = 'auto';

611
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS = 'recordLockTimeoutSeconds';
Carsten  Rose's avatar
Carsten Rose committed
612
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS_DEFAULT = 900; // 15 mins
Carsten  Rose's avatar
Carsten Rose committed
613

614
const SYSTEM_SESSION_TIMEOUT_SECONDS = 'sessionTimeoutSeconds';
615
616

const SYSTEM_FILE_MAX_FILE_SIZE = 'maxFileSize';
617
618
619

const SYSTEM_COOKIE_LIFETIME = 259200; // 3 days. Should be more than  SYSTEM_SESSION_TIMEOUT_SECONDS_DEFAULT, in case the user setup's a higher value.

620
// Deprecated, replaced by SYSTEM_FILL_STORE_SYSTEM_BY_SQ
621
const SYSTEM_VAR_ADD_BY_SQL = 'VAR_ADD_BY_SQL'; // since 1.12.17
622

623
624
const SYSTEM_FILL_STORE_SYSTEM_BY_SQL = 'fillStoreSystemBySql';
const SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG = 'fillStoreSystemBySqlErrorMsg';
625

626
const SYSTEM_FORM_LANGUAGE = 'formLanguage';
627

628
629
const SYSTEM_FORM_LANGUAGE_A_ID = 'formLanguageAId';
const SYSTEM_FORM_LANGUAGE_A_LABEL = 'formLanguageALabel';
630

631
632
const SYSTEM_FORM_LANGUAGE_B_ID = 'formLanguageBId';
const SYSTEM_FORM_LANGUAGE_B_LABEL = 'formLanguageBLabel';
633

634
635
const SYSTEM_FORM_LANGUAGE_C_ID = 'formLanguageCId';
const SYSTEM_FORM_LANGUAGE_C_LABEL = 'formLanguageCLabel';
636

637
638
const SYSTEM_FORM_LANGUAGE_D_ID = 'formLanguageDId';
const SYSTEM_FORM_LANGUAGE_D_LABEL = 'formLanguageDLabel';
639

640
const SYSTEM_ENTER_AS_SUBMIT = 'enterAsSubmit';
641
const SYSTEM_SHOW_ID_IN_FORM_TITLE = 'showIdInFormTitle';
642
const SYSTEM_INPUT_CLEAR_ME = 'clearMe';
643

644
const SYSTEM_CMD_WKHTMLTOPDF = 'cmdWkhtmltopdf';
645
646
const SYSTEM_CMD_INKSCAPE = 'cmdInkscape';
const SYSTEM_CMD_CONVERT = 'cmdConvert';
647
648
const SYSTEM_CMD_PDF2SVG = 'cmdPdf2svg';
const SYSTEM_CMD_PDFTOCAIRO = 'cmdPdftocairo';
649
650
651
const SYSTEM_CMD_QPDF = 'cmdQpdf';
const SYSTEM_CMD_GS = 'cmdGs';
const SYSTEM_CMD_PDFUNITE = 'cmdPdfunite';
652
const SYSTEM_CMD_IMG2PDF = 'cmdImg2pdf';
653
654

// Thumbnail
655
656
const SYSTEM_THUMBNAIL_DIR_SECURE_REL_TO_APP = 'thumbnailDirSecure';
const SYSTEM_THUMBNAIL_DIR_PUBLIC_REL_TO_APP = 'thumbnailDirPublic';
657

658
const SYSTEM_DOCUMENTATION_QFQ = 'documentation';
659
const SYSTEM_DOCUMENTATION_QFQ_URL = 'http://docs.qfq.io/en/master';
660

661

662
// Not stored in config.qfq.php, but used in STORE_SYSTEM
663
// Information for: Log / Debug / Exception
Carsten  Rose's avatar
Carsten Rose committed
664
665
666
667
const SYSTEM_SQL_RAW = 'sqlRaw';  // Type: SANITIZE_ALL / String. SQL Query (before substitute). Useful for error reporting.
const SYSTEM_SQL_FINAL = 'sqlFinal'; //  Type: SANITIZE_ALL / String. SQL Query (after substitute). Useful for error reporting.
const SYSTEM_SQL_COUNT = 'sqlCount'; //  Type: SANITIZE_DIGIT / Int.Number of rows in SQL ResultSet. Useful for error reporting.
const SYSTEM_SQL_PARAM_ARRAY = 'sqlParamArray'; //  Type: SANITIZE_ALL / Parameter of prepared SQL Statement. Useful for error reporting.
668
669
const SYSTEM_FORM = CLIENT_FORM;                        // '<formName> / <formId>'
const SYSTEM_FORM_ELEMENT = 'formElement';              // '<formElementName> / <formElementeId>'
670
const SYSTEM_FORM_ELEMENT_ID = 'formElementId';              // '<formElementName> / <formElementeId>'
671
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
672
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
Carsten  Rose's avatar
Carsten Rose committed
673
674
675
676
const SYSTEM_REPORT_COLUMN_INDEX = 'reportColumnIndex'; // Index of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_NAME = 'reportColumnName'; // Name of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Value of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Full level of current report row. E.g.: 10.20.1. Used for error reports.
677
const SYSTEM_MESSAGE_DEBUG = 'messageDebug';
Carsten  Rose's avatar
Carsten Rose committed
678
679
680
681
const SYSTEM_DOWNLOAD_POPUP = 'hasDownloadPopup'; // Marker which is set to 'true' if there is at least one Download Link rendered
const DOWNLOAD_POPUP_REQUEST = 'true';
const DOWNLOAD_POPUP_REPLACE_TEXT = '#downloadPopupReplaceText#';
const DOWNLOAD_POPUP_REPLACE_TITLE = '#downloadPopupReplaceTitle#';
682
const SYSTEM_DRAG_AND_DROP_JS = 'hasDragAndDropJS';
683
const SYSTEM_SQL_DIRECT_DOWNLOAD = 'sqlDirect'; // becomes sqlDirectdownload.php, sqlDirectdl.php, sqlDirectdl2.php, sqlDirectdl3.php
Carsten  Rose's avatar
Carsten Rose committed
684

685
const SYSTEM_PARAMETER_LANGUAGE_FIELD_NAME = 'parameterLanguageFieldName';
686
687
const CSS_REQUIRED_RIGHT = 'required-right';
const CSS_REQUIRED_LEFT = 'required-left';
688

689
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen globale Vars benutzt.
Carsten  Rose's avatar
Carsten Rose committed
690
691
692
//const SYSTEM_FORM_DEF = 'formDefinition'; // Type: SANITIZE_ALNUMX / AssocArray. Final form to process. Useful for error reporting.
//const SYSTEM_FORM_ELEMENT_DEF = 'formElementDefinition'; // Type: SANITIZE_ALL / AssocArray. Formelement which are processed at the moment. Useful for error reporting.
//const SYSTEM_FORM_ELEMENT_FIELD = 'formElementField'; // Type: SANITIZE_ALNUMX / String. Fieldname of processed Formelement. Useful for error reporting.
693

694
695
const SYSTEM_QFQ_PROJECT_PATH = 'qfqProjectPath';

696
697
698
699
700
701
702
const MODE_HTML = 'html';
const MODE_JSON = 'json';

const MSG_HEADER = 'header';
const MSG_CONTENT = 'content';
const MSG_ERROR_CODE = 'errorCode';

703
const SIP_TOKEN_LENGTH = 13; // length of string returned by `uniqid()`
704
705
const SIP_SIP = CLIENT_SIP;  // s
const SIP_RECORD_ID = CLIENT_RECORD_ID; // r
Carsten  Rose's avatar
Carsten Rose committed
706
const SIP_TARGET_URL = '_targetUrl'; // URL where to jump after delete()
707
const SIP_MODE_ANSWER = '_modeAnswer'; // Mode how delete() will answer to client: MODE_HTML, MODE_JSON
708
const SIP_FORM = CLIENT_FORM;
709
const SIP_TABLE = 'table'; // delete a record from 'table'
710
const SIP_URLPARAM = 'urlparam';
Carsten  Rose's avatar
Carsten Rose committed
711
const SIP_SIP_URL = 'sipUrl';
712
const SIP_MAKE_URLPARAM_UNIQ = '_makeUrlParamUniq'; // SIPs for 'new records' needs to be uniq per TAB! Therefore add a uniq parameter
713
const SIP_DOWNLOAD_PARAMETER = '_b64_download'; // Parameter name, filled in SIP, to hold all download element parameter.
Carsten  Rose's avatar
Carsten Rose committed
714
715
716

const SIP_PREFIX_BASE64 = '_b64';

717
718
719
720
721
const SIP_EXCLUDE_ID = 'id';
const SIP_EXCLUDE_TYPE = 'type';
const SIP_EXCLUDE_L = 'L';
const SIP_EXCLUDE_XDEBUG_SESSION_START = 'XDEBUG_SESSION_START';

Carsten  Rose's avatar
Carsten Rose committed
722
// FURTHER: all extracted params from 'urlparam
723

724
725
const ACTION_KEYWORD_SLAVE_ID = 'slaveId';

726
const VAR_RANDOM = 'random';
727
728
729
const VAR_FILE_DESTINATION = 'fileDestination';
const VAR_SLAVE_ID = ACTION_KEYWORD_SLAVE_ID;
const VAR_FILENAME = 'filename'; // Original filename of an uploaded file.
730
const VAR_FILENAME_ONLY = 'filenameOnly'; // Original filename of an uploaded file, without directories.
731
732
const VAR_FILENAME_BASE = 'filenameBase'; // Original filename of an uploaded file, without the extension.
const VAR_FILENAME_EXT = 'filenameExt'; // Extension of the original filename of an uploaded file, .
733
734
const VAR_FILE_MIME_TYPE = 'mimeType';
const VAR_FILE_SIZE = 'fileSize';
735
const VAR_ALL_REQUIRED_GIVEN = 'allRequiredGiven'; // If all required FE are given: 1, else: 0. If there is no required FE: 1
736
737
const VAR_TAG_ID = 'tagId';
const VAR_TAG_VALUE = 'tagValue';
738

739
// PHP class Typeahead
740
const TYPEAHEAD_API_QUERY = 'query';  // Name of parameter in API call of typeahead.php?query=...&s=... - See also FE_TYPE_AHEAD_SQL
741
const TYPEAHEAD_API_PREFETCH = 'prefetch';  // Name of parameter in API call of typeahead.php?prefetch=...&s=... - See also FE_TYPE_AHEAD_SQL
742
743
const TYPEAHEAD_API_SIP = 'sip';  // Name of parameter in API call of typeahead.php?query=...&s=...
const TYPEAHEAD_DEFAULT_LIMIT = 20;
744
const TYPEAHEAD_SQL_KEY_NAME = 'id';
745

746
747
const DEFAULT_LDAP_TIME_LIMIT = 3;

748
749
const SINGLE_TICK = "'";
const DOUBLE_TICK = '"';
Carsten  Rose's avatar
#2067    
Carsten Rose committed
750

751
// TOKEN evaluate
752
const TOKEN_ESCAPE_CONFIG = 'c';
753
754
const TOKEN_ESCAPE_SINGLE_TICK = 's';
const TOKEN_ESCAPE_DOUBLE_TICK = 'd';
755
const TOKEN_ESCAPE_COLON = 'C';
756
757
758
const TOKEN_ESCAPE_LDAP_FILTER = 'l';
const TOKEN_ESCAPE_LDAP_DN = 'L';
const TOKEN_ESCAPE_MYSQL = 'm';
759
const TOKEN_ESCAPE_PASSWORD_T3FE = 'p';
760
const TOKEN_ESCAPE_NONE = '-';
761
const TOKEN_ESCAPE_WIPE = 'w';
762
const TOKEN_ESCAPE_TIMEZONE = 't';
763
const TOKEN_ESCAPE_HTML_SPECIAL_CHAR = 'h';
764

765
766
767
768
const TOKEN_ESCAPE_STOP_REPLACE = 'S';
const TOKEN_ESCAPE_EXCEPTION = 'X';
#const TOKEN_ESCAPE_ACTION = 'A';

769
770
771
772
773
774
// Workaround for PHP < 5.6.0
if (!function_exists('ldap_escape')) {
    define('LDAP_ESCAPE_FILTER', 0x01);
    define('LDAP_ESCAPE_DN', 0x02);
}

775
const TOKEN_FOUND_IN_STORE_QUERY = 'query';
776
const TOKEN_FOUND_AS_COLUMN = 'column';
777
const TOKEN_FOUND_AS_DEFAULT = 'default';
778
const TOKEN_FOUND_STOP_REPLACE = 'stopReplace';
779

780
781
const VAR_INDEX_VALUE = 0;
const VAR_INDEX_STORE = 1;
Carsten  Rose's avatar
Carsten Rose committed
782
const VAR_INDEX_SANITIZE = 2;
783
784
785
786
const VAR_INDEX_ESCAPE = 3;
const VAR_INDEX_DEFAULT = 4;
const VAR_INDEX_MESSAGE = 5;

787
788
const RANDOM_LENGTH = 32;

789
// FORM - copy from table 'form' of processed form
790
//const DEF_FORM_NAME = CLIENT_FORM;
791
792

// FORMELEMENT - copy of all formElements of processed form
793
//const DEF_FORM_ELEMENT_ID = 'id';
794