fix getAttributeEditField() for boolean attributes

This commit is contained in:
Uwe Steinmann 2020-10-07 07:45:06 +02:00
parent 74a07c9593
commit a3898e36de

View File

@ -1515,8 +1515,9 @@ $(document).ready(function() {
$content = '';
switch($attrdef->getType()) {
case SeedDMS_Core_AttributeDefinition::type_boolean:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';
$content .= "<input type=\"hidden\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"\" />";
$content .= "<input type=\"checkbox\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"1\" ".(($attribute && $attribute->getValue()) ? 'checked' : '')." />";
$content .= "<input type=\"checkbox\" id=\"".$fieldname."_".$attrdef->getId()."\" name=\"".$fieldname."[".$attrdef->getId()."]\" value=\"1\" ".($objvalue ? 'checked' : '')." />";
break;
case SeedDMS_Core_AttributeDefinition::type_date:
$objvalue = $attribute ? (is_object($attribute) ? $attribute->getValue() : $attribute) : '';