Constants.php 19.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
const CONFIG_INI = "config.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
19
20
const SESSION_FE_USER_UID = 'fe_user_uid';
const SESSION_NAME = 'qfq';

21

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

35
36
37
38
const FORM_FORWARD_MODE_NO = 'no';
const FORM_FORWARD_MODE_AUTO = 'auto';
const FORM_FORWARD_MODE_PAGE = 'page';

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.name, fe.label, fe.type, 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";
50

Carsten  Rose's avatar
Carsten Rose committed
51
52
53
// SANITIZE Classifier
const SANITIZE_ALLOW_ALNUMX = "alnumx";
const SANITIZE_ALLOW_DIGIT = "digit";
54
const SANITIZE_ALLOW_EMAIL = "email";
55
56
57
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
58
const SANITIZE_ALLOW_ALLBUT = "allbut";
Carsten  Rose's avatar
Carsten Rose committed
59
60
const SANITIZE_ALLOW_ALL = "all";
const SANITIZE_DEFAULT = SANITIZE_ALLOW_DIGIT;
61

62
63
64
const SANATIZE_EXCEPTION = 'exception';
const SANATIZE_EMPTY_STRING = 'empty string';

65
66
67
68
69
70
// 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';
71
const WRAP_SETUP_SUBRECORD = 'subrecord';
72
const WRAP_SETUP_IN_FIELDSET = 'inFieldset';
73
74
75
const WRAP_SETUP_START = 'start';
const WRAP_SETUP_END = 'end';

76
77
78
// dbQuerySimple
const ROW_REGULAR = "regular";
const ROW_IMPLODE_ALL = "implode_all";
79
80
81
82
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";
83
const ROW_KEYS = "keys";
84

85
// KeyValueParser
86
87
const KVP_IF_VALUE_EMPTY_COPY_KEY = 'if_value_empty_copy_key';
const KVP_VALUE_GIVEN = 'value_given';
88

89
// QFQ Error Codes
Carsten  Rose's avatar
Carsten Rose committed
90
const ERROR_UNKNOW_SANITIZE_CLASS = 1001;
91

92
const ERROR_CODE_SHOULD_NOT_HAPPEN = 1003;
93
94
const ERROR_SIP_MALFORMED = 1005;
const ERROR_SIP_INVALID = 1006;
95
const ERROR_MISSING_RECORD_ID = 1007;
96
const ERROR_IN_SQL_STATEMENT = 1008;
97
const ERROR_MISSING_REQUIRED_PARAMETER = 1009;
98
99
100
101
102
103
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
104
105
106
107
108
109
110
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;
111
const ERROR_CHECKBOXMODE_UNKNOWN = 1024;
112
const ERROR_MISSING_SQL1 = 1025;
113
114
const ERROR_CHECKBOX_EQUAL = 1026;
const ERROR_MISSING_ITEM_VALUES = 1027;
115
const ERROR_UNKNOWN_FORM_RENDER = 1028;
Carsten  Rose's avatar
Carsten Rose committed
116
const ERROR_NAME_LABEL_EMPTY = 1029;
Carsten  Rose's avatar
Carsten Rose committed
117
const ERROR_DEBUG = 1031;
118
119
120
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
const ERROR_RESERVED_KEY_NAME = 1034;
121
const ERROR_UNKNOWN_FORWARD_MODE = 1036;
Carsten  Rose's avatar
Carsten Rose committed
122
123
124
125
126
127
128
129
130
131
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;
132
const ERROR_MISSING_FORMELEMENT = 1049;
133
const ERROR_INVALID_OR_MISSING_PARAMETER = 1050;
134
const ERROR_UNKNOWN_SQL_LOG_MODE = 1051;
Carsten  Rose's avatar
Carsten Rose committed
135
const ERROR_FORM_NOT_FOUND = 1052;
136
const ERROR_DATE_TIME_FORMAT_NOT_RECOGNISED = 1053;
137
const ERROR_SANATIZE_INVALID_VALUE = 1054;
138
const ERROR_REQUIRED_VALUE_EMPTY = 1055;
139
140
141
const ERROR_DATE_UNEXPECTED_FORMAT = 1056;
const ERROR_NOT_APPLICABLE = 1057;
const ERROR_FORMELEMENT_TYPE = 1058;
142
143
const ERROR_MISSING_OPEN_DELIMITER = 1059;
const ERROR_MISSING_CLOSE_DELIMITER = 1060;
144
145
146
const ERROR_EXPECTED_ARRAY = 1061;
const ERROR_REPORT_FAILED_ACTION = 1062;
const ERROR_MISSING_MESSAGE_FAIL = 1063;
147
148
const ERROR_MISSING_TABLE_NAME = 1064;
const ERROR_RECORD_NOT_FOUND = 1065;
149

150
151
152
// Store
const ERROR_STORE_VALUE_ALREADY_CODPIED = 1100;
const ERROR_STORE_KEY_EXIST = 1101;
153

154
155
156
157
// I/O Error
const ERROR_IO_READ_FILE = 1200;
const ERROR_IO_WRITE = 1203;
const ERROR_IO_OPEN = 1204;
158
159
160
const ERROR_IO_UNLINK = 1205;
const ERROR_IO_FILE_EXIST = 1206;
const ERROR_IO_RENAME = 1207;
161
162
163
const ERROR_IO_INVALID_LINK = 1208;
const ERROR_IO_DIR_EXIST_AS_FILE = 1209;
const ERROR_IO_CHDIR = 1210;
164

165
166
//Report
const ERROR_UNKNOWN_LINK_QUALIFIER = 1300;
167
168
const ERROR_UNDEFINED_RENDER_CONTROL_COMBINATION = 1301;
const ERROR_MISSING_VALUE = 1302;
169
170
171
const ERROR_INVALID_VALUE = 1303;
const ERROR_MULTIPLE_DEFINITION = 1304;
const ERROR_MULTIPLE_URL_PAGE_MAILTO_DEFINITION = 1305;
172
173
174
const ERROR_UNKNOWN_TOKEN = 1306;
const ERROR_TOO_FEW_PARAMETER_FOR_SENDMAIL = 1307;
const ERROR_TOO_MANY_PARAMETER = 1308;
175

176
177
// Upload
const ERROR_UPLOAD = 1400;
178
const ERROR_UNKNOWN_ACTION = 1402;
179
const ERROR_NO_TARGET_PATH_FILE_NAME = 1403;
180

181
182
// KeyValueParser
const ERROR_KVP_VALUE_HAS_NO_KEY = 1900;
183

184
// DB Errors
185
186
187
188
189
190
191
192
193
194
195
196
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;
197
198
199
const ERROR_DB_UNKNOWN_COMMAND = 2012;
const ERROR_DB_MISSING_COLUMN_ID = 2013;
const ERROR_DB_COLUMN_NOT_FOUND_IN_TABLE = 2014;
Carsten  Rose's avatar
Carsten Rose committed
200
201
202
203

// onArray
const ERROR_SUBSTITUTE_FOUND = 2100;

204
205
206
//
// Store Names: Identifier
//
207
208
const STORE_FORM = "F";  // form, still not saved in database
const STORE_SIP = "S"; // SIP
Carsten  Rose's avatar
Carsten Rose committed
209
const STORE_RECORD = "R"; // selected record from primary table.
210
const STORE_PARENT_RECORD = "P"; // on multi forms the recent record of the outer query (multi).
211
212
const STORE_TABLE_DEFAULT = "D"; // definition of primary table.
const STORE_TABLE_COLUMN_TYPES = "M"; // column types of primary table.
213
const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable
214
const STORE_TYPO3 = "T"; // Typo3 > Page content record > bodytext
215
const STORE_VAR = "V"; // Generic Vars
216
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
217
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
218
const STORE_SYSTEM = "Y"; // various system values like db connection credentials
Carsten  Rose's avatar
Carsten Rose committed
219
const STORE_EXTRA = 'X'; // Persistent Store: contains arrays! Not Usefull for user. Used by system.
220

221
const STORE_USE_DEFAULT = "FSRD";
222
//
Carsten  Rose's avatar
Carsten Rose committed
223
// Store: Definitions / Members
224
225
//

Carsten  Rose's avatar
Carsten Rose committed
226
// URL variables
227
228
const CLIENT_FORM = 'form';
const CLIENT_SIP = 's';
229
const CLIENT_RECORD_ID = 'r';
230
231
const CLIENT_KEY_SEM_ID = 'keySemId';
const CLIENT_KEY_SEM_ID_USER = 'keySemIdUser';
232
233
234
const CLIENT_PAGE_ID = 'id';
const CLIENT_PAGE_TYPE = 'type';
const CLIENT_PAGE_LANGUAGE = 'L';
235
const CLIENT_UPLOAD_FE_NAME = 'name';
Carsten  Rose's avatar
Carsten Rose committed
236

237
238
const CLIENT_SIP_FOR_FORM = '_sipForForm';
const CLIENT_FE_NAME = '_feName';
239
const CLIENT_UPLOAD_FILENAME = '_filename';
240

241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
// 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';
const CLIENT_SERVER_ADDRESS = 'SERVER_ADDRESS';
const CLIENT_SERVER_PORT = 'SERVER_PORT';
const CLIENT_REMOTE_ADDRESS = 'REMOTE_ADDRESS';
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
258
// T3 Bodytext Keywords
259
const TYPO3_FORM = CLIENT_FORM;
260
const TYPO3_RECORD_ID = CLIENT_RECORD_ID;
261
262
263
const TYPO3_FE_USER = 'feUser';
const TYPO3_FE_USER_UID = 'feUserUid';
const TYPO3_FE_USER_GROUP = 'feUserGroup';
264
const TYPO3_TT_CONTENT_UID = 'ttcontentUid';
265
266
267
const TYPO3_PAGE_ID = 'pageId';
const TYPO3_PAGE_TYPE = 'pageType';
const TYPO3_PAGE_LANGUAGE = 'pageLanguage';
268
const TYPO3_DEBUG_SHOW_BODY_TEXT = 'debugShowBodyText';
269

270
// System
271
272
273
274
275
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';
276
const SYSTEM_DB_INIT = 'DB_INIT';
277
278
const SYSTEM_SQL_LOG = 'SQL_LOG'; //  Logging to file
const SYSTEM_SQL_LOG_MODE = 'SQL_LOG_MODE'; // Mode, which statements to log.
279
const SYSTEM_DATE_FORMAT = 'DATE_FORMAT';
280
281
282
283

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';
284
const SYSTEM_CSS_CLASS_QFQ_CONTAINER = 'CSS_CLASS_QFQ_CONTAINER';
285

286
287
// computed automatically during runtime
const SYSTEM_PATH_EXT = 'EXT_PATH';
288
const SYSTEM_SITE_PATH = 'SITE_PATH';
289

290
// Information for: Log / Debug / Exception
Carsten  Rose's avatar
Carsten Rose committed
291
292
293
294
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.
295
296
297
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>'
298
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
299
300
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.
301
302
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.
303

304
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt.
Carsten  Rose's avatar
Carsten Rose committed
305
306
307
//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.
308

309
310
311
312
313
314
315
const MODE_HTML = 'html';
const MODE_JSON = 'json';

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

316
317
const SIP_SIP = CLIENT_SIP;  // s
const SIP_RECORD_ID = CLIENT_RECORD_ID; // r
318
319
const SIP_TARGET_URL= '_targetUrl'; // URL where to jump after delete()
const SIP_MODE_ANSWER = '_modeAnswer'; // Mode how delete() will answer to client: MODE_HTML, MODE_JSON
320
const SIP_FORM = CLIENT_FORM;
321
const SIP_TABLE = 'table'; // delete a record from 'table'
322
const SIP_URLPARAM = 'urlparam';
Carsten  Rose's avatar
Carsten Rose committed
323
// FURTHER: all extracted params from 'urlparam
324

325
326
const VAR_RANDOM = 'random';

327
328
329
330
// TOKEN evaluate
const TOKEN_ESCAPE_SINGLE_TICK = 's';
const TOKEN_ESCAPE_DOUBLE_TICK = 'd';
const TOKEN_FOUND_IN_STORE_QUERY = 'query';
331
332
333

const RANDOM_LENGTH = 32;

334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
// 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';
353

354
// FORM - copy from table 'form' of processed form
355
//const DEF_FORM_NAME = CLIENT_FORM;
356
357

// FORMELEMENT - copy of all formElements of processed form
358
//const DEF_FORM_ELEMENT_ID = 'id';
359

360
361
362
363
// SQL logging Modes
const SQL_LOG_MODE_ALL = 'all';
const SQL_LOG_MODE_MODIFY = 'modify';

364
// api/save.php, api/delete.php, api/load.php
365
366
367
368
369
370
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
371
const API_FORM_UPDATE = 'form-update';
372

373
374
375
376
377
378
379
380
const API_JSON_HIDDEN = 'hidden';
const API_JSON_DISABLED = 'disabled';
const API_JSON_REQUIRED = 'required';

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

381
382
383
384
385
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';
386

387
// BuildForm
388
389
const SYMBOL_NEW = 'new';
const SYMBOL_EDIT = 'edit';
390
const SYMBOL_DELETE = 'delete';
391
392
393

//CHECKBOX
const CHECKBOX_VALUE_CHECKED = 'checked';
394
const CHECKBOX_VALUE_UNCHECKED = 'unchecked';
395
//const CHECKBOX_ORIENTATION = 'orientation';
396

397
398
399
const ALIGN_HORIZONTAL = 'horizontal';
const ALIGN_VERTICAL = 'vertical';

400
401
402
403
404
// 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
405
//const FORM_ELEMENTS_DYNAMIC_UPDATE = 'native_dynamic_update';
406
407
408
409
410
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';
411
412
413
414
415
const SUBRECORD_PARAMETER_DETAIL = 'detail';

const GLYPH_ICON_EDIT = 'glyphicon-pencil';
const GLYPH_ICON_NEW = 'glyphicon-plus';
const GLYPH_ICON_DELETE = 'glyphicon-trash';
416
417
418
const GLYPH_ICON_HELP = 'glyphicon-question-sign';
const GLYPH_ICON_INFO = 'glyphicon-info-sign';
const GLYPH_ICON_SHOW = 'glyphicon-search';
419
const GLYPH_ICON_TOOL = 'glyphicon-wrench';
420
421
const GLYPH_ICON_CHECK = 'glyphicon-ok';
const GLYPH_ICON_CLOSE = 'glyphicon-remove';
422

423
// FORM
424
const F_TABLE_NAME = 'tableName';
425
426
const F_REQUIRED_PARAMETER = 'requiredParameter';

427

428
429
430
431
// FORM_ELEMENT_STATI
const FE_MODE_SHOW = 'show';
const FE_MODE_READONLY = 'readonly';
const FE_MODE_REQUIRED = 'required';
432
const FE_MODE_HIDDEN = 'hidden';
433

434
const FE_SUBRECORD_ROW_CLASS = '_rowClass';
435
const FE_SUBRECORD_ROW_TITLE = '_rowTitle';
436

437
// FormElement columns: real
438
const FE_NAME = 'name';
439
const FE_TYPE = 'type';
440
const FE_MODE = 'mode';
441
const FE_MODE_SQL = 'modeSql';
442
443
// TODO: Konstante FE_DYNAMIC_UPDATE ueberall einsetzen
const FE_DYNAMIC_UPDATE = 'dynamicUpdate';
444
445
446
447
448

// 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
449
const FE_FILE_DESTINATION = 'fileDestination'; // Target pathFilename for an uploaded file.
450
451
452
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.
453
const FE_REQUIRED_LIST = 'requiredList'; // Optional list of FormElements which have to be non empty to make this 'action'-FormElement active.
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
const FE_SLAVE_ID = 'slaveId'; // Action; Value or Query to compute id of slave record.
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.

// FormElement Types
const FE_TYPE_EXTRA = 'extra';
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';

const ACTION_KEYWORD_SLAVE_ID = 'slaveId';
473

474
475
// SUPPORT
const PARAM_T3_ALL = 't3 all';
476
477
478
479
480
481
482
483
const PARAM_T3_NO_ID = "t3 no id";

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

const QUERY_TYPE_SELECT = 'type: select,show,describe,explain';
const QUERY_TYPE_INSERT = 'type: insert';
484
const QUERY_TYPE_UPDATE = 'type: update,replace,delete';
485
const QUERY_TYPE_CONTROL = 'type: set';
486
487

//Regexp
488
489
490
491
492
493
494
495
//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';
496
497
498
499
500
501

// $_FILES
const FILES_NAME = 'name';
const FILES_TMP_NAME = 'tmp_name';
const FILES_ERROR = 'error';
const FILES_SIZE = 'size';
502
const FILES_FLAG_DELETE = 'flagDelete';
Carsten  Rose's avatar
Carsten Rose committed
503

504
505
506
const UPLOAD_CACHED = '.cached';
const FILE_ACTION = 'action';
const FILE_ACTION_UPLOAD = 'upload';
507
508
509
510
511
512
513
const FILE_ACTION_DELETE = 'delete';

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

514
515
const COLUMN_CREATED = 'created';

Carsten  Rose's avatar
Carsten Rose committed
516
517
const INDEX_PHP = 'index.php';

518
519
520
521
// QuickFormQuery.php
const T3DATA_BODYTEXT = 'bodytext';
const T3DATA_UID = 'uid';

522
523
// Special Column to check for uploads
const COLUMN_PATH_FILE_NAME = 'pathFileName';