mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 04:23:49 +00:00
Add a link between accompanying period and user
It is now allowed to indicates who make/made the accompanying period. This feature may be hidden by a specific configuration option. Default to visible.
This commit is contained in:
@@ -53,6 +53,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
$config['validation']['birthdate_not_after']);
|
||||
|
||||
$this->handlePersonFieldsParameters($container, $config['person_fields']);
|
||||
$this->handleAccompanyingPeriodsFieldsParameters($container, $config['accompanying_periods_fields']);
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('services.yml');
|
||||
@@ -65,6 +66,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
$loader->load('services/privacyEvent.yml');
|
||||
$loader->load('services/command.yml');
|
||||
$loader->load('services/actions.yml');
|
||||
$loader->load('services/form.yml');
|
||||
|
||||
if ($container->getParameter('chill_person.accompanying_period') !== 'hidden') {
|
||||
$loader->load('services/exports_accompanying_period.yml');
|
||||
@@ -90,6 +92,21 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function handleAccompanyingPeriodsFieldsParameters(ContainerBuilder $container, $config)
|
||||
{
|
||||
$container->setParameter('chill_person.accompanying_period_fields', $config);
|
||||
|
||||
foreach ($config as $key => $value) {
|
||||
switch($key) {
|
||||
case 'enabled':
|
||||
break;
|
||||
default:
|
||||
$container->setParameter('chill_person.accompanying_period_fields.'.$key, $value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function declarePersonAsCustomizable (ContainerBuilder $container)
|
||||
{
|
||||
@@ -131,7 +148,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'globals' => array(
|
||||
'chill_person' => array(
|
||||
'fields' => $config['person_fields']
|
||||
)
|
||||
),
|
||||
'chill_accompanying_periods' => [
|
||||
'fields' => $config['accompanying_periods_fields']
|
||||
]
|
||||
),
|
||||
'form_themes' => array('ChillPersonBundle:Export:ListPersonFormFields.html.twig')
|
||||
);
|
||||
|
@@ -78,6 +78,12 @@ class Configuration implements ConfigurationInterface
|
||||
->append($this->addFieldNode('memo'))
|
||||
->end() //children for 'person_fields', parent = array 'person_fields'
|
||||
->end() // person_fields, parent = children of root
|
||||
->arrayNode('accompanying_periods_fields')
|
||||
->canBeDisabled()
|
||||
->children()
|
||||
->append($this->addFieldNode('user'))
|
||||
->end() //children for 'accompanying_person_fields', parent = array 'person_fields'
|
||||
->end() // paccompanying_person_fields, parent = children of root
|
||||
->end() // children of 'root', parent = root
|
||||
;
|
||||
|
||||
|
Reference in New Issue
Block a user