Commit 7be64978 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge remote-tracking branch 'origin/crose_work' into raos_work

parents 83dfdcde bd991dba
...@@ -258,9 +258,10 @@ Server Response ...@@ -258,9 +258,10 @@ Server Response
: The response contains a [Minimal Response]. : The response contains a [Minimal Response].
### Record delete ### Record(s) delete
Request the deletion of the record identified by the SIP. Request the deletion of the record identified by the SIP. The SIP might contain a SIP_TABLE and/or a SIP_FORM.
If both are specified, SIP_FORM will be taken. With SIP_FORM, the tableName is derived from the form.
Request Request
: api/delete.php : api/delete.php
...@@ -273,6 +274,7 @@ URL Parameters ...@@ -273,6 +274,7 @@ URL Parameters
Server Response Server Response
: The response contains a [Minimal Response]. : The response contains a [Minimal Response].
[Redirection Response] may be included.
## Glossary ## Glossary
......
...@@ -36,12 +36,14 @@ Setup ...@@ -36,12 +36,14 @@ Setup
* Install the extension via the Extensionmanager. * Install the extension via the Extensionmanager.
* If you install the extension by manual download/upload and get an error message * If you install the extension by manual download/upload and get an error message
"can't activate extension": rename the downloaded zip file to `qfq.zip`. "can't activate extension": rename the downloaded zip file to `qfq.zip` or `qfq_<version>.zip` (e.g. version: 0.9.1).
* If the Extensionmanager stops after importing: check your memory limit in php.ini. * If the Extensionmanager stops after importing: check your memory limit in php.ini.
* Enable the online Documentation_. * Enable the online Documentation_.
* Copy/rename the file *<ext_dir>/config.example.qfq.ini* to *typo3conf/config.qfq.ini* and configure the necessary values: `config.qfq.ini`_ * Copy/rename the file *<Documentroot>/typo3conf/ext/<ext_dir>/config.example.qfq.ini* to
*<Documentroot>/typo3conf/config.qfq.ini* and configure the necessary values: `config.qfq.ini`_
The configuration file is outside the extension directory to not loose it during updates.
* Play the SQL File *<ext_dir>/qfq/sql/formEditor.sql* to fill the database with the *FormEditor* records. * Play the SQL File *<ext_dir>/qfq/sql/formEditor.sql* to fill the database with the *FormEditor* records.
* Configure Typoscript to include Bootstrap, jQuery, QFQ javascript and CSS files. * Configure Typoscript to include Bootstrap, jQuery, QFQ javascript and CSS files.
...@@ -88,35 +90,42 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content ...@@ -88,35 +90,42 @@ Setup a *report* to manage all *forms*: Create a Typo3 page and insert a content
config.qfq.ini config.qfq.ini
-------------- --------------
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| Keyword | Example | Description | | Keyword | Example | Description |
+========================+==================================+============================================================================+ +=========================+=========================================+============================================================================+
| DB_USER | DB_USER=qfqUser | Credentials configured in MySQL | | DB_USER | DB_USER=qfqUser | Credentials configured in MySQL |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_PASSWORD | DB_PASSWORD=12345678 | Credentials configured in MySQL | | DB_PASSWORD | DB_PASSWORD=12345678 | Credentials configured in MySQL |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_SERVER | DB_SERVER=localhost | Hostname of MySQL Server | | DB_SERVER | DB_SERVER=localhost | Hostname of MySQL Server |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_NAME | DB_NAME=qfq_db | Database name | | DB_NAME | DB_NAME=qfq_db | Database name |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_NAME_TEST | DB_NAME_TEST=qfq_db_test | Used during development of QFQ | | DB_NAME_TEST | DB_NAME_TEST=qfq_db_test | Used during development of QFQ |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DB_INIT | DB_INIT=set names utf8 | Global init for using the database. | | DB_INIT | DB_INIT=set names utf8 | Global init for using the database. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. | | SQL_LOG | SQL_LOG=sql.log | Filename to log SQL commands: relative to <ext_dir> or absolute. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot | | SQL_LOG_MODE | SQL_LOG_MODE=modify | *all*: every statement will be logged - this is a lot |
| | | *modify*: log only statements who change data | | | | *modify*: log only statements who change data |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, | | SHOW_DEBUG_INFO | SHOW_DEBUG_INFO=auto | Possible values: auto|yes|no. For 'auto': If a BE User is logged in, |
| | | debug information will be shown on the fronend. | | | | debug information will be shown on the fronend. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_INTERNAL| CSS_LINK_CLASS_INTERNAL=internal | CSS class name of links which points to internal tagets | | CSS_LINK_CLASS_INTERNAL | CSS_LINK_CLASS_INTERNAL=internal | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_LINK_CLASS_EXTERNAL| CSS_LINK_CLASS_EXTERNAL=external | CSS class name of links which points to internal tagets | | CSS_LINK_CLASS_EXTERNAL | CSS_LINK_CLASS_EXTERNAL=external | CSS class name of links which points to internal tagets |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ +-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DATE_FORMAT | DATE_FORMAT= yyyy-mm-dd | Possible options: yyyy-mm-dd, dd.mm.yyyy | | CSS_CLASS_QFQ_CONTAINER |CSS_CLASS_QFQ_CONTAINER=container | QFQ with own Bootstrap: 'container'. |
+------------------------+----------------------------------+----------------------------------------------------------------------------+ | | | QFQ already nested in Bootstrap of mainpage: <empty> |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_PILL |CSS_CLASS_QFQ_FORM_PILL=qfq-color-grey-1 | Wrap around title bar for pills: CSS Class, typically a background color |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| CSS_CLASS_QFQ_FORM_BODY |CSS_CLASS_QFQ_FORM_BODY=qfq-color-grey-2 | Wrap around formelements: CSS Class, typically a background color |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| DATE_FORMAT | DATE_FORMAT= yyyy-mm-dd | Possible options: yyyy-mm-dd, dd.mm.yyyy |
+-------------------------+-----------------------------------------+----------------------------------------------------------------------------+
Example: *typo3conf/config.qfq.ini* Example: *typo3conf/config.qfq.ini*
...@@ -132,13 +141,16 @@ Example: *typo3conf/config.qfq.ini* ...@@ -132,13 +141,16 @@ Example: *typo3conf/config.qfq.ini*
SHOW_DEBUG_INFO = auto SHOW_DEBUG_INFO = auto
CSS_LINK_CLASS_INTERNAL = internal CSS_LINK_CLASS_INTERNAL = internal
CSS_LINK_CLASS_EXT = external CSS_LINK_CLASS_EXT = external
CSS_CLASS_QFQ_CONTAINER =
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
Documentation Documentation
------------- -------------
To render the QFQ reST documentation: To render the QFQ reST documentation:
* Take care to have 'unzip' and 'Python setuptools' installed (necessary to run ). * Take care to have 'unzip' and 'Python setuptools' installed (necessary to run).
Preparation for Ubuntu 16.04:: Preparation for Ubuntu 16.04::
......
...@@ -32,7 +32,7 @@ QFQ Extension ...@@ -32,7 +32,7 @@ QFQ Extension
Quick Form Query, Form, Report, SQL, Query, Generator. Quick Form Query, Form, Report, SQL, Query, Generator.
:Copyright: :Copyright:
2016 2017
:Author: :Author:
Carsten Rose, Rafael Ostertag Carsten Rose, Rafael Ostertag
......
.. ================================================== .. ==================================================
.. FOR YOUR INFORMATION .. Header hierachy
.. ==
.. --
.. ^^
.. ''
.. ;;
.. ,,
..
.. -------------------------------------------------- .. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM. .. -*- coding: utf-8 -*- with BOM.
...@@ -110,7 +117,7 @@ Form ...@@ -110,7 +117,7 @@ Form
* *Simple* form: the form acts on one record, stored in one table. * *Simple* form: the form acts on one record, stored in one table.
* The form will create necessary SQL commands for insert, update and delete automatically. * The form will create necessary SQL commands for insert, update and delete (only primary record) automatically.
* *Advanced* form: the form acts on multiple records, stored in more than one table. * *Advanced* form: the form acts on multiple records, stored in more than one table.
...@@ -465,8 +472,8 @@ SQL Statement ...@@ -465,8 +472,8 @@ SQL Statement
* This is only possible for the outermost SELECT. * This is only possible for the outermost SELECT.
Form: basic setup Form: main
----------------- ----------
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+ +------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
| Name | Type | Description | | Name | Type | Description |
...@@ -506,8 +513,8 @@ Form: basic setup ...@@ -506,8 +513,8 @@ Form: basic setup
|bsLabelColumns | string | The bootstrap grid system is based on 12 columns. The sum of *bsLabelColumns*, | |bsLabelColumns | string | The bootstrap grid system is based on 12 columns. The sum of *bsLabelColumns*, |
+------------------------+----------------------------------------------------------+ *bsInputColumns* and *bsNoteColumns* should be 12. These values here are the base values| +------------------------+----------------------------------------------------------+ *bsInputColumns* and *bsNoteColumns* should be 12. These values here are the base values|
|bsInputColumns | string | for all formelements. Exceptions per formelement can be specified per formelement. | |bsInputColumns | string | for all formelements. Exceptions per formelement can be specified per formelement. |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+ +------------------------+----------------------------------------------------------+ Default: label=3, input=6, note=3 |
|bsNoteColumns | string | note: default number of 'bootstrap 12grid' columns | |bsNoteColumns | string | |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+ +------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
|parameter | text | Misc additional parameters. See :ref:`form-parameter` | |parameter | text | Misc additional parameters. See :ref:`form-parameter` |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+ +------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
...@@ -518,47 +525,91 @@ Form: basic setup ...@@ -518,47 +525,91 @@ Form: basic setup
|created | datetime | set once through QFQ | |created | datetime | set once through QFQ |
+------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+ +------------------------+----------------------------------------------------------+-----------------------------------------------------------------------------------------+
Field: Form.showButton showButton
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
Display or hide the button 'new' and / or 'delete'. Display or hide the button `new`, `delete`, `close`, `save`.
* *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. * *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. * *delete*: This either deletes the current record only, or (if defined via action form element 'before Delete' ) any specified subrecords.
* *close*: Close the current form. If there are changes, a popup opens and ask to save / close / cancel. The last page from the history will be shown.
* *save*: Save the form.
* Default: show all buttons.
.. _form-parameter: .. _form-parameter:
Field: Form.parameter parameter
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^
* The following parameter are optional and can be configured in the *Form.parameter* field. * The following parameter are optional and can be configured in the *Form.parameter* field.
+------------------------+--------+---------------------------------------------------------------------------------------------------+ +------------------------+--------+----------------------------------------------------------------------------------------------------------+
| Name | Type | Description | | Name | Type | Description |
+========================+========+===================================================================================================+ +========================+========+==========================================================================================================+
| maxVisiblePill | int | Show pills upto <maxVisiblePill> as button, all further in a dropdown menu. Eg.: maxVisiblePill=3 | | 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 | | class | string | HTML div with given class, surrounding the whole form. Eg.: class=container-fluid |
+------------------------+--------+---------------------------------------------------------------------------------------------------+ +------------------------+--------+----------------------------------------------------------------------------------------------------------+
| submitButtonText | string | Show save button, with the <submitButtonText> at the bottom of the form | | classPill | string | HTML div with given class, surrounding the `pill` title line. |
+------------------------+--------+---------------------------------------------------------------------------------------------------+ +------------------------+--------+----------------------------------------------------------------------------------------------------------+
| classBody | string | HTML div with given class, surrounding all `form elements`. |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| submitButtonText | string | Show save button, with the <submitButtonText> at the bottom of the form |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
* Example: * Example:
* maxVisiblePill = 5 * maxVisiblePill = 5
* class = container-fluid * class = container-fluid
* classBody = qfq-form-right
Field: Form.parameter.submitButtonText
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ submitButtonText
''''''''''''''''
* Optional
* By default this field is empty and a 'submit' button with a Bootstrap glyph 'check' symbol is rendered at the top right corner of the form. * Optional.
* In case the 'submit' is needed at the bottom of the form, a <submitButtonText> can be specified. This will automatically * Default: Empty
render the 'submit' at the bottom without a 'check' glyph symbol. Be sure to uncheck 'ShowButton: Save' * Empty: a 'submit' button with a Bootstrap glyph 'check' symbol is rendered at the *top right corner* of the form.
* Non Empty: a 'submit' button, with <submitButtonText>, is rendered at the bottom of the form (without a 'check' glyph
symbol). Typically 'ShowButton: Save' will be unchecked to hide the regular save glyph symbol.
class
'''''
* Optional.
* Default: `container`
* Any CSS class name(s) can be specified.
* Check `typo3conf/ext/qfq/Resources/Public/Css/qfq-bs.css` for predefined classes.
* Typical use: adjust the floating rules of the form.
* See: http://getbootstrap.com/css/#overview-container
* Expand the form over the whole area: `container-fluid`
classPill
'''''''''
* Optional.
* Default: `qfq-color-grey-1`
* Any CSS class name(s) can be specified.
* Check `typo3conf/ext/qfq/Resources/Public/Css/qfq-bs.css` for predefined classes.
* Typical use: adjust the background color of the `pill title` area.
* Predefined background colors: `qfq-color-white`, `qfq-color-grey-1` (dark), `qfq-color-grey-2` (light),
`qfq-color-blue-1` (dark), `qfq-color-blue-2`. (light)
* `classPill` is only visible on forms with container elemants of type 'Pill'.
classBody
'''''''''
* Optional.
* Default: `qfq-color-grey-2`
* Any CSS class name(s) can be specified.
* Check `typo3conf/ext/qfq/Resources/Public/Css/qfq-bs.css` for predefined classes.
* Typical use:
1) adjust the background color of the `form element` area.
1) make all form labels right align: `qfq-form-right`.
* Predefined background colors: `qfq-color-white`, `qfq-color-grey-1` (dark), `qfq-color-grey-2` (light),
`qfq-color-blue-1` (dark), `qfq-color-blue-2`. (light)
FormElements FormElements
------------ ------------
...@@ -577,7 +628,7 @@ FormElements ...@@ -577,7 +628,7 @@ FormElements
Class: Container Class: Container
---------------- ----------------
* Pills are containers for 'fieldset' *and* 'native' Form-Elements. * Pills are containers for 'fieldset' *and* / *or* 'native' Form-Elements.
* Fieldsets are containers for 'native' Form-Elements * Fieldsets are containers for 'native' Form-Elements
Type: fieldset Type: fieldset
...@@ -878,6 +929,11 @@ Type: editor ...@@ -878,6 +929,11 @@ Type: editor
Type: note Type: note
^^^^^^^^^^ ^^^^^^^^^^
Type: password
^^^^^^^^^^^^^^
* Like a `text` element, but every character is shown as a asterisk.
Type: radio Type: radio
^^^^^^^^^^^ ^^^^^^^^^^^
...@@ -1009,15 +1065,6 @@ will be rendered inside the form as a HTML table. ...@@ -1009,15 +1065,6 @@ will be rendered inside the form as a HTML table.
* *Constant '&'*: Indicate a 'constant' value. E.g. `&12:xId` or `{{...}}` (all possibilities, incl. further SELECT * *Constant '&'*: Indicate a 'constant' value. E.g. `&12:xId` or `{{...}}` (all possibilities, incl. further SELECT
statements) might be used. statements) might be used.
Type: string
^^^^^^^^^^^^
Type: submit
^^^^^^^^^^^^
Typically not used. Useful if user wishes an explicit 'Submit' Button.
Type: time Type: time
^^^^^^^^^^ ^^^^^^^^^^
...@@ -1080,12 +1127,23 @@ Class: Action ...@@ -1080,12 +1127,23 @@ Class: Action
Type: before... | after... Type: before... | after...
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
These type of 'action' formelements will be used to implement data validation or creating/updating additional records.
Types: Types:
* beforeLoad * beforeLoad
* good to grant access permission.
* afterLoad * afterLoad
* beforeSave * beforeSave
* good to prohibit creating of duplicate records.
* afterSave * afterSave
* good to create & update additional records.
* beforeInsert * beforeInsert
* afterInsert * afterInsert
* beforeUpdate * beforeUpdate
...@@ -1093,55 +1151,85 @@ Types: ...@@ -1093,55 +1151,85 @@ Types:
* beforeDelete * beforeDelete
* afterDelete * afterDelete
* Check data Validate
''''''''
Perform checks by fireing s SQL query and expecting a predefined number of selected records. Depending on the Perform checks by fireing a SQL query and expecting a predefined number of selected records.
'action'-type, the check is perform on form load, or form save.
* OK: the expected number of records has been selected. Continue processing the next FormElement. * OK: the `expectRecords` number of records has been selected. Continue processing the next FormElement.
* Fail: the expected number of records has not been selected (less or more): Display an error message and abort the * Fail: the `expectRecords` number of records has not been selected (less or more): Display the error message
current form load or form save. `messageFail`and abort the whole (!) current form load or save.
FormElement.’‘’parameter’‘’: FormElement.’‘’parameter’‘’:
* ‘’‘requiredList‘’‘ - List of `native`-FormElements: only if all of those elements are filled, the current * `requiredList` - List of `native`-formelement names: only if all of those elements are filled (!=0 and !=''), the *current*
`action`-FormElement will be processed. `action`-FormElement will be processed. This will enable or disable the check, based on the user input! If no
* ‘’‘sqlValidate’‘’ - query. E.g.: `sqlValidate={{!SELECT id FROM Person AS p WHERE p.name LIKE {{name:F:all}} AND p.firstname LIKE {{firstname:F:all}} }}` `native`-formelement names are given, the specified check will always be performed.
* `sqlValidate` - validation query. E.g.: `sqlValidate={{!SELECT id FROM Person AS p WHERE p.name LIKE {{name:F:all}} AND p.firstname LIKE {{firstname:F:all}} }}`
* Pay attention to '{{!...' after the equal sign. * Pay attention to '{{!...' after the equal sign.
* ‘’‘expectRecords‘’‘ - number of records. E.g.: `expectRecords=0` or `expectRecords=0,1` or `expectRecords={{SELECT COUNT(id) FROM Person}}` * `expectRecords` - number of expected records.
* `expectRecords=0` or `expectRecords=0,1` or `expectRecords={{SELECT COUNT(id) FROM Person}}`
* Separate multiple valid record numbers by ','. If at least one of those matches, the check will pass successfully. * Separate multiple valid record numbers by ','. If at least one of those matches, the check will pass successfully.
* ‘’‘messageFail‘’‘ - Message to show. E.g.: `messageFail=There is already a person called {{firstname:F:all}} {{name:F:all}}`
* Insert / Update / Delete records * `messageFail` - Message to show. E.g.: `messageFail=There is already a person called {{firstname:F:all}} {{name:F:all}}`
sqlInsert / sqlUpdate / sqlDelete
'''''''''''''''''''''''''''''''''
* Save values of a form to different record(s), optionally on different table(s). * Save values of a form to different record(s), optionally on different table(s).
* Typically usefull on 'afterSave' - be carefull when using it earlier, e.g. beforeLoad. * Typically usefull on 'afterSave' - be carefull when using it earlier, e.g. beforeLoad.
FormElement.’‘’parameter’‘’: FormElement.’‘’parameter’‘’:
* ‘’‘requiredList‘’‘ - List of `native`-FormElements: only if all of those elements are filled, the current * `requiredList` - List of `native`-FormElements: only if all of those elements are filled, the current
`action`-FormElement will be processed. `action`-FormElement will be processed.
* ‘’‘slaveId‘’‘: * `slaveId`:
* Auto fill: name the action `action`-FormElement equal to an existing column (table from the current form definition).
`slaveId` will be automatically filled with the value of the named column.
* If there is no such named columnname, set `slaveId=0`.
* Explicit definition: `slaveId=123` or `slaveId={{SELECT id ...}}`
* `sqlInsert`: fired if `slaveId=0` or `slaveId=''`.
* `sqlUpdate`: fired if `slaveId>0`:
* `sqlDelete`: always fired (after sqlInsert or sqlUpdate) - the definition, when this query is fired, might change in
the future.
Note:
* `{{slaveId:V}}` can be used in any query as the current slaveId. It's *important* to Specify Store V!
* If the `action`-FormElement name exist as a column in the master record: Update that column *automatically* with the
recent slaveId (after an INSERT the last_insert_id() acts as the new `slaveId`).
* If `slaveId` does not exist or is empty (e.g. a defined query has an empty result): Example
'''''''
* If there is a primary table column, with the same name as the current `action`-FormElement: take the value from that column as `slaveId`. Situation 1: master.x_id=slave.id (1:1)
* If not: treat it as '0'.
* A value of `0` means the following `sqlInsert` will be fired. * Name the action element 'x_id': than {{slaveId}} will be automatically set to the value of 'master.x_id'
* A value > `0` means the following `sqlUpdate` will be fired and the `slaveId` specifies which one.
* Access the `slaveId` by using the variable `{{slaveId:V}}` inside of `sqlUpdate`, `sqlInsert` or `sqlDelete`.
* ‘’‘sqlUpdate‘’‘ - query. E.g.: `sqlUpdate={{UPDATE Address SET street = '{{street:F:all}}' WHERE id={{slaveId:V}} LIMIT 1}}` * {{slaveId}} == 0 ? 'sqlInsert' will be fired.
* ‘’‘sqlInsert‘’‘ - query. E.g.: `sqlInsert={{INSERT INTO Address (pId, street) VALUES ( {{id:R}}, '{{street:F:all}}' WHERE id={{slaveId:V}} }}` * {{slaveId}} != 0 ? 'sqlUpdate' will be fired.
* ‘’‘sqlDelete‘’‘ - query: E.g.: `sqlDelete={{DELETE FROM Address WHERE id={{slaveId:V}} AND ''='{{city:F:allbut:s}}' LIMIT 1}}` * In case of fireing 'sqlInsert', the 'slave.id' of the new created record are copied to master.x_id (the database will
be updated automatically).
* If the `action`-FormElement name exist as a column in the master record: Update that column with the recent slaveId * If the automatic update of the master record is not suitable, the action element should have no name or a name
(after an INSERT the last_insert_id() acts as the new `slaveId`). which does not exist as a column of the master record. Define `slaveId={{SELECT id ...}}`
Situation 2: master.id=slave.x_id (1:n)
* Name the action element different to any columnname of the master record (or no name).
* Determine the slaveId: `slaveId={{SELECT id FROM slave WHERE slave.xxx={{...}} LIMIT 1}}`
* {{slaveId}} == 0 ? 'sqlInsert' will be fired.
* {{slaveId}} != 0 ? 'sqlUpdate' will be fired.
Type: sendmail Type: sendmail
...@@ -1526,55 +1614,57 @@ Column: _link ...@@ -1526,55 +1614,57 @@ Column: _link
* Column names like `_pagee`, `_mailto`, ... are wrapper to class link. * Column names like `_pagee`, `_mailto`, ... are wrapper to class link.
* The parameters for link contains a prefix to make them position-independet. * The parameters for link contains a prefix to make them position-independet.
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|URL|IMG|Meaning |Qualifier |Example |Description | |URL|IMG|Meaning |Qualifier |Example |Description |
+===+===+==========+===================================+===========================+========================================================================================================================================+ +===+===+==============+===================================+===========================+========================================================================================================================================+
|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 | |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 |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Mail |m:<email> |m:info@example.com |Default link class: email | |x | |Mail |m:<email> |m:info@example.com |Default link class: email |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
|x | |Page |p:<pageId> |p:impressum |Prepend '?' or '?id=', no hostname qualifier (automatically set by browser), default link class: internal, default value: {{pageId}} | |x | |Page |p:<pageId> |p:impressum |Prepend '?' or '?id=', no hostname qualifier (automatically set by browser), default link class: internal, default value: {{pageId}} |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Text |t:<text> |t:Firstname Lastname |- | | | |Text |t:<text> |t:Firstname Lastname |- |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| | |Render |r:<mode> |r:[0-5] |See: `render-mode`_, Default: 0 | | | |Render |r:<mode> |r:[0-5] |See: `render-mode`_, Default: 0 |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Picture |P:<filename> |P:bullet-red.gif |Picture '<img src="bullet-red.gif"alt="....">', default link class: internal. | | |x |Picture |P:<filename> |P:bullet-red.gif |Picture '<img src="bullet-red.gif"alt="....">', default link class: internal. |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Edit |E |E |Show 'edit' icon as image | | |x |Edit |E |E |Show 'edit' icon as image |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |New |N |N |Show 'new' icon as image | | |x |New |N |N |Show 'new' icon as image |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Delete |D |D |Show 'delete' icon as image | | |x |Delete |D |D |Show 'delete' icon as image (only the icon, no database record 'delete' functionality) |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
| |x |Help |H |H |Show 'help' icon as image | | |x |Help |H |H |Show 'help' icon as image |
+---+---+----------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +---+---+--------------+-----------------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+