Most fields of a form specification might contain: * ‘’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.
A variable (or SQL) statement is surrounded by curely braces:
{{VarName[:<store / prio>[:<sanitize class>]]}}
Example:
{{recordid}}
{{SELECT name FROM person WHERE id=1234}}
{{SELECT name FROM person WHERE id={{recordid}} }}
{{SELECT name FROM person WHERE id={{key1:C:ALNUMX}} }}
Leading and tailing spaces inside curly braces are removed.
There are several stores, from where to retrieve the value. If a value is not found in one store, take the next store, until a value has been found.
If there is an empty string found, this ‘’‘is’‘’ a value: value found >> stop search.
If no value is found, the value is an <empty string>.
Only variables, which are known in a specified store, can be substituted.
Name Description Content F Form: data still not saved in database. 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 SESSION repo to the SIP-Store. sip, r (record_id), form R Record - the one who will 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 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 send 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 helpfull if variable is empty but used in an SQL statement, which might produce a SQL error otherwise if substituted with an empty string All possible keys Y System: a) Database credentials, b) helper vars for logging/debugging: SYSTEM_SQL_RAW ... SYSTEM_FORM_ELEMENT_COLUMN
Name Explanation s =SIP r record id. Typically stored in SIP, rarely specified on the URL keySemId always current Semester Id keySemIdUser {{keySemIdUser}}, may be changed by user 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 ‘$_SERVER[*]’ All other variables accessable by $_SERVER[]. Only the often used have a pre defined sanitize class. form Unique name of current form random random string with length of 32 chars, alphanum ANREDE {{sex}} == male >> Sehr geehrter Herr, {{sex}} == female Sehr geehrte Frau EANREDE {{sex}} == male >> Dear Mr., {{sex}} == female >> Dear Mrs.
Name Explanation form Formname defined in ttcontent record bodytext * fix. E.g.: form = person * via SIP. E.g. `form = {{form}} debugShowStack Any exception will show the call stack. E.g. debugShowStack = 1 debugLoad Debug Level for ‘load’, defined in ttcontent record bodytext debugSave Debug Level for ‘save’, defined in ttcontent record bodytext fe_user Logged in Typo3 FE User fe_user_uid Logged in Typo3 FE User uid fe_user_group FE groups of logged in Typo3 FE User
Name Explanation FormElement name Name of native formelement. To get, exactly and only, the specified form element(for ‘p_id’): {{p_id:F}}
Name Explanation 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}}
Name Explanation SELECT ... reserved and indicates a SQL Statememt INSERT ... reserved and indicates a SQL Statememt UPDATE ... reserved and indicates a SQL Statememt DELETE ... reserved and indicates a SQL Statememt SHOW ... reserved and indicates a SQL Statememt
SQL Statement:
{{[!]SELECT ...|UPDATE ...|INSERT ...|SHOW ...|LAST_INSERT_ID ...}}
Example:
{{SELECT ... id, name, ... [<PARAM1>] ... FROM person ... [<PARAM2>] [...]}}
A SQL Statement might contain parameter, including additional SQL statements. Inner SQL queries will be fired first.
All variables will be substituted one by one from inner to outer.
Maximum recursion depth: 5 (a recursion depth of 2 is sometimes used for mailing with templates, 3 and more probably confuses too much and are therefore not practicable, but supported until depth of 5)
The number of variables inside an input field or a SQL statement is not limited.
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).
Array: {{!SELECT ...}}
Name | Explanation | Description |
---|---|---|
id | int, autoincrement | created by by MySQL |
name | string | unique and speaking name of the form. Form will be identified by this name |
title | string / query | Title, shown on/above the form. |
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 |
permitUrlParameter | textarea | Braucht es das wircklich? per line one GET-‘parameter name’ with a class DIGIT, ALNUMX, ALL. F.e.: email:ALPHANUM n postalcode:DIGIT |
render | enum(‘plain’,’table’, ‘bootstrap’) | Default bootstrap |
multiMode | enum(‘none’,’horizontal’,’vertical’) | Default ‘none’ |
multiSql | text | Optional. SQL Query which selects all records to edit. |
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 |
parameter | text | Misc additional parameters. See ‘Form.parameter’ |
deleted | string | ‘yes’|’no’. |
modified | timestamp | updated autmatically throught stored procedure |
created | datetime | set once through QFQ |
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 |
Name | Type | Description |
---|---|---|
id | int | |
formId | int | |
feIdContainer | int | |
enabled | enum(‘yes’|’no’) | |
name | string | |
label | string | Label of formelement. Depending on layout model, left or on top of the formelement |
mode | enum(‘show’, ‘readonly’, ‘required’, ‘lock’, ‘disable’ ) | Default: normal - Normal: regular user input field. Readonly : user can’t change any data. Important : user manipulated data wont be saved. Required User has to specify a value. Typically, an <empty string> represents ‘no value’ . lock form element is read only and grayed out, disable: form element is not visible |
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’, | ||
‘before_delete’, ‘after_load’, ‘after_save’, ‘after_insert’, ‘after_update’, ‘after_delete’, ‘feGroup’, ‘sendmail’ )’. | ||
checkType | enum(‘min|max’, ‘pattern’, ‘number’, ‘email’) | |
checkPattern | ‘regexp’ | if $check_type==’pattern’: pattern to match |
onChange | string |
|
ord | string | display order of form elements (‘order’ is a reserved keyword) |
tabindex | string | HTML tabindex attribute |
size | string | Visible length of input element. Might be ommited, depending on the choosen form layout |
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 |
placeholder | string | text, displayed inside the input element in light grey |
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. |
feGroup | string | Comma separated list of Typo3 FE Group ID. NOT SURE IF THIS WILL BE IMPLEMENTED. Natvie 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’. |
modified | timestamp | updated autmatically throught stored procedure |
created | datetime | set once through QFQ |
Attribute | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | <-14> Internal id | |||||||||||||
formId | <-14> Form | |||||||||||||
containerId | <-14> Assign the Formelement to user defined fieldSet or pill | |||||||||||||
enabled | <-14> Formelement is active or not | |||||||||||||
name | <-14> Name of a column of the primary table. Formelements with a corresponding table will be saved automatically. | |||||||||||||
label | <-14> Label shown to the user. | |||||||||||||
mode | <-14> show, readonly, required, lock, disable. | |||||||||||||
class | <-14> native | |||||||||||||
type | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
checkType | ||||||||||||||
checkPattern | ||||||||||||||
onChange | ||||||||||||||
ord | ||||||||||||||
tabindex | ||||||||||||||
size |
|
|
|
|
|
|||||||||
maxLength | ||||||||||||||
note | ||||||||||||||
tooltip | ||||||||||||||
placeholder | ||||||||||||||
clientJs | ||||||||||||||
value | ||||||||||||||
sql1 | <-14> ? | |||||||||||||
sql2 | <-14> ? | |||||||||||||
<-15 rowbgcolor=”#eeeeee”> Additional attributes in Field ‘parameter’. Typically in key=value format. | ||||||||||||||
type | checkbox | dateJQW | datetimeJQW | gridJQW | hidden | input | note | password | radio | select | subrecord | textarea | timeJQW | upload |
accept | <-15> ? | |||||||||||||
alt | <-15> ? | |||||||||||||
autocomplete | ||||||||||||||
autofocus | ||||||||||||||
checkBoxMode | ||||||||||||||
checked | ||||||||||||||
unchecked | ||||||||||||||
label2 | ||||||||||||||
itemList | ||||||||||||||
emptyItemAtStart | ||||||||||||||
emptyItemAtEnd | ||||||||||||||
accept |
|
Radio Buttons will be build from one of three sources:
FormElement.’‘’parameter’‘’:
Select lists will be build from one of three sources:
FormElement.’‘’size’‘’:
FormElement.’‘’parameter’‘’:
‘subrecord’ will be rendered as html table.
FormElement.’‘’sql1’‘’: SQL query to select records. E.g.:
{{!SELECT a.id AS id, CONCAT(a.strasse, a.hausnummer) AS a, a.city AS b, a.zip AS c FROM adresse AS a}}
Columnname: <title>[|<number>][|width=<number>][|nostrip][|icon][|url][|mailto]
Exactly one column ‘id’ has to exist and specifies the primary record for the target form.
FormElement.’‘’parameter’‘’
Typical not used. Usefull if user wisches an explicit ‘Submit’ Button.