check if attribute is aof type document or folder and multivalue

This commit is contained in:
Uwe Steinmann 2024-03-20 14:04:56 +01:00
parent 5235a859fc
commit 39ded6779d

View File

@ -73,8 +73,13 @@ if ($action == "addattrdef") {
if($minvalues > $maxvalues) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
}
if($multiple && $valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
if($multiple) {
if(in_array($type, array(SeedDMS_Core_AttributeDefinition::type_document, SeedDMS_Core_AttributeDefinition::type_folder))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_but_doc_or_folder"));
}
if($valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
}
}
$controller->setParam('name', $name);
@ -150,8 +155,13 @@ else if ($action == "editattrdef") {
if($minvalues > $maxvalues) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
}
if($multiple && $valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
if($multiple) {
if(in_array($type, array(SeedDMS_Core_AttributeDefinition::type_document, SeedDMS_Core_AttributeDefinition::type_folder))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_but_doc_or_folder"));
}
if($valueset == '' && !in_array($type, array(SeedDMS_Core_AttributeDefinition::type_user, SeedDMS_Core_AttributeDefinition::type_group))) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
}
}
$controller->setParam('name', $name);