Constants.php 62.4 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
const CONFIG_QFQ_INI = "config.qfq.ini";  // QFQ configuration file: db access
const CONFIG_QFQ_PHP = "config.qfq.php";  // QFQ configuration file: db access
12
const CONFIG_T3 = 'LocalConfiguration.php'; // T3 config file
Carsten  Rose's avatar
Carsten Rose committed
13

14
const GFX_INFO = 'typo3conf/ext/qfq/Resources/Public/icons/note.gif';
15
const API_DIR = 'typo3conf/ext/qfq/qfq/api';
16

17
18
const QFQ_TEMP_FILE_PATTERN = 'qfq.split.XXXXX';
const QFQ_TEMP_SOURCE = '.temp.source';
Carsten  Rose's avatar
Carsten Rose committed
19

20
21
const MAX_LENGTH_IPV6 = 45;

22
const SESSION_LIFETIME_SECONDS = 86400;
23
const SESSION_NAME = 'qfq';
24
25
26
const SESSION_FE_USER_UID = 'feUserUid';
const SESSION_FE_USER = 'feUser';
const SESSION_FE_USER_GROUP = 'feUserGroup';
27
const SESSION_BE_USER = 'beUser';
28

Carsten  Rose's avatar
Carsten Rose committed
29
30
const TABLE_NAME_FORM = 'Form';
const TABLE_NAME_FORM_ELEMENT = 'FormElement';
31
const TABLE_NAME_SPLIT = 'Split';
Carsten  Rose's avatar
Carsten Rose committed
32

33
34
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';
Carsten  Rose's avatar
Carsten Rose committed
35
const FORM_UPDATE = 'form_update';
36
const FORM_DELETE = 'form_delete';
37
const FORM_DRAG_AND_DROP = 'form_drag_and_drop';
38
39
40
41
42
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';
43
44
const FORM_BUTTON_NEW = 'new';
const FORM_BUTTON_DELETE = 'delete';
45
46
const FORM_BUTTON_CLOSE = 'close';
const FORM_BUTTON_SAVE = 'save';
47

48
49
const REPORT_SAVE = 'reportSave';

50
51
const F_BS_COLUMNS = 'bsColumns';

52
53
54
55
const F_BS_LABEL_COLUMNS = 'bsLabelColumns';
const F_BS_INPUT_COLUMNS = 'bsInputColumns';
const F_BS_NOTE_COLUMNS = 'bsNoteColumns';

56
57
const RETURN_URL = 'return_url';
const RETURN_SIP = 'return_sip';
58
const RETURN_ARRAY = 'return_array';
59

60
const SQL_FORM_ELEMENT_BY_ID = "SELECT * FROM FormElement AS fe WHERE fe.id = ?";
61
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";
Carsten  Rose's avatar
Carsten Rose committed
62
63
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";
64
const SQL_FORM_ELEMENT_SIMPLE_ALL_CONTAINER = "SELECT fe.id, fe.feIdContainer, fe.name, 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";
Carsten  Rose's avatar
Carsten Rose committed
65
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";
66
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' ";
67
68
//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'";
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'";
69

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

Carsten  Rose's avatar
Carsten Rose committed
73
// SANITIZE Classifier
74
const SANITIZE_ALLOW_AUTO = "auto"; // Default for FormElements
Carsten  Rose's avatar
Carsten Rose committed
75
76
const SANITIZE_ALLOW_ALNUMX = "alnumx";
const SANITIZE_ALLOW_DIGIT = "digit";
77
const SANITIZE_ALLOW_NUMERICAL = "numerical";
78
const SANITIZE_ALLOW_EMAIL = "email";
79
const SANITIZE_ALLOW_PATTERN = "pattern";
Carsten  Rose's avatar
Carsten Rose committed
80
const SANITIZE_ALLOW_ALLBUT = "allbut";
Carsten  Rose's avatar
Carsten Rose committed
81
const SANITIZE_ALLOW_ALL = "all";
82
const SANITIZE_DEFAULT = SANITIZE_ALLOW_DIGIT; // for {{variable}} expressions without checkType
83

84
85
const SANITIZE_EXCEPTION = 'exception';
const SANITIZE_EMPTY_STRING = 'empty string';
86

87
88
const SANITIZE_VIOLATE = '!!';

89
90
91
92
93
94
// 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';
95
const WRAP_SETUP_SUBRECORD = 'subrecord';
96
const WRAP_SETUP_IN_FIELDSET = 'inFieldset';
97
const WRAP_SETUP_IN_TEMPLATE_GROUP = 'inTemplateGroup';
98
const WRAP_SETUP_START = 'start';
99
const WRAP_SETUP_CLASS = 'class';
100
101
const WRAP_SETUP_END = 'end';

102
103
104
// dbQuerySimple
const ROW_REGULAR = "regular";
const ROW_IMPLODE_ALL = "implode_all";
105
106
107
108
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";
109
const ROW_KEYS = "keys";
110

111
// KeyValueParser
112
113
const KVP_IF_VALUE_EMPTY_COPY_KEY = 'if_value_empty_copy_key';
const KVP_VALUE_GIVEN = 'value_given';
114

115
// https://lib2.colostate.edu/wildlife/atoz.php?letter=ALL
116
117
118
119
// JSON encoded messages thrown through an exception:
const ERROR_MESSAGE_TO_USER = 'toUser'; // always shown to the user.
const ERROR_MESSAGE_SUPPORT = 'support'; // Message to help the developer to understand the problem.
const ERROR_MESSAGE_OS = 'os'; // Error message from the OS - like 'file not found' or specific SQL problem
120

121
// QFQ Error Codes
Carsten  Rose's avatar
Carsten Rose committed
122
const ERROR_UNKNOW_SANITIZE_CLASS = 1001;
123

124
const ERROR_CODE_SHOULD_NOT_HAPPEN = 1003;
125
126
const ERROR_SIP_MALFORMED = 1005;
const ERROR_SIP_INVALID = 1006;
127
const ERROR_MISSING_RECORD_ID = 1007;
128
const ERROR_IN_SQL_STATEMENT = 1008;
129
const ERROR_MISSING_REQUIRED_PARAMETER = 1009;
130
const ERROR_FE_NESTED_TOO_MUCH = 1010;
131
132
133
134
135
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
136
137
138
139
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;
140
const ERROR_FORM_UNKNOWN_PERMISSION_MODE = 1020;
Carsten  Rose's avatar
Carsten Rose committed
141
const ERROR_MULTI_SQL_MISSING = 1021;
142
const ERROR_TOKEN_MISSING = 1022;
Carsten  Rose's avatar
Carsten Rose committed
143
const ERROR_RECURSION_TOO_DEEP = 1023;
144
const ERROR_CHECKBOXMODE_UNKNOWN = 1024;
145
const ERROR_MISSING_SQL1 = 1025;
146
const ERROR_CHECKBOX_EQUAL = 1026;
147
const ERROR_MISSING_ITEM_LIST = 1027;
148
const ERROR_UNKNOWN_FORM_RENDER = 1028;
Carsten  Rose's avatar
Carsten Rose committed
149
const ERROR_NAME_LABEL_EMPTY = 1029;
150
const ERROR_BROKEN_JSON_STRUCTURE = 1030;
Carsten  Rose's avatar
Carsten Rose committed
151
const ERROR_DEBUG = 1031;
152
153
154
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
const ERROR_RESERVED_KEY_NAME = 1034;
155
const ERROR_MISSING_FORM = 1035;
156
const ERROR_UNKNOWN_FORWARD_MODE = 1036;
157
158
159
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
160
const ERROR_MISSING_PARAMETER_FILE = 1040;
161
const ERROR_NO_BE_USER_LOGGED = 1041;
Carsten  Rose's avatar
Carsten Rose committed
162
163
164
165
166
167
168
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;
const ERROR_GET_STORE_ZERO = 1047;
const ERROR_SET_STORE_ZERO = 1048;
169
const ERROR_INVALID_OR_MISSING_PARAMETER = 1050;
170
const ERROR_UNKNOWN_SQL_LOG_MODE = 1051;
Carsten  Rose's avatar
Carsten Rose committed
171
const ERROR_FORM_NOT_FOUND = 1052;
172
const ERROR_DATE_TIME_FORMAT_NOT_RECOGNISED = 1053;
173
const ERROR_SANATIZE_INVALID_VALUE = 1054;
174
const ERROR_REQUIRED_VALUE_EMPTY = 1055;
175
const ERROR_DATE_UNEXPECTED_FORMAT = 1056;
176
const ERROR_UNEXPECTED_TYPE = 1057;
177
const ERROR_NOT_APPLICABLE = 1058;
178
179
180
181
182
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;
183

184
185
186
187
188
189
190
191
192
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;
193
const ERROR_MISSING_SLAVE_ID_DEFINITION = 1074;
194
const ERROR_MISSING_INTL = 1075;
195
const ERROR_HTML_TOKEN_TOO_SHORT = 1076;
196
const ERROR_MISSING_PRINTF_ARGUMENTS = 1077;
197
const ERROR_MISSING_DEFINITON = 1078;
198
const ERROR_QFQ_VERSION = 1079;
Carsten  Rose's avatar
Carsten Rose committed
199
const ERROR_PLAY_SQL_FILE = 1080;
200
const ERROR_MISSING_FILE_NAME = 1081;
201
const ERROR_MAX_FILE_SIZE_TOO_BIG = 1082;
Elias Villiger's avatar
Elias Villiger committed
202
const ERROR_SMALLER_THAN_MIN = 1083;
Elias Villiger's avatar
Elias Villiger committed
203
const ERROR_LARGER_THAN_MAX = 1084;
204
const ERROR_INVALID_DECIMAL_FORMAT = 1085;
205
const ERROR_INVALID_DATE = 1086;
206

207
// Subrecord
208
const ERROR_SUBRECORD_MISSING_COLUMN_ID = 1100;
209
const ERROR_SUBRECORD_DETAIL_COLUMN_NOT_FOUND = 'Column not found in primary record or current row';
210
// Store
211
212
const ERROR_STORE_VALUE_ALREADY_CODPIED = 1200;
const ERROR_STORE_KEY_EXIST = 1201;
213

214
// I/O Error
215
216
217
218
219
220
221
222
223
const ERROR_IO_READ_FILE = 1300;
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;
224
const ERROR_IO_CREATE_FILE = 1311;
Carsten  Rose's avatar
Carsten Rose committed
225
const ERROR_IO_COPY_FILE = 1312;
226
const ERROR_IO_FILE_NOT_FOUND = 1313;
227

228
//Report
229
230
const ERROR_UNKNOWN_LINK_QUALIFIER = 1400;
const ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION = 1401;
231
232
233
234
235
236
237
238
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;
239
const ERROR_INVALID_SAVE_PDF_FILENAME = 1410;
240

241
// Upload
242
const ERROR_UPLOAD = 1500;
243
244
245
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
246
const ERROR_UPLOAD_UNKNOWN_ACTION = 1504;
247
const ERROR_NO_TARGET_PATH_FILE_NAME = 1505;
248
const ERROR_UPLOAD_FILES_BROKEN = 1506;
249

250
// LDAP / typeahead
251
const ERROR_LDAP_CONNECT = 1600;
252
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH = 1601;
253
254
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH_PREFETCH = 1602;
const ERROR_LDAP_BIND = 1603;
255
const ERROR_MISSING_TYPE_AHEAD_SQL_PREFETCH = 1604;
256

Carsten  Rose's avatar
Carsten Rose committed
257
258
259
260
// Download
const ERROR_DOWNLOAD_CREATE_NEW_FILE = 1700;
const ERROR_DOWNLOAD_NO_FILES = 1701;
const ERROR_DOWNLOAD_NOTHING_TO_DO = 1702;
261
const ERROR_DOWNLOAD_UNEXPECTED_MIME_TYPE = 1703;
Carsten  Rose's avatar
Carsten Rose committed
262
const ERROR_DOWNLOAD_UNEXPECTED_NUMBER_OF_SOURCES = 1704;
263
const ERROR_DOWNLOAD_FILE_NOT_READABLE = 1705;
264
const ERROR_DOWNLOAD_FOPEN_BLOCKED = 1706;
Carsten  Rose's avatar
Carsten Rose committed
265

266
267
// Excel
const ERROR_EXCEL_POSITION_ARGUMENT_EMPTY = 1800;
268
const ERROR_EXCEL_INVALID_COORDINATES = 1801;
269

270
271
// KeyValueParser
const ERROR_KVP_VALUE_HAS_NO_KEY = 1900;
272

273
// DB Errors
274
275
276
277
278
279
280
281
282
283
284
285
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;
286
287
288
const ERROR_DB_UNKNOWN_COMMAND = 2012;
const ERROR_DB_MISSING_COLUMN_ID = 2013;
const ERROR_DB_COLUMN_NOT_FOUND_IN_TABLE = 2014;
289
const ERROR_DB_SET_CHARSET = 2015;
Carsten  Rose's avatar
Carsten Rose committed
290
const ERROR_DB_MULTI_QUERY_FAILED = 2016;
Carsten  Rose's avatar
Carsten Rose committed
291
292
293
294

// onArray
const ERROR_SUBSTITUTE_FOUND = 2100;

Carsten  Rose's avatar
Carsten Rose committed
295
// Dirty
Carsten  Rose's avatar
Carsten Rose committed
296
297
298
const ERROR_DIRTY_MISSING_FORM_IN_SIP = 2200;
const ERROR_DIRTY_DELETE_RECORD = 2201;
const ERROR_DIRTY_UNKNOWN_ACTION = 2202;
299
300
const ERROR_DIRTY_MISSING_LOCK = 2203;
const ERROR_DIRTY_ALREADY_LOCKED = 2204;
Carsten  Rose's avatar
Carsten Rose committed
301
const ERROR_DIRTY_RECORD_MODIFIED = 2205;
Carsten  Rose's avatar
Carsten Rose committed
302

303
304
305
// Language
const ERROR_LANGUAGE_NOT_CONFIGURED_IN_QFQ = 2300;

306
307
308
309
// Session
const ERROR_MISSING_SESSIONNAME = 2400;
const ERROR_QFQ_SESSION_MISSING = 2401;
const ERROR_SESSION_BROKEN_SCRIPT_PATH = 2402;
310
const ERROR_MISSING_COOKIE = 2403;
311

312
313
314
const ERROR_HTML2PDF_MISSING_CONFIG = 2500;
const ERROR_HTML2PDF_WKHTML_NOT_EXECUTABLE = 2501;
const ERROR_HTML2PDF_WKHTML_FAILED = 2502;
315

316
// Thumbnail
317
const ERROR_THUMBNAIL_RENDER = 2600;
318
319
320

// Drag and Drop
const ERROR_DND_EMPTY_REORDER_SQL = 2700;
321
322
323
//
// Store Names: Identifier
//
324
325
const STORE_FORM = "F";  // form, still not saved in database
const STORE_SIP = "S"; // SIP
Carsten  Rose's avatar
Carsten Rose committed
326
const STORE_RECORD = "R"; // selected record from primary table.
327
const STORE_BEFORE = "B"; // selected record from primary table before any modifcations.
328
const STORE_PARENT_RECORD = "P"; // on autoCron, copy/paste & multi forms the recent record of the outer query (multi).
329
330
const STORE_TABLE_DEFAULT = "D"; // definition of primary table.
const STORE_TABLE_COLUMN_TYPES = "M"; // column types of primary table.
331
const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable
332
const STORE_TYPO3 = "T"; // Typo3 > Page content record > bodytext
333
const STORE_VAR = "V"; // Generic Vars
334
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
335
const STORE_EMPTY = "E"; // value: '', might helpfull if variable is not defined and should result in an empty string instead of {{...}} (cause not replaced)
Carsten  Rose's avatar
Carsten Rose committed
336
const STORE_SYSTEM = "Y"; // various system values like db connection credentials
Carsten  Rose's avatar
Carsten Rose committed
337
const STORE_EXTRA = 'X'; // Persistent Store: contains arrays! Not Usefull for user. Used by system.
338
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.
339
const STORE_LDAP = 'L';
340

341
const STORE_USE_DEFAULT = "FSRVD";
342

343
//
Carsten  Rose's avatar
Carsten Rose committed
344
// Store: Definitions / Members
345
346
//

Carsten  Rose's avatar
Carsten Rose committed
347
// URL variables
348
349
const CLIENT_FORM = 'form';
const CLIENT_SIP = 's';
350
const CLIENT_RECORD_ID = 'r';
351
352
const CLIENT_KEY_SEM_ID = 'keySemId';
const CLIENT_KEY_SEM_ID_USER = 'keySemIdUser';
353
354
355
const CLIENT_PAGE_ID = 'id';
const CLIENT_PAGE_TYPE = 'type';
const CLIENT_PAGE_LANGUAGE = 'L';
356
const CLIENT_UPLOAD_FE_NAME = 'name';
Carsten  Rose's avatar
Carsten Rose committed
357

358
359
const CLIENT_SIP_FOR_FORM = '_sipForForm';
const CLIENT_FE_NAME = '_feName';
360
const CLIENT_TYPO3VARS = '_sipForTypo3Vars';
361

362
363
364
365
// 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';
366
const CLIENT_HTTP_COOKIE = 'HTTP_COOKIE';
367
368
369
const CLIENT_HTTP_HOST = 'HTTP_HOST';
const CLIENT_HTTP_USER_AGENT = 'HTTP_USER_AGENT';
const CLIENT_SERVER_NAME = 'SERVER_NAME';
370
const CLIENT_SERVER_ADDRESS = 'SERVER_ADDR';
371
const CLIENT_SERVER_PORT = 'SERVER_PORT';
372
const CLIENT_REMOTE_ADDRESS = 'REMOTE_ADDR';
373
374
375
376
377
378
379
const CLIENT_REQUEST_SCHEME = 'REQUEST_SCHEME';
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';

380
// _COOKIE
Carsten  Rose's avatar
Carsten Rose committed
381
382
const CLIENT_COOKIE_QFQ = 'cookieQfq';

Carsten  Rose's avatar
Carsten Rose committed
383
// T3 Bodytext Keywords
384
const TYPO3_FORM = CLIENT_FORM;
385
const TYPO3_RECORD_ID = CLIENT_RECORD_ID;
386
const TYPO3_BE_USER_LOGGED_IN = 'beUserLoggedIn';   // 'yes' | 'no'
387
const TYPO3_BE_USER = 'beUser';   // 'yes' | 'no'
388
389
390
const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
391
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
392
const TYPO3_PAGE_ID = 'pageId';
393
394
const TYPO3_PAGE_ALIAS = 'pageAlias';
const TYPO3_PAGE_TITLE = 'pageTitle';
395
const TYPO3_PAGE_TYPE = 'pageType';
396

397
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
398
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
399
400
const TYPO3_SQL_LOG = 'sqlLog';
const TYPO3_SQL_LOG_MODE = 'sqlLogMode';
401

402
// Deprecated: legacy config - still used to read old configuration file.
403
404
405
406
const SYSTEM_DB_USER = 'DB_USER';
const SYSTEM_DB_SERVER = 'DB_SERVER';
const SYSTEM_DB_PASSWORD = 'DB_PASSWORD';
const SYSTEM_DB_NAME = 'DB_NAME';
407

408
// Recent DB config
409
410
411
412
413
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';

414
415
const SYSTEM_T3_DB_NAME = 'T3_DB_NAME';

416
const SYSTEM_DB_INIT = 'init';
417

418
419
420
const SYSTEM_DB_INDEX_DATA = "indexData";
const SYSTEM_DB_INDEX_QFQ = "indexQfq";

421
422
//const SYSTEM_DB_INDEX_DATA_DEPRECATED = "DB_INDEX_DATA";
//const SYSTEM_DB_INDEX_QFQ_DEPRECATED = "DB_INDEX_QFQ";
423

424
425
426
// Computed dynamically
const SYSTEM_DB_NAME_DATA = '_dbNameData';
const SYSTEM_DB_NAME_QFQ = '_dbNameQfq';
427

428
429
const SYSTEM_LOG_DIR = 'logDir'; //  Logging to file
const SYSTEM_LOG_DIR_DEFAULT = 'fileadmin/protected/log'; //  Logging to file
430

431
432
const SYSTEM_QFQ_LOG = 'qfqLog'; //  Logging to file
const SYSTEM_QFQ_LOG_FILE = 'fileadmin/protected/log/qfq.log';
433

434
const SYSTEM_SQL_LOG = 'sqlLog'; //  Logging to file
435
const SYSTEM_SQL_LOG_FILE = 'fileadmin/protected/log/sql.log';
436
const SYSTEM_SQL_LOG_MODE = 'sqlLogMode'; // Mode, which statements to log.
437

438
439
440
441
const SYSTEM_FORM_SUBMIT_LOG_MODE = 'formSubmitLogMode';
const FORM_SUBMIT_LOG_MODE_ALL = 'all';
const FORM_SUBMIT_LOG_MODE_NONE = 'none';

442
443
444
const SYSTEM_DATE_FORMAT = 'dateFormat';
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'redirectAllMailTo';
const SYSTEM_MAIL_LOG = 'mailLog';
445
const SYSTEM_MAIL_LOG_FILE = 'fileadmin/protected/log/mail.log';
446

447
const SYSTEM_SHOW_DEBUG_INFO = 'showDebugInfo';
448
449
const SYSTEM_SHOW_DEBUG_INFO_YES = 'yes';
const SYSTEM_SHOW_DEBUG_INFO_NO = 'no';
450
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
451
452
const SYSTEM_SHOW_DEBUG_INFO_DOWNLOAD = 'download';

453
454
//const SYSTEM_CSS_LINK_CLASS_INTERNAL = 'CSS_LINK_CLASS_INTERNAL';
//const SYSTEM_CSS_LINK_CLASS_EXTERNAL = 'CSS_LINK_CLASS_EXTERNAL';
455
456
457
458
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';
459

460
const SYSTEM_CSS_CLASS_COLUMN_ID = 'cssClassColumnId';
461

462
// Textmessages used for Form validation.
463
464
465
466
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';
467

468
const SYSTEM_FORM_BS_COLUMNS = 'formBsColumns';
469

470
471
472
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'formBsLabelColumns';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'formBsInputColumns';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'formBsNoteColumns';
473

474
const SYSTEM_BASE_URL = 'baseUrl';
475

476
const SYSTEM_SEND_E_MAIL = 'sendEmail';
477
const SYSTEM_SEND_E_MAIL_OPTIONS = 'sendEMailOptions';
478

479
const SYSTEM_EDIT_FORM_PAGE = 'editFormPage';
480

481
482
// computed automatically during runtime
const SYSTEM_PATH_EXT = 'EXT_PATH';
483
const SYSTEM_SITE_PATH = 'SITE_PATH';
484

485
486
487
const SYSTEM_LDAP_1_RDN = 'LDAP_1_RDN'; // Credentials to access LDAP
const SYSTEM_LDAP_1_PASSWORD = 'LDAP_1_PASSWORD'; // Credentials to access LDAP

488
489
490
const SYSTEM_ESCAPE_TYPE_DEFAULT = 'escapeTypeDefault';
const SYSTEM_SECURITY_VARS_HONEYPOT = 'securityVarsHoneypot'; // Fake variables
const SYSTEM_SECURITY_ATTACK_DELAY = 'securityAttackDelay'; // Detected attack causes x seconds delay
491
const SYSTEM_SECURITY_ATTACK_DELAY_DEFAULT = 5; // Detected attack causes x seconds delay
492
493
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;
494
495
496
497
const SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT = 50; // Default max length for get variables

const GET_EXTRA_LENGTH_TOKEN = '_';

498
499
500
const SYSTEM_EXTRA_BUTTON_INFO_INLINE = 'extraButtonInfoInline';
const SYSTEM_EXTRA_BUTTON_INFO_BELOW = 'extraButtonInfoBelow';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'extraButtonInfoPosition';
501
502
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_AUTO = 'auto';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION_BELOW = 'below';
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
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';
527
528
529
530
const SYSTEM_DB_UPDATE_ALWAYS = 'always';
const SYSTEM_DB_UPDATE_NEVER = 'never';
const SYSTEM_DB_UPDATE_AUTO = 'auto';

531
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS = 'recordLockTimeoutSeconds';
Carsten  Rose's avatar
Carsten Rose committed
532
const SYSTEM_RECORD_LOCK_TIMEOUT_SECONDS_DEFAULT = 900; // 15 mins
Carsten  Rose's avatar
Carsten Rose committed
533

534
// Deprecated, replaced by SYSTEM_FILL_STORE_SYSTEM_BY_SQ
535
const SYSTEM_VAR_ADD_BY_SQL = 'VAR_ADD_BY_SQL'; // since 1.12.17
536

537
538
const SYSTEM_FILL_STORE_SYSTEM_BY_SQL = 'fillStoreSystemBySql';
const SYSTEM_FILL_STORE_SYSTEM_ERROR_MSG = 'fillStoreSystemBySqlErrorMsg';
539

540
const SYSTEM_FORM_LANGUAGE = 'formLanguage';
541

542
543
const SYSTEM_FORM_LANGUAGE_A_ID = 'formLanguageAId';
const SYSTEM_FORM_LANGUAGE_A_LABEL = 'formLanguageALabel';
544

545
546
const SYSTEM_FORM_LANGUAGE_B_ID = 'formLanguageBId';
const SYSTEM_FORM_LANGUAGE_B_LABEL = 'formLanguageBLabel';
547

548
549
const SYSTEM_FORM_LANGUAGE_C_ID = 'formLanguageCId';
const SYSTEM_FORM_LANGUAGE_C_LABEL = 'formLanguageCLabel';
550

551
552
const SYSTEM_FORM_LANGUAGE_D_ID = 'formLanguageDId';
const SYSTEM_FORM_LANGUAGE_D_LABEL = 'formLanguageDLabel';
553

554
const SYSTEM_ENTER_AS_SUBMIT = 'enterAsSubmit';
555
const SYSTEM_SHOW_ID_IN_FORM_TITLE = 'showIdInFormTitle';
556

557
const SYSTEM_CMD_WKHTMLTOPDF = 'cmdWkhtmltopdf';
558

559
560
561
562
563
564
565
566
// Thumbnail
const SYSTEM_CMD_INKSCAPE = 'cmdInkscape';
const SYSTEM_CMD_CONVERT = 'cmdConvert';
const SYSTEM_THUMBNAIL_DIR_SECURE = 'thumbnailDirSecure';
const SYSTEM_THUMBNAIL_DIR_SECURE_DEFAULT = 'fileadmin/protected/qfqThumbnail';
const SYSTEM_THUMBNAIL_DIR_PUBLIC = 'thumbnailDirPublic';
const SYSTEM_THUMBNAIL_DIR_PUBLIC_DEFAULT = 'typo3temp/qfqThumbnail';

567
const DOCUMENTATION_QFQ = 'documentation';
568
569
const DOCUMENTATION_QFQ_URL = 'https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/Manual.html';

570

571
// Not stored in config.qfq.ini, but used in STORE_SYSTEM
572
// Information for: Log / Debug / Exception
Carsten  Rose's avatar
Carsten Rose committed
573
574
575
576
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.
577
578
const SYSTEM_FORM = CLIENT_FORM;                        // '<formName> / <formId>'
const SYSTEM_FORM_ELEMENT = 'formElement';              // '<formElementName> / <formElementeId>'
579
const SYSTEM_FORM_ELEMENT_ID = 'formElementId';              // '<formElementName> / <formElementeId>'
580
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
581
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
582
583
const SYSTEM_REPORT_COLUMN_INDEX = 'reportColumnIndex'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_NAME = 'reportColumnName'; // Keyname of SQL-column processed at the moment.
584
585
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Keyname of SQL-column processed at the moment.
586
const SYSTEM_MESSAGE_DEBUG = 'messageDebug';
Carsten  Rose's avatar
Carsten Rose committed
587
588
589
590
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#';
591
const SYSTEM_DRAG_AND_DROP_JS = 'hasDragAndDropJS';
Carsten  Rose's avatar
Carsten Rose committed
592

593
const SYSTEM_PARAMETER_LANGUAGE_FIELD_NAME = 'parameterLanguageFieldName';
594
595
const CSS_REQUIRED = 'required-field';

596
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen globale Vars benutzt.
Carsten  Rose's avatar
Carsten Rose committed
597
598
599
//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.
600

601
602
603
604
605
606
607
const MODE_HTML = 'html';
const MODE_JSON = 'json';

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

608
const SIP_TOKEN_LENGTH = 13; // length of string returned by `uniqid()`
609
610
const SIP_SIP = CLIENT_SIP;  // s
const SIP_RECORD_ID = CLIENT_RECORD_ID; // r
Carsten  Rose's avatar
Carsten Rose committed
611
const SIP_TARGET_URL = '_targetUrl'; // URL where to jump after delete()
612
const SIP_MODE_ANSWER = '_modeAnswer'; // Mode how delete() will answer to client: MODE_HTML, MODE_JSON
613
const SIP_FORM = CLIENT_FORM;
614
const SIP_TABLE = 'table'; // delete a record from 'table'
615
const SIP_URLPARAM = 'urlparam';
Carsten  Rose's avatar
Carsten Rose committed
616
const SIP_SIP_URL = 'sipUrl';
617
const SIP_MAKE_URLPARAM_UNIQ = '_makeUrlParamUniq'; // SIPs for 'new records' needs to be uniq per TAB! Therefore add a uniq parameter
Carsten  Rose's avatar
Carsten Rose committed
618
619
620
621
const SIP_DOWNLOAD_PARAMETER = '_b64_download'; // Parametername, filled in SIP, to hold all download element parameter.

const SIP_PREFIX_BASE64 = '_b64';

622
623
624
625
626
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
627
// FURTHER: all extracted params from 'urlparam
628

629
630
const ACTION_KEYWORD_SLAVE_ID = 'slaveId';

631
const VAR_RANDOM = 'random';
632
633
634
const VAR_FILE_DESTINATION = 'fileDestination';
const VAR_SLAVE_ID = ACTION_KEYWORD_SLAVE_ID;
const VAR_FILENAME = 'filename'; // Original filename of an uploaded file.
635
const VAR_FILENAME_ONLY = 'filenameOnly'; // Original filename of an uploaded file, without directories.
636
637
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, .
638
639
640
const VAR_FILE_MIME_TYPE = 'mimeType';
const VAR_FILE_SIZE = 'fileSize';

641

642
// PHP class Typeahead
643
const TYPEAHEAD_API_QUERY = 'query';  // Name of parameter in API call of typeahead.php?query=...&s=... - See also FE_TYPE_AHEAD_SQL
644
const TYPEAHEAD_API_PREFETCH = 'prefetch';  // Name of parameter in API call of typeahead.php?prefetch=...&s=... - See also FE_TYPE_AHEAD_SQL
645
646
const TYPEAHEAD_API_SIP = 'sip';  // Name of parameter in API call of typeahead.php?query=...&s=...
const TYPEAHEAD_DEFAULT_LIMIT = 20;
647
const TYPEAHEAD_SQL_KEY_NAME = 'id';
648

649
650
const DEFAULT_LDAP_TIME_LIMIT = 3;

651
652
const SINGLE_TICK = "'";
const DOUBLE_TICK = '"';
Carsten  Rose's avatar
#2067    
Carsten Rose committed
653

654
// TOKEN evaluate
655
const TOKEN_ESCAPE_CONFIG = 'c';
656
657
const TOKEN_ESCAPE_SINGLE_TICK = 's';
const TOKEN_ESCAPE_DOUBLE_TICK = 'd';
658
659
660
661
const TOKEN_ESCAPE_LDAP_FILTER = 'l';
const TOKEN_ESCAPE_LDAP_DN = 'L';
const TOKEN_ESCAPE_MYSQL = 'm';
const TOKEN_ESCAPE_NONE = '-';
662
663
664
665
666
667
668

// Workaround for PHP < 5.6.0
if (!function_exists('ldap_escape')) {
    define('LDAP_ESCAPE_FILTER', 0x01);
    define('LDAP_ESCAPE_DN', 0x02);
}

669
const TOKEN_FOUND_IN_STORE_QUERY = 'query';
670
const TOKEN_FOUND_AS_COLUMN = 'column';
671
const TOKEN_FOUND_AS_DEFAULT = 'default';
672
673
674

const RANDOM_LENGTH = 32;

675
// FORM - copy from table 'form' of processed form
676
//const DEF_FORM_NAME = CLIENT_FORM;
677
678

// FORMELEMENT - copy of all formElements of processed form
679
//const DEF_FORM_ELEMENT_ID = 'id';
680

681
682
683
// SQL logging Modes
const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';
684
685
const SQL_LOG_MODE_NONE = 'none';
const SQL_LOG_MODE_ERROR = 'error';
686

687
const MODE_LDAP_PREFETCH = 'ldapPrefetch';
688
689
690
const MODE_LDAP_SINGLE = 'ldapSingle';
const MODE_LDAP_MULTI = 'ldapMulti';

691
// api/save.php, api/delete.php, api/load.php
692
const API_DELETE_PHP = 'delete.php';
Carsten  Rose's avatar
Carsten Rose committed
693
const API_DOWNLOAD_PHP = 'download.php';
694
const API_DRAG_AND_DROP_PHP = 'dragAndDrop.php';
695

696
697
698
699
const API_STATUS = 'status';
const API_MESSAGE = 'message';
const API_REDIRECT = 'redirect';
const API_REDIRECT_URL = 'redirect-url';
Carsten  Rose's avatar
Carsten Rose committed
700
701
const API_LOCK_ACTION = 'action';
const API_LOCK_TIMEOUT = 'lock_timeout';
702
703
const API_FIELD_NAME = 'field-name';
const API_FIELD_MESSAGE = 'field-message';
Carsten  Rose's avatar
Carsten Rose committed
704
const API_FORM_UPDATE = 'form-update';
705
706
707
708
709
710
const API_FORM_UPDATE_FORM_ELEMENT = 'form-element';
const API_FORM_UPDATE_VALUE = 'value';
const API_FORM_UPDATE_HIDDEN = 'hidden';
const API_FORM_UPDATE_DISABLED = 'disabled';
const API_FORM_UPDATE_REQUIRED = 'required';

711
const API_ELEMENT_UPDATE = 'element-update';
712
713
const API_ELEMENT_ATTRIBUTE = 'attr';
const API_ELEMENT_CONTENT = 'content';
714

715
716
717
718
const API_SUBMIT_REASON = 'submit_reason';
const API_SUBMIT_REASON_SAVE = 'save';
const API_SUBMIT_REASON_SAVE_CLOSE = 'save,close';

Carsten  Rose's avatar
Carsten Rose committed
719
const API_LOCK_ACTION_LOCK = 'lock';
720
const API_LOCK_ACTION_EXTEND = 'extend';
Carsten  Rose's avatar
Carsten Rose committed
721
722
const API_LOCK_ACTION_RELEASE = 'release';

723
const API_ANSWER_STATUS_SUCCESS = 'success';
Carsten  Rose's avatar
Carsten Rose committed
724
725
const API_ANSWER_STATUS_CONFLICT = 'conflict';
const API_ANSWER_STATUS_CONFLICT_ALLOW_FORCE = 'conflict_allow_force';
726
const API_ANSWER_STATUS_ERROR = 'error';
727
728
const API_ANSWER_REDIRECT_AUTO = 'auto';
const API_ANSWER_REDIRECT_CLOSE = 'close';
729
730
const API_ANSWER_REDIRECT_NO = 'no';
const API_ANSWER_REDIRECT_URL = 'url';
731
const API_ANSWER_REDIRECT_URL_SKIP_HISTORY = 'url-skip-history';
732

733
734
735
736
737
738
739
const API_TYPEAHEAD_KEY = 'key';
const API_TYPEAHEAD_VALUE = 'value';

const DATA_HIDDEN = 'data-hidden';
const DATA_DISABLED = 'data-disabled';
const DATA_REQUIRED = 'data-required';

Carsten  Rose's avatar
Carsten Rose committed
740
const CLASS_TYPEAHEAD = 'qfq-typeahead';
741
const DATA_TYPEAHEAD_SIP = 'data-typeahead-sip'; // Used for typeAhead
742
743
744

const CLASS_NOTE = 'qfq-note';

745
746
const DATA_ENABLE_SAVE_BUTTON = 'data-enable-save-button';

Carsten  Rose's avatar
Carsten Rose committed
747
748
749
//const CLASS_TYPEAHEAD = 'qfq-type-ahead';
//const DATA_TYPEAHEAD_SIP = 'data-sip'; // Used for typeAhead

750
751
const DATA_TYPEAHEAD_LIMIT = 'data-typeahead-limit';
const DATA_TYPEAHEAD_MINLENGTH = 'data-typeahead-minlength';
752
const DATA_TYPEAHEAD_PEDANTIC = 'data-typeahead-pedantic';
753

754
755
756
const CLASS_CHARACTER_COUNT = 'qfq-character-count';
const DATA_CHARACTER_COUNT_ID = 'data-character-count-id';

757
758
const CLASS_FORM_ELEMENT_EDIT = 'qfq-form-element-edit';

759
// BuildForm
760
761
const SYMBOL_NEW = 'new';
const SYMBOL_EDIT = 'edit';
762
const SYMBOL_SHOW = 'show';
763
const SYMBOL_DELETE = 'delete';
764
765

//CHECKBOX
766
767
768
const ALIGN_HORIZONTAL = 'horizontal';
const ALIGN_VERTICAL = 'vertical';

769
// Subrecord
770
const SUBRECORD_COLUMN_DEFAULT_MAX_LENGTH = 20;
771
772
const SUBRECORD_COLUMN_TITLE_EDIT = 'subrecordColumnTitleEdit';
const SUBRECORD_COLUMN_TITLE_DELETE = 'subrecordColumnTitleDelete';
773
774
775
const FORM_ELEMENTS_NATIVE = 'native';
const FORM_ELEMENTS_SUBRECORD = 'subrecord';
const FORM_ELEMENTS_NATIVE_SUBRECORD = 'native_subrecord';
Carsten  Rose's avatar
Carsten Rose committed
776
//const FORM_ELEMENTS_DYNAMIC_UPDATE = 'native_dynamic_update';
777
778
779
780
781
const SUBRECORD_NEW = SYMBOL_NEW;
const SUBRECORD_EDIT = SYMBOL_EDIT;
const SUBRECORD_DELETE = SYMBOL_DELETE;
const SUBRECORD_PARAMETER_FORM = CLIENT_FORM;
const SUBRECORD_PARAMETER_PAGE = 'page';
782
783
const SUBRECORD_PARAMETER_DETAIL = 'detail';

784
785
786
787
788
789
790
791
792
793
794
const SUBRECORD_COLUMN_TITLE = 'title';
const SUBRECORD_COLUMN_MAX_LENGTH = 'maxLength';
const SUBRECORD_COLUMN_NO_STRIP = 'nostrip';
const SUBRECORD_COLUMN_ICON = 'icon';
const SUBRECORD_COLUMN_LINK = 'link';
const SUBRECORD_COLUMN_URL = 'url';
const SUBRECORD_COLUMN_MAILTO = 'mailto';
const SUBRECORD_COLUMN_ROW_CLASS = '_rowClass';
const SUBRECORD_COLUMN_ROW_TITLE = '_rowTitle';
const SUBRECORD_COLUMN_ROW_TOOLTIP = '_rowTooltip';

795
const SUBRECORD_TABLE_CLASS_DEFAULT = 'table table-hover qfq-table-100';
Carsten  Rose's avatar
Carsten Rose committed
796

797
const GLYPH_ICON = 'glyphicon';
798
799
800
const GLYPH_ICON_EDIT = 'glyphicon-pencil';
const GLYPH_ICON_NEW = 'glyphicon-plus';
const GLYPH_ICON_DELETE = 'glyphicon-trash';
801
802
803
const GLYPH_ICON_HELP = 'glyphicon-question-sign';
const GLYPH_ICON_INFO = 'glyphicon-info-sign';
const GLYPH_ICON_SHOW = 'glyphicon-search';
804
const GLYPH_ICON_TOOL = 'glyphicon-wrench';
805
806
const GLYPH_ICON_CHECK = 'glyphicon-ok';
const GLYPH_ICON_CLOSE = 'glyphicon-remove';
807
const GLYPH_ICON_TASKS = 'glyphicon-tasks';
Carsten  Rose's avatar
Carsten Rose committed
808
const GLYPH_ICON_DUPLICATE = 'glyphicon-duplicate';
Carsten  Rose's avatar
Carsten Rose committed
809
const GLYPH_ICON_VIEW = 'glyphicon-eye-open';
Carsten  Rose's avatar
Carsten Rose committed
810
const GLYPH_ICON_FILE = 'glyphicon-file';
811
const GLYPH_ICON_COPY = 'glyphicon-copy';
812

813
// FORM columns: real
814
const F_ID = 'id';
815
const F_NAME = 'name';
816
const F_TITLE = 'title';
817
const F_TABLE_NAME = 'tableName';
818
819
const F_REQUIRED_PARAMETER_NEW = 'requiredParameterNew';
const F_REQUIRED_PARAMETER_EDIT = 'requiredParameterEdit';