check if attribute def. has value set if multiple is set

This commit is contained in:
Uwe Steinmann 2016-02-03 14:45:26 +01:00
parent d835aa84fe
commit 43e6583db9

View File

@ -63,6 +63,9 @@ if ($action == "addattrdef") {
if($minvalues > $maxvalues) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
}
if($multiple && $valueset == '') {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
}
$newAttrdef = $dms->addAttributeDefinition($name, $objtype, $type, $multiple, $minvalues, $maxvalues, $valueset, $regex);
if (!$newAttrdef) {
@ -137,6 +140,9 @@ else if ($action == "editattrdef") {
if($minvalues > $maxvalues) {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_min_greater_max"));
}
if($multiple && $valueset == '') {
UI::exitError(getMLText("admin_tools"),getMLText("attrdef_multiple_needs_valueset"));
}
if (!$attrdef->setName($name)) {
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));