Commit 2184e772 authored by Michael Herold's avatar Michael Herold
Browse files

Fixes corner cases with handles and organizations

parent e01e4d90
......@@ -84,7 +84,7 @@ class HandleCreate extends Window
foreach ($required as $field)
$field->setRequired();
$required['organization']->setRequired(false);
$required['organization']->setRequired($update);
$required['alias']->setPlaceholder(_('First Name-Last Name'));
......@@ -115,9 +115,9 @@ class HandleCreate extends Window
$optional['mobile_phone']->setPlaceholder('+49-3-11');
$container = new form\Container();
$container[] = $required;
$container[] = $optional;
$container = new form\Container();
$container['required'] = $required;
$container['optional'] = $optional;
return $container;
}
......
......@@ -52,7 +52,10 @@ class HandleDetails extends Window
$helper = new HandleCreate($this->module);
$window->getForm()->addChild($helper->handle(true));
$formElements = $helper->handle(true);
$window->getForm()->addChild($formElements);
if (!$formElements['required']['organization']->getValueStored())
unset($formElements['required']['organization']);
$this->handleSubmit($alias, $window->getForm());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment