fix import of object type of attribute definitions

This commit is contained in:
Uwe Steinmann 2017-03-06 13:47:38 +01:00
parent 62eb18f6a3
commit d1829dfe29

View File

@ -203,7 +203,8 @@ function insert_attributedefinition($attrdef) { /* {{{ */
$logger->info("Attribute definition already exists"); $logger->info("Attribute definition already exists");
} else { } else {
if(in_array('attributedefinitions', $sections)) { if(in_array('attributedefinitions', $sections)) {
if(!$newAttrdef = $dms->addAttributeDefinition($attrdef['attributes']['name'], $attrdef['objecttype'], $attrdef['attributes']['type'], $attrdef['attributes']['multiple'], $attrdef['attributes']['minvalues'], $attrdef['attributes']['maxvalues'], $attrdef['attributes']['valueset'], $attrdef['attributes']['regex'])) { $objtype = ($attrdef['objecttype'] == 'folder' ? SeedDMS_Core_AttributeDefinition::objtype_folder : ($attrdef['objecttype'] == 'document' ? SeedDMS_Core_AttributeDefinition::objtype_document : ($attrdef['objecttype'] == 'documentcontent' ? SeedDMS_Core_AttributeDefinition::objtype_documentcontent : 0)));
if(!$newAttrdef = $dms->addAttributeDefinition($attrdef['attributes']['name'], $objtype, $attrdef['attributes']['type'], $attrdef['attributes']['multiple'], $attrdef['attributes']['minvalues'], $attrdef['attributes']['maxvalues'], $attrdef['attributes']['valueset'], $attrdef['attributes']['regex'])) {
$logger->err("Could not add attribute definition"); $logger->err("Could not add attribute definition");
$logger->debug($dms->getDB()->getErrorMsg()); $logger->debug($dms->getDB()->getErrorMsg());
return false; return false;