use same edit attributes code as for add document

This commit is contained in:
Uwe Steinmann 2020-09-24 08:32:09 +02:00
parent ab464b633d
commit e2f2021b19

View File

@ -283,22 +283,10 @@ console.log(element);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) if($arr)
$this->formField($arr[0], $arr[1]); $this->formField($arr[0], $arr[1]);
} elseif(is_string($arr)) {
echo $arr;
} else { } else {
$presetbtnhtml = ''; $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef)));
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);
} }
} }
} }