diff --git a/CHANGELOG.md b/CHANGELOG.md
index f63fd5fd9..41b133bba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,9 @@ and this project adheres to
+* [person]: Add civility to the person
+* [person]: Various improvements on the edit person form
+* [person]: Set available_languages and available_countries as parameters for use in the edit person form
* [activity] Bugfix: documents can now be added to an activity.
* [tasks] improve tasks with filter order
* [tasks] refactor singleControllerTasks: limit the number of conditions from the context
@@ -35,6 +38,7 @@ and this project adheres to
## Test releases
+
### Test release 2021-10-27
* [person]: delete double actions buttons on search person page
diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
index b35ca5004..da53ba3af 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
@@ -107,6 +107,9 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
$container->setParameter('chill_main.available_languages',
$config['available_languages']);
+ $container->setParameter('chill_main.available_countries',
+ $config['available_countries']);
+
$container->setParameter('chill_main.routing.resources',
$config['routing']['resources']);
diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
index b7cff5821..e75488ba6 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
@@ -51,6 +51,10 @@ class Configuration implements ConfigurationInterface
->defaultValue(array('fr'))
->prototype('scalar')->end()
->end() // end of array 'available_languages'
+ ->arrayNode('available_countries')
+ ->defaultValue(array('FR'))
+ ->prototype('scalar')->end()
+ ->end() // end of array 'available_countries'
->arrayNode('routing')
->children()
->arrayNode('resources')
diff --git a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php
index afcd061e6..3d3f2e9d8 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php
@@ -54,7 +54,7 @@ class CommentType extends AbstractType
$data = $event->getForm()->getData();
$comment = $event->getData() ?? ['comment' => ''];
- if ($data->getComment() !== $comment['comment']) {
+ if (null !== $data && $data->getComment() !== $comment['comment']) {
$data->setDate(new \DateTime());
$data->setUserId($this->user->getId());
$event->getForm()->setData($data);
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
index 617d1afce..c8288d69d 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
@@ -28,6 +28,7 @@ use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
use Doctrine\Persistence\ObjectManager;
use Chill\MainBundle\Form\Type\Select2ChoiceType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
/**
* Extends choice to allow adding select2 library on widget
@@ -37,31 +38,25 @@ use Chill\MainBundle\Templating\TranslatableStringHelper;
*/
class Select2CountryType extends AbstractType
{
- /**
- * @var RequestStack
- */
- private $requestStack;
+ private RequestStack $requestStack;
- /**
- *
- * @var TranslatableStringHelper
- */
- protected $translatableStringHelper;
+ private ObjectManager $em;
- /**
- * @var ObjectManager
- */
- private $em;
+ protected TranslatableStringHelper $translatableStringHelper;
+
+ protected ParameterBagInterface $parameterBag;
public function __construct(
RequestStack $requestStack,
ObjectManager $em,
- TranslatableStringHelper $translatableStringHelper
+ TranslatableStringHelper $translatableStringHelper,
+ ParameterBagInterface $parameterBag
)
{
$this->requestStack = $requestStack;
$this->em = $em;
$this->translatableStringHelper = $translatableStringHelper;
+ $this->parameterBag = $parameterBag;
}
public function getBlockPrefix()
@@ -82,19 +77,29 @@ class Select2CountryType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
- $locale = $this->requestStack->getCurrentRequest()->getLocale();
$countries = $this->em->getRepository('Chill\MainBundle\Entity\Country')->findAll();
- $choices = array();
+ $choices = [];
+ $preferredCountries = $this->parameterBag->get('chill_main.available_countries');
+ $preferredChoices = [];
foreach ($countries as $c) {
$choices[$c->getId()] = $this->translatableStringHelper->localize($c->getName());
}
+ foreach ($preferredCountries as $pc) {
+ foreach ($countries as $c) {
+ if ($c->getCountryCode() == $pc) {
+ $preferredChoices[$c->getId()] = $this->translatableStringHelper->localize($c->getName());
+ }
+ }
+ }
+
asort($choices, SORT_STRING | SORT_FLAG_CASE);
$resolver->setDefaults(array(
'class' => 'Chill\MainBundle\Entity\Country',
- 'choices' => array_combine(array_values($choices),array_keys($choices))
+ 'choices' => array_combine(array_values($choices),array_keys($choices)),
+ 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices))
));
}
}
diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
index 2c8dea857..a50569967 100644
--- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
+++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
@@ -28,37 +28,32 @@ use Chill\MainBundle\Form\Type\DataTransformer\MultipleObjectsToIdTransformer;
use Doctrine\Persistence\ObjectManager;
use Chill\MainBundle\Form\Type\Select2ChoiceType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
/**
* Extends choice to allow adding select2 library on widget for languages (multiple)
*/
class Select2LanguageType extends AbstractType
{
- /**
- * @var RequestStack
- */
- private $requestStack;
+ private RequestStack $requestStack;
- /**
- * @var ObjectManager
- */
- private $em;
+ private ObjectManager $em;
- /**
- *
- * @var TranslatableStringHelper
- */
- protected $translatableStringHelper;
+ protected TranslatableStringHelper $translatableStringHelper;
+
+ protected ParameterBagInterface $parameterBag;
public function __construct(
RequestStack $requestStack,
ObjectManager $em,
- TranslatableStringHelper $translatableStringHelper
+ TranslatableStringHelper $translatableStringHelper,
+ ParameterBagInterface $parameterBag
)
{
$this->requestStack = $requestStack;
$this->em = $em;
$this->translatableStringHelper = $translatableStringHelper;
+ $this->parameterBag = $parameterBag;
}
public function getBlockPrefix()
@@ -79,19 +74,24 @@ class Select2LanguageType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
- $locale = $this->requestStack->getCurrentRequest()->getLocale();
$languages = $this->em->getRepository('Chill\MainBundle\Entity\Language')->findAll();
- $choices = array();
+ $preferredLanguages = $this->parameterBag->get('chill_main.available_languages');
+ $choices = [];
+ $preferredChoices = [];
foreach ($languages as $l) {
$choices[$l->getId()] = $this->translatableStringHelper->localize($l->getName());
}
+ foreach ($preferredLanguages as $l) {
+ $preferredChoices[$l] = $choices[$l];
+ }
asort($choices, SORT_STRING | SORT_FLAG_CASE);
$resolver->setDefaults(array(
'class' => 'Chill\MainBundle\Entity\Language',
- 'choices' => array_combine(array_values($choices),array_keys($choices))
+ 'choices' => array_combine(array_values($choices), array_keys($choices)),
+ 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices))
));
}
}
diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/index.js b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/index.js
index 34f3b80b5..88890ab40 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/index.js
@@ -1 +1,5 @@
-require("./show_hide.js");
\ No newline at end of file
+//require("./show_hide.js");
+
+import { ShowHide } from './show_hide.js'
+
+export { ShowHide }
\ No newline at end of file
diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js
index dd4dfd6db..ec6b796ec 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/lib/show_hide/show_hide.js
@@ -134,4 +134,4 @@ var ShowHide = function(options) {
};
};
-export {ShowHide};
+export { ShowHide };
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/mod_input_address_index.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/mod_input_address_index.js
index ad4a648f5..0f39c5e75 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/mod_input_address_index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/mod_input_address_index.js
@@ -5,82 +5,89 @@ import App from './App.vue';
const i18n = _createI18n(addressMessages);
-let inputs = document.querySelectorAll('input[type="hidden"][data-input-address]');
+const addAddressInput = (inputs) => {
-const isNumeric = function(v) { return !isNaN(v); };
+ inputs.forEach(el => {
+ let
+ addressId = el.value,
+ uniqid = el.dataset.inputAddress,
+ container = document.querySelector('div[data-input-address-container="' + uniqid + '"]'),
+ isEdit = addressId !== '',
+ addressIdInt = addressId !== '' ? parseInt(addressId) : null
+ ;
-inputs.forEach(el => {
- let
- addressId = el.value,
- uniqid = el.dataset.inputAddress,
- container = document.querySelector('div[data-input-address-container="' + uniqid + '"]'),
- isEdit = addressId !== '',
- addressIdInt = addressId !== '' ? parseInt(addressId) : null
- ;
+ if (container === null) {
+ throw Error("no container");
+ }
+ console.log('useValidFrom', el.dataset.useValidFrom === '1');
- if (container === null) {
- throw Error("no container");
- }
- console.log('useValidFrom', el.dataset.useValidFrom === '1');
-
- const app = createApp({
- template: ``,
- data() {
- return {
- addAddress: {
- context: {
- // for legacy ? can be remove ?
- target: {
- name: 'input-address',
- id: addressIdInt,
- },
- edit: isEdit,
- addressId: addressIdInt,
- },
- options: {
- /// Options override default.
- /// null value take default component value defined in AddAddress data()
- button: {
- text: {
- create: el.dataset.buttonTextCreate || null,
- edit: el.dataset.buttonTextUpdate || null,
+ const app = createApp({
+ template: ``,
+ data() {
+ return {
+ addAddress: {
+ context: {
+ // for legacy ? can be remove ?
+ target: {
+ name: 'input-address',
+ id: addressIdInt,
},
- size: null,
- displayText: true
+ edit: isEdit,
+ addressId: addressIdInt,
},
+ options: {
+ /// Options override default.
+ /// null value take default component value defined in AddAddress data()
+ button: {
+ text: {
+ create: el.dataset.buttonTextCreate || null,
+ edit: el.dataset.buttonTextUpdate || null,
+ },
+ size: null,
+ displayText: true
+ },
- /// Modal title text if create or edit address (trans chain, see i18n)
- title: {
- create: null,
- edit: null,
- },
+ /// Modal title text if create or edit address (trans chain, see i18n)
+ title: {
+ create: null,
+ edit: null,
+ },
- /// Display panes in Modal for step123
- openPanesInModal: true,
+ /// Display panes in Modal for step123
+ openPanesInModal: true,
- /// Display actions buttons of panes in a sticky-form-button navbar
- stickyActions: false,
- showMessageWhenNoAddress: true,
+ /// Display actions buttons of panes in a sticky-form-button navbar
+ stickyActions: false,
+ showMessageWhenNoAddress: true,
- /// Use Date fields
- useDate: {
- validFrom: el.dataset.useValidFrom === '1' || false, //boolean, default: false
- validTo: el.dataset.useValidTo === '1' || false, //boolean, default: false
- },
+ /// Use Date fields
+ useDate: {
+ validFrom: el.dataset.useValidFrom === '1' || false, //boolean, default: false
+ validTo: el.dataset.useValidTo === '1' || false, //boolean, default: false
+ },
- /// Don't display show renderbox Address: showPane display only a button
- onlyButton: false,
+ /// Don't display show renderbox Address: showPane display only a button
+ onlyButton: false,
+ }
}
}
+ },
+ methods: {
+ associateToInput(payload) {
+ el.value = payload.addressId;
+ }
}
- },
- methods: {
- associateToInput(payload) {
- el.value = payload.addressId;
- }
- }
- })
- .use(i18n)
- .component('app', App)
- .mount(container);
-});
+ })
+ .use(i18n)
+ .component('app', App)
+ .mount(container);
+ });
+};
+
+document.addEventListener('DOMContentLoaded', (_e) =>
+ addAddressInput(document.querySelectorAll('input[type="hidden"][data-input-address]'))
+);
+
+window.addEventListener('collection-add-entry', (e) =>
+ addAddressInput(e.detail.entry.querySelectorAll('input[type="hidden"][data-input-address]'))
+);
\ No newline at end of file
diff --git a/src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/config/config.yml b/src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/config/config.yml
index b16af4de1..530c29ee6 100644
--- a/src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/config/config.yml
+++ b/src/Bundle/ChillMainBundle/Resources/test/Fixtures/App/app/config/config.yml
@@ -39,3 +39,4 @@ assetic:
chill_main:
available_languages: [fr, en]
+ available_countries: [FR]
diff --git a/src/Bundle/ChillMainBundle/config/services/form.yaml b/src/Bundle/ChillMainBundle/config/services/form.yaml
index b3eb0ca98..27d018229 100644
--- a/src/Bundle/ChillMainBundle/config/services/form.yaml
+++ b/src/Bundle/ChillMainBundle/config/services/form.yaml
@@ -25,6 +25,7 @@ services:
- "@request_stack"
- "@doctrine.orm.entity_manager"
- "@chill.main.helper.translatable_string"
+ - '@Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface'
tags:
- { name: form.type, alias: select2_chill_country }
@@ -34,6 +35,7 @@ services:
- "@request_stack"
- "@doctrine.orm.entity_manager"
- "@chill.main.helper.translatable_string"
+ - '@Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface'
tags:
- { name: form.type, alias: select2_chill_language }
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php
index bf2d18922..2c53af0fe 100644
--- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php
+++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php
@@ -77,11 +77,13 @@ class Configuration implements ConfigurationInterface
->append($this->addFieldNode('nationality'))
->append($this->addFieldNode('country_of_birth'))
->append($this->addFieldNode('marital_status'))
+ ->append($this->addFieldNode('civility'))
->append($this->addFieldNode('spoken_languages'))
->append($this->addFieldNode('address'))
->append($this->addFieldNode('accompanying_period'))
->append($this->addFieldNode('memo'))
->append($this->addFieldNode('number_of_children'))
+ ->append($this->addFieldNode('acceptEmail'))
->arrayNode('alt_names')
->defaultValue([])
->arrayPrototype()
diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php
index a7fed2683..5e521b60a 100644
--- a/src/Bundle/ChillPersonBundle/Entity/Person.php
+++ b/src/Bundle/ChillPersonBundle/Entity/Person.php
@@ -34,6 +34,7 @@ use Chill\PersonBundle\Entity\MaritalStatus;
use Chill\PersonBundle\Entity\Household\HouseholdMember;
use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\Address;
+use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\PersonBundle\Entity\Person\PersonCurrentAddress;
use DateTime;
@@ -212,6 +213,15 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
*/
private $maritalStatus;
+ /**
+ * The marital status of the person
+ * @var Civility
+ *
+ * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Civility")
+ * @ORM\JoinColumn(nullable=true)
+ */
+ private $civility;
+
/**
* The date of the last marital status change of the person
* @var \DateTime
@@ -982,6 +992,28 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->maritalStatus;
}
+ /**
+ * Set civility
+ *
+ * @param Civility $civility
+ * @return Person
+ */
+ public function setCivility(Civility $civility = null)
+ {
+ $this->civility = $civility;
+ return $this;
+ }
+
+ /**
+ * Get civility
+ *
+ * @return Civility
+ */
+ public function getCivility()
+ {
+ return $this->civility;
+ }
+
/**
* Set contactInfo
*
diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php
index 8bc982713..521d9a9d9 100644
--- a/src/Bundle/ChillPersonBundle/Form/PersonType.php
+++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php
@@ -22,6 +22,7 @@
namespace Chill\PersonBundle\Form;
use Chill\CustomFieldsBundle\Form\Type\CustomFieldType;
+use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\Select2CountryType;
@@ -35,6 +36,11 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
use Symfony\Component\Form\AbstractType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\CommentType;
+use Chill\MainBundle\Templating\TranslatableStringHelper;
+use Doctrine\ORM\QueryBuilder;
+use Doctrine\ORM\EntityRepository;
+use Symfony\Bridge\Doctrine\Form\Type\EntityType;
+use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
@@ -62,16 +68,20 @@ class PersonType extends AbstractType
*/
protected $configAltNamesHelper;
+ protected TranslatableStringHelper $translatableStringHelper;
+
/**
*
* @param string[] $personFieldsConfiguration configuration of visibility of some fields
*/
public function __construct(
array $personFieldsConfiguration,
- ConfigPersonAltNamesHelper $configAltNamesHelper
+ ConfigPersonAltNamesHelper $configAltNamesHelper,
+ TranslatableStringHelper $translatableStringHelper
) {
$this->config = $personFieldsConfiguration;
$this->configAltNamesHelper = $configAltNamesHelper;
+ $this->translatableStringHelper = $translatableStringHelper;
}
/**
@@ -114,7 +124,19 @@ class PersonType extends AbstractType
}
if ($this->config['place_of_birth'] === 'visible') {
- $builder->add('placeOfBirth', TextType::class, array('required' => false));
+ $builder->add('placeOfBirth', TextType::class, array(
+ 'required' => false,
+ 'attr' => ['style' => 'text-transform: uppercase;'],
+ ));
+
+ $builder->get('placeOfBirth')->addModelTransformer(new CallbackTransformer(
+ function ($string) {
+ return strtoupper($string);
+ },
+ function ($string) {
+ return strtoupper($string);
+ }
+ ));
}
if ($this->config['contact_info'] === 'visible') {
@@ -150,7 +172,11 @@ class PersonType extends AbstractType
if ($this->config['email'] === 'visible') {
$builder
- ->add('email', EmailType::class, array('required' => false))
+ ->add('email', EmailType::class, array('required' => false));
+ }
+
+ if ($this->config['acceptEmail'] === 'visible') {
+ $builder
->add('acceptEmail', CheckboxType::class, array('required' => false));
}
@@ -173,6 +199,23 @@ class PersonType extends AbstractType
));
}
+ if ($this->config['civility'] === 'visible'){
+ $builder
+ ->add('civility', EntityType::class, [
+ 'label' => 'Civility',
+ 'class' => Civility::class,
+ 'choice_label' => function (Civility $civility): string {
+ return $this->translatableStringHelper->localize($civility->getName());
+ },
+ 'query_builder' => function (EntityRepository $er): QueryBuilder {
+ return $er->createQueryBuilder('c')
+ ->where('c.active = true');
+ },
+ 'placeholder' => 'choose civility',
+ 'required' => false
+ ]);
+ }
+
if ($this->config['marital_status'] === 'visible'){
$builder
->add('maritalStatus', Select2MaritalStatusType::class, array(
@@ -192,6 +235,7 @@ class PersonType extends AbstractType
array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup']))
;
}
+
}
/**
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/page/person/index.js b/src/Bundle/ChillPersonBundle/Resources/public/page/person/index.js
index d641e3b36..28ae3380a 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/page/person/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/page/person/index.js
@@ -7,7 +7,6 @@ const personAcceptEmail = document.getElementById("personAcceptEmail");
const personPhoneNumber = document.getElementById("personPhoneNumber");
const personAcceptSMS = document.getElementById("personAcceptSMS");
-
new ShowHide({
froms: [maritalStatus],
container: [maritalStatusDate],
@@ -24,21 +23,24 @@ new ShowHide({
event_name: 'change'
});
-new ShowHide({
- froms: [personEmail],
- container: [personAcceptEmail],
- test: function(froms) {
- for (let f of froms.values()) {
- for (let input of f.querySelectorAll('input').values()) {
- if (input.value) {
- return true
+if (personAcceptEmail) {
+ new ShowHide({
+ froms: [personEmail],
+ container: [personAcceptEmail],
+ test: function(froms) {
+ for (let f of froms.values()) {
+ for (let input of f.querySelectorAll('input').values()) {
+ if (input.value) {
+ return true
+ }
}
}
- }
- return false;
- },
- event_name: 'input'
-});
+ return false;
+ },
+ event_name: 'input'
+ });
+}
+
new ShowHide({
froms: [personPhoneNumber],
diff --git a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/app/config/config_test_with_hidden_fields.yml b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/app/config/config_test_with_hidden_fields.yml
index e11599661..0b12be8d0 100644
--- a/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/app/config/config_test_with_hidden_fields.yml
+++ b/src/Bundle/ChillPersonBundle/Resources/test/Fixtures/App/app/config/config_test_with_hidden_fields.yml
@@ -15,4 +15,5 @@ chill_person:
phonenumber: hidden
country_of_birth: hidden
marital_status: hidden
- spoken_languages: hidden
\ No newline at end of file
+ spoken_languages: hidden
+ civility: hidden
\ No newline at end of file
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig
index 2bb7fa4bb..d394a75a8 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/edit.html.twig
@@ -37,6 +37,9 @@