mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Allow to enable multiple simultaneous accompanyingPeriods
This commit is contained in:
parent
fa5d0fbd21
commit
1d6a8987e9
@ -293,12 +293,16 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
$errors = $this->validator->validate($person, null,
|
$errors = $this->validator->validate($person, null,
|
||||||
['Default']);
|
['Default']);
|
||||||
|
|
||||||
|
// Can be disabled with config
|
||||||
|
if (false === $this->container->getParameter('chill_person.allow_multiple_simultaneous_accompanying_periods')) {
|
||||||
|
|
||||||
$errors_accompanying_period = $this->validator->validate($person, null,
|
$errors_accompanying_period = $this->validator->validate($person, null,
|
||||||
['accompanying_period_consistent']);
|
['accompanying_period_consistent']);
|
||||||
|
|
||||||
foreach($errors_accompanying_period as $error ) {
|
foreach($errors_accompanying_period as $error ) {
|
||||||
$errors->add($error);
|
$errors->add($error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,9 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
$this->handlePersonFieldsParameters($container, $config['person_fields']);
|
$this->handlePersonFieldsParameters($container, $config['person_fields']);
|
||||||
$this->handleAccompanyingPeriodsFieldsParameters($container, $config['accompanying_periods_fields']);
|
$this->handleAccompanyingPeriodsFieldsParameters($container, $config['accompanying_periods_fields']);
|
||||||
|
|
||||||
|
$container->setParameter('chill_person.allow_multiple_simultaneous_accompanying_periods',
|
||||||
|
$config['allow_multiple_simultaneous_accompanying_periods']);
|
||||||
|
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||||
$loader->load('services.yaml');
|
$loader->load('services.yaml');
|
||||||
$loader->load('services/widgets.yaml');
|
$loader->load('services/widgets.yaml');
|
||||||
|
@ -104,8 +104,21 @@ class Configuration implements ConfigurationInterface
|
|||||||
->canBeDisabled()
|
->canBeDisabled()
|
||||||
->children()
|
->children()
|
||||||
->append($this->addFieldNode('user'))
|
->append($this->addFieldNode('user'))
|
||||||
|
->append($this->addFieldNode('createdBy'))
|
||||||
|
->append($this->addFieldNode('step'))
|
||||||
|
->append($this->addFieldNode('origin'))
|
||||||
|
->append($this->addFieldNode('intensity'))
|
||||||
|
->append($this->addFieldNode('scopes'))
|
||||||
|
->append($this->addFieldNode('requestor'))
|
||||||
|
->append($this->addFieldNode('anonymous'))
|
||||||
|
->append($this->addFieldNode('emergency'))
|
||||||
|
->append($this->addFieldNode('confidential'))
|
||||||
->end() //children for 'accompanying_person_fields', parent = array 'person_fields'
|
->end() //children for 'accompanying_person_fields', parent = array 'person_fields'
|
||||||
->end() // paccompanying_person_fields, parent = children of root
|
->end() // paccompanying_person_fields, parent = children of root
|
||||||
|
->booleanNode('allow_multiple_simultaneous_accompanying_periods')
|
||||||
|
->info('Can we have more than one simultaneous accompanying period in the same time. Default false.')
|
||||||
|
->defaultValue(false)
|
||||||
|
->end()
|
||||||
->end() // children of 'root', parent = root
|
->end() // children of 'root', parent = root
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user