Commit 78aa1845 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Report.php: Columns '_bullet' and '_check' implemented.

parent d9c4a84a
......@@ -62,3 +62,4 @@ define("PATH_ICONS", "typo3conf/ext/qfq/Resources/Public/icons/");
// Definitions to allow successfull include of ext_localconf.
//define( 'TYPO3_MODE', '1' );
//define( 'FORMREPORT', '1' );
......@@ -493,12 +493,12 @@ class Report {
$this->store->setVar(SYSTEM_REPORT_COLUMN_NAME, $keys[$ii], STORE_SYSTEM);
$this->store->setVar(SYSTEM_REPORT_COLUMN_VALUE, $row[$ii], STORE_SYSTEM);
$tmp = $this->renderColumn($ii, $keys[$ii], $row[$ii], $full_level, $rowIndex, $show);
if ($show) {
$renderedColumn = $this->renderColumn($ii, $keys[$ii], $row[$ii], $full_level, $rowIndex);
if ($renderedColumn != '') {
//prints
$content .= $this->variables->doVariables($fsep);
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "fbeg"]);
$content .= $tmp;
$content .= $renderedColumn;
$content .= $this->variables->doVariables($this->frArray[$full_level . "." . "fend"]);
$fsep = $this->frArray[$full_level . "." . "fsep"];
}
......@@ -514,22 +514,19 @@ class Report {
* @param string $columnValue
* @param string $full_level
* @param string $rowIndex
* @param bool $show
* @return string rendered column
* @throws SyntaxReportException
*/
private function renderColumn($columnIndex, $columnName, $columnValue, $full_level, $rowIndex, &$show) {
private function renderColumn($columnIndex, $columnName, $columnValue, $full_level, $rowIndex) {
$content = "";
$show = TRUE;
if (substr($columnName, 0, 1) == "_") {
$show = false;
$columnName = substr($columnName, 1);
}
$content = "";
switch ($columnName) {
case "link":
$link = new Link($this->fr_error, $this->dbAlias, $this->sip);
$link = new Link($this->fr_error, $this->sip);
$content .= $link->renderLink($columnValue);
# unset $link;
break;
......@@ -567,6 +564,24 @@ class Report {
$content .= $link->renderLink($linkValue);
break;
case "bullet":
if ($columnValue === '')
break;
$linkValue = "r:3|B:" . $columnValue;
$link = new Link($this->fr_error, $this->sip);
$content .= $link->renderLink($linkValue);
break;
case "check":
if ($columnValue === '')
break;
$linkValue = "r:3|C:" . $columnValue;
$link = new Link($this->fr_error, $this->sip);
$content .= $link->renderLink($linkValue);
break;
case "img":
// "<path to image>|[alttext]|[text behind]" renders to: <img src="<path to image>" alt="[alttext]">[text behind]
if (empty($columnValue)) break;
......@@ -656,24 +671,31 @@ class Report {
case "Q":
$newColumnName = $kv[1];
#if(!$newColumnName) throw new syntaxException ( "Missing a 'reserved column name' for parameter 'Q' in column 'F': $columnValue","",__FILE__,__LINE__,$this->fr_error);
if ($newColumnName == 'F') throw new SyntaxReportException ("Not allowed: 'F' as 'reserved column name' for parameter 'Q': $columnValue", "", __FILE__, __LINE__, $this->fr_error);
if ($newColumnName == 'F')
throw new SyntaxReportException ("Not allowed: 'F' as 'reserved column name' for parameter 'Q': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case "Z":
$show = false;
// $show = false;
break;
case "T":
$striptags = TRUE;
break;
case "X":
$tag = $kv[1];
if (!$tag) throw new SyntaxReportException ("Missing the 'tag' parameter for 'X'): $columnValue", "", __FILE__, __LINE__, $this->fr_error);
if (!$tag)
throw new SyntaxReportException ("Missing the 'tag' parameter for 'X'): $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case "V":
$newFinalColumnName = $kv[1];
if (!$newFinalColumnName) throw new SyntaxReportException ("Missing the 'name' parameter for 'V': $columnValue", "", __FILE__, __LINE__, $this->fr_error);
if (!$newFinalColumnName)
throw new SyntaxReportException ("Missing the 'name' parameter for 'V': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
case 'F':
throw new SyntaxReportException ("Qualifier 'F' is not allowed inside of a column with column name 'F': $columnValue", "", __FILE__, __LINE__, $this->fr_error);
throw new SyntaxReportException ("Qualifier 'F' is not allowed inside of a column with column name 'F': $columnValue",
"", __FILE__, __LINE__, $this->fr_error);
break;
# Save every non 'F' qualifier for later usage
default:
......@@ -681,6 +703,7 @@ class Report {
break;
}
}
# Check for needed action
# if(!$newColumnName) throw new syntaxException ( "Missing parameter 'Q' in column 'F': $columnValue","",__FILE__,__LINE__,$this->fr_error);
if ($newColumnName)
......@@ -691,7 +714,7 @@ class Report {
# reconstruct remaining parameters
$arr = implode("|", $remain);
# render
$content = $this->renderColumn($columnIndex, $columnName, $arr, $full_level, $rowIndex, $dummy);
$content = $this->renderColumn($columnIndex, $columnName, $arr, $full_level, $rowIndex);
if ($newFinalColumnName)
$columnName = $newFinalColumnName;
......
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