diff --git a/extension/Documentation/Manual.rst b/extension/Documentation/Manual.rst index 9278e399c91298692744931cfecf04cc0cb94239..170694f352201ef18a9bbaa5539f08f20cac430c 100644 --- a/extension/Documentation/Manual.rst +++ b/extension/Documentation/Manual.rst @@ -1441,11 +1441,17 @@ Store: *RECORD* - R * *Report*: See `access-column-values`_ * If r=0, all values are empty. - +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ - | 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*: *{{pId:R}}* | - +------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +------------------------+-------------------------------------------------------------------------------------------------------------------------+ + | Name | Type | Explanation | + +========================+==========+==============================================================================================================+ + | <column name> | Form | Name of a column of the primary table (as defined in the current form). Example: *{{pId:R}}* | + +------------------------+----------+--------------------------------------------------------------------------------------------------------------+ + | <column name> | Report | Name of a column of a previous fired SQL query. Example: *{{pId:R}}* | + +------------------------+----------+--------------------------------------------------------------------------------------------------------------+ + | &<column name> | Report | Name of a column of a previous fired SQL query, typically used by columns with a `special-column-names`_. | + | | (final) | Final value. Example: '{{link:R}}' returns 'p:home&form=Person|s|b:success|t:Edit'. | + | | | Whereas '{{&link:R}}' returns '<span class="btn btn-success"><a href="?home&s=badcaffee1234">Edit</a></span> | + +------------------------+----------+--------------------------------------------------------------------------------------------------------------+ .. _STORE_BEFORE: @@ -3375,7 +3381,8 @@ and will be processed after saving the primary record and before any action Form * *FormElement.value*: By default, the full path of any already uploaded file is shown. To show something different, e.g. only the filename, define: :: - {{SELECT SUBSTRING_INDEX( '{{pathFileName:R}}', '/', -1) }} + a) {{filenameBase:V}} + b) {{SELECT SUBSTRING_INDEX( '{{pathFileName:R}}', '/', -1) }} See also `downloadButton`_ to offer a download of an uploaded file. @@ -4891,7 +4898,7 @@ Example:: 20.sql = SELECT 'a warm welcome' 'some additional', 'columns' - FROM anotherable + FROM another_table WHERE id>100 20.head = <h3> @@ -5025,6 +5032,16 @@ Columns of the upper / outer level result can be accessed via variables in two w The STORE_RECORD will always be merged with previous content. The Level Keys are unique. +Multiple columns, with the same column name, can't be accessed individually. Only the last column is available. + +Retrieving the *final* value of `special-column-names`_ is possible via '{{&<column>:R}}. Example: :: + + 10.sql = SELECT 'p:home&form=Person|s|b:success|t:Edit' AS _link + 10.20.sql = SELECT '{{link:R}}', '{{&link:R}}' + +The first column of row `10.20` returns 'p:home&form=Person|s|b:success|t:Edit',the second column returns +'<span class="btn btn-success"><a href="?home&s=badcaffee1234">Edit</a></span>'. + Example STORE_RECORD: :: 10.sql= SELECT p.id AS _pId, p.name FROM Person AS p diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index ac63ba817f85d44716869e25f12da137c787f0b3..7e7fc23e5b384cdca588b016ae7039e7d8094c4b 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -1330,6 +1330,8 @@ const RENDER_MODE_5 = '5'; const RENDER_MODE_6 = '6'; const RENDER_MODE_7 = '7'; +const REPORT_TOKEN_FINAL_VALUE = '&'; + const WKHTML_OPTION_VIEWPORT = '--viewport-size'; const WKHTML_OPTION_VIEWPORT_VALUE = '1280x1024'; diff --git a/extension/qfq/qfq/report/Report.php b/extension/qfq/qfq/report/Report.php index bbe04d01005f35f4ad67a217abc269ea43c6eb32..5aa4aee698185cfc353bbce2bf87889e5ab30ce4 100644 --- a/extension/qfq/qfq/report/Report.php +++ b/extension/qfq/qfq/report/Report.php @@ -617,7 +617,7 @@ class Report { $keyAssoc = OnString::stripFirstCharIf(TOKEN_COLUMN_CTRL, $keys[$ii]); if ($keyAssoc != '') { $assoc[$keyAssoc] = $row[$ii]; - + $assoc[REPORT_TOKEN_FINAL_VALUE . $keyAssoc] = $renderedColumn; }