diff --git a/extension/Documentation/UsersManual/Index.rst b/extension/Documentation/UsersManual/Index.rst index 5f0e79112bfb5cc8873d94c07660724c53839e19..51d675f7be35e2f6c230806604b5bce6afcbcef2 100644 --- a/extension/Documentation/UsersManual/Index.rst +++ b/extension/Documentation/UsersManual/Index.rst @@ -213,8 +213,11 @@ Only variables that are known in a specified store can be substituted. +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ | V | Vars - Generic variables | | +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ - | 0 | Value: 0, might be helpful if variable is empty but used in an SQL statement, which | All possible keys | - | | might produce a SQL error otherwise if substituted with an empty string | | + | 0 | Zero - allways value: 0, might be helpful if a variable is empty or undefined and will | All possible keys | + | | be used in an SQL statement. | | + +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ + | E | Empty - allways value: 0, might be helpful if a variable is empty or undefined and will| All possible keys | + | | be used in an SQL statement | | +-----+----------------------------------------------------------------------------------------+----------------------------------------------------------------------------+ | Y | System: a) Database credentials, b) helper vars for logging/debugging: | | | | SYSTEM_SQL_RAW ... SYSTEM_FORM_ELEMENT_COLUMN | | @@ -2165,13 +2168,14 @@ QFQ content record:: # Creates a small form that redirects back to this page 10 { sql = SELECT '_' - head = <form action='{{pageId:T}}'>Search for person by name: <input type='text' name='search' vaue='{{search:C0:all}}'><input type='submit' value='Search'></form> + head = <form action='#' method='get'><input type='hidden' name='id' value='{{pageId:T}}'>Search for person by name: <input type='text' name='search' value='{{search:CE:all}}'><input type='submit' value='Search'></form> } # SQL statement will find and list all the relevant persons 20 { - sql = SELECT CONCAT('persondetail&form=person&r=', p.id) AS Pagee, CONCAT(p.lastName, ', ', p.firstName) - FROM person AS p WHERE CONCAT(p.lastName, ', ', p.firstName, ' ' , p.lastName) LIKE '%{{search:C0:all}}%' + sql = SELECT CONCAT('?detail&form=form&r=', f.id) AS Pagee, f.name + FROM Form AS f + WHERE f.name LIKE '%{{search:CE:all}}%' head = <table> tail = </table> rbeg = <tr> @@ -2180,4 +2184,3 @@ QFQ content record:: fend = </td> } - diff --git a/extension/qfq/qfq/Constants.php b/extension/qfq/qfq/Constants.php index 35fbcaa140c80f8dfc47f101087a4fce3f365c29..7abfcf1e2365b42c00df3918f6a0af0e599a6486 100644 --- a/extension/qfq/qfq/Constants.php +++ b/extension/qfq/qfq/Constants.php @@ -173,6 +173,7 @@ const STORE_CLIENT = "C"; // Client: POST variable, if not found: GET variable const STORE_TYPO3 = "T"; // Typo3 > Page content record > bodytext const STORE_VAR = "V"; // Generic Vars const STORE_ZERO = "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 +const STORE_EMPTY = "E"; // value: '', might helpfull if variable is not defined and should result in an empty string instead of {{...}} (cause not replaced) const STORE_SYSTEM = "Y"; // various system values like db connection credentials const STORE_USE_DEFAULT = "FSRD"; diff --git a/extension/qfq/qfq/store/Store.php b/extension/qfq/qfq/store/Store.php index 057bc2efadf981672932abfb95b3752e3d9cebdb..5abd6b94407a8d0091b20d433fcbe8446557a375 100644 --- a/extension/qfq/qfq/store/Store.php +++ b/extension/qfq/qfq/store/Store.php @@ -317,6 +317,8 @@ class Store { switch ($store) { case STORE_ZERO: return 0; + case STORE_EMPTY: + return ''; case STORE_VAR: if ($key === VAR_RANDOM) { return self::randomAlphaNum(RANDOM_LENGTH);