Commit 98d3989b authored by Carsten  Rose's avatar Carsten Rose
Browse files

Index.rst: replace example table columns names of type 'person_id' against 'pId'.

parent da6145d0
...@@ -234,7 +234,7 @@ Only variables that are known in a specified store can be substituted. ...@@ -234,7 +234,7 @@ Only variables that are known in a specified store can be substituted.
+=====+========================================================================================+============================================================================+ +=====+========================================================================================+============================================================================+
| F | :ref:`STORE_FORM`: data not saved in database yet. | All native *FormElements*. Recent values from the Browser. | | F | :ref:`STORE_FORM`: data not saved in database yet. | All native *FormElements*. Recent values from the Browser. |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| S | :ref:`STORE_SIP`: Client parameter 's' will indicate the current SIP, which will be | sip, r (record_id), form | | S | :ref:`STORE_SIP`: Client parameter 's' will indicate the current SIP, which will be | sip, r (recordId), form |
| | loaded from the SESSION repo to the SIP-Store. | | | | loaded from the SESSION repo to the SIP-Store. | |
+-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+
| R | :ref:`STORE_RECORD`: Record - the current record loaded in the form | All columns of the current record from the current table | | R | :ref:`STORE_RECORD`: Record - the current record loaded in the form | All columns of the current record from the current table |
...@@ -291,7 +291,7 @@ Store: *FORM* - F ...@@ -291,7 +291,7 @@ Store: *FORM* - F
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation | | Name | Explanation |
+=================================+============================================================================================================================================+ +=================================+============================================================================================================================================+
| <FormElement name> | Name of native *FormElement*. To get, exactly and only, the specified *FormElement* (for 'p_id'): *{{p_id:F}}* | | <FormElement name> | Name of native *FormElement*. To get, exactly and only, the specified *FormElement* (for 'pId'): *{{pId:F}}* |
+---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_SIP: .. _STORE_SIP:
...@@ -333,7 +333,7 @@ Store: *RECORD* - R ...@@ -333,7 +333,7 @@ Store: *RECORD* - R
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation | | Name | Explanation |
+========================+==================================================================================================================================================+ +========================+==================================================================================================================================================+
| <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form *FormElement*: *{{p_id:R}}* | | <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form *FormElement*: *{{pId:R}}* |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_BEFORE: .. _STORE_BEFORE:
...@@ -350,7 +350,7 @@ This store is handy to compare new and old values of a form. ...@@ -350,7 +350,7 @@ This store is handy to compare new and old values of a form.
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| Name | Explanation | | Name | Explanation |
+========================+==================================================================================================================================================+ +========================+==================================================================================================================================================+
| <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form *FormElement*: *{{p_id:R}}* | | <column name> | Name of a column of the primary table (as defined in the current form). To get, exactly and only, the specified form *FormElement*: *{{pId:R}}* |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
.. _STORE_CLIENT: .. _STORE_CLIENT:
...@@ -522,7 +522,7 @@ SQL Statement ...@@ -522,7 +522,7 @@ SQL Statement
{{SELECT id, name FROM Person}} {{SELECT id, name FROM Person}}
{{SELECT id, name, IF({{feUser}}=0,'Yes','No') FROM Vorlesung WHERE sem_id={{keySemId:Y}} }} {{SELECT id, name, IF({{feUser}}=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={{feUser}} }} }} {{SELECT id, city FROM Address AS adr WHERE adr.pId={{SELECT id FROM Account AS acc WHERE acc.name={{feUser}} }} }}
* Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT: :: * Special case for SELECT input fields. To deliver a result array specify an '!' before the SELECT: ::
...@@ -834,7 +834,7 @@ Fields: ...@@ -834,7 +834,7 @@ Fields:
|checkType | enum('min|max', 'pattern', | | |checkType | enum('min|max', 'pattern', | |
| | 'number', 'email') | | | | 'number', 'email') | |
+---------------+-----------------------------+---------------------------------------------------------------------------------------------------+ +---------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|checkPattern | 'regexp' |If $check_type=='pattern': pattern to match | |checkPattern | 'regexp' |If $checkType=='pattern': pattern to match |
+---------------+-----------------------------+---------------------------------------------------------------------------------------------------+ +---------------+-----------------------------+---------------------------------------------------------------------------------------------------+
|onChange | string |List of *FormElement*-names of current form, separated by ', ', If one of the named *FormElements* | |onChange | string |List of *FormElement*-names of current form, separated by ', ', If one of the named *FormElements* |
| | | change, reload own data / status / mode | | | | change, reload own data / status / mode |
...@@ -1561,20 +1561,20 @@ sqlBefore / sqlInsert / sqlUpdate / sqlDelete / sqlAfter ...@@ -1561,20 +1561,20 @@ sqlBefore / sqlInsert / sqlUpdate / sqlDelete / sqlAfter
Example Example
''''''' '''''''
Situation 1: master.x_id=slave.id (1:1) Situation 1: master.xId=slave.id (1:1)
* Name the action element 'x_id': than {{slaveId}} will be automatically set to the value of 'master.x_id' * Name the action element 'xId': than {{slaveId}} will be automatically set to the value of 'master.xId'
* {{slaveId}} == 0 ? 'sqlInsert' will be fired. * {{slaveId}} == 0 ? 'sqlInsert' will be fired.
* {{slaveId}} != 0 ? 'sqlUpdate' will be fired. * {{slaveId}} != 0 ? 'sqlUpdate' will be fired.
* In case of fireing 'sqlInsert', the 'slave.id' of the new created record are copied to master.x_id (the database will * In case of fireing 'sqlInsert', the 'slave.id' of the new created record are copied to master.xId (the database will
be updated automatically). be updated automatically).
* If the automatic update of the master record is not suitable, the action element should have no name or a name * If the automatic update of the master record is not suitable, the action element should have no name or a name
which does not exist as a column of the master record. Define `slaveId={{SELECT id ...}}` which does not exist as a column of the master record. Define `slaveId={{SELECT id ...}}`
Situation 2: master.id=slave.x_id (1:n) Situation 2: master.id=slave.xId (1:n)
* Name the action element different to any columnname of the master record (or no name). * 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}}` * Determine the slaveId: `slaveId={{SELECT id FROM slave WHERE slave.xxx={{...}} LIMIT 1}}`
...@@ -1716,10 +1716,10 @@ To display a report on any given TYPO3 page, create a content element of type 'Q ...@@ -1716,10 +1716,10 @@ To display a report on any given TYPO3 page, create a content element of type 'Q
A simple example A simple example
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
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: Assume that the database has a table person with columns firstName and lastName. To create a simple list of all persons, we can do the following:
:: ::
10.sql = SELECT id AS person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person 10.sql = SELECT id AS pId, CONCAT(firstName, " ", lastName, " ") AS name FROM person
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 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
separated by a space character. separated by a space character.
...@@ -1739,7 +1739,7 @@ However, we can modify (wrap) the output by setting the values of various keys f ...@@ -1739,7 +1739,7 @@ However, we can modify (wrap) the output by setting the values of various keys f
:: ::
10.sql = SELECT id AS person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person 10.sql = SELECT id AS personId, CONCAT(firstName, " ", lastName, " ") AS name FROM person
10.sep = <br /> 10.sep = <br />
HTML output: HTML output:
...@@ -1817,10 +1817,10 @@ See the example below: ...@@ -1817,10 +1817,10 @@ See the example below:
:: ::
10.sql = SELECT id AS _person_id, CONCAT(first_name, " ", last_name, " ") AS name FROM person 10.sql = SELECT id AS _pId, CONCAT(firstName, " ", lastName, " ") AS name FROM person
10.rsep = <br /> 10.rsep = <br />
10.10.sql = SELECT CONCAT(postal_code, " ", city) FROM address WHERE p_id = {{10.person_id}} 10.10.sql = SELECT CONCAT(postal_code, " ", city) FROM address WHERE pId = {{10.pId}}
10.10.rbeg = ( 10.10.rbeg = (
10.10.rend = ) 10.10.rend = )
...@@ -1934,7 +1934,7 @@ Be careful to: ...@@ -1934,7 +1934,7 @@ Be careful to:
Access to upper column values Access to upper column values
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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. Columns of the upper level result can be accessed via variables, eg. {{10.pId}} will be replaced by the value in the pId column.
+-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +-------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|**Levels** |A report is divided into levels. Example 1 has 3 levels **10**, **20.25**, **20.25.10** | |**Levels** |A report is divided into levels. Example 1 has 3 levels **10**, **20.25**, **20.25.10** |
...@@ -1965,10 +1965,10 @@ Report Example 1: ...@@ -1965,10 +1965,10 @@ Report Example 1:
10.sql = SELECT CURDATE() 10.sql = SELECT CURDATE()
# Show all students from the person table # 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" 20.sql = SELECT p.id AS pId, p.firstName, " - ", p.lastName FROM person AS p WHERE p.typ LIKE "student"
# Show all the marks from the current student ordered chronological # Show all the marks from the current student ordered chronological
20.25.sql = SELECT e.mark FROM exam AS e WHERE e.p_id={{20.p_id}} ORDER BY e.date 20.25.sql = SELECT e.mark FROM exam AS e WHERE e.pId={{20.pId}} ORDER BY e.date
# This query will never be fired, cause there is no direct parent called 20.30. # This query will never be fired, cause there is no direct parent called 20.30.
20.30.10.sql = SELECT 'never fired' 20.30.10.sql = SELECT 'never fired'
...@@ -2857,7 +2857,7 @@ Accessing the database ...@@ -2857,7 +2857,7 @@ Accessing the database
:: ::
10.sql = SELECT p.first_name FROM exp_person AS p 10.sql = SELECT p.firstName FROM exp_person AS p
.. ..
...@@ -2879,7 +2879,7 @@ Accessing the database ...@@ -2879,7 +2879,7 @@ Accessing the database
:: ::
10.sql = SELECT p.first_name, p.last_name FROM exp_person AS p 10.sql = SELECT p.firstName, p.lastName FROM exp_person AS p
.. ..
...@@ -2913,7 +2913,7 @@ Two columns ...@@ -2913,7 +2913,7 @@ Two columns
# Add the formating information as a coloum # Add the formating information as a coloum
10.sql = SELECT p.first_name, " " , p.last_name, "'<br /'>" FROM exp_person AS p 10.sql = SELECT p.firstName, " " , p.lastName, "'<br /'>" FROM exp_person AS p
.. ..
...@@ -3014,29 +3014,29 @@ Two queries: nested with variables :: ...@@ -3014,29 +3014,29 @@ Two queries: nested with variables ::
10.rend = <br /> 10.rend = <br />
# inner query # inner query
10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.pid='{{10.id}}' 10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.pId='{{10.id}}'
10.10.rend = <br /> 10.10.rend = <br />
* For every record of '10', all assigned records of 10.10 will be printed. * For every record of '10', all assigned records of 10.10 will be printed.
Two queries: nested with hidden variables in a table :: Two queries: nested with hidden variables in a table ::
10.sql = SELECT p.id AS _p_id, p.name FROM exp_person AS p 10.sql = SELECT p.id AS _pId, p.name FROM exp_person AS p
10.rend = <br /> 10.rend = <br />
# inner query # inner query
10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.p_id='{{10.p_id}}' 10.10.sql = SELECT a.street FROM exp_address AS a WHERE a.pId='{{10.pId}}'
10.10.rend = <br /> 10.10.rend = <br />
Same as above, but written in the nested notation :: Same as above, but written in the nested notation ::
10 { 10 {
sql = SELECT p.id AS _p_id, p.name FROM exp_person AS p sql = SELECT p.id AS _pId, p.name FROM exp_person AS p
rend = <br /> rend = <br />
10 { 10 {
# inner query # inner query
sql = SELECT a.street FROM exp_address AS a WHERE a.p_id='{{10.p_id}}' sql = SELECT a.street FROM exp_address AS a WHERE a.pId='{{10.pId}}'
rend = <br /> rend = <br />
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment