Commit 086ea67b authored by Carsten  Rose's avatar Carsten Rose
Browse files

Feature #5302 / remove automated 'class internal / external' - fixed unit tests

parent 69e368a5
......@@ -3027,12 +3027,12 @@ will be rendered inside the form as a HTML table.
* *sql1*: SQL query to select records. E.g.::
{{!SELECT AS id, CONCAT(a.street, a.streetnumber) AS a, AS b, AS c FROM Address AS a}}
{{!SELECT AS id, CONCAT(addr.street, addr.streetnumber) AS a, AS b, AS c FROM Address AS addr}}
* Notice the **exclamation mark** after '{{' - this is necessary to return an array of elements, instead of a single string.
* Exactly one column **'id'** has to exist; it specifies the primary record for the target form.
In case the id should not be visible to the user, it has to be named **'_id'**.
* Columnname: *[title=]<title>[|[maxLength=]<number>][|width=<number>][|nostrip][|icon][|link][|url][|mailto][|_rowClass][|_rowTooltip]*
* Columnname: *[title=]<title>[|[maxLength=]<number>][|nostrip][|icon][|link][|url][|mailto][|_rowClass][|_rowTooltip]*
* If the keyword is used, all parameter are position independent.
* Parameter are separated by '|'.
......@@ -3063,6 +3063,7 @@ will be rendered inside the form as a HTML table.
{{!SELECT id, note1 AS 'Comment', note2 AS 'Comment|50' , note3 AS 'title=Comment|maxLength=100|nostrip', note4 AS '50|Comment',
'checked.png' AS 'Status|icon', email AS 'mailto', CONCAT(homepage, '|Homepage') AS 'url',
CONCAT('d|s|F:', pathFileName) AS 'Download|link',
ELT(status,'info','warning','danger') AS '_rowClass', help AS '_rowTooltip' ...}}
* *FormElement.parameter*
......@@ -6219,7 +6220,7 @@ A nice feature is to show a list with last changed records. The following will s
FormElement) forms: ::
10 {
sql = SELECT CONCAT('p:form&r=',, '|t:',,'|o:', GREATEST(MAX(fe.modified), f.modified)) AS _page
sql = SELECT CONCAT('p:{{pageAlias:T}}&form=form&r=',, '|t:',,'|o:', GREATEST(MAX(fe.modified), f.modified)) AS _page
FROM Form AS f
LEFT JOIN FormElement AS fe ON fe.formId =
......@@ -2643,7 +2643,7 @@ abstract class AbstractBuildForm {
* Returned assoc array:
* title Only key. Element is non numeric, which is not a keyword 'width/nostrip/icon/url/mailto'
* width Key/Value Pair. Not provided for 'icon/url/mailto'.
* maxLength Key/Value Pair. Not provided for 'icon/url/mailto'.
* nostrip Only key. Do not strip HTML Tags from the content.
* icon Only key. Value will rendered (later) as an image.
* url Only key. Value will rendered (later) as a 'href'
......@@ -2693,8 +2693,9 @@ abstract class AbstractBuildForm {
$control[$attribute][$columnName] = $value;
if (!isset($control[SUBRECORD_COLUMN_TITLE][$columnName]))
if (!isset($control[SUBRECORD_COLUMN_TITLE][$columnName])) {
$control[SUBRECORD_COLUMN_TITLE][$columnName] = ''; // Fallback: Might be wrong, but better than nothing.
// Don't render Columns starting with '_...'.
if (substr($control[SUBRECORD_COLUMN_TITLE][$columnName], 0, 1) === '_') {
......@@ -433,7 +433,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
// _id: 1, name: Doe, link
$formElement['sql1'] = $this->dbArray[DB_INDEX_DATA_DEFAULT]->sql('SELECT id AS "_id", name, CONCAT("s:1|p:form&form=person&r=" , id , "|t:", name) AS "link" FROM Person ORDER BY id LIMIT 2');
$result = $build->buildSubrecord($formElement, 'name:1', '', $json);
$this->assertEquals('<table class="' . SUBRECORD_TABLE_CLASS_DEFAULT . '" ><thead><tr><th>name</th><th></th></tr></thead><tbody><tr class="record" ><td>Doe</td><td><a href="index.php?id=form&s=badcaffee1234" class="internal" >Doe</a></td></tr><tr class="record" ><td>Smith</td><td><a href="index.php?id=form&s=badcaffee1234" class="internal" >Smith</a></td></tr></tbody></table>', $result);
$this->assertEquals('<table class="' . SUBRECORD_TABLE_CLASS_DEFAULT . '" ><thead><tr><th>name</th><th></th></tr></thead><tbody><tr class="record" ><td>Doe</td><td><a href="index.php?id=form&s=badcaffee1234" >Doe</a></td></tr><tr class="record" ><td>Smith</td><td><a href="index.php?id=form&s=badcaffee1234" >Smith</a></td></tr></tbody></table>', $result);
This diff is collapsed.
This diff is collapsed.
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