Commit 3cb504de authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #11998 - Change funtion notation from ':' to '=>'. Make special column...

Refs #11998 - Change funtion notation from ':' to '=>'. Make special column definition available via '{{&...:R}}''
parent c1f6172f
Pipeline #5049 passed with stages
in 5 minutes and 4 seconds
......@@ -2020,6 +2020,8 @@ const SETTING_TABLESORTER_MODE = 'mode';
const SETTING_TABLESORTER_MODE_DELETE = 'delete';
const SETTING_TABLESORTER_CLEAR = 'Clear';
const COLUMN_FUNCTION_OUTPUT = '_output';
// Object: Type
const T_LABEL = 't_label';
const T_INPUT = 't_input';
......
......@@ -359,7 +359,7 @@ class OnString {
}
// $cmd = "getFeUser(pId, pName) : accountId, feUserUid"
$split = explode(':', $cmd, 2);
$split = explode('=>', $cmd, 2);
// $split[0] = getFeUser(pId, pName), $split[1]=accountId, feUserUid
$functionArr = explode('(', $split[0], 2);
......
......@@ -23,6 +23,7 @@
namespace IMATHUZH\Qfq\Core\Report;
use IMATHUZH\Qfq\Core\BodytextParser;
use IMATHUZH\Qfq\Core\Database\Database;
use IMATHUZH\Qfq\Core\Evaluate;
use IMATHUZH\Qfq\Core\Form\FormAsFile;
......@@ -440,8 +441,9 @@ class Report {
// Explode cmd
OnString::splitFunctionCmd($cmd, $rcFunctionName, $rcFunctionParam, $rcReturnParam);
// Save STORE_RECORD
// Save STORE_RECORD, STORE_TYPO3
$storeRecord = $this->store->getStore(STORE_RECORD);
$storeTypo3 = $this->store->getStore(STORE_TYPO3);
// Fill STORE_RECORD with parameter
$tmp = array();
......@@ -453,18 +455,29 @@ class Report {
// Get tt_content record bodytext
$bodytextArr = $this->db->getBodyText($rcFunctionName);
// Fake uid/pid for meaningful error messages
$this->store->setVar(TYPO3_PAGE_ID, $bodytextArr[T3DATA_PID], STORE_TYPO3);
$this->store->setVar(TYPO3_TT_CONTENT_UID, $bodytextArr[T3DATA_UID], STORE_TYPO3);
$btp = new BodytextParser();
$bodytextArr[T3DATA_BODYTEXT] = $btp->process($bodytextArr[T3DATA_BODYTEXT]);
$report = new Report(array(), $this->evaluate, $this->phpUnit);
// Fire bodytext. output is purged
$output = $report->process($bodytextArr[T3DATA_BODYTEXT]);
$storeRecord[COLUMN_FUNCTION_OUTPUT] = $report->process($bodytextArr[T3DATA_BODYTEXT]);
unset($report);
// Restore and fill STORE_RECORD
$tmp = $this->store->getStore(STORE_RECORD);
foreach ($rcReturnParam as $key) {
$storeRecord[$key] = $tmp[$key] ?? '';
$storeRecord['&' . $key] = $tmp['&' . $key] ?? '';
}
// Restore old state
$this->store->setStore($storeRecord, STORE_RECORD, true);
$this->store->setStore($storeTypo3, STORE_TYPO3, true);
}
......
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