add search by phone + format phonenumber

This commit is contained in:
2019-10-30 22:54:24 +01:00
parent 122aa3a993
commit f1eefa7ed7
19 changed files with 469 additions and 26 deletions

View File

@@ -44,10 +44,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
// set configuration for double metaphone
$container->setParameter('cl_chill_person.search.use_double_metaphone',
$config['search']['use_double_metaphone']);
// set configuration for validation
$container->setParameter('chill_person.validation.birtdate_not_before',
$config['validation']['birthdate_not_after']);
@@ -67,6 +63,14 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
$loader->load('services/command.yml');
$loader->load('services/actions.yml');
$loader->load('services/form.yml');
$loader->load('services/repository.yml');
// load service advanced search only if configure
if ($config['search']['search_by_phone'] != 'never') {
$loader->load('services/search_by_phone.yml');
$container->setParameter('chill_person.search.search_by_phone',
$config['search']['search_by_phone']);
}
if ($container->getParameter('chill_person.accompanying_period') !== 'hidden') {
$loader->load('services/exports_accompanying_period.yml');

View File

@@ -30,12 +30,14 @@ class Configuration implements ConfigurationInterface
->arrayNode('search')
->canBeDisabled()
->children()
->booleanNode('use_double_metaphone')
->defaultFalse()
->end() // use_double_metaphone, parent = children for 'search'
->booleanNode('use_trigrams')
->defaultFalse()
->end() // use_trigrams, parent = children of 'search'
->enumNode('search_by_phone')
->values(['always', 'on-domain', 'never'])
->defaultValue('on-domain')
->info('enable search by phone. \'always\' show the result '
. 'on every result. \'on-domain\' will show the result '
. 'only if the domain is given in the search box. '
. '\'never\' disable this feature')
->end()
->end() //children for 'search', parent = array node 'search'
->end() // array 'search', parent = children of root
->arrayNode('validation')