diff --git a/src/Calc/Calc.php b/src/Calc/Calc.php index 523b6d8..7077965 100644 --- a/src/Calc/Calc.php +++ b/src/Calc/Calc.php @@ -119,7 +119,7 @@ class Calc if($edge->getFormel() != "") { $formel = $this->formelCalc->parse($edge->getFormel()); - if ($formel != "" && $option->getId() != 'weight' && !$option->isAjaxExport()) { + if ($formel != "" && $option->getId() != 'weight' && !$option->isAjaxExport() && !$option->isDisplayOnly()) { $p = 0; $formel = str_replace("tonumber", '$this->toNumber', $formel); diff --git a/src/Option/Parser/Base.php b/src/Option/Parser/Base.php index bbf6b12..ac4cdfd 100644 --- a/src/Option/Parser/Base.php +++ b/src/Option/Parser/Base.php @@ -31,6 +31,9 @@ class Base if(isset($this->node['exportAjax']) && (string)$this->node['exportAjax'] == 1) { $this->element->setIsAjaxExport(true); } + if(isset($this->node['displayOnly']) && (string)$this->node['displayOnly'] == 1) { + $this->element->setIsDisplayOnly(true); + } } diff --git a/src/Option/Type/Base.php b/src/Option/Type/Base.php index 0a082d6..e82ea49 100644 --- a/src/Option/Type/Base.php +++ b/src/Option/Type/Base.php @@ -38,6 +38,9 @@ class Base /** @var bool */ protected $isAjaxExport = false; + /** @var bool */ + protected $isDisplayOnly = false; + protected $savedCalcValues = []; public function __construct() @@ -249,4 +252,20 @@ class Base { $this->savedCalcValues = $savedCalcValues; } + + /** + * @return bool + */ + public function isDisplayOnly() + { + return $this->isDisplayOnly; + } + + /** + * @param bool $isDisplayOnly + */ + public function setIsDisplayOnly($isDisplayOnly) + { + $this->isDisplayOnly = $isDisplayOnly; + } } \ No newline at end of file diff --git a/tests/TestFiles/Complex/1.xml b/tests/TestFiles/Complex/1.xml index 9d949d5..7db1f44 100644 --- a/tests/TestFiles/Complex/1.xml +++ b/tests/TestFiles/Complex/1.xml @@ -89,6 +89,11 @@ 0-660 +