Index.rst 137 KB
Newer Older
Carsten  Rose's avatar
Carsten Rose committed
1
.. ==================================================
2
3
4
5
6
7
8
9
10
11
12
13
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.

.. include:: ../Includes.txt


.. _users-manual:

Users manual
============

Carsten  Rose's avatar
Carsten Rose committed
14
The QFQ extension is activated through tt-content records. One or more tt-content records per page are necessary to render
15
*forms*, *reports* (exports) or to perform *delete* and *save* commands submitted by a QFQ form.
16
17


18
Features not implemented yet
19
20
21
22
----------------------------

* Multi Forms
* File upload
23
* FormElement:
24

25
26
  * type=action (especially not *addNupdate*)
  * field dependencies (activating a parent element, activates child elements and vice versa)
27
  * Checkbox: some combinations not tested.
28
29
30
31

QFQ content element
-------------------

32
QFQ is used by configuring Typo3 content elements. Insert one or more QFQ content elements on a Typo3 page.
33
34
35
36
37
38
39
40
Specify column and language per content record as wished.

The title of the QFQ content element will not be rendered. It's only visible in the backend for orientation.


QFQ Keywords (Bodytext)
^^^^^^^^^^^^^^^^^^^^^^^

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 +-------------------+---------------------------------------------------------------------------------+
 | Name              | Explanation                                                                     |
 +===================+=================================================================================+
 | form              | Formname defined in ttcontent record bodytext                                   |
 |                   | * Fix. E.g.: **form = person**                                                  |
 |                   | * by SIP: **form = {{form}}**                                                   |
 |                   | * by SQL: **form = {{SELECT c.form FROM conference AS c WHERE c.id={{a:C}} }}** |
 +-------------------+---------------------------------------------------------------------------------+
 | r                 | recordId. If specified, the form will load the record with the specified id     |
 |                   | * Fix. E.g.: **r = 123**, by SQL: **r = {{SELECT ...}}**                        |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.db        | Select a DB. Only necessary if a different than the standard DB should be used. |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.fbeg      | Start token for every field (=column)                                           |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.fend      | End token for every field (=column)                                             |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.head      | Start token for whole <level>                                                   |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.tail      | End token for whole <level>                                                     |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.rbeg      | Start token for row.                                                            |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.rbgd      | Alternating (per row) token                                                     |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.rend      | End token for row. Will be rendered **before** subsequent levels are processed  |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.renr      | End token for row. Will be rendered **after** subsequent levels are processed   |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.rsep      | Seperator token between rows                                                    |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.fsep      | Seperator token between fields (=columns)                                       |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.sql       | SQL Query                                                                       |
 +-------------------+---------------------------------------------------------------------------------+
 | <level>.althead   | If <level>.sql is empty, these token will be rendered                           |
 +-------------------+---------------------------------------------------------------------------------+
 | debugShowBodyText | If ='1' and config.ini > *showDebugInfo=yes*: shows a symbols with bodytext     |
 +-------------------+---------------------------------------------------------------------------------+
80

81
82
.. _debug:

83
84
85
86
87
Debug
^^^^^

* config.ini: *SHOW_DEBUG_INFO = yes|no|auto*

88
89
90
91
92
93
  * *yes*:

    * Form:

      * For every internal link/button, show tooltips with decoded SIP on mouseover.
      * Shows 'Edit form' (wrench symbol) button on a form.
94

95
    * Report: Will be configured per tt-content record.
96

97
      *debugShowBodyText = 1*
98

99
  * *no*: No debug info.
100

101
  * *auto*: Depending if there is a Typo3 BE session, set internally:
102

103
104
    * *SHOW_DEBUG_INFO = yes*  (BE session exist)
    * *SHOW_DEBUG_INFO = no*   (no BE session)
Carsten  Rose's avatar
Carsten Rose committed
105
106
107
108

Form
----

109
* Forms will be created by using the *Form editor* (HTML form). The Formeditor itself consist of two regular QFQ forms: *form* and *formElement*
110
111
112
113
* Every form consist of a) a *Form* record and b) multiple *FormElement* records.
* A form is assigned to a  *table*. Such a table is called the *primary table* for this form.
* There are three types of forms:

114
  * *Simple* form: the form acts on one record, stored in one table.
115

116
    * The form will create necessary SQL commands for insert, update and delete automatically.
117

118
  * *Advanced* form: the form acts on one record, stored in more than one table.
119

120
    * Fields of the primary table acts like a *simple* form, all other fields have to be specified with *addNupdate* records.
121

122
  * *Multi* form: the form acts simultanously on more than one record. All records use the same *FormElements*.
123

124
125
    * The *FormElements* are defined as a regular *simple* / or *advanced* form, plus a SQL Query, which selects and
      iterates over all records. Those records will be loaded at the same time.
Carsten  Rose's avatar
Carsten Rose committed
126

127
.. _variables:
Carsten  Rose's avatar
Carsten Rose committed
128

129
130
Variable (incl. mixed SQL Statement)
------------------------------------
Carsten  Rose's avatar
Carsten Rose committed
131
132

Most fields of a form specification might contain:
133

Carsten  Rose's avatar
Carsten Rose committed
134
135
136
137
138
* ''constants'' (=strings), this is the standard use case.
* ''variables'' retrieved from the stores (see below),
* ''SQL statements'' (limited set of),
* or any combination of the above.

139
* A variable (or SQL) statement is surrounded by curly braces:
Carsten  Rose's avatar
Carsten Rose committed
140

141
  *{{VarName[:<store / prio>[:<sanitize class>]]}}*
Carsten  Rose's avatar
Carsten Rose committed
142
143
144

* Example:

145
  *{{recordid}}*
Carsten  Rose's avatar
Carsten Rose committed
146

147
  *{{SELECT name FROM person WHERE id=1234}}*
Carsten  Rose's avatar
Carsten Rose committed
148

149
  *{{SELECT name FROM person WHERE id={{recordid}} }}*
Carsten  Rose's avatar
Carsten Rose committed
150

151
  *{{SELECT name FROM person WHERE id={{key1:C:alnumx}} }}*
Carsten  Rose's avatar
Carsten Rose committed
152

153
* Leading and trailing spaces inside curly braces are removed.
Carsten  Rose's avatar
Carsten Rose committed
154

155
156
  * *{{ SELECT "Hello World"   }}* acts as *{{SELECT "Hello World"}}*
  * *{{ varname   }}* acts as *{{varname}}*
Carsten  Rose's avatar
Carsten Rose committed
157

158
159
160
* There are several stores, from where to retrieve the value. If a value is not found in one store, the next store is searched,
  until a value is found or there are no more stores available.
*   sdkf
161
* If anywhere along the line an empty string is found, this **is** a value: therefore, the search will stop.
Carsten  Rose's avatar
Carsten Rose committed
162
163
164
165
166
* If no value is found, the value is an <empty string>.

URL Parameter
-------------

167
* URL (=GET) Parameter can be used in *forms* and *reports* as variables.
168
* If a value violates a parameter sanitize class, an exception is thrown.
Carsten  Rose's avatar
Carsten Rose committed
169
170
171
172

Sanitize class
--------------

173
174
175
176
177
178
* All values in Store *C* (Client) and store *F* (Form) will be sanitized:
* All :ref:`predefined-variable-names` have a specific default sanitize class. For these variables, it's not necessary
  to specify a sanitize class.
* All other variables (Store: C, F) get by default the sanitize class defined in the corresponding form. If not defined
  the default class is 'digit'.
* A default sanitize class can be overwritten by individual definition: *{{a:C:all}}*
Carsten  Rose's avatar
Carsten Rose committed
179

180
  * **alnumx**: [A-Za-z][0-9]@-_.,;: /()
Carsten  Rose's avatar
Carsten Rose committed
181
  * **digit**: [0-9].-+
182
183
184
185
  * **email**: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  * **min|max**: only usable in forms. Compares the value against an lower and upper limit (numeric or string).
  * **min|max date**:  only usable in forms. Compares the value against an lower and upper date or datetime.
  * **pattern**:  only usable in forms. Compares the value against a regexp.
Carsten  Rose's avatar
Carsten Rose committed
186
187
188
189
190
191
  * **all**: no sanitizing


Store / prio
------------

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
Only variables that are known in a specified store can be substituted.

 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 |Name |Description                                                                             | Content                                                                    |
 +=====+========================================================================================+============================================================================+
 | F   | Form: data not saved in database yet.                                                  | All native form elements. Recent values from the Browser.                  |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | S   | SIP: Client parameter 's' will indicate the current SIP, which will be loaded from the | sip, r (record_id), form                                                   |
 |     | SESSION repo to the SIP-Store.                                                         |                                                                            |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | R   | Record - the record that is going to be edited. For new records: empty.                | All columns of the current record from the current table                   |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | P   | Parent record. E.g.: on multi forms the current record of the outer query              | All columns of the MultiSQL Statement from the table for the current row   |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | D   | The *table.column* specified *default value*.                                          |                                                                            |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | M   | The *table.column* specified *type*                                                    |                                                                            |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | C   | Client: POST variable, if not found: GET variable                                      | Parameter sent from the Client (=Browser).                                 |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | T   | Typo3: a) Bodytext (ttcontent record), b) Typo3 internal varibles like fe_user_uid, ...| See Typo3 tt_content record configuration                                  |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | 0   | Value: 0, might be helpful if variable is empty but used in an SQL statement, which    | All possible keys                                                          |
 |     | might produce a SQL error otherwise if substituted with an empty string                |                                                                            |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
 | Y   | System: a) Database credentials, b) helper vars for logging/debugging:                 |                                                                            |
 |     | SYSTEM_SQL_RAW ... SYSTEM_FORM_ELEMENT_COLUMN                                          |                                                                            |
 +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
Carsten  Rose's avatar
Carsten Rose committed
220

221
* Default *<prio>*: *FSRD* - Form / SIP / Record / Table definition.
Carsten  Rose's avatar
Carsten Rose committed
222
223
* Hint: Preferable, parameter should be submitted by SIP, not by Client (=URL).

224
225
226
  * Warning: Data submitted via 'Client' can be easily spoofed and altered.
  * Best: Data submitted via SIP never leaves the server, cannot be spoofed or altered by the user.
  * SIPs can _only_ be defined by using *Report*. Inside of *Report* use columns 'Link' (with attribute 's'), 'page?' or 'Page?'.
Carsten  Rose's avatar
Carsten Rose committed
227
228
229
230
231
232

.. _predefined-variable-names:

Predefined variable names
-------------------------

233
Store: *CLIENT* - C
Carsten  Rose's avatar
Carsten Rose committed
234
235
236
237
238
239
240
241
242
243
244
^^^^^^^^^^^^^^^^^^^

 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | Name          | Explanation                                                                                                                              |
 +===============+==========================================================================================================================================+
 | s             | =SIP                                                                                                                                     |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | r             | record id. Typically stored in SIP, rarely specified on the URL                                                                          |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | keySemId      | always current Semester Id                                                                                                               |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
245
 | keySemIdUser  | *{{keySemIdUser}}*, may be changed by user                                                                                               |
Carsten  Rose's avatar
Carsten Rose committed
246
247
248
249
250
251
252
253
254
255
256
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | pageId        | current T3 page Id                                                                                                                       |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | pageType      | T3 GET Parameter 'type'                                                                                                                  |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | pageLanguage  | T3 GET Parameter 'L'                                                                                                                     |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | HTTP_HOST     | current HTTP HOST                                                                                                                        |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | REMOTE_ADDR   | Client IP address                                                                                                                        |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
257
 | '$_SERVER[*]' | All other variables accessable by *$_SERVER[]*. Only the often used have a pre-defined sanitize class.                                   |
Carsten  Rose's avatar
Carsten Rose committed
258
259
260
261
262
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | form          | Unique name of current form                                                                                                              |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
 | random        | random string with length of 32 chars, alphanum                                                                                          |
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
263
 | ANREDE        | *{{sex}}* == male >> Sehr geehrter Herr, *{{sex}}* == female  Sehr geehrte Frau                                                          |
Carsten  Rose's avatar
Carsten Rose committed
264
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+
265
 | EANREDE       | *{{sex}}* == male >> Dear Mr., *{{sex}}* == female >> Dear Mrs.                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
266
267
 +---------------+------------------------------------------------------------------------------------------------------------------------------------------+

268
Store: *TYPO3* (Bodytext) - T
Carsten  Rose's avatar
Carsten Rose committed
269
270
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Carsten  Rose's avatar
Carsten Rose committed
271
272
273
274
 +---------------+-------------------------------------------------------------------+
 | Name          | Explanation                                                       |
 +===============+===================================================================+
 | form          | Formname defined in ttcontent record bodytext                     |
275
 |               |                                                                   |
276
277
 |               | * Fix. E.g. *form = person*                                       |
 |               | * via SIP. E.g. *form = {{form}}*                                 |
Carsten  Rose's avatar
Carsten Rose committed
278
 +---------------+-------------------------------------------------------------------+
279
280
281
 | feUser        | Logged in Typo3 FE User                                           |
 +---------------+-------------------------------------------------------------------+
 | feUserUid     | Logged in Typo3 FE User uid                                       |
Carsten  Rose's avatar
Carsten Rose committed
282
 +---------------+-------------------------------------------------------------------+
283
 | feUserGroup   | FE groups of logged in Typo3 FE User                              |
Carsten  Rose's avatar
Carsten Rose committed
284
 +---------------+-------------------------------------------------------------------+
285
 | ttcontentUid  | Record id of current Typo3 content element                        |
Carsten  Rose's avatar
Carsten Rose committed
286
 +---------------+-------------------------------------------------------------------+
287
288
289
 | typo3PageId   | Record id of current Typo3 page                                   |
 +---------------+-------------------------------------------------------------------+

Carsten  Rose's avatar
Carsten Rose committed
290

291
Store: *FORM* - F
Carsten  Rose's avatar
Carsten Rose committed
292
293
294
295
296
297
^^^^^^^^^^^^^^^^^
* Represents the values in the form, typically before saving them.
* Used for:

  * Formelements who will be rerendered, after a parent element has been changed by the user.
  * Formelement actions, before saving the form.
298
  * Values will be sanatized by the class configured in corresponding the formelement. By default, the sanitize class is `alnumx`.
Carsten  Rose's avatar
Carsten Rose committed
299
300
301
302

 +--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
 | Name               | Explanation                                                                                                                                |
 +====================+============================================================================================================================================+
303
 | FormElement name   | Name of native formelement. To get, exactly and only, the specified form element (for 'p_id'): *{{p_id:F}}*                                |
Carsten  Rose's avatar
Carsten Rose committed
304
305
 +--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+

306
Store: *RECORD* - R
Carsten  Rose's avatar
Carsten Rose committed
307
308
309
310
^^^^^^^^^^^^^^^^^^^
 +--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
 | Name               | Explanation                                                                                                                                |
 +====================+============================================================================================================================================+
311
 | record column name | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form element: *{{p_id:R}}* |
Carsten  Rose's avatar
Carsten Rose committed
312
313
314
315
316
 +--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+

SQL
---

317
* The detection of an SQL command is case *insensitive*.
318
* Leading  whitespace will be skipped.
319
* The following commands are interpreted as SQL commands:
Carsten  Rose's avatar
Carsten Rose committed
320

321
322
323
324
325
  * SELECT
  * INSERT
  * UPDATE
  * DELETE
  * SHOW
Carsten  Rose's avatar
Carsten Rose committed
326

327
* A SQL Statement might contain parameters, including additional SQL statements. Inner SQL queries will be executed first.
Carsten  Rose's avatar
Carsten Rose committed
328
* All variables will be substituted one by one from inner to outer.
329
* Maximum recursion depth: 5 (a recursion depth of 2 is sometimes used for mailing with templates, 3 and more probably confuses too much and is therefore not practicable, but supported until depth of 5)
Carsten  Rose's avatar
Carsten Rose committed
330
* The number of variables inside an input field or a SQL statement is not limited.
331
* A resultset of a SQL statement will be imploded over all: concat all columns of a row, concat all rows - there is no glue string.
Carsten  Rose's avatar
Carsten Rose committed
332

333
* Example::
Carsten  Rose's avatar
Carsten Rose committed
334

335
336
337
338
339
340
341
342
  {{SELECT id, name FROM Person}}
  {{SELECT id, name, IF({{fe_user}}=0,'Yes','No')  FROM Vorlesung WHERE sem_id={{keySemId:Y}} }}
  {{SELECT id, city FROM Address AS adr WHERE adr.p_id={{SELECT id FROM Account AS acc WHERE acc.name={{fe_user}} }} }}

* Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT:

  *{{!SELECT ...}}*

343
  * This is only possible for the outermost SELECT.
344
345
346

Form: basic setup
-----------------
Carsten  Rose's avatar
Carsten Rose committed
347
348

+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
349
| Name                   | Type                                                     | Description                                                                             |
Carsten  Rose's avatar
Carsten Rose committed
350
351
352
353
354
+========================+==========================================================+=========================================================================================+
|id                      | int, autoincrement                                       | created by by MySQL                                                                     |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|name                    | string                                                   | unique and speaking name of the form. Form will be identified by this name              |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
355
|title                   | string                                                   | Title, shown on/above the form.                                                         |
Carsten  Rose's avatar
Carsten Rose committed
356
357
358
359
360
361
362
363
364
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|noteInternal            | textarea                                                 | Internal notes: special functionality, used variables, ...                              |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|tableName               | string                                                   | Primay table of the form                                                                |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|permitNew               | enum('sip', 'logged_in', 'logged_out', 'always', 'never')| Default: sip                                                                            |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|permitEdit              | enum('sip', 'logged_in', 'logged_out', 'always', 'never')| Default: sip                                                                            |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
365
|showButton              | set('new', 'delete')                                     | Default 'new,delete'. Displays button 'new' and 'delete'.                               |
Carsten  Rose's avatar
Carsten Rose committed
366
367
368
369
370
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|render                  | enum('plain','table', 'bootstrap')                       | Default bootstrap                                                                       |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|multiMode               | enum('none','horizontal','vertical')                     | Default 'none'                                                                          |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
371
|multiSql                | text                                                     | Optional. SQL Query which selects all records to edit.                                  |
Carsten  Rose's avatar
Carsten Rose committed
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|multiDetailForm         | string                                                   | Optional. Form to open, if a record is selected to edit (double click on record line)   |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|multiDetailFormParameter| string                                                   | Optional. Translated Parameter submitted to detailform (like subrecord parameter)       |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|forwardMode             | string: 'auto|no|page'.                                  |                                                                                         |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|forwardPage             | string / query                                           | If $forward=="page": page to jump to                                                    |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|bsLabelColumns          | string                                                   | title: default number of 'bootstrap 12grid' columns                                     |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|bsInputColumns          | string                                                   | input: default number of 'bootstrap 12grid' columns                                     |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|bsNoteColumns           | string                                                   | note: default number of 'bootstrap 12grid' columns                                      |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
387
|parameter               | text                                                     | Misc additional parameters. See :ref:`form-parameter`                                   |
Carsten  Rose's avatar
Carsten Rose committed
388
389
390
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|deleted                 | string                                                   | 'yes'|'no'.                                                                             |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
391
|modified                | timestamp                                                | updated automatically through stored procedure                                          |
Carsten  Rose's avatar
Carsten Rose committed
392
393
394
395
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|created                 | datetime                                                 | set once through QFQ                                                                    |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+

396
397
398
399
400
401
402
403
404
405
Field: Form.showButton
^^^^^^^^^^^^^^^^^^^^^^

Display or hide the button 'new' and / or 'delete'.

* *new*: Creates a new record. If the form needs any special parameter via SIP or Client, hide this 'new' button - the necessary parameter are not provided.
* *delete*: The simple form of deleting a record only deletes the record itself, not any child records.



406
.. _form-parameter:
Carsten  Rose's avatar
Carsten Rose committed
407

408
409
Field: Form.parameter
^^^^^^^^^^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
410

411
* The following parameter are optional and can be configured in the *Form.parameter* field.
Carsten  Rose's avatar
Carsten Rose committed
412
413
414
415
416
417
418
419
420

+------------------------+--------+---------------------------------------------------------------------------------------------------+
| Name                   | Type   | Description                                                                                       |
+========================+========+===================================================================================================+
| maxVisiblePill         | int    | Show pills upto <maxVisiblePill> as button, all further in a dropdown menu. Eg.: maxVisiblePill=3 |
+------------------------+--------+---------------------------------------------------------------------------------------------------+
| class                  | string | HTML div with given class, surrounding the whole form. Eg.: class=container-fluid                 |
+------------------------+--------+---------------------------------------------------------------------------------------------------+

421
422
* Example:

423
424
  * maxVisiblePill = 5
  * class = container-fluid
425
426
427
428
429
430

FormElements
------------
* Each *form* contains one or more *FormElement*.
* The *FormElements* are divided in three categories:
  
431
432
433
  * :ref:`class-container`
  * :ref:`class-native`
  * :ref:`class-action`
Carsten  Rose's avatar
Carsten Rose committed
434

435
* Ordering and grouping: Native Form-Elements and Container-Elements (both with feIdContainer=0) will be ordered by 'ord'.
Carsten  Rose's avatar
Carsten Rose committed
436
437
* Inside of a container, all nested elements will be displayed.

438
439
.. _class-container:

Carsten  Rose's avatar
Carsten Rose committed
440
441
442
Class: Container
----------------

443
* Pills are containers for 'fieldset' *and* 'native' Form-Elements.
444
* Fieldsets are containers for 'native' Form-Elements
Carsten  Rose's avatar
Carsten Rose committed
445
446
447
448

Type: fieldset
^^^^^^^^^^^^^^

449
* Native Formelements can be assigned to a fieldset.
Carsten  Rose's avatar
Carsten Rose committed
450
451
452
453
454
455
* name: technical name, used as HTML identifier.
* label: Shown title of the fieldset.

Type: pill
^^^^^^^^^^

456
457
458
459
* Pill is synonymous for a tab. A pill looks like a tab.
* Pills are only available with mode render='bootstrap'.
* If there is at least one pill defined, every native Formelement needs to be assigned to a pill or to a fieldset.
* If there is at least one pill defined, every fieldset needs to be assigned to a pill.
Carsten  Rose's avatar
Carsten Rose committed
460
461
462
463
464

* Parameter:

  * FormElement.'''name''': technical name, used as HTML identifier.
  * FormElement.'''label''': Label shown on the corresponding pill button or inside the dropdown menu.
465
  * FormElement.'''type''': *pill*
Carsten  Rose's avatar
Carsten Rose committed
466
  * FormElement.'''feIdContainer''': 0  # Pill's can't be nested.
467
  * Form.'''Parameter''': *maxVisiblePill=<nr>* Number of Pill-Buttons shown. Undefined means unlimited. Excess Pill buttons will be displayed as a dropdown menu.
Carsten  Rose's avatar
Carsten Rose committed
468

469
470
.. _class-native:

Carsten  Rose's avatar
Carsten Rose committed
471
472
473
474
475
476
477
478
479
480
481
482
483
484
Class: Native
-------------

+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
| Name         | Type                        | Description                                                                                       |
+==============+=============================+===================================================================================================+
| id           | int                         |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
| formId       | int                         |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|feIdContainer | int                         |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|enabled       | enum('yes'|'no')            |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
Carsten  Rose's avatar
Carsten Rose committed
485
|dynamicUpdate | enum('yes'|'no')            | In the browser, formelements with "dynamicUpdate='yes'"  will be updated depending on user input. |
486
|              |                             | :ref:`dynamic-update`                                                                             |
Carsten  Rose's avatar
Carsten Rose committed
487
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
Carsten  Rose's avatar
Carsten Rose committed
488
489
490
491
|name          | string                      |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|label         | string                      | Label of formelement. Depending on layout model, left or on top of the formelement                |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
492
493
494
495
|mode          | enum('show', 'readonly',    | Default: show - *Show*: regular user input field. *Readonly* : user can't change any data.        |
|              | 'required',  'lock',        | *Important* : user manipulated data won't be saved. *Required* User has to specify a value.       |
|              | 'disabled' )                | Typically, an <empty string> represents 'no value'. *Lock* form element is read only and grayed   |
|              |                             | out, *Disabled*: form element is not visible                                                      |
Carsten  Rose's avatar
Carsten Rose committed
496
497
498
499
500
501
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|class         | enum('native', 'action',    | Details below.                                                                                    |
|              | 'container')                |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|type          | enum('checkbox', 'dateJQW', 'datetimeJQW', 'gridJQW', 'hidden', 'text', 'note', 'password', 'radio', 'select', 'subrecord',     |
|              | 'textarea', 'timeJQW', 'upload', 'fieldset', 'pill', 'before_load', 'before_save', 'before_insert', 'before_update',            |
Carsten  Rose's avatar
Carsten Rose committed
502
|              | 'before_delete', 'after_load', 'after_save', 'after_insert', 'after_update', 'after_delete', 'feGroup', 'sendmail')             |
Carsten  Rose's avatar
Carsten Rose committed
503
504
505
506
507
508
509
510
511
512
513
514
515
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|checkType     | enum('min|max', 'pattern',  |                                                                                                   |
|              | 'number', 'email')          |                                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|checkPattern  | 'regexp'                    |if $check_type=='pattern': pattern to match                                                        |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|onChange      | string                      |list of 'form element names' of current form, separated by ', ', If one of the named form elements |
|              |                             | change, reload own data / status / mode                                                           |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|ord           | string                      |display order of form elements ('order' is a reserved keyword)                                     |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|tabindex      | string                      |HTML tabindex attribute                                                                            |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
516
517
|size          | string                      |Visible length of input element. Might be ommited, depending on the choosen form layout.           |
|              |                             |Format: <width>,<height> (in characters)                                                           |
Carsten  Rose's avatar
Carsten Rose committed
518
519
520
521
522
523
524
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|maxLength     | string                      |Maximum characters for input.                                                                      |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|note          | string                      |Note of formelement. Depending on layout model, right or below of the formelement                  |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|tooltip       | text                        |Display this text as tooltip on mouse over                                                         |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
525
|placeholder   | string                      |Text, displayed inside the input element in light grey                                             |
Carsten  Rose's avatar
Carsten Rose committed
526
527
528
529
530
531
532
533
534
535
536
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|clientJs      | text                        |Javascript called on 'on change' formelements                                                      |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|value         | text                        |Default value                                                                                      |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|sql1          | text                        |SQL query  ('sql' is a reserved keyword)                                                           |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|sql2          | text                        |second SQL query                                                                                   |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|parameter     | text                        |might contain misc parameter. Depends on the type of formelement.                                  |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
537
|feGroup       | string                      | Comma-separated list of Typo3 FE Group ID. NOT SURE IF THIS WILL BE IMPLEMENTED. Native           |
Carsten  Rose's avatar
Carsten Rose committed
538
539
540
541
542
543
|              |                             | formElements, fieldsets and pills can be assigned to feGroups. Group status: show, hidden,        |
|              |                             | disabled. Group Access: FE-Groups. User will be assigned to FE-Groups and the form defintion      |
|              |                             | reference such FE-groups. Easy way of granting permission.                                        |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|deleted       | string                      |'yes'|'no'.                                                                                        |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
544
|modified      | timestamp                   |updated autmatically through stored procedure                                                      |
Carsten  Rose's avatar
Carsten Rose committed
545
546
547
548
549
550
551
552
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|created       | datetime                    |set once through QFQ                                                                               |
+--------------+-----------------------------+---------------------------------------------------------------------------------------------------+


+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| Attribute        | checkbox | dateJQW | datetimeJQW |  gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+==================+==========+=========+=============+==========+========+=======+======+==========+=======+========+===========+==========+=========+========+
553
|id                |Internal id                                                                                                                                |
Carsten  Rose's avatar
Carsten Rose committed
554
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
555
|formId            |Form                                                                                                                                       |
Carsten  Rose's avatar
Carsten Rose committed
556
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
557
|containerId       |Assign the Formelement to user defined fieldSet or pill                                                                                    |
Carsten  Rose's avatar
Carsten Rose committed
558
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
559
|enabled           |Formelement is active or not                                                                                                               |
Carsten  Rose's avatar
Carsten Rose committed
560
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
561
|name              |Name of a column of the primary table. Formelements with a corresponding table will be saved automatically.                                |
Carsten  Rose's avatar
Carsten Rose committed
562
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
563
|label             |Label shown to the user.                                                                                                                   |
Carsten  Rose's avatar
Carsten Rose committed
564
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
565
|mode              |show, readonly, required, lock, disable.                                                                                                   |
Carsten  Rose's avatar
Carsten Rose committed
566
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
567
|class             |native                                                                                                                                     |
Carsten  Rose's avatar
Carsten Rose committed
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|type              | checkbox | dateJQW | datetimeJQW |  gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|checkType         |          |   -     |   -         |          |        |   -   |      |   -      |       |        |           |   -      |   -     |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|checkPattern      |          |   -     |   -         |          |        |   -   |      |   -      |       |        |           |   -      |   -     |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|onChange          |   -      |   -     |   -         |          |        |   -   |      |   -      |   -   |   -    |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|ord               |   -      |   -     |   -         |   -      |   -    |   -   |   -  |   -      |   -   |   -    |   -       |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|tabindex          |   -      |   -     |   -         |   -      |   -    |   -   |   -  |   -      |   -   |   -    |   -       |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|size              |   -  1   |         |             |          |        |   -   |      |   -      |   -  1|   -  2 |           |   -  1   |   -     |   -  ? |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|maxLength         |          |         |             |          |        |   -   |      |   -      |       |        |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|note              |   -      |   -     |   -         |          |        |   -   |   -  |   -      |   -   |   -    |   -       |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|tooltip           |   -      |   -     |   -         |          |        |   -   |      |   -      |   -   |   -    |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|placeholder       |          |   -     |   -         |          |        |   -   |      |          |       |        |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|clientJs          |          |   -     |   -         |   -      |        |   -   |      |   -      |   -   |   -    |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
|value             |   -      |   -     |   -         |   -      |   -    |   -   |   -  |   -      |   -   |   -    |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
595
|sql1              |?                                                                                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
596
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
597
|sql2              |?                                                                                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
598
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
599
|Additional attributes in Field 'parameter'. Typically in key=value format.                                                                                    |
Carsten  Rose's avatar
Carsten Rose committed
600
601
602
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| type             | checkbox | dateJQW | datetimeJQW | gridJQW  | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
603
| accept           |?                                                                                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
604
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
605
| alt              |?                                                                                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| autocomplete     |          |   -     |   -         |          |        |   -   |      |          |       |        |           |   -      |   -     |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| autofocus        |   -      |   -     |   -         |          |        |   -   |      |   -      |   -   |   -    |           |   -      |   -     |   -    |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| checkBoxMode     |   -      |     -   |             |          |        |       |      |          |       |        |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| checked          |   -      |         |             |          |        |   -   |      |          |   -   |        |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| unchecked        |   -      |         |             |          |        |   -   |      |          |   -   |        |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| label2           |   -      |         |             |          |        |       |      |          |   -   |        |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| itemList         |   -      |         |             |          |        |       |      |          |   -   |   -    |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| emptyItemAtStart |          |         |             |          |        |       |      |          |       |   -    |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
| emptyItemAtEnd   |          |         |             |          |        |       |      |          |       |   -    |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
625
626
| emptyHide        |          |         |             |          |        |       |      |          |       |   -    |           |          |         |        |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+
Carsten  Rose's avatar
Carsten Rose committed
627
628
629
630
631
632
633
634
635
636
637
638
| accept           |          |         |             |          |        |       |      |          |       |        |           |          |         |   -  3 |
+------------------+----------+---------+-------------+----------+--------+-------+------+----------+-------+--------+-----------+----------+---------+--------+

* 1: A line break created every <size> elements. Easy way to make checkboxes or radio vertical instead of horizontal.
* 2: Any number >1 makes the 'select' input 'multiple' ready.
* See: https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)

* All 'native' Formelements like 'input', 'checkbox', ...

Type: checkbox
^^^^^^^^^^^^^^

639
Checkboxes can be rendered in mode:
Carsten  Rose's avatar
Carsten Rose committed
640

641
* *single*:
Carsten  Rose's avatar
Carsten Rose committed
642

643
  * One column in a table corresponds to one checkbox.
644
  * The value for statuses *checked* and *unchecked* are free to choose.
645
646
  * This mode is selected, if a) *checkBoxMode* = single, or b) *checkBoxMode* is missing **and** the number of fields of the column definition is <3.
  * *parameter*:
Carsten  Rose's avatar
Carsten Rose committed
647

648
649
    * *checkBoxMode* = single (optional)
    * *checked* = <value> (optional, the value which represents 'checked')
Carsten  Rose's avatar
Carsten Rose committed
650

651
      * If *checked* is empty or missing: If *type* = 'enum' or 'set', get first item of the definition. If *type* = string, get default.
Carsten  Rose's avatar
Carsten Rose committed
652

653
    * *unchecked* = <value> (optional, the value which represents 'unchecked')
Carsten  Rose's avatar
Carsten Rose committed
654

655
      * If *unchecked* is empty or missing: If *type* = 'enum' or 'set', get second item of checked. If *type* = 'string', get ''.
Carsten  Rose's avatar
Carsten Rose committed
656

657
    * *label2* = <value>       (Text right beside checkbox) (optional)
Carsten  Rose's avatar
Carsten Rose committed
658
659


660
661
* *multi*:

662
  * One column in a table represents multiple checkboxes. This is typically useful for the column type *set*.
663
664
665
666
667
668
669
670
671
672
673
  * The value for status *checked* are free to choose, the value for status *unchecked* is always the empty string.
  * Each field key (or the corresponding value from the key/value pair) will be rendered right beside the checkbox.
  * *parameter*

    * *checkBoxMode*: multi
    * *orientation*: vertical | horizontal (default), optional - the checkboxes are rendered horizontal or vertical.
    * *itemList* - E.g.:

      * ``itemList=red,blue,orange``
      * ``itemList=1:red,2:blue,3:orange``
      * ``itemList={{!SELECT id, value FROM someTable}}``
Carsten  Rose's avatar
Carsten Rose committed
674
675
676
677
678

Type: date
^^^^^^^^^^

Type: datetime
679
^^^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
680
681

Type: hidden
682
^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
683
684

Type: input
685
^^^^^^^^^^^
686

687
* General input for text and number.
Carsten  Rose's avatar
Carsten Rose committed
688
689
690
* size:

  * <number>:  width of input element in characters. Lineheight = 1.
691
  * <cols>,<rows>: input element = textarea, width=<cols>, height=<rows>
Carsten  Rose's avatar
Carsten Rose committed
692
693

Type: note
694
^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
695
696

Type: radio
697
^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
698

699
* Radio Buttons will be built from one of three sources:
Carsten  Rose's avatar
Carsten Rose committed
700

701
  * a) 'sql1': E.g. *{{!SELECT type AS label FROM car }}* or *{{!SELECT type AS label, typeNr AS id FROM car}}* or *{{!SHOW tables}}*.
Carsten  Rose's avatar
Carsten Rose committed
702
703
704

    * Resultset format 'named': column 'label' and optional a column 'id'.
    * Resultset format 'index':
705
706
707

      * One column in resultset >> first column represents *label*
      * Two or more columns in resultset >> first column represents *id* and second column represents *label*.
Carsten  Rose's avatar
Carsten Rose committed
708
709
710

  * b) FormElement.'''parameter''':

711
    * '''itemList''' attribute. E.g.: *itemList=red,blue,orange* or *itemList=1:red,2:blue:3:orange*
Carsten  Rose's avatar
Carsten Rose committed
712

713
  * c) Definition of the *enum* or *set* field (only labels, no ids are possible).
Carsten  Rose's avatar
Carsten Rose committed
714
715
716
717
718

* FormElement.'''parameter''':

  * '''emptyItemAtStart''': Existence of this item inserts an empty entry at the beginning of the selectlist.
  * '''emptyItemAtEnd''': Existence of this item inserts an empty entry at the end of the selectlist.
719
720
  * '''emptyHide''': Existence of this item hides the empty entry. This is usefull for e.g. Enums, which have a en empty
    entry and the empty value should not be an option to be selected.
Carsten  Rose's avatar
Carsten Rose committed
721
722

Type: select
723
^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
724

725
* Select lists will be built from one of three sources:
Carsten  Rose's avatar
Carsten Rose committed
726

727
  * a) 'sql1': E.g. *{{!SELECT type AS label FROM car }}* or *{{!SELECT type AS label, typeNr AS id FROM car}}* or *{{!SHOW tables}}*.
Carsten  Rose's avatar
Carsten Rose committed
728
729
730
731

    * Resultset format 'named': column 'label' and optional a column 'id'.
    * Resultset format 'index':

732
733
      * One column in resultset >> first column represents *label*
      * Two or more columns in resultset >> first column represents *id* and second column represents *label*.
Carsten  Rose's avatar
Carsten Rose committed
734
735
736

  * b) FormElement.'''parameter''':

737
    * '''itemList''' attribute. E.g.: *itemList=red,blue,orange* or *itemList=1:red,2:blue:3:orange*
Carsten  Rose's avatar
Carsten Rose committed
738

739
  * c) Definition of the *enum* or *set* field (only labels, no ids are possible).
Carsten  Rose's avatar
Carsten Rose committed
740
741
742
743

* FormElement.'''size''':

  * <empty>|0|1: Dropdown list.
744
  * >1: Select field with 'size' rows height. Multiple selection of items is possible.
Carsten  Rose's avatar
Carsten Rose committed
745
746
747
748
749

* FormElement.'''parameter''':

  * '''emptyItemAtStart''': Existence of this item inserts an empty entry at the beginning of the selectlist.
  * '''emptyItemAtEnd''': Existence of this item inserts an empty entry at the end of the selectlist.
750
751
  * '''emptyHide''': Existence of this item hides the empty entry. This is usefull for e.g. Enums, which have a en empty
    entry and the empty value should not be an option to be selected.
Carsten  Rose's avatar
Carsten Rose committed
752
753
754
755

Type: subrecord
^^^^^^^^^^^^^^^

756
757
758
759
760
761
762
763
'subrecord' will be rendered as HTML table.

* *parameter*

  * *detail*: e.g. *detail=id:gr_id,#{{a}}:p_id,#12:x_id*
  * *form*: Target form, e.g. *form=person*
  * *page*: Target page with detail form. If none specified, use the current page
  * *title*: Title displayed over the table.
Carsten  Rose's avatar
Carsten Rose committed
764

765
766
* *sql1*: SQL query to select records. E.g.::

767
   {{!SELECT a.id AS id, CONCAT(a.street, a.streetnumber) AS a, a.city AS b, a.zip AS c FROM adresse AS a}}
768

769
   # Notice the **exclamation mark** after '{{' - this is necessary to return an array of elements, instead of a single string.
770

771
  * Exactly one column 'id' has to exist; it specifies the primary record for the target form.
Carsten  Rose's avatar
Carsten Rose committed
772

773
* Columnname: *<title>[|<number>][|width=<number>][|nostrip][|icon][|url][|mailto]*
Carsten  Rose's avatar
Carsten Rose committed
774

775
776
777
778
779
780
781
  * *<number>*: any 'digit only' will be treated as '''width'''.
  * *width=<number>*: max. number of chars displayed per cell in the column.
  * *nostrip*: by default, html tags will be stripped off the cell content before rendering. This protects the table layout. 'nostrip' deactivates the cleaning to make links, images, ... possible.
  * *icon*: the cell value contains the name of an icon in *fileadmin/icons*. Empty cell values will omit an html image tag (=nothing renderd in the cell).
  * *mailto*: value will be rendered as a mailto link.
  * *url*: value will be rendered as a link.
  * *title=<text>* or '<none of the above>': column '''title'''.
Carsten  Rose's avatar
Carsten Rose committed
782
783
  * The parameters are position independet.
  * Examples::
784

785
786
       SELECT note1 AS 'Comment', note2 AS 'Comment\|50' , note3 AS 'title=Comment\|width=100\|nostrip', note4 AS '50\|Comment',
       'checked.png' AS 'Status\|icon', email AS 'mailto', CONCAT(homepage, '\|Homepage') AS 'url' ...
Carsten  Rose's avatar
Carsten Rose committed
787
788
789
790
791
792
793
794


Type: string
^^^^^^^^^^^^

Type: submit
^^^^^^^^^^^^

795
Typically not used. Useful if user wishes an explicit 'Submit' Button.
Carsten  Rose's avatar
Carsten Rose committed
796
797
798
799
800
801
802
803

Type: time
^^^^^^^^^^

Type: upload
^^^^^^^^^^^^

* See: https://www.w3.org/TR/html5/forms.html#file-upload-state-(type=file)
804
* parameter:accept: *image/*,video/*,audio/*,.doc,.docx,.pdf,<mime type>*
Carsten  Rose's avatar
Carsten Rose committed
805

806
807
.. _class-action:

Carsten  Rose's avatar
Carsten Rose committed
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
Class: Action
-------------

Type: before load
^^^^^^^^^^^^^^^^^

* Former: formallow
* Function: a) fire SQL, b) allow / deny access
* respects 'processRow'

Type: after load
^^^^^^^^^^^^^^^^

* Probably not implemented: no usecase.
* Function: fire SQL
* respects 'processRow'

Type: before save
^^^^^^^^^^^^^^^^^

* Former: lookup
* Function: a) fire SQL, b) allow / deny access
* respects 'processRow'

Type: after save
^^^^^^^^^^^^^^^^

835
* Maybe successor of *addnupdate*
Carsten  Rose's avatar
Carsten Rose committed
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
* Function: fire SQL
* respects 'processRow'

Type: before /after insert
^^^^^^^^^^^^^^^^^^^^^^^^^^

* Function: a) fire SQL, b) (before) allow / deny access
* respects 'processRow'

Type: before /after update
^^^^^^^^^^^^^^^^^^^^^^^^^^

* Function: a) fire SQL, b) (before) allow / deny access
* respects 'processRow'

Type: before / after delete
^^^^^^^^^^^^^^^^^^^^^^^^^^^

* Function: a) fire SQL, b) (before) allow / deny access
* respects 'processRow'

Type: addnupdate
^^^^^^^^^^^^^^^^

* Probably not implemented: no usecase. Probably replaced by after save | after insert. Depends on functionality of 'after ...'.

Type: sendmail
^^^^^^^^^^^^^^

* Send mail(s) on request.
* respects 'processRow'

868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
.. _dynamic-update:

Dynamic Update
--------------

Depending of the form requirements, it's necessary to update FormElements depending on the recent user input. E.g. a user
activates a checkbox and therefore the content of a select list should change.

Make a form dynamic:

* Mark all FormElements with {dynamic update}=enabled, which should send **or** receive a 'do update' signal.
* Define the receiving FormElements in a way, that they will interpret the recent user change. In the example, the FormElement
  'carPriceRange' is the sender and the receiving FormElement might be of type 'radio' or 'selectList'.

  [receiving formElement].parameter: itemList={{ SELECT IF({{carPriceRange}}='expensive','Ferrari,Tesla,Jaguar','General Motors,Honda,Seat,Fiat') }}

Carsten  Rose's avatar
Carsten Rose committed
884
885
886
887
888

Report
======


889
890
General
-------
Carsten  Rose's avatar
Carsten Rose committed
891

892
To display a report on any given TYPO3 page, create a content element of type 'QFQ Element' (plugin) on that page.
Carsten  Rose's avatar
Carsten Rose committed
893
894

A simple example
895
^^^^^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
896
897

Assume that the database has a table person with columns first_name and last_name. To create a simple list of all persons, we can do the following:
898
899
900
::

    10.sql = SELECT id AS person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person
Carsten  Rose's avatar
Carsten Rose committed
901

902
10 Stands for a *root level* of the report (see section `Structure`_). 10.sql defines a SQL query for this specific level. When the query is executed it will return a result having one single column name containing first and last name
Carsten  Rose's avatar
Carsten Rose committed
903
904
905
906
907
908
909
910
911
912
913
separated by a space character.

The HTML output displayed on the page resulting from only this definition could look as follows:
::

    Marc MusterElton JohnSpeedy Gonzales

..



914
I.e., QFQ will simply output the content of the SQL result row after row for each single level.
Carsten  Rose's avatar
Carsten Rose committed
915

916
However, we can modify (wrap) the output by setting the values of various keys for each level: 10.rsep=<br/> for example tells QFQ to seperate the rows of the result by a HTML-line break. The final result in this case is:
Carsten  Rose's avatar
Carsten Rose committed
917
918
919

::

920
921
    10.sql = SELECT id AS person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person
    10.sep = <br />
Carsten  Rose's avatar
Carsten Rose committed
922

923
HTML output:
Carsten  Rose's avatar
Carsten Rose committed
924
925
::

926
    Marc Muster<br />Elton John<br />Speedy Conzales<br />
Carsten  Rose's avatar
Carsten Rose committed
927
928
929
930
931
932
933
934
935
936
937
938
939

..


Syntax
------

    All **root level queries** will be fired in the order specified by 'level' (Integer value).

    For **each** row of a query (this means *all* queries), all subqueries will be fired once.

    *   E.g. if the outer query selects 5 rows, and a nested query always select 3 rows, than the total number of rows are 5 x 3 = 15 rows.

940
    There is a set of **variables** that will get replaced before the SQL-Query gets executed:
Carsten  Rose's avatar
Carsten Rose committed
941

942
        Column values of the recent rows: {{<level>.<columnname>}}
Carsten  Rose's avatar
Carsten Rose committed
943

944
        Global variables: {{global.<name>}}
Carsten  Rose's avatar
Carsten Rose committed
945

946
        Variables from specific stores: {{<name>[:<store/s>[:<sanitize class>]]}}
Carsten  Rose's avatar
Carsten Rose committed
947

948
        Row index and total rows: {{<level>.line.count}} or {{<level>.line.total}}
Carsten  Rose's avatar
Carsten Rose committed
949

950
        'last_insert_id' and 'affected_rows': {{<level>.line.total}} (*total* may have a different meaning, depending on the type of the SQL command)
Carsten  Rose's avatar
Carsten Rose committed
951

952
        See :ref:`variables` for a full list of all available variables.
Carsten  Rose's avatar
Carsten Rose committed
953
954
955
956
957

    Different types of SQL queries are possible: SELECT, INSERT, UPDATE, DELETE, SHOW

    Only SELECT and SHOW queries will fire subqueries.

958
    *   Processing of the resulting rows and columns:
Carsten  Rose's avatar
Carsten Rose committed
959
960
961

    *   In general, all columns of all rows will be printed out sequentially.

962
963
        On a per column base, printing of columns can be suppressed. This might be useful to select values which will be
        accessed later on in another query via the {{level.columnname}} variable. To suppress printing of a column, use a
Carsten  Rose's avatar
Carsten Rose committed
964
965
        underscore as column name prefix.

966
        Reserved column names have a special meaning and will be processed in a special way. See `Processing of columns in the SQL result`_ for details.
Carsten  Rose's avatar
Carsten Rose committed
967

968
        There are extensive ways to wrap columns and rows automatically. See :ref:`wrapping-rows-and-columns`
Carsten  Rose's avatar
Carsten Rose committed
969

970
971
Debug the bodytext
------------------
972
The parsed bodytext could be displayed by activating 'showDebugInfo' (:ref:`debug`) and specifying
973
974
975
976
977
978

::

    debugShowBodyText = 1

A small symbol with a tooltip will be shown, where the content record will be displayed on the webpage.
979
Note: :ref:`debug` information will only be shown with *showDebugInfo=yes* in config.ini .
980

Carsten  Rose's avatar
Carsten Rose committed
981
982
983
Structure
---------

984
985
986
A report can be divided into several levels. This can make report definitions more readable because it allows for
splitting of otherwise excessively long SQL queries. For example, if your SQL query on the root level selects a number
of person records from your person table, you can use the SQL query on the second level to look up the city where each person lives.
Carsten  Rose's avatar
Carsten Rose committed
987
988
989
990
991
992

See the example below:

::


993
994
    10.sql = SELECT id AS _person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person
    10.rsep = <br />
Carsten  Rose's avatar
Carsten Rose committed
995

996
    10.10.sql = SELECT CONCAT(postal_code, " ", city) FROM address WHERE p_id = {{10.person_id}}
Carsten  Rose's avatar
Carsten Rose committed
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
    10.10.rbeg = (
    10.10.rend = )

..

This would result in

::


    Marc Muster (3004 Bern)
    Elton John (8008 Zürich)
    Speedy Conzales (3012 Bern)

..

1013
1014
1015
1016
Across several lines
^^^^^^^^^^^^^^^^^^^^

To make SQL quieres more readable, it's possible to split a line across several lines. Lines with keywords are on their
1017
own - if a line is not a 'keyword' line, it will be appended at the last keyword line. 'Keyword' lines are detected on:
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042

 * <level>.<keyword> =
 * {
 * <level> {

Example::

    10.sql = SELECT 'hello world'
             FROM mastertable
    10.tail = End

    20.sql = SELECT 'a warm welcome'
               'some additional', 'columns'
               FROM smartTable
               WHERE id>100

    20.head = <h3>
    20.tail = </h3>

Nesting of levels
^^^^^^^^^^^^^^^^^

Levels can be nested by using curly brackets::

   10.sql = SELECT 'hello world'
1043

1044
1045
1046
1047
1048
   20 {
         sql = SELECT 'a new query'
         head = <h1>
         tail = </h1>
   }
1049

1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
   30 {
         sql = SELECT 'a third query'
         head = <h1>
         tail = </h1>
         40 {
               sql = SELECT 'a nested nested query'
         }
   }

   30.40.tail = End

   50
Carsten  Rose's avatar
Carsten Rose committed
1062

1063
1064
1065
   {
          sql = SELECT 'A query with braces on their own'
   }
Carsten  Rose's avatar
Carsten Rose committed
1066

1067

1068
Columns of the upper level result can be accessed via variables, eg. {{10.person_id}} will be replaced by the value in the person_id column.
Carsten  Rose's avatar
Carsten Rose committed
1069
1070

+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1071
|**Levels**   |A report is divided into levels. Example 1 has 3 levels **10**, **20.25**, **20.25.10**                                                                                                                                      |
Carsten  Rose's avatar
Carsten Rose committed
1072
1073
1074
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**Qualifier**|A level is divided into qualifiers **20.30.10** has 3 qualifiers **20**, **30**, **10**                                                                                                                                      |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1075
|**Root       |Is a level with one qualifier. E.g.: 10                                                                                                                                                                                      |
Carsten  Rose's avatar
Carsten Rose committed
1076
1077
|levels**     |                                                                                                                                                                                                                             |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1078
|**Sub        |Is a level with more than one qualifier. E.g. levels **20.25** and **20.30.10**                                                                                                                                              |
Carsten  Rose's avatar
Carsten Rose committed
1079
1080
|levels**     |                                                                                                                                                                                                                             |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1081
|**Child**    |The level **20** has one child **20.25**                                                                                                                                                                                     |
Carsten  Rose's avatar
Carsten Rose committed
1082
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1083
|**Parent**   |The level 20.25 has a parent **20**                                                                                                                                                                                          |
Carsten  Rose's avatar
Carsten Rose committed
1084
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1085
|**Example    |**10** and **20** are root level and will be executed independently. **10** don't have a sub level. **20.25** will be executed as many times as **20** has row numbers. **20.30.10** won't be executed because there isn't   |
Carsten  Rose's avatar
Carsten Rose committed
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
|explanation**|any **20.30** level                                                                                                                                                                                                          |
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


Report Example 1:

::


    # Displays current date
    10.sql = SELECT CURDATE()

1098
1099
    # Show all students from the person table
    20.sql = SELECT p.id AS p_id, p.first_name, " - ", p.last_name FROM person AS p WHERE p.typ LIKE "student"
Carsten  Rose's avatar
Carsten Rose committed
1100
1101

    # Show all the marks from the current student ordered chronological
1102
    20.25.sql = SELECT e.mark FROM exam AS e WHERE e.p_id={{20.p_id}} ORDER BY e.date
Carsten  Rose's avatar
Carsten Rose committed
1103
1104
1105
1106

    # This query will never be fired, cause there is no direct parent called 20.30.
    20.30.10.sql = SELECT 'never fired'

1107
.. _wrapping-rows-and-columns:
Carsten  Rose's avatar
Carsten Rose committed
1108
1109
1110
1111

Wrapping rows and columns: Level keys
-------------------------------------

1112
1113
Order and nesting of queries, will be defined with a typoscript-like syntax: level.sublevel1.subsublevel2. ...
Each 'level' directive needs a final key, e.g: 20.30.10. **sql**. A key **sql** is necessary in order to process a level.
1114
All `QFQ Keywords (Bodytext)`_.
Carsten  Rose's avatar
Carsten Rose committed
1115
1116
1117
1118

Processing of columns in the SQL result
---------------------------------------

1119
1120
1121
* The content of all columns of all rows will be printed sequentially, without separator.
* Rows with `Special column names`_  will be processed in a special way.
* Column names, which start with a '_', will not be printed. This is useful if you only want to access the content of
1122
  some columns during later on via the {{<level>.<column>}} variable but don't want to print the content of those columns.
Carsten  Rose's avatar
Carsten Rose committed
1123

1124
Special column names
1125
--------------------
Carsten  Rose's avatar
Carsten Rose committed
1126

1127
1128
1129
* The input parameters for the processing function are stored as as column values.
* Single parameters are delimited by the '|' character.
* Parameters are identified by the function either
Carsten  Rose's avatar
Carsten Rose committed
1130

1131
1132
  * by their **order**
  * or by a **one character qualifier** followed by the : character, placed in front of the actual parameter value.
Carsten  Rose's avatar
Carsten Rose committed
1133
1134

+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1135
|**Special column name** | **Purpose**                                                                                                                                                                                 |
Carsten  Rose's avatar
Carsten Rose committed
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|_<someName>             |Suppress output. Column names with leading underscore are used to select data from the database and make it available in other parts of the report without generating any output.            |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?link                   |Easily create links with different features.                                                                                                                                                 |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?mailto                 |Quickly create email links. A click on the link will open the default mailer. The address is encrypted via JS against email bots.                                                            |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?pageX or PageX         |Shortcut version of the link interface for fast creation of internal links. The column name is composed of the string *page*/*Page* and a optional character to specify the type of the link.|
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?sendmail               |Send emails.                                                                                                                                                                                 |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1147
|?exec                   |Run batch files or executables on the webserver.                                                                                                                                             |
Carsten  Rose's avatar
Carsten Rose committed
1148
1149
1150
1151
1152
1153
1154
1155
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?vertical               |Render Text vertically. This is usefull for tables with limited column width.                                                                                                                |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?img                    |Display images.                                                                                                                                                                              |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|?F                      |Wrap/modify content. Undocumented.                                                                                                                                                           |
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

1156
.. _column-link:
Carsten  Rose's avatar
Carsten Rose committed
1157
1158

Column: link
1159
^^^^^^^^^^^^
Carsten  Rose's avatar
Carsten Rose committed
1160

1161
{{url | display | **i (internal)**, e(external) | **- (same)**,n (new), p (parent), t(top) | **-**, (e(edit), c(copy), n(new), d(delete), i(insert) , f(file)) }}
Carsten  Rose's avatar
Carsten Rose committed
1162

1163
1164
1165
1166
* Most URLs will be rendered via class link.
* Column names like pagee, mailto,... are wrapper to class link.
* The parameters for link contains a prefix to make them position-independet.
* For fewer conflicts:
Carsten  Rose's avatar
Carsten Rose committed
1167

1168
        A:u|m|p:url|mail|page (A=Anchor)
Carsten  Rose's avatar
Carsten Rose committed
1169

1170
        G:E|N|T|I|M|C (G=Grafic)
Carsten  Rose's avatar
Carsten Rose committed
1171

1172
        G:P|b|C:<Color>|<Text> (G=Grafic)
Carsten  Rose's avatar
Carsten Rose committed
1173
1174
1175
1176
1177
1178

+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|URL|IMG|Meaning   |Qualifier                          |Example                    |Description                                                                                                                             |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|   |   |Anchor    |A:...                              |See above                  |Superclass for regular URL defnition                                                                                                    |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
1179
|   |   |Grafic    |G:...                              |See above                  |Superclass for graphic definiton                                                                                                        |
Carsten  Rose's avatar
Carsten Rose committed
1180
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
1181
|x  |   |URL       |u:<url>                            |u:http://www.example.com   |If an image is specified, it will be rendered inside the link, default link class: external                                             |
Carsten  Rose's avatar
Carsten Rose committed
1182
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
1183
|x  |   |Mail      |m:<email>                          |m:info@example.com         |Default link class: email                                                                                                               |