mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02:00
Added rule for "hidden" field
This commit is contained in:
parent
2f40804568
commit
20591bc251
@ -67,7 +67,7 @@ trait PdfMakerUtilities
|
||||
{
|
||||
$processed = [];
|
||||
|
||||
foreach($children as $child) {
|
||||
foreach ($children as $child) {
|
||||
if (!isset($child['order'])) {
|
||||
$child['order'] = 0;
|
||||
}
|
||||
@ -84,6 +84,14 @@ trait PdfMakerUtilities
|
||||
|
||||
public function updateElementProperty($element, string $attribute, string $value)
|
||||
{
|
||||
// We have exception for "hidden" property.
|
||||
// hidden="true" or hidden="false" will both hide the element,
|
||||
// that's why we have to create an exception here for this rule.
|
||||
|
||||
if ($attribute == 'hidden' && ($value == false || $value == "false")) {
|
||||
return $element;
|
||||
}
|
||||
|
||||
$element->setAttribute($attribute, $value);
|
||||
|
||||
if ($element->getAttribute($attribute) === $value) {
|
||||
@ -117,7 +125,7 @@ trait PdfMakerUtilities
|
||||
public function updateVariables(array $variables)
|
||||
{
|
||||
$html = strtr($this->getCompiledHTML(), $variables['labels']);
|
||||
|
||||
|
||||
$html = strtr($html, $variables['values']);
|
||||
|
||||
$this->document->loadHTML($html);
|
||||
|
Loading…
Reference in New Issue
Block a user