Constants.php 36.5 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
const CONFIG_INI = "config.qfq.ini";  // QFQ configuration file: db access
Carsten  Rose's avatar
Carsten Rose committed
11

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

Carsten  Rose's avatar
Carsten Rose committed
15
16
const QFQ_LOG = 'qfq.log';

17
const SESSION_LIFETIME_SECONDS = 86400;
18
const SESSION_NAME = 'qfq';
19
20
21
const SESSION_FE_USER_UID = 'feUserUid';
const SESSION_FE_USER = 'feUser';
const SESSION_FE_USER_GROUP = 'feUserGroup';
22

23
24
const FORM_LOAD = 'form_load';
const FORM_SAVE = 'form_save';
Carsten  Rose's avatar
Carsten Rose committed
25
const FORM_UPDATE = 'form_update';
26
const FORM_DELETE = 'form_delete';
27
28
29
30
31
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';
32
33
const FORM_BUTTON_NEW = 'new';
const FORM_BUTTON_DELETE = 'delete';
34
35
const FORM_BUTTON_CLOSE = 'close';
const FORM_BUTTON_SAVE = 'save';
36

37
38
const F_BS_COLUMNS = 'bsColumns';

39
40
41
42
const F_BS_LABEL_COLUMNS = 'bsLabelColumns';
const F_BS_INPUT_COLUMNS = 'bsInputColumns';
const F_BS_NOTE_COLUMNS = 'bsNoteColumns';

43
44
const RETURN_URL = 'return_url';
const RETURN_SIP = 'return_sip';
45
const RETURN_ARRAY = 'return_array';
46

Carsten  Rose's avatar
Carsten Rose committed
47
48
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";
49
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
50
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";
51
52
53
54
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' ";
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 NAME_TG_COPIES = '_tgCopies';
55

Carsten  Rose's avatar
Carsten Rose committed
56
57
58
// SANITIZE Classifier
const SANITIZE_ALLOW_ALNUMX = "alnumx";
const SANITIZE_ALLOW_DIGIT = "digit";
59
const SANITIZE_ALLOW_NUMERICAL = "numerical";
60
const SANITIZE_ALLOW_EMAIL = "email";
61
62
63
const SANITIZE_ALLOW_MIN_MAX = "min|max";
const SANITIZE_ALLOW_MIN_MAX_DATE = "min|max date";
const SANITIZE_ALLOW_PATTERN = "pattern";
Carsten  Rose's avatar
Carsten Rose committed
64
const SANITIZE_ALLOW_ALLBUT = "allbut";
Carsten  Rose's avatar
Carsten Rose committed
65
66
const SANITIZE_ALLOW_ALL = "all";
const SANITIZE_DEFAULT = SANITIZE_ALLOW_DIGIT;
67

68
69
70
const SANATIZE_EXCEPTION = 'exception';
const SANATIZE_EMPTY_STRING = 'empty string';

71
72
73
74
75
76
// 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';
77
const WRAP_SETUP_SUBRECORD = 'subrecord';
78
const WRAP_SETUP_IN_FIELDSET = 'inFieldset';
79
const WRAP_SETUP_IN_TEMPLATE_GROUP = 'inTemplateGroup';
80
81
82
const WRAP_SETUP_START = 'start';
const WRAP_SETUP_END = 'end';

83
84
85
// dbQuerySimple
const ROW_REGULAR = "regular";
const ROW_IMPLODE_ALL = "implode_all";
86
87
88
89
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";
90
const ROW_KEYS = "keys";
91

92
// KeyValueParser
93
94
const KVP_IF_VALUE_EMPTY_COPY_KEY = 'if_value_empty_copy_key';
const KVP_VALUE_GIVEN = 'value_given';
95

96
// QFQ Error Codes
Carsten  Rose's avatar
Carsten Rose committed
97
const ERROR_UNKNOW_SANITIZE_CLASS = 1001;
98

99
const ERROR_CODE_SHOULD_NOT_HAPPEN = 1003;
100
101
const ERROR_SIP_MALFORMED = 1005;
const ERROR_SIP_INVALID = 1006;
102
const ERROR_MISSING_RECORD_ID = 1007;
103
const ERROR_IN_SQL_STATEMENT = 1008;
104
const ERROR_MISSING_REQUIRED_PARAMETER = 1009;
105
106
107
108
109
110
const ERROR_MISSING_SESSIONNAME = 1010;
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
111
112
113
114
115
116
117
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;
const ERROR_FORM_UNKNOWN_PERMISSION_MODE = 10120;
const ERROR_MULTI_SQL_MISSING = 1021;
const ERROR_RECURSION_TOO_DEEP = 1023;
118
const ERROR_CHECKBOXMODE_UNKNOWN = 1024;
119
const ERROR_MISSING_SQL1 = 1025;
120
const ERROR_CHECKBOX_EQUAL = 1026;
121
const ERROR_MISSING_ITEM_LIST = 1027;
122
const ERROR_UNKNOWN_FORM_RENDER = 1028;
Carsten  Rose's avatar
Carsten Rose committed
123
const ERROR_NAME_LABEL_EMPTY = 1029;
Carsten  Rose's avatar
Carsten Rose committed
124
const ERROR_DEBUG = 1031;
125
126
127
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
const ERROR_RESERVED_KEY_NAME = 1034;
128
const ERROR_UNKNOWN_FORWARD_MODE = 1036;
Carsten  Rose's avatar
Carsten Rose committed
129
130
131
132
133
134
135
136
137
138
const ERROR_MISSING_HIDDEN_FIELD_IN_SIP = 1038;
const ERROR_MISSING_MIN_MAX = 1040;
const ERROR_MIN_MAX_VIOLATION = 1041;
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;
139

140
const ERROR_INVALID_OR_MISSING_PARAMETER = 1050;
141
const ERROR_UNKNOWN_SQL_LOG_MODE = 1051;
Carsten  Rose's avatar
Carsten Rose committed
142
const ERROR_FORM_NOT_FOUND = 1052;
143
const ERROR_DATE_TIME_FORMAT_NOT_RECOGNISED = 1053;
144
const ERROR_SANATIZE_INVALID_VALUE = 1054;
145
const ERROR_REQUIRED_VALUE_EMPTY = 1055;
146
const ERROR_DATE_UNEXPECTED_FORMAT = 1056;
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
const ERROR_UNEXPECTED_TYPE = 1057;
const ERROR_NOT_APPLICABLE = 108;
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;
const ERROR_MISSING_MESSAGE_FAIL = 1064;
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;
164
const ERROR_MISSING_SLAVE_ID_DEFINITION = 1074;
165
const ERROR_MISSING_INTL = 1075;
166
const ERROR_HTML_TOKEN_TOO_SHORT = 1076;
167
const ERROR_MISSING_PRINTF_ARGUMENTS = 1077;
168
const ERROR_MISSING_DEFINITON = 1078;
169
const ERROR_QFQ_VERSION = 1079;
Carsten  Rose's avatar
Carsten Rose committed
170
const ERROR_PLAY_SQL_FILE = 1080;
171

172
// Subrecord
173
const ERROR_SUBRECORD_MISSING_COLUMN_ID = 1100;
174

175
// Store
176
177
const ERROR_STORE_VALUE_ALREADY_CODPIED = 1200;
const ERROR_STORE_KEY_EXIST = 1201;
178

179
// I/O Error
180
181
182
183
184
185
186
187
188
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;
189
const ERROR_IO_CREATE_FILE = 1311;
190

191
//Report
192
193
const ERROR_UNKNOWN_LINK_QUALIFIER = 1400;
const ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION = 1401;
194
195
196
197
198
199
200
201
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;
202

203
// Upload
204
205
206
const ERROR_UPLOAD = 1500;
const ERROR_UNKNOWN_ACTION = 1502;
const ERROR_NO_TARGET_PATH_FILE_NAME = 1503;
207

Carsten  Rose's avatar
Carsten Rose committed
208
// LDAP
209
const ERROR_LDAP_CONNECT = 1600;
210
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH = 1601;
211
212
const ERROR_MISSING_TYPE_AHEAD_LDAP_SEARCH_PREFETCH = 1602;
const ERROR_LDAP_BIND = 1603;
213

Carsten  Rose's avatar
Carsten Rose committed
214
215
216
217
218
// Download
const ERROR_DOWNLOAD_CREATE_NEW_FILE = 1700;
const ERROR_DOWNLOAD_NO_FILES = 1701;
const ERROR_DOWNLOAD_NOTHING_TO_DO = 1702;
const ERROR_DOWNLOAD_UNEXPECTED_MIMETYPE = 1703;
Carsten  Rose's avatar
Carsten Rose committed
219
const ERROR_DOWNLOAD_UNEXPECTED_NUMBER_OF_SOURCES = 1704;
Carsten  Rose's avatar
Carsten Rose committed
220

221
222
// KeyValueParser
const ERROR_KVP_VALUE_HAS_NO_KEY = 1900;
223

224
// DB Errors
225
226
227
228
229
230
231
232
233
234
235
236
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;
237
238
239
const ERROR_DB_UNKNOWN_COMMAND = 2012;
const ERROR_DB_MISSING_COLUMN_ID = 2013;
const ERROR_DB_COLUMN_NOT_FOUND_IN_TABLE = 2014;
240
const ERROR_DB_SET_CHARSET = 2015;
Carsten  Rose's avatar
Carsten Rose committed
241
const ERROR_DB_MULTI_QUERY_FAILED = 2016;
Carsten  Rose's avatar
Carsten Rose committed
242
243
244
245

// onArray
const ERROR_SUBSTITUTE_FOUND = 2100;

246
247
248
//
// Store Names: Identifier
//
249
250
const STORE_FORM = "F";  // form, still not saved in database
const STORE_SIP = "S"; // SIP
Carsten  Rose's avatar
Carsten Rose committed
251
const STORE_RECORD = "R"; // selected record from primary table.
252
const STORE_BEFORE = "B"; // selected record from primary table before any modifcations.
253
const STORE_PARENT_RECORD = "P"; // on multi forms the recent record of the outer query (multi).
254
255
const STORE_TABLE_DEFAULT = "D"; // definition of primary table.
const STORE_TABLE_COLUMN_TYPES = "M"; // column types of primary table.
256
const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable
257
const STORE_TYPO3 = "T"; // Typo3 > Page content record > bodytext
258
const STORE_VAR = "V"; // Generic Vars
259
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
260
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
261
const STORE_SYSTEM = "Y"; // various system values like db connection credentials
Carsten  Rose's avatar
Carsten Rose committed
262
const STORE_EXTRA = 'X'; // Persistent Store: contains arrays! Not Usefull for user. Used by system.
263
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.
264
const STORE_LDAP = 'L';
265

266
const STORE_USE_DEFAULT = "FSRVD";
267

268
//
Carsten  Rose's avatar
Carsten Rose committed
269
// Store: Definitions / Members
270
271
//

Carsten  Rose's avatar
Carsten Rose committed
272
// URL variables
273
274
const CLIENT_FORM = 'form';
const CLIENT_SIP = 's';
275
const CLIENT_RECORD_ID = 'r';
276
277
const CLIENT_KEY_SEM_ID = 'keySemId';
const CLIENT_KEY_SEM_ID_USER = 'keySemIdUser';
278
279
280
const CLIENT_PAGE_ID = 'id';
const CLIENT_PAGE_TYPE = 'type';
const CLIENT_PAGE_LANGUAGE = 'L';
281
const CLIENT_UPLOAD_FE_NAME = 'name';
Carsten  Rose's avatar
Carsten Rose committed
282

283
284
const CLIENT_SIP_FOR_FORM = '_sipForForm';
const CLIENT_FE_NAME = '_feName';
285
const CLIENT_TYPO3VARS = '_sipForTypo3Vars';
286

287
288
289
290
291
292
293
// 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';
const CLIENT_HTTP_HOST = 'HTTP_HOST';
const CLIENT_HTTP_USER_AGENT = 'HTTP_USER_AGENT';
const CLIENT_SERVER_NAME = 'SERVER_NAME';
294
const CLIENT_SERVER_ADDRESS = 'SERVER_ADDR';
295
const CLIENT_SERVER_PORT = 'SERVER_PORT';
296
const CLIENT_REMOTE_ADDRESS = 'REMOTE_ADDR';
297
298
299
300
301
302
303
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';

Carsten  Rose's avatar
Carsten Rose committed
304
// T3 Bodytext Keywords
305
const TYPO3_FORM = CLIENT_FORM;
306
const TYPO3_RECORD_ID = CLIENT_RECORD_ID;
307
const TYPO3_BE_USER_LOGGED_IN = 'beUser';   // 'yes' | 'no'
308
309
310
const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
311
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
312
313
314
const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
315
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
316

317
// System
318
319
320
321
322
const SYSTEM_DB_USER = 'DB_USER';
const SYSTEM_DB_SERVER = 'DB_SERVER';
const SYSTEM_DB_PASSWORD = 'DB_PASSWORD';
const SYSTEM_DB_NAME = 'DB_NAME';
const SYSTEM_DB_NAME_TEST = 'DB_NAME_TEST';
323
const SYSTEM_DB_INIT = 'DB_INIT';
324
325
const SYSTEM_SQL_LOG = 'SQL_LOG'; //  Logging to file
const SYSTEM_SQL_LOG_MODE = 'SQL_LOG_MODE'; // Mode, which statements to log.
326
const SYSTEM_DATE_FORMAT = 'DATE_FORMAT';
327
const SYSTEM_REDIRECT_ALL_MAIL_TO = 'REDIRECT_ALL_MAIL_TO';
328
329
330
331

const SYSTEM_SHOW_DEBUG_INFO = 'SHOW_DEBUG_INFO';
const SYSTEM_CSS_LINK_CLASS_INTERNAL = 'CSS_LINK_CLASS_INTERNAL';
const SYSTEM_CSS_LINK_CLASS_EXTERNAL = 'CSS_LINK_CLASS_EXTERNAL';
332
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'CSS_CLASS_QFQ_CONTAINER';
333
const SYSTEM_CSS_CLASS_QFQ_FORM = 'CSS_CLASS_QFQ_FORM';
334
335
const SYSTEM_CSS_CLASS_QFQ_FORM_PILL = 'CSS_CLASS_QFQ_FORM_PILL';
const SYSTEM_CSS_CLASS_QFQ_FORM_BODY = 'CSS_CLASS_QFQ_FORM_BODY';
336

337
338
339
340
341
342
// Textmessages used for Form validation.
const SYSTEM_FORM_DATA_PATTERN_ERROR = 'FORM_DATA_PATTERN_ERROR';
const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'FORM_DATA_REQUIRED_ERROR';
const SYSTEM_FORM_DATA_MATCH_ERROR = 'FORM_DATA_MATCH_ERROR';
const SYSTEM_FORM_DATA_ERROR = 'FORM_DATA_ERROR';

343
344
const SYSTEM_FORM_BS_COLUMNS = 'FORM_BS_COLUMNS';

345
346
347
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'FORM_BS_LABEL_COLUMNS';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'FORM_BS_INPUT_COLUMNS';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'FORM_BS_NOTE_COLUMNS';
348

349
350
const SYSTEM_FORM_BUTTON_ON_CHANGE_CLASS = 'FORM_BUTTON_ON_CHANGE_CLASS';

351
352
353
const SYSTEM_BASE_URL_PRINT = 'BASE_URL_PRINT';
const SYSTEM_WKHTMLTOPDF = 'WKHTMLTOPDF';

354
355
const SYSTEM_EDIT_FORM_PAGE = 'EDIT_FORM_PAGE';

356
357
// computed automatically during runtime
const SYSTEM_PATH_EXT = 'EXT_PATH';
358
const SYSTEM_SITE_PATH = 'SITE_PATH';
359

360
361
362
363
364
365
366
367
368
369
const SYSTEM_LDAP_1_RDN = 'LDAP_1_RDN'; // Credentials to access LDAP
const SYSTEM_LDAP_1_PASSWORD = 'LDAP_1_PASSWORD'; // Credentials to access LDAP

const SYSTEM_ESCAPE_TYPE_DEFAULT = 'ESCAPE_TYPE_DEFAULT';
const SYSTEM_SECURITY_VARS_HONEYPOT = 'SECURITY_VARS_HONEYPOT'; // Fake variables
const SYSTEM_SECURITY_ATTACK_DELAY = 'SECURITY_ATTACK_DELAY'; // Detected attack causes x seconds delay
const SYSTEM_SECURITY_SHOW_MESSAGE = 'SECURITY_SHOW_MESSAGE'; // Detected attack shows an error message
const SYSTEM_SECURITY_GET_MAX_LENGTH = 'SECURITY_GET_MAX_LENGTH'; // Trim every character (before conversion) to SECURITY_GET_MAX_LENGTH chars;

// Not stored in config.qfq.ini, but used in STORE_SYSTEM
370
// Information for: Log / Debug / Exception
Carsten  Rose's avatar
Carsten Rose committed
371
372
373
374
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.
375
376
377
const SYSTEM_FORM = CLIENT_FORM;                        // '<formName> / <formId>'
const SYSTEM_FORM_ELEMENT = 'formElement';              // '<formElementName> / <formElementeId>'
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
378
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
379
380
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.
381
382
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.
Carsten  Rose's avatar
Carsten Rose committed
383
384
385
386
387
388
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#';

389
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt.
Carsten  Rose's avatar
Carsten Rose committed
390
391
392
//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.
393

394
395
396
397
398
399
400
const MODE_HTML = 'html';
const MODE_JSON = 'json';

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

401
const SIP_TOKEN_LENGTH = 13; // length of string returned by `uniqid()`
402
403
const SIP_SIP = CLIENT_SIP;  // s
const SIP_RECORD_ID = CLIENT_RECORD_ID; // r
Carsten  Rose's avatar
Carsten Rose committed
404
const SIP_TARGET_URL = '_targetUrl'; // URL where to jump after delete()
405
const SIP_MODE_ANSWER = '_modeAnswer'; // Mode how delete() will answer to client: MODE_HTML, MODE_JSON
406
const SIP_FORM = CLIENT_FORM;
407
const SIP_TABLE = 'table'; // delete a record from 'table'
408
const SIP_URLPARAM = 'urlparam';
409
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
410
411
412
413
const SIP_DOWNLOAD_PARAMETER = '_b64_download'; // Parametername, filled in SIP, to hold all download element parameter.

const SIP_PREFIX_BASE64 = '_b64';

414
415
416
417
418
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
419
// FURTHER: all extracted params from 'urlparam
420

421
422
const ACTION_KEYWORD_SLAVE_ID = 'slaveId';

423
const VAR_RANDOM = 'random';
424
425
426
const VAR_FILE_DESTINATION = 'fileDestination';
const VAR_SLAVE_ID = ACTION_KEYWORD_SLAVE_ID;
const VAR_FILENAME = 'filename'; // Original filename of an uploaded file.
427

428

429
// PHP class DB can operate in these modes
430
431
432
const MODE_DB_REGULAR = 'regular';
const MODE_DB_NO_LOG = 'noLog';

433
// PHP class Typeahead
434
const TYPEAHEAD_API_QUERY = 'query';  // Name of parameter in API call of typeahead.php?query=...&s=... - See also FE_TYPE_AHEAD_SQL
435
const TYPEAHEAD_API_PREFETCH = 'prefetch';  // Name of parameter in API call of typeahead.php?prefetch=...&s=... - See also FE_TYPE_AHEAD_SQL
436
437
const TYPEAHEAD_API_SIP = 'sip';  // Name of parameter in API call of typeahead.php?query=...&s=...
const TYPEAHEAD_DEFAULT_LIMIT = 20;
438
const TYPEAHEAD_SQL_KEY_NAME = 'id';
439

440
441
const DEFAULT_LDAP_TIME_LIMIT = 3;

442
443
const SINGLE_TICK = "'";
const DOUBLE_TICK = '"';
Carsten  Rose's avatar
#2067    
Carsten Rose committed
444

445
// TOKEN evaluate
446
const TOKEN_ESCAPE_CONFIG = 'c';
447
448
const TOKEN_ESCAPE_SINGLE_TICK = 's';
const TOKEN_ESCAPE_DOUBLE_TICK = 'd';
449
450
451
452
const TOKEN_ESCAPE_LDAP_FILTER = 'l';
const TOKEN_ESCAPE_LDAP_DN = 'L';
const TOKEN_ESCAPE_MYSQL = 'm';
const TOKEN_ESCAPE_NONE = '-';
453
454
455
456
457
458
459

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

460
const TOKEN_FOUND_IN_STORE_QUERY = 'query';
461
462
463

const RANDOM_LENGTH = 32;

464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
// Report, BodyText
const TOKEN_SQL = 'sql';
const TOKEN_HEAD = 'head';
const TOKEN_ALT_HEAD = 'althead';
const TOKEN_TAIL = 'tail';
const TOKEN_RBEG = 'rbeg';
const TOKEN_REND = 'rend';
const TOKEN_RENR = 'renr';
const TOKEN_RSEP = 'rsep';
const TOKEN_FBEG = 'fbeg';
const TOKEN_FEND = 'fend';
const TOKEN_FSEP = 'fsep';
const TOKEN_RBGD = 'rbgd';
const TOKEN_DEBUG = 'debug';
const TOKEN_FORM = CLIENT_FORM;
const TOKEN_RECORD_ID = CLIENT_RECORD_ID;
const TOKEN_DEBUG_BODYTEXT = TYPO3_DEBUG_SHOW_BODY_TEXT;

const TOKEN_VALID_LIST = 'sql|head|althead|tail|rbeg|rend|renr|rsep|fbeg|fend|fsep|rbgd|debug|form|r|debugShowBodyText';
483

484
// FORM - copy from table 'form' of processed form
485
//const DEF_FORM_NAME = CLIENT_FORM;
486
487

// FORMELEMENT - copy of all formElements of processed form
488
//const DEF_FORM_ELEMENT_ID = 'id';
489

490
491
492
// SQL logging Modes
const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';
493
const SQL_LOG_MODE_ERROR = 'error';  // write log entry, independent of global setting (e.g. broken Query)
494

495
const MODE_LDAP_PREFETCH = 'ldapPrefetch';
496
497
498
const MODE_LDAP_SINGLE = 'ldapSingle';
const MODE_LDAP_MULTI = 'ldapMulti';

499
// api/save.php, api/delete.php, api/load.php
500
const API_DELETE_PHP = 'delete.php';
Carsten  Rose's avatar
Carsten Rose committed
501
const API_DOWNLOAD_PHP = 'download.php';
502

503
504
505
506
507
508
const API_STATUS = 'status';
const API_MESSAGE = 'message';
const API_REDIRECT = 'redirect';
const API_REDIRECT_URL = 'redirect-url';
const API_FIELD_NAME = 'field-name';
const API_FIELD_MESSAGE = 'field-message';
Carsten  Rose's avatar
Carsten Rose committed
509
const API_FORM_UPDATE = 'form-update';
510
const API_ELEMENT_UPDATE = 'element-update';
511
512
const API_ELEMENT_ATTRIBUTE = 'attr';
const API_ELEMENT_CONTENT = 'content';
513

514
515
516
517
const API_JSON_HIDDEN = 'hidden';
const API_JSON_DISABLED = 'disabled';
const API_JSON_REQUIRED = 'required';

518
519
520
521
522
const API_ANSWER_STATUS_SUCCESS = 'success';
const API_ANSWER_STATUS_ERROR = 'error';
const API_ANSWER_REDIRECT_CLIENT = 'client';
const API_ANSWER_REDIRECT_NO = 'no';
const API_ANSWER_REDIRECT_URL = 'url';
523

524
525
526
527
528
529
530
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
531
const CLASS_TYPEAHEAD = 'qfq-typeahead';
532
const DATA_TYPEAHEAD_SIP = 'data-typeahead-sip'; // Used for typeAhead
533

534

535
536
const CLASS_NOTE = 'qfq-note';

537
538
const DATA_ENABLE_SAVE_BUTTON = 'data-enable-save-button';

Carsten  Rose's avatar
Carsten Rose committed
539
540
541
//const CLASS_TYPEAHEAD = 'qfq-type-ahead';
//const DATA_TYPEAHEAD_SIP = 'data-sip'; // Used for typeAhead

542
543
const DATA_TYPEAHEAD_LIMIT = 'data-typeahead-limit';
const DATA_TYPEAHEAD_MINLENGTH = 'data-typeahead-minlength';
544
const DATA_TYPEAHEAD_PEDANTIC = 'data-typeahead-pedantic';
545

546
547
548
const CLASS_CHARACTER_COUNT = 'qfq-character-count';
const DATA_CHARACTER_COUNT_ID = 'data-character-count-id';

549
550
const CLASS_FORM_ELEMENT_EDIT = 'qfq-form-element-edit';

551
// BuildForm
552
553
const SYMBOL_NEW = 'new';
const SYMBOL_EDIT = 'edit';
554
const SYMBOL_DELETE = 'delete';
555
556
557

//CHECKBOX
const CHECKBOX_VALUE_CHECKED = 'checked';
558
const CHECKBOX_VALUE_UNCHECKED = 'unchecked';
559
//const CHECKBOX_ORIENTATION = 'orientation';
560

561
562
563
const ALIGN_HORIZONTAL = 'horizontal';
const ALIGN_VERTICAL = 'vertical';

564
565
566
567
568
// Subrecord
const SUBRECORD_COLUMN_WIDTH = 20;
const FORM_ELEMENTS_NATIVE = 'native';
const FORM_ELEMENTS_SUBRECORD = 'subrecord';
const FORM_ELEMENTS_NATIVE_SUBRECORD = 'native_subrecord';
Carsten  Rose's avatar
Carsten Rose committed
569
//const FORM_ELEMENTS_DYNAMIC_UPDATE = 'native_dynamic_update';
570
571
572
573
574
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';
575
576
const SUBRECORD_PARAMETER_DETAIL = 'detail';

577
const GLYPH_ICON = 'glyphicon';
578
579
580
const GLYPH_ICON_EDIT = 'glyphicon-pencil';
const GLYPH_ICON_NEW = 'glyphicon-plus';
const GLYPH_ICON_DELETE = 'glyphicon-trash';
581
582
583
const GLYPH_ICON_HELP = 'glyphicon-question-sign';
const GLYPH_ICON_INFO = 'glyphicon-info-sign';
const GLYPH_ICON_SHOW = 'glyphicon-search';
584
const GLYPH_ICON_TOOL = 'glyphicon-wrench';
585
586
const GLYPH_ICON_CHECK = 'glyphicon-ok';
const GLYPH_ICON_CLOSE = 'glyphicon-remove';
587
const GLYPH_ICON_TASKS = 'glyphicon-tasks';
Carsten  Rose's avatar
Carsten Rose committed
588
const GLYPH_ICON_VIEW = 'glyphicon-eye-open';
Carsten  Rose's avatar
Carsten Rose committed
589
const GLYPH_ICON_FILE = 'glyphicon-file';
590

591
// FORM
592
const F_ID = 'id';
593
const F_NAME = 'name';
594
const F_TITLE = 'title';
595
const F_TABLE_NAME = 'tableName';
596
const F_REQUIRED_PARAMETER = 'requiredParameter';
597
598
const F_EXTRA_DELETE_FORM = 'extraDeleteForm';
const F_FINAL_DELETE_FORM = 'finalDeleteForm';
599

600
const F_SUBMIT_BUTTON_TEXT = 'submitButtonText';
601
const F_BUTTON_ON_CHANGE_CLASS = 'buttonOnChangeClass';
602

603
604
const F_ESCAPE_TYPE_DEFAULT = 'escapeTypeDefault';

605
const F_CLASS = 'class';
606
607
608
const F_CLASS_PILL = 'classPill';
const F_CLASS_BODY = 'classBody';

Carsten  Rose's avatar
Carsten Rose committed
609
610
const F_SHOW_BUTTON = 'showButton';

611
612
613
614
615
616
617
const F_FORWARD_MODE = 'forwardMode';
const F_FORWARD_PAGE = 'forwardPage';

const F_FORWARD_MODE_CLIENT = 'client';
const F_FORWARD_MODE_NO = 'no';
const F_FORWARD_MODE_PAGE = 'page';

618
619
620
621
622
const F_FE_DATA_PATTERN_ERROR = 'data-pattern-error';
const F_FE_DATA_REQUIRED_ERROR = 'data-required-error';
const F_FE_DATA_MATCH_ERROR = 'data-match-error';
const F_FE_DATA_ERROR = 'data-error';

623
624
const F_PARAMETER = 'parameter';    // valid for F_ and FE_

625
626
627
const F_LDAP_SERVER = 'ldapServer';
const F_LDAP_BASE_DN = 'ldapBaseDn';
const F_LDAP_SEARCH = 'ldapSearch';
628
629
const F_LDAP_ATTRIBUTES = 'ldapAttributes';
const F_LDAP_TIME_LIMIT = 'ldapTimeLimit';
630
const F_LDAP_USE_BIND_CREDENTIALS = 'ldapUseBindCredentials';
631
632
const F_TYPEAHEAD_LIMIT = 'typeAheadLimit';
const F_TYPEAHEAD_MINLENGTH = 'typeAheadMinLength';
633
const F_TYPEAHEAD_PEDANTIC = 'typeAheadPedantic';
634
const F_TYPEAHEAD_LDAP_VALUE_PRINTF = 'typeAheadLdapValuePrintf';
635
const F_TYPEAHEAD_LDAP_ID_PRINTF = 'typeAheadLdapIdPrintf';
636
const F_TYPEAHEAD_LDAP_SEARCH = 'typeAheadLdapSearch';
637
const F_TYPEAHEAD_LDAP_SEARCH_PREFETCH = 'typeAheadLdapSearchPrefetch';
638
const F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN = 'typeAheadLdapSearchPerToken';
639

Carsten  Rose's avatar
Carsten Rose committed
640
641
642
const F_MODE = 'mode';
const F_MODE_READONLY = 'readonly';

643
644
const F_SAVE_BUTTON_ACTIVE = 'saveButtonActive';

645
646
647
648
// FORM_ELEMENT_STATI
const FE_MODE_SHOW = 'show';
const FE_MODE_READONLY = 'readonly';
const FE_MODE_REQUIRED = 'required';
649
const FE_MODE_HIDDEN = 'hidden';
650

651
652
653
654
const FE_CLASS_NATIVE = 'native';
const FE_CLASS_ACTION = 'action';
const FE_CLASS_CONTAINER = 'container';

655
const FE_SUBRECORD_ROW_CLASS = '_rowClass';
656
const FE_SUBRECORD_ROW_TITLE = '_rowTitle';
657

658
// FormElement columns: real
659
const FE_ID = 'id';
Carsten  Rose's avatar
Carsten Rose committed
660
const FE_ID_CONTAINER = 'feIdContainer';
Carsten  Rose's avatar
Carsten Rose committed
661
const FE_FORM_ID = 'formId';
662
const FE_NAME = 'name';
663
const FE_TYPE = 'type';
664
const FE_MODE = 'mode';
665
const FE_MODE_SQL = 'modeSql';
666
const FE_DYNAMIC_UPDATE = 'dynamicUpdate';
667
const FE_VALUE = 'value';
668
const FE_CLASS = 'class';
669
670
const FE_LABEL = 'label';
const FE_NOTE = 'note';
671
672
673
674
675
const FE_BS_LABEL_COLUMNS = F_BS_LABEL_COLUMNS;
const FE_BS_INPUT_COLUMNS = F_BS_INPUT_COLUMNS;
const FE_BS_NOTE_COLUMNS = F_BS_NOTE_COLUMNS;
const FE_WRAP_ROW_LABEL_INPUT_NOW = 'rowLabelInputNote';
const FE_MAX_LENGTH = 'maxLength';
676
const FE_PARAMETER = 'parameter';
677
678
679
const FE_ENCODE = 'encode';
const FE_CHECK_TYPE = 'checkType';
const FE_CHECK_PATTERN = 'checkPattern';
680

681
const FE_TYPE_CHECKBOX = 'checkbox';
682

683
684
685
686
// FormElement columns: via parameter field
const FE_DATE_FORMAT = 'dateFormat';  // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
const FE_SHOW_SECONDS = 'showSeconds';  // value: 0|1
const FE_SHOW_ZERO = 'showZero';  // value: 0|1
687
const FE_FILE_DESTINATION = 'fileDestination'; // Target pathFilename for an uploaded file.
688
689
const FE_FILE_REPLACE_MODE = 'fileReplace'; // Target pathFilename for an uploaded file.
const FE_FILE_REPLACE_MODE_ALWAYS = 'always'; // Target pathFilename for an uploaded file.
690
691
692
const FE_SQL_VALIDATE = 'sqlValidate'; // Action: Query to validate form load
const FE_EXPECT_RECORDS = 'expectRecords'; // Action: expected number of rows of FE_SQL_VALIDATE
const FE_MESSAGE_FAIL = 'messageFail'; // Action: Message to display, if FE_SQL_VALIDATE fails.
693
const FE_REQUIRED_LIST = 'requiredList'; // Optional list of FormElements which have to be non empty to make this 'action'-FormElement active.
694
const FE_SLAVE_ID = 'slaveId'; // Action; Value or Query to compute id of slave record.
695
696
const FE_SQL_AFTER = 'sqlAfter'; // Action: Always fired
const FE_SQL_BEFORE = 'sqlBefore'; // Action: Always fired
697
698
699
const FE_SQL_UPDATE = 'sqlUpdate'; // Action: Update Statement for slave record
const FE_SQL_INSERT = 'sqlInsert'; // Action: Insert Statement to create slave record.
const FE_SQL_DELETE = 'sqlDelete'; // Action: Delete Statement to delete unused slave record.
700
const FE_SQL_HONOR_FORM_ELEMENTS = 'sqlHonorFormElements'; // Action: Honor given list of FormElements for sqlInsert|Update|Delete
Carsten  Rose's avatar
Carsten Rose committed
701
const FE_EDITOR_PREFIX = 'editor-'; // TinyMCE configuration settings.
702
703
704
705
706
707
708
709
710
const FE_SENDMAIL_TO = 'sendMailTo'; // Receiver email adresses. Separate multiple by comma.
const FE_SENDMAIL_CC = 'sendMailCc'; // CC Receiver email adresses. Separate multiple by comma.
const FE_SENDMAIL_BCC = 'sendMailBcc'; // BCC Receiver email adresses. Separate multiple by comma.
const FE_SENDMAIL_FROM = 'sendMailFrom'; // Sender email address.
const FE_SENDMAIL_SUBJECT = 'sendMailSubject'; // Email subject
const FE_SENDMAIL_REPLY_TO = 'sendMailReplyTo'; // Reply to email address
const FE_SENDMAIL_FLAG_AUTO_SUBMIT = 'sendMailFlagAutoSubmit'; // on|off - if 'on', suppresses OoO answers from receivers.
const FE_SENDMAIL_GR_ID = 'sendMailGrId'; // gr_id: used to classify mail log entries ind table mailLog
const FE_SENDMAIL_X_ID = 'sendMailXId'; // x_id: used to classify mail log entries ind table mailLog
711
const FE_AUTOFOCUS = 'autofocus'; // value: <none>|0|1  , <none>==1, this element becomes the focus during form load.
712
713
714
const FE_RETYPE = 'retype'; // value: <none>|0|1  , <none>==1, this element becomes the focus during form load.
const FE_RETYPE_LABEL = 'retypeLabel'; // value: label text for retype FormElement
const FE_RETYPE_NOTE = 'retypeNote'; // value: note text for retype FormElement
715
const FE_RETYPE_SOURCE_NAME = '_retypeSourceName'; // QFQ internal reference to name of source FormElement.
716
717
718
719
const FE_WRAP_ROW = 'wrapRow';
const FE_WRAP_LABEL = 'wrapLabel';
const FE_WRAP_INPUT = 'wrapInput';
const FE_WRAP_NOTE = 'wrapNote';
720
721
722
723
724
725
726
const FE_HTML_BEFORE = 'htmlBefore';
const FE_HTML_AFTER = 'htmlAfter';
const FE_TEMPLATE_GROUP_ADD_CLASS = 'tgAddClass';
const FE_TEMPLATE_GROUP_ADD_TEXT = 'tgAddText';
const FE_TEMPLATE_GROUP_REMOVE_CLASS = 'tgRemoveClass';
const FE_TEMPLATE_GROUP_REMOVE_TEXT = 'tgRemoveText';
const FE_TEMPLATE_GROUP_CLASS = 'tgClass';
Carsten  Rose's avatar
Carsten Rose committed
727
const FE_TEMPLATE_GROUP_DEFAULT_MAX_LENGTH = 5;
728
const FE_TEMPLATE_GROUP_NAME_PATTERN = '%d';
729
const FE_TEMPLATE_GROUP_NAME_PATTERN_0 = '%D';
730
const FE_TEMPLATE_GROUP_CURRENT_IDX = 'tgCurentIndex';
731
const FE_BUTTON_CLASS = 'buttonClass';
732
733
734
const FE_LDAP_SERVER = F_LDAP_SERVER;
const FE_LDAP_BASE_DN = F_LDAP_BASE_DN;
const FE_LDAP_SEARCH = F_LDAP_SEARCH;
735
736
const FE_LDAP_ATTRIBUTES = F_LDAP_ATTRIBUTES;
const FE_LDAP_TIME_LIMIT = F_LDAP_TIME_LIMIT;
737
const FE_LDAP_USE_BIND_CREDENTIALS = F_LDAP_USE_BIND_CREDENTIALS;
738
739
const FE_TYPEAHEAD_LIMIT = F_TYPEAHEAD_LIMIT;
const FE_TYPEAHEAD_MINLENGTH = F_TYPEAHEAD_MINLENGTH;
740
const FE_TYPEAHEAD_PEDANTIC = F_TYPEAHEAD_PEDANTIC;
741
const FE_TYPEAHEAD_SQL = 'typeAheadSql';
742
const FE_TYPEAHEAD_LDAP_VALUE_PRINTF = F_TYPEAHEAD_LDAP_VALUE_PRINTF;
743
const FE_TYPEAHEAD_LDAP_ID_PRINTF = F_TYPEAHEAD_LDAP_ID_PRINTF;
744
const FE_TYPEAHEAD_LDAP = 'typeAheadLdap';
745
const FE_TYPEAHEAD_LDAP_SEARCH = F_TYPEAHEAD_LDAP_SEARCH;
746
const FE_TYPEAHEAD_LDAP_SEARCH_PREFETCH = F_TYPEAHEAD_LDAP_SEARCH_PREFETCH;
747
const FE_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN = F_TYPEAHEAD_LDAP_SEARCH_PER_TOKEN;
748
const FE_FILL_STORE_LDAP = 'fillStoreLdap';
749
const FE_CHARACTER_COUNT_WRAP = 'characterCountWrap';
750
const RETYPE_FE_NAME_EXTENSION = 'RETYPE';
751

752
753
const TYPEAHEAD_PLACEHOLDER = '?';

754
755
const FE_HTML_ID = 'htmlId'; // Will be dynamically computed during runtime.

756
757
758
759
// Values
const FE_ENCODE_SPECIALCHAR = 'specialchar';
const FE_ENCODE_NONE = 'none';

760
// FormElement Types
761
const FE_TYPE_UPLOAD = 'upload';
762
const FE_TYPE_EXTRA = 'extra';
763
764
765
const FE_TYPE_SUBRECORD = 'subrecord';
const FE_TYPE_NOTE = 'note';

766
const FE_TYPE_SENDMAIL = 'sendMail';
767
768
769
770
771
772
773
774
775
776
777
const FE_TYPE_BEFORE_LOAD = 'beforeLoad';
const FE_TYPE_BEFORE_SAVE = 'beforeSave';
const FE_TYPE_BEFORE_INSERT = 'beforeInsert';
const FE_TYPE_BEFORE_UPDATE = 'beforeUpdate';
const FE_TYPE_BEFORE_DELETE = 'beforeDelete';
const FE_TYPE_AFTER_LOAD = 'afterLoad';
const FE_TYPE_AFTER_SAVE = 'afterSave';
const FE_TYPE_AFTER_INSERT = 'afterInsert';
const FE_TYPE_AFTER_UPDATE = 'afterUpdate';
const FE_TYPE_AFTER_DELETE = 'afterDelete';

778
779
const FE_TYPE_TEMPLATE_GROUP = 'templateGroup';

780
781
// SUPPORT
const PARAM_T3_ALL = 't3 all';
782
const PARAM_T3_NO_ID = "t3 no id";
783
784
const ESCAPE_WITH_BACKSLASH = 'backslash';
const ESCAPE_WITH_HTML_QUOTE = 'htmlquote';
785
786
787
788
789

// AbstractBuildForm
const FLAG_ALL = 'flagAll';
const FLAG_DYNAMIC_UPDATE = 'flagDynamicUpdate';

790
791
792
const HTML_DELIMITER_NAME = '-';
const HTML_DELIMITER_ID = HTML_DELIMITER_NAME;

793
794
795
796
797
const HTML_ID_EXTENSION_LABEL = '-l';
const HTML_ID_EXTENSION_INPUT = '-i';
const HTML_ID_EXTENSION_NOTE = '-n';
const HTML_ID_EXTENSION_TOOLTIP = '-t';
const HTML_ID_EXTENSION_ROW = '-r';
798
const HTML_ID_EXTENSION_CHARACTER_COUNT = '-cc';
799

800
801
const QUERY_TYPE_SELECT = 'type: select,show,describe,explain';
const QUERY_TYPE_INSERT = 'type: insert';
802
const QUERY_TYPE_UPDATE = 'type: update,replace,delete';
803
const QUERY_TYPE_CONTROL = 'type: set';
804
805

//Regexp
806
807
808
809
810
811
812
813
//const REGEXP_DATE_INT = '^\d{4}-\d{2}-\d{2}$';
//const REGEXP_DATE_GER = '^\d{1,2}\.\d{1,2}\.\d{2}(\d{2})?$';
//const REGEXP_TIME = '^\d{1,2}:\d{1,2}(:\d{1,2})?$';


// Date/ DateTime formats
const FORMAT_DATE_INTERNATIONAL = 'yyyy-mm-dd';
const FORMAT_DATE_GERMAN = 'dd.mm.yyyy';
814

815
816
817
818
819
820
// Upload
const UPLOAD_MODE_UNCHANGED = 'unchanged';
const UPLOAD_MODE_NEW = 'new';
const UPLOAD_MODE_DELETEOLD = 'deleteOld';
const UPLOAD_MODE_DELETEOLD_NEW = 'deleteOld+new';

821
822
823
824
825
// $_FILES
const FILES_NAME = 'name';
const FILES_TMP_NAME = 'tmp_name';
const FILES_ERROR = 'error';
const FILES_SIZE = 'size';
826
const FILES_FLAG_DELETE = 'flagDelete';
Carsten  Rose's avatar
Carsten Rose committed
827

828
829
830
const UPLOAD_CACHED = '.cached';
const FILE_ACTION = 'action';
const FILE_ACTION_UPLOAD = 'upload';
831
832
833
834
835
836
837
const FILE_ACTION_DELETE = 'delete';

// DATABASE
const DB_NUM_ROWS = 'numRows';
const DB_AFFECTED_ROWS = 'affectedRows';
const DB_INSERT_ID = 'insertId';

838
const COLUMN_CREATED = 'created';
839
const COLUMN_MODIFIED = 'modified';
840

Carsten  Rose's avatar
Carsten Rose committed
841
842
const INDEX_PHP = 'index.php';

843
844
845
846
// QuickFormQuery.php
const T3DATA_BODYTEXT = 'bodytext';
const T3DATA_UID = 'uid';

847
848
// Special Column to check for uploads
const COLUMN_PATH_FILE_NAME = 'pathFileName';
Carsten  Rose's avatar
Upload:    
Carsten Rose committed
849
850
851

// Used to in SIP Store to handle 'delete' after upload
const EXISTING_PATH_FILE_NAME = '_existingPathFileName';
852
853
854
855
856
857
858
859
860
861
862
863
864

//SENDMAIL
const SENDMAIL_IDX_RECEIVER = 0;
const SENDMAIL_IDX_SENDER = 1;
const SENDMAIL_IDX_SUBJECT = 2;
const SENDMAIL_IDX_BODY = 3;
const SENDMAIL_IDX_REPLY_TO = 4;
const SENDMAIL_IDX_FLAG_AUTO_SUBMIT = 5;
const SENDMAIL_IDX_GR_ID = 6;
const SENDMAIL_IDX_X_ID = 7;
const SENDMAIL_IDX_RECEIVER_CC = 8;
const SENDMAIL_IDX_RECEIVER_BCC = 9;
const SENDMAIL_IDX_SRC = 10;
865
866
867
868
869
870
871
872
873
874

//Report: Column Token
const COLUMN_PPAGE = "Page";
const COLUMN_PPAGEC = "Pagec";
const COLUMN_PPAGED = "Paged";
const COLUMN_PPAGEE = "Pagee";
const COLUMN_PPAGEH = "Pageh";
const COLUMN_PPAGEI = "Pagei";
const COLUMN_PPAGEN = "Pagen";
const COLUMN_PPAGES = "Pages";
875
876
877
const COLUMN_PPDF = "Pdf";
const COLUMN_ZZIP = "Zip";
const COLUMN_FFILE = "File";
878
879
880
881
882
883
884
885

const COLUMN_PAGE = "page";
const COLUMN_PAGEC = "pagec";
const COLUMN_PAGED = "paged";
const COLUMN_PAGEE = "pagee";
const COLUMN_PAGEH = "pageh";
const COLUMN_PAGEI = "pagei";
const COLUMN_PAGEN = "pagen";
886
const COLUMN_PAGES = "pages";
887
888
889
const COLUMN_PDF = "pdf";
const COLUMN_FILE = "file";
const COLUMN_ZIP = "zip";
890

891
const FORM_NAME_FORM = 'form';
892
893
const FORM_NAME_FORM_ELEMENT = 'formElement';

Carsten  Rose's avatar
Carsten Rose committed
894
895
896
897
898
899
900
const PENALTY_TIME_BROKEN_SIP = 5;

// DOWNLOAD
const DOWNLOAD_MODE = 'mode';
const DOWNLOAD_MODE_FILE = 'file';
const DOWNLOAD_MODE_PDF = 'pdf';
const DOWNLOAD_MODE_EXCEL = 'excel';
Carsten  Rose's avatar
Carsten Rose committed
901
902
903
const DOWNLOAD_MODE_ZIP = 'zip';
const DOWNLOAD_EXPORT_FILENAME = '_exportFilename';
const DOWNLOAD_FILE_PREFIX = 'qfq.temp'; // temporary filename on server of single export file
904
const DOWNLOAD_OUTPUT_PDF = 'output';
905
const DOWNLOAD_SIP_ENCODE_PARAMETER = '_sip';
Carsten  Rose's avatar
Carsten Rose committed
906
907
908
909
910
911

// HTML2PDF
const HTML2PDF_PAGEID = 'id';
const HTML2PDF_PARAM_GET = 'paramGet';
const HTML2PDF_URL_PRINT = 'urlPrint';

912
const SESSION_COOKIE_PREFEIX = 'qfq.cookie.'; // temporary 'cookie file' to forward `fe_user` and `qfq` session.
913

Carsten  Rose's avatar
Carsten Rose committed
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
// Class: LINK
const PARAM_DELIMITER = '|';

const TOKEN_URL = 'u';
const TOKEN_MAIL = 'm';
const TOKEN_PAGE = 'p';
const TOKEN_DOWNLOAD = 'd';

const TOKEN_TEXT = 't';
const TOKEN_ALT_TEXT = 'a';
const TOKEN_TOOL_TIP = 'o';
const TOKEN_PICTURE = 'P';
const TOKEN_BULLET = 'B';
const TOKEN_CHECK = 'C';
const TOKEN_DELETE = 'D';
const TOKEN_EDIT = 'E';
const TOKEN_HELP = 'H';
const TOKEN_INFO = 'I';
const TOKEN_NEW = 'N';
const TOKEN_SHOW = 'S';
const TOKEN_RENDER = 'r';
const TOKEN_TARGET = 'g';
const TOKEN_CLASS = 'c';
const TOKEN_QUESTION = 'q';
const TOKEN_ENCRYPTION = 'e';
const TOKEN_SIP = 's';
const TOKEN_URL_PARAM = 'U';
const TOKEN_RIGHT = 'R';
const TOKEN_FILE = 'f';
const TOKEN_DOWNLOAD_MODE = 'M';

const TOKEN_ACTION_DELETE = 'x';
const TOKEN_ACTION_DELETE_AJAX = 'a';
const TOKEN_ACTION_DELETE_REPORT = 'r';
const TOKEN_ACTION_DELETE_CLOSE = 'c';

const TOKEN_CLASS_NONE = 'n';
const TOKEN_CLASS_INTERNAL = 'i';
const TOKEN_CLASS_EXTERNAL = 'e';

954
955
const WKHTML_OPTION_VIEWPORT = '--viewport-size';
const WKHTML_OPTION_VIEWPORT_VALUE = '1280x1024';