Commit 19e42393 authored by Carsten  Rose's avatar Carsten Rose
Browse files

QuickFormQuery.php: Parameter 'r' in Bodytext supports now variables

parent 9c2c34b3
......@@ -46,9 +46,10 @@ QFQ Keywords (Bodytext)
| | * by SIP: **form = {{form}}** |
| | * by SQL: **form = {{SELECT c.form FROM conference AS c WHERE c.id={{a:C}} }}** |
+-----------------+---------------------------------------------------------------------------------+
| <level>.db | Select a DB. Only necessary if a different than the standard DB should be used. |
| r | recordId. If specified, the form will load the record with the specified id |
| | * Fix. E.g.: **r = 123**, by SQL: **r = {{SELECT ...}}** |
+-----------------+---------------------------------------------------------------------------------+
| <level>.debug | Debug Level for *report* |
| <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) |
+-----------------+---------------------------------------------------------------------------------+
......@@ -75,24 +76,30 @@ QFQ Keywords (Bodytext)
| <level>.althead | If <level>.sql is empty, these token will be rendered |
+-----------------+---------------------------------------------------------------------------------+
.. _debug:
Debug
^^^^^
* config.ini: *SHOW_DEBUG_INFO = yes|no|auto*
* 'yes':
* *yes*:
* Form:
* For every internal link/button, show tooltips with decoded SIP on mouseover.
* Shows 'Edit form' (wrench symbol) button on a form.
* Show tooltips in forms filled with decoded SIP.
* Shows 'Edit form' button in every form.
* Report: Will be configured per tt-content record.
* 'no': No debug info rendered in the output.
*debugShowBodyText = 1*
* 'auto':
* *no*: No debug info.
* checks if there is a Typo3 BE Session.
* *auto*: Depending if there is a Typo3 BE session, set internally:
* yes: *SHOW_DEBUG_INFO = 'yes'*
* no: *SHOW_DEBUG_INFO = 'no'*
* *SHOW_DEBUG_INFO = yes* (BE session exist)
* *SHOW_DEBUG_INFO = no* (no BE session)
Form
----
......@@ -267,12 +274,6 @@ Store: *TYPO3* (Bodytext) - T
| | * 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 |
+---------------+-------------------------------------------------------------------+
| feUser | Logged in Typo3 FE User |
+---------------+-------------------------------------------------------------------+
| feUserUid | Logged in Typo3 FE User uid |
......@@ -966,7 +967,7 @@ Syntax
Debug the bodytext
------------------
The parsed bodytext could be displayed by specifying
The parsed bodytext could be displayed by activating 'showDebugInfo' (:ref:`debug`) and specifying
::
......@@ -2103,3 +2104,4 @@ Two queries: nested with variables
* Columns starting with a '_' won't be printed but can be accessed as regular columns.
......@@ -254,6 +254,13 @@ class QuickFormQuery {
}
$this->store->setVar(SYSTEM_FORM, $formName, STORE_SYSTEM);
// Check if there is a recordId specified in Bodytext - as variable or query.
$rTmp = $this->store->getVar(CLIENT_RECORD_ID, STORE_TYPO3, SANITIZE_ALLOW_ALL);
if (false !== $rTmp && !is_int($rTmp)) {
$rTmp = $this->eval->parse($rTmp);
$this->store->setVar(CLIENT_RECORD_ID, $rTmp, STORE_TYPO3);
}
// Load form
$form = $this->db->sql("SELECT * FROM Form AS f WHERE f.name LIKE ? AND f.deleted='no'", ROW_EXPECT_1,
[$formName], 'Form not found or multiple forms with the same name.');
......@@ -332,7 +339,6 @@ class QuickFormQuery {
}
$storeFormName = $this->store->getVar(SIP_FORM, $store, '', $foundInStore);
$formName = $this->eval->parse($storeFormName, 0, $dummy, $foundInStore);
// If the formname is '': no formname name.
......@@ -359,7 +365,7 @@ class QuickFormQuery {
private function validateForm($formNameFoundInStore) {
// Retrieve record_id either from SIP (prefered) or via URL
$r = $this->store->getVar(SIP_RECORD_ID, STORE_SIP . STORE_CLIENT, '', $recordIdFoundInStore);
$r = $this->store->getVar(SIP_RECORD_ID, STORE_SIP . STORE_TYPO3 . STORE_CLIENT, '', $recordIdFoundInStore);
// If there is a record_id>0: EDIT else NEW: 'sip','logged_in','logged_out','always','never'
$permitMode = ($r > 0) ? $this->formSpec['permitEdit'] : $this->formSpec['permitNew'];
......
Supports Markdown
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