formEditor.sql 21.9 KB
Newer Older
1
#DROP TABLE IF EXISTS `Form`;
2
CREATE TABLE IF NOT EXISTS `Form` (
3
4
5
6
7
  `id`                       INT(11)                                                   NOT NULL  AUTO_INCREMENT,
  `name`                     VARCHAR(255)                                              NOT NULL  DEFAULT '',
  `title`                    VARCHAR(255)                                              NOT NULL  DEFAULT '',
  `noteInternal`             TEXT                                                      NOT NULL,
  `tableName`                VARCHAR(255)                                              NOT NULL  DEFAULT '',
8

9

10
11
  `permitNew`                ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL  DEFAULT 'sip',
  `permitEdit`               ENUM('sip', 'logged_in', 'logged_out', 'always', 'never') NOT NULL  DEFAULT 'sip',
Carsten  Rose's avatar
Carsten Rose committed
12
  `render` ENUM('bootstrap', 'table', 'plain') NOT NULL  DEFAULT 'bootstrap',
13
  `requiredParameter`        VARCHAR(255)                                              NOT NULL  DEFAULT '',
14
  `showButton`               SET('new', 'delete', 'close', 'save')                     NOT NULL  DEFAULT 'new,delete,close,save',
15
16
17
18
  `multiMode`                ENUM('none', 'horizontal', 'vertical')                    NOT NULL  DEFAULT 'none',
  `multiSql`                 TEXT                                                      NOT NULL,
  `multiDetailForm`          VARCHAR(255)                                              NOT NULL  DEFAULT '',
  `multiDetailFormParameter` VARCHAR(255)                                              NOT NULL  DEFAULT '',
19

20
  `forwardMode`              ENUM('client', 'no', 'page')                              NOT NULL  DEFAULT 'client',
21
  `forwardPage`              VARCHAR(255)                                              NOT NULL  DEFAULT '',
22

23
24
25
  `bsLabelColumns`           VARCHAR(255)                                              NOT NULL  DEFAULT '',
  `bsInputColumns`           VARCHAR(255)                                              NOT NULL  DEFAULT '',
  `bsNoteColumns`            VARCHAR(255)                                              NOT NULL  DEFAULT '',
26

27
  `parameter`                TEXT                                                      NOT NULL,
28

29
  `deleted`                  ENUM('yes', 'no')                                         NOT NULL  DEFAULT 'no',
30
  `modified` TIMESTAMP NOT NULL  DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
31
  `created`                  DATETIME                                                  NOT NULL  DEFAULT '0000-00-00 00:00:00',
32

33
34
35
36
37
38
39
40
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `name_deleted` (`name`, `deleted`)
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8
  AUTO_INCREMENT = 0;

41

42
43
44
45
46
47
48
49
50
51
#--
#-- Triggers `Form`
#--
#DROP TRIGGER IF EXISTS `on_Form_update_modified`;
#DELIMITER //
#CREATE TRIGGER `on_Form_update_modified` BEFORE UPDATE ON `Form`
#FOR EACH ROW SET NEW.modified =
#current_timestamp()
#//
#DELIMITER ;
52
53
54
55

# ----------------------------------------
# FormElement

56
#DROP TABLE IF EXISTS `FormElement`;
57
CREATE TABLE IF NOT EXISTS `FormElement` (
Carsten  Rose's avatar
Carsten Rose committed
58
59
60
61
  `id`                INT(11)                                                                    NOT NULL  AUTO_INCREMENT,
  `formId`            INT(11)                                                                    NOT NULL,
  `feIdContainer`     INT(11)                                                                    NOT NULL  DEFAULT '0',
  `dynamicUpdate`     ENUM('yes', 'no')                                                          NOT NULL  DEFAULT 'no',
62

Carsten  Rose's avatar
Carsten Rose committed
63
  `enabled`           ENUM('yes', 'no')                                                          NOT NULL  DEFAULT 'yes',
64

Carsten  Rose's avatar
Carsten Rose committed
65
66
  `name`              VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `label`             VARCHAR(255)                                                               NOT NULL  DEFAULT '',
67

Carsten  Rose's avatar
Carsten Rose committed
68
69
70
  `mode`              ENUM('show', 'required', 'readonly', 'hidden')                             NOT NULL  DEFAULT 'show',
  `modeSql`           TEXT                                                                       NOT NULL,
  `class`             ENUM('native', 'action', 'container')                                      NOT NULL  DEFAULT 'native',
71
  `type`              ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
72
73
                           'editor', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload',
                           'fieldset', 'pill', 'templateGroup',
74
                           'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
Carsten  Rose's avatar
Carsten Rose committed
75
76
                           'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail') NOT NULL  DEFAULT 'text',
  `subrecordOption`   SET('edit', 'delete', 'new')                                               NOT NULL  DEFAULT '',
77
  `checkType`         ENUM('alnumx', 'digit', 'numerical', 'email', 'min|max', 'min|max date', 'pattern', 'allbut', 'all') NOT NULL  DEFAULT 'alnumx',
Carsten  Rose's avatar
Carsten Rose committed
78
  `checkPattern`      VARCHAR(255)                                                               NOT NULL  DEFAULT '',
79

Carsten  Rose's avatar
Carsten Rose committed
80
  `onChange`          VARCHAR(255)                                                               NOT NULL  DEFAULT '',
81

Carsten  Rose's avatar
Carsten Rose committed
82
83
  `ord`               INT(11)                                                                    NOT NULL  DEFAULT '0',
  `tabindex`          INT(11)                                                                    NOT NULL  DEFAULT '0',
84

Carsten  Rose's avatar
Carsten Rose committed
85
86
87
88
89
90
91
  `size`              VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `maxLength`         VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `bsLabelColumns`    VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `bsInputColumns`    VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `bsNoteColumns`     VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `rowLabelInputNote` SET('row', 'label', '/label', 'input', '/input', 'note', '/note', '/row')  NOT NULL  DEFAULT 'row,label,/label,input,/input,note,/note,/row',
  `note`              TEXT                                                                       NOT NULL,
92
  `adminNote`         TEXT                                                                       NOT NULL,
Carsten  Rose's avatar
Carsten Rose committed
93
  `tooltip`           VARCHAR(255)                                                               NOT NULL  DEFAULT '',
94
  `placeholder`       VARCHAR(2048)                                                              NOT NULL  DEFAULT '',
95

Carsten  Rose's avatar
Carsten Rose committed
96
97
98
99
  `value`             TEXT                                                                       NOT NULL,
  `sql1`              TEXT                                                                       NOT NULL,
  `parameter`         TEXT                                                                       NOT NULL,
  `clientJs`          TEXT                                                                       NOT NULL,
100

Carsten  Rose's avatar
Carsten Rose committed
101
102
  `feGroup`           VARCHAR(255)                                                               NOT NULL  DEFAULT '',
  `deleted`           ENUM('yes', 'no')                                                          NOT NULL  DEFAULT 'no',
103
  `modified` TIMESTAMP NOT NULL  DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
Carsten  Rose's avatar
Carsten Rose committed
104
  `created`           DATETIME                                                                   NOT NULL  DEFAULT '0000-00-00 00:00:00',
105
106
107

  PRIMARY KEY (`id`),
  KEY `formId` (`formId`),
108
109
110
111
112
  KEY `formId_class_enabled_deleted` (`formId`, `class`, `enabled`, `deleted`),
  KEY `feIdContainer` (`feIdContainer`),
  KEY `ord` (`ord`),
  KEY `feGroup` (`feGroup`)

113
114
115
116
117
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8
  AUTO_INCREMENT = 0;

118
119
120
121
122
123
124
125
126
127
#--
#-- Triggers `FormElement`
#--
#DROP TRIGGER IF EXISTS `on_FormEelement_update_modified`;
#DELIMITER //
#CREATE TRIGGER `on_FormEelement_update_modified` BEFORE UPDATE ON `FormElement`
#FOR EACH ROW SET NEW.modified =
#current_timestamp()
#//
#DELIMITER ;
128

129
130
# Delete previous FormElements (if exist)
DELETE FormElement FROM FormElement, Form
131
WHERE (Form.name LIKE 'form' OR Form.name LIKE 'formElement') AND Form.id = FormElement.formId;
132
133
134
135

# Delete previous Forms (if exist)
DELETE FROM Form
WHERE name LIKE 'form' OR name LIKE 'formElement';
136
137

#
138
# FormEditor: Form
139
INSERT INTO Form (id, name, title, noteInternal, tableName, permitNew, permitEdit, render, multiSql, parameter) VALUES
Carsten  Rose's avatar
Carsten Rose committed
140
  (1, 'form', 'Form Editor: {{SELECT id, " / ", name FROM Form WHERE id = {{r:S0}}}}', 'FormElement Editor',
141
   'Form', 'sip', 'sip', 'bootstrap', '', 'maxVisiblePill=5\nclass=container-fluid');
142

143
# FormEditor: FormElements for 'form'
144
INSERT INTO FormElement (id, formId, name, label, mode, type, checkType, class, ord, size, note, clientJs, value,
145
                         sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder)
146
VALUES
147
148
149
150
151
  (1, 1, 'basic', 'Basic', 'show', 'pill', 'all', 'container', 10, 0, '', '', '', '', '', 0, '', '', ''),
  (2, 1, 'access', 'Access', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', '', ''),
  (3, 1, 'various', 'Various', 'show', 'pill', 'all', 'container', 30, 0, '', '', '', '', '', 0, '', '', ''),
  (4, 1, 'multi', 'Multi', 'show', 'pill', 'all', 'container', 40, 0, '', '', '', '', '', 0, '', '', ''),
  (5, 1, 'formelement', 'Formelement', 'show', 'pill', 'all', 'container', 50, 0, '', '', '', '', '', 0, '', '', '');
152
153
154
155
156
157

# FormEditor: FormElements for 'form'
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
                         sql1, parameter, feIdContainer, subrecordOption, modeSql, placeholder)
VALUES
  (1, 'id', 'id', 'readonly', 'text', 'all', 'native', 100, 0, 11, '', '', '', '', '', 1, '', '', ''),
158
159
  (1, 'name', 'Name', 'required', 'text', 'alnumx', 'native', 120, 0, 0, '', '', '', '', 'autofocus', 1, '', '', ''),
  (1, 'title', 'Title', 'show', 'text', 'all', 'native', 130, 0, 0, '', '', '', '', '', 1, '', '', ''),
160
161
162
  (1, 'noteInternal', 'Note', 'show', 'text', 'all', 'native', 140, '40,3', 0, '', '', '', '', '', 1, '', '', ''),
  (1, 'tableName', 'Table', 'required', 'select', 'all', 'native', 150, 0, 0, '', '', '', '{{!SHOW tables}}', 'emptyItemAtStart', 1, '', '', ''),

163
  (1, 'requiredParameter', 'Required Parameter', 'show', 'text', 'all', 'native', 200, 0, 0, '', '', '', '', '', 2, '', '', ''),
Carsten  Rose's avatar
Carsten Rose committed
164
165
  (1, 'permitNew', 'Permit New', 'show', 'radio', 'all', 'native', 210, 0, 10, '', '', '', '', '', 2, '', '', ''),
  (1, 'permitEdit', 'Permit Edit', 'show', 'radio', 'all', 'native', 220, 0, 10, '', '', '', '', '', 2, '', '', ''),
166
167
168
169
  (1, 'render', 'Render', 'show', 'radio', 'all', 'native', 230, 0, 3, '', '', '', '', '', 2, '', '', ''),
  (1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 240, 0, 5, '', '', '', '', 'checkBoxMode = multi\norientation=vertical', 2, '', '', ''),

  (1, 'forwardMode', 'Forward', 'show', 'radio', 'all', 'native', 300, 0, 0, '', '', '', '', '', 3, '', '', ''),
170
  (1, 'forwardPage', 'Forward Page', 'show', 'text', 'all', 'native', 310, 0, 0, '', '', '', '', '', 3, '', '', ''),
171
  (1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 320, '40,8', 0, '', '', '', '', '', 3, '', '', ''),
172
173
174
  (1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 330, 0, 0, '', '', '', '', '', 3, '', '', '{{bsLabelColumns:Y}}'),
  (1, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 3, '', '', '{{bsInputColumns:Y}}'),
  (1, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 350, 0, 0, '', '', '', '', '', 3, '', '', '{{bsNoteColumns:Y}}'),
175
176
177
178
179
180
181
  (1, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 360, 0, 0, '', '', '', '', '', 3, '', '', ''),
  (1, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 370, 0, 20, '', '', '', '', '', 3, '', '', ''),
  (1, 'created', 'Created', 'readonly', 'text', 'all', 'native', 380, 0, 20, '', '', '', '', '', 3, '', '', ''),

  (1, 'multi', 'Multi', 'show', 'fieldset', 'all', 'native', 400, 0, 0, '', '', '', '', '', 4, '', '', ''),
  (1, 'multiMode', 'Multi Mode', 'show', 'radio', 'all', 'native', 410, 0, 0, '', '', '', '', '', 4, '', '', ''),
  (1, 'multiSql', 'Multi SQL', 'show', 'text', 'all', 'native', 420, '40,3', 0, '', '', '', '', '', 4, '', '', ''),
182
  (1, 'multiDetailForm', 'Multi Detail Form', 'show', 'text', 'all', 'native', 430, 0, 0, '', '', '', '', '', 4,
183
   '', '', ''),
184
  (1, 'multiDetailFormParameter', 'Multi Detail Form Parameter', 'show', 'text', 'all', 'native', 440, 0, 0, '', '',
185
   '', '', '', 4, '', '', ''),
186

Carsten  Rose's avatar
Carsten Rose committed
187
  (1, '', 'FormElements', 'show', 'subrecord', 'all', 'native', 500, 0, 0, '', '', '',
188
   '{{!SELECT IF( fe.enabled="yes", IF( fe.enabled="yes" AND fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "danger", IF( fe.class="container", "text-info",  IF( fe.class="action", "text-success", ""))), "text-muted") AS _rowClass, IF( fe.enabled="yes", IF(fe.feIdContainer=0 AND !ISNULL(feCX.id) AND fe.class="native", "Please choose a container for this formelement", fe.class), "Disabled") AS _rowTitle, fe.id, CONCAT( IFNULL( CONCAT( feC.name, " (", fe.feIdContainer, ")"),"")) AS Container, fe.name AS "Name|50", fe.label, fe.mode, fe.class,	fe.type, fe.ord, IF(fe.dynamicUpdate="yes", \'<span class="glyphicon glyphicon-random"></span>\',"") AS "dyn|||nostrip", fe.parameter FROM FormElement AS fe LEFT JOIN FormElement AS feC ON feC.id=fe.feIdContainer AND feC.formId=fe.formId LEFT JOIN FormElement AS feCX ON feCX.class="container" AND feCX.enabled="yes" AND feCX.formId=fe.formId WHERE fe.formId={{id:R0}} GROUP BY fe.id ORDER BY fe.class DESC, feC.ord, fe.ord, fe.id}}',
189
   'form=formElement\ndetail=id:formId', 5, 'new,edit,delete', '', '');
190

191

192
193
#
# FormEditor: FormElement
194
INSERT INTO Form (id, name, title, noteInternal, tableName, permitNew, permitEdit, render, multiSql, parameter, requiredParameter)
195
VALUES
196
  (2, 'formElement',
197
   'Form Element Editor. Form : {{SELECT f.id, " / ",  f.name  FROM Form AS f WHERE f.id = {{formId:S0}}  }}',
198
   'Please secure the form',
199
   'FormElement', 'sip', 'sip', 'bootstrap', '', 'maxVisiblePill=5\nclassBody=qfq-color-blue-1', 'formId');
200

201
# FormEditor: FormElements for 'formElement'
202
INSERT INTO FormElement (id, formId, name, label, mode, type, checkType, class, ord, size, note, clientJs, value,
203
                         sql1, parameter, feIdContainer, subrecordOption, modeSql)
204
205
VALUES

206
207
  (100, 2, 'basic', 'Basic', 'show', 'pill', 'all', 'container', 10, 0, '', '', '', '', '', 0, '', ''),
  (101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '',
208
   ''),
209
210
211
  (102, 2, 'layout', 'Layout', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', ''),
  (103, 2, 'value', 'Value', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', ''),
  (104, 2, 'info', 'Info', 'show', 'pill', 'all', 'container', 20, 0, '', '', '', '', '', 0, '', '');
212

213
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
214
                         sql1, parameter, feIdContainer, subrecordOption, dynamicUpdate, bsLabelColumns, bsInputColumns, bsNoteColumns, modeSql, placeholder)
215
VALUES
216

217
  (2, 'id', 'id', 'readonly', 'text', 'all', 'native', 100, 0, 11, '', '', '', '', '', 100, '', 'no', '', '', '', '',
218
   ''),
219
  (2, 'formId', 'formId', 'readonly', 'text', 'all', 'native', 110, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
Carsten  Rose's avatar
Carsten Rose committed
220
  (2, 'feIdContainer', 'Container', 'show', 'select', 'all', 'native', 120, 0, 0, '', '', '',
221
   '{{!SELECT fe.id, CONCAT(fe.type, " / ", fe.name) FROM FormElement As fe WHERE fe.formId={{formId:S0}} AND fe.class="container" ORDER BY fe.type, fe.name }}',
222
223
224
225
   'emptyItemAtStart', 100, '', 'no', '', '', '', '', ''),
  (2, 'enabled', 'Enabled', 'show', 'checkbox', 'all', 'native', 130, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
  (2, 'dynamicUpdate', 'Dynamic Update', 'show', 'checkbox', 'all', 'native', 135, 0, 0, 'On change, this element will be updated and trigger other.',
   '', '', '', '', 100, '', 'no', '3', '2', '7', '', ''),
226
227
228
229
230
231
  (2, 'name', 'Name', 'show', 'text', 'all', 'native', 140, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
  (2, 'label', 'Label', 'show', 'text', 'all', 'native', 150, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
  (2, 'mode', 'Mode', 'show', 'radio', 'all', 'native', 160, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
  (2, 'modeSql', 'Mode sql', 'show', 'text', 'all', 'native', 170, '70,2', 0, '', '', '', '', '', 100, '', 'no', '', '', '', '', ''),
  (2, 'class', 'Class', 'show', 'select', 'all', 'native', 180, 0, 0, '', '', '{{class:FSRD0:alnumx}}', '', '', 100, '', 'yes', '', '', '', '', ''),
  (2, 'type', 'Type', 'show', 'select', 'all', 'native', 190, 0, 0, '', '', '', '',
232
   'itemList={{SELECT IF( "{{class:FRD0:alnumx}}"="native","checkbox,date,time,datetime,dateJQW,datetimeJQW,extra,gridJQW,text,editor,note,password,radio,select,subrecord,upload", IF("{{class:FRD0:alnumx}}"="action","beforeLoad,beforeSave,beforeInsert,beforeUpdate,beforeDelete,afterLoad,afterSave,afterInsert,afterUpdate,afterDelete,sendMail", "fieldset,pill,templateGroup")  ) }}',
233
234
235
   100, '', 'yes', '', '', '', '', ''),
  (2, 'subrecordOption', 'Subrecord Option', 'show', 'checkbox', 'all', 'native', 200, 0, 0, '', '', '', '', '', 100, '', 'no', '', '', '',
   '', ''),
236
237
238
239
  (2, 'checkType', 'Check Type', 'show', 'select', 'all', 'native', 300, 0, 0, '', '', '', '', '', 101, '', 'no', '', '', '', '', ''),
  (2, 'checkPattern', 'Check Pattern', 'show', 'text', 'all', 'native', 310, 0, 0, '', '', '', '', '', 101, '', 'no', '', '', '', '', ''),
  (2, 'onChange', 'JS onChange', 'show', 'text', 'all', 'native', 320, 0, 0, '', '', '', '', '', 101, '', 'no', '', '', '', '', ''),
  (2, 'ord', 'Order', 'show', 'text', 'all', 'native', 330, 0, 0, '', '',
240
   '{{SELECT IF({{ord:R0}}=0,  MAX(IFNULL(fe.ord,0))+10,{{ord:R0}})  FROM (SELECT 1) AS a LEFT JOIN FormElement AS fe ON fe.formId={{formId:S0}} GROUP BY fe.formId}}',
241
   '', '', 101, '', 'no', '', '', '', '', ''),
242
243
244
245
246
  (2, 'tabindex', 'tabindex', 'show', 'text', 'all', 'native', 340, 0, 0, '', '', '', '', '', 101, '', 'no', '', '', '', '', ''),
  (2, 'size', 'Size', 'show', 'text', 'all', 'native', 400, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', ''),
  (2, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 410, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', '{{bsLabelColumns:Y}}'),
  (2, 'bsInputColumns', 'BS Input Columns', 'show', 'text', 'all', 'native', 420, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', '{{bsInputColumns:Y}}'),
  (2, 'bsNoteColumns', 'BS Note Columns', 'show', 'text', 'all', 'native', 430, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', '{{bsNoteColumns:Y}}'),
247
  (2, 'rowLabelInputNote', 'Label / Input / Note', 'show', 'checkbox', 'alnumx', 'native', 440, 0, 10, '', '', '', '', '', 102, '', 'no', '', '', '', '', ''),
248
249
250
  (2, 'maxLength', 'Maxlength', 'show', 'text', 'all', 'native', 450, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', ''),
  (2, 'note', 'Note', 'show', 'editor', 'all', 'native', 460, '', 0, '', '', '', '', 'editor-plugins=code link table textcolor textpattern\neditor-toolbar=code | styleselect link table | bullist numlist | forecolor backcolor bold italic\neditor-menubar=false\neditor-statusbar=false', 102, '', 'no', '', '', '', '', ''),
  (2, 'tooltip', 'Tooltip', 'show', 'text', 'all', 'native', 470, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', ''),
251
  (2, 'placeholder', 'Placeholder', 'show', 'text', 'all', 'native', 480, 0, 0, '', '', '', '', '', 102, '', 'no', '', '', '', '', ''),
252
253
  (2, 'value', 'value', 'show', 'text', 'all', 'native', 500, '40,2', 0, '', '', '', '', '', 103, '', 'no', '', '', '', '', ''),
  (2, 'sql1', 'sql1', 'show', 'text', 'all', 'native', 510, '40,5', 0, 'MariaDB: <a href="https://mariadb.com/kb/en/mariadb/select/">Select</a>, <a href="https://mariadb.com/kb/en/mariadb/functions-and-operators/">Functions</a>', '', '', '', '', 103, '', 'no', '', '', '', '', ''),
254
  (2, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 520, '40,8', 0, '',
255
   '', '', '', '', 103, '', 'no', '', '', '', '', ''),
256
  (2, 'clientJs', 'ClientJS', 'show', 'text', 'all', 'native', 530, 0, 0, '', '', '', '', '', 103, '', 'no', '', '', '', '', ''),
257
258
259
260
  (2, 'adminNote', 'Admin Note', 'show', 'text', 'all', 'native', 600, 0, 0, '', '', '', '', '', 104, '', 'no', '', '', '', '', ''),
  (2, 'feGroup', 'feGroup', 'show', 'text', 'all', 'native', 610, 0, 0, '', '', '', '', '', 104, '', 'no', '', '', '',
   '', ''),
  (2, 'deleted', 'Deleted', 'show', 'checkbox', 'all', 'native', 620, 0, 0, '', '', '', '', '', 104, '', 'no', '', '',
261
   '', '', ''),
262
  (2, 'modified', 'Modified', 'readonly', 'text', 'all', 'native', 630, 0, 20, '', '', '', '', '', 104, '', 'no',
263
   '', '', '', '', ''),
264
  (2, 'created', 'Created', 'readonly', 'text', 'all', 'native', 640, 0, 20, '', '', '', '', '', 104, '', 'no', '',
265
   '', '', '', '');
266

267
268
269
270

# ----------------------------------------
# MailLog

271
272
#DROP TABLE IF EXISTS `MailLog`;
CREATE TABLE IF NOT EXISTS `MailLog` (
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
  `id`       INT(11)      NOT NULL  AUTO_INCREMENT,
  `grId`     INT(11)      NOT NULL  DEFAULT '0',
  `xId`      INT(11)      NOT NULL  DEFAULT '0',
  `receiver` TEXT         NOT NULL  DEFAULT '',
  `sender`   VARCHAR(255) NOT NULL  DEFAULT '',
  `subject`  VARCHAR(255) NOT NULL  DEFAULT '',
  `body`     TEXT         NOT NULL  DEFAULT '',
  `header`   VARCHAR(255) NOT NULL  DEFAULT '',
  `attach`   VARCHAR(255) NOT NULL  DEFAULT '',
  `src`      VARCHAR(255) NOT NULL  DEFAULT '',
  `modified` TIMESTAMP    NOT NULL  DEFAULT CURRENT_TIMESTAMP,
  `created`  DATETIME     NOT NULL  DEFAULT '0000-00-00 00:00:00',

  PRIMARY KEY (`id`)
)
  ENGINE = InnoDB
  DEFAULT CHARSET = utf8
  AUTO_INCREMENT = 0;


#--
#-- Triggers `MailLog`
#--
#DROP TRIGGER IF EXISTS `on_MailLog_update_modified`;
#DELIMITER //
#CREATE TRIGGER `on_MailLog_update_modified` BEFORE UPDATE ON `MailLog`
#FOR EACH ROW SET NEW.modified =
#current_timestamp()
#//
#DELIMITER ;