From e2f2021b196971dfec478f5cc90de2382703f659 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 24 Sep 2020 08:32:09 +0200 Subject: [PATCH] use same edit attributes code as for add document --- views/bootstrap/class.UpdateDocument.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/views/bootstrap/class.UpdateDocument.php b/views/bootstrap/class.UpdateDocument.php index 8fbf44dc9..b58e14391 100644 --- a/views/bootstrap/class.UpdateDocument.php +++ b/views/bootstrap/class.UpdateDocument.php @@ -283,22 +283,10 @@ console.log(element); if(is_array($arr)) { if($arr) $this->formField($arr[0], $arr[1]); + } elseif(is_string($arr)) { + echo $arr; } else { - $presetbtnhtml = ''; - if($latestContent->getAttributeValue($attrdef)) { - switch($attrdef->getType()) { - case SeedDMS_Core_AttributeDefinition::type_string: - case SeedDMS_Core_AttributeDefinition::type_date: - case SeedDMS_Core_AttributeDefinition::type_int: - case SeedDMS_Core_AttributeDefinition::type_float: - $presetbtnhtml = $this->getInputPresetButtonHtml('attributes_version_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef), $attrdef->getValueSetSeparator()); - break; - case SeedDMS_Core_AttributeDefinition::type_boolean: - $presetbtnhtml = $this->gettCheckboxPresetButtonHtml('attributes_version_'.$attrdef->getID(), $latestContent->getAttributeValue($attrdef)); - break; - } - } - $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, '', 'attributes_version')." ".$presetbtnhtml); + $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef))); } } }