diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c3733d95..8e8ed5f1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ and this project adheres to * [action] add an unrelated issue within action creation. * [origin] fix origin: use correctly the translatable strings * /!\ everyone must update the origin table. As there is only one row, execute `update chill_person_accompanying_period_origin set label = jsonb_build_object('fr', 'appel téléphonique');` +* [main] change order of civilities in civility fixtures (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) +* [person] set min attr in the minimum of children field (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) +* [person] add marital status date in person view (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) +* [person] show number of children + allow set number of children to null (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) +* [person] show acceptSMS option (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) +* [person] add death information in person render box in twig and vue render boxes (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/191) ## Test releases diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php index 856ef6a46..07cf976eb 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php @@ -26,8 +26,8 @@ class LoadCivility extends Fixture implements FixtureGroupInterface public function load(ObjectManager $manager): void { $civilities = [ - ['name' => ['fr' => 'Monsieur'], 'abbrev' => ['fr' => 'M.']], ['name' => ['fr' => 'Madame'], 'abbrev' => ['fr' => 'Mme']], + ['name' => ['fr' => 'Monsieur'], 'abbrev' => ['fr' => 'M.']], ['name' => ['fr' => 'Docteur'], 'abbrev' => ['fr' => 'Dr']], ['name' => ['fr' => 'Professeur'], 'abbrev' => ['fr' => 'Pr']], ['name' => ['fr' => 'Madame la Directrice'], 'abbrev' => ['fr' => 'Mme']], diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 012d0fd68..802f9fd6c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -186,7 +186,7 @@ class HouseholdMemberController extends ApiController $_format, ['groups' => ['read']] ); - } catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) { + } catch (Exception\InvalidArgumentException|Exception\UnexpectedValueException $e) { throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e); } diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php index d3e1b7f82..8a0cab301 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php @@ -80,6 +80,7 @@ class Configuration implements ConfigurationInterface ->append($this->addFieldNode('memo')) ->append($this->addFieldNode('number_of_children')) ->append($this->addFieldNode('acceptEmail')) + ->append($this->addFieldNode('deathdate')) ->arrayNode('alt_names') ->defaultValue([]) ->arrayPrototype() diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index fb34a779a..a3524d306 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -244,6 +244,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * @Assert\Date( * groups={"general", "creation"} * ) + * @Assert\GreaterThan(propertyPath="birthDate") + * @Assert\LessThanOrEqual("today") */ private ?DateTimeImmutable $deathdate = null; @@ -1774,7 +1776,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } - public function setNumberOfChildren(int $numberOfChildren): self + public function setNumberOfChildren(?int $numberOfChildren): self { $this->numberOfChildren = $numberOfChildren; diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index de9b3bbb1..47baafe2b 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -93,6 +93,7 @@ class PersonType extends AbstractType ]) ->add('numberOfChildren', IntegerType::class, [ 'required' => false, + 'attr' => ['min' => 0], ]); if ($this->configAltNamesHelper->hasAltNames()) { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue index ab7074ffc..adbf3494d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -18,6 +18,7 @@ {{ person.firstName }} {{ person.lastName }} + (‡) {{ altNameLabel }} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index 18c03bc92..61bf3e83b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -10,6 +10,7 @@ * addAge bool * addCenter bool * hLevel integer + * addDeath bool * address_multiline bool * customButtons [ 'before' Twig\Markup, (injected with macro) @@ -24,7 +25,12 @@ {% macro raw(person, options) %} {{ person.firstName }} - {{ person.lastName }} + + {{ person.lastName }} + {%- if options['addDeath'] -%} + {% if person.deathdate is not null %} (‡){% endif %} + {% endif %} + {%- if options['addAltNames'] -%} {%- for n in person.altNames -%} @@ -82,21 +88,17 @@ {{ 'Date of death'|trans }}: {%- endif -%} {#- must be on one line to avoid spaces with dash -#} - - {% if options['addAge'] %} - - ({{ 'years_old'|trans({ 'age': person.age }) }}) - - {% endif %} + + {%- if options['addAge'] -%} + {{ 'years_old'|trans({ 'age': person.age }) }} + {%- endif -%} {%- elseif person.birthdate is not null -%} {%- if options['addAge'] -%} - - {{- 'years_old'|trans({ 'age': person.age }) -}} - + {{- 'years_old'|trans({ 'age': person.age }) -}} {%- endif -%} {%- endif -%}

diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig index fb06c4d5e..3ff3fe47b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/view.html.twig @@ -92,6 +92,13 @@ This view should receive those arguments: {%- endif -%} + {%- if chill_person.fields.deathdate == 'visible' -%} + {%- if person.deathdate is not null -%} +
{{ 'Date of death'|trans }} :
+
{{ person.deathdate|format_date('long') }}
+ {%- endif -%} + {%- endif -%} + {%- if chill_person.fields.place_of_birth == 'visible' -%}
{{ 'Place of birth'|trans }} :
{% if person.placeOfBirth is not empty %} @@ -111,6 +118,7 @@ This view should receive those arguments: {% endif %} {% endapply %} {%- endif -%} + @@ -159,12 +167,27 @@ This view should receive those arguments: {%- endif -%} + {%- if chill_person.fields.number_of_children == 'visible' -%} +
+
{{'Number of children'|trans}} :
+
+ {% if person.numberOfChildren is not null %} + {{ person.numberOfChildren }} + {% else %} + {{ 'No data given'|trans }} + {% endif %} +
+
+ {%- endif -%} {%- if chill_person.fields.marital_status == 'visible' -%}
{{'Marital status'|trans}} :
{% if person.maritalStatus is not null %} {{ person.maritalStatus.name|localize_translatable_string }} + {% if person.maritalStatusDate is not null %} + {{ 'person.from_the'|trans }} {{ person.maritalStatusDate|format_date('long') }} + {% endif %} {% else %} {{ 'No data given'|trans }} {% endif %} @@ -217,6 +240,7 @@ This view should receive those arguments:
{{ 'Mobilenumber'|trans }} :
{% if person.mobilenumber is not empty %}{{ person.mobilenumber|chill_format_phonenumber }}{% else %}{{ 'No data given'|trans }}{% endif %}
+

{% if person.acceptSMS %}{{ 'Accept short text message'|trans }}{% endif %}

{% endif %} diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 0a5624f42..1f1601920 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -51,6 +51,7 @@ class PersonRender extends AbstractChillEntityRender 'hLevel' => $options['hLevel'] ?? 3, 'customButtons' => $options['customButtons'] ?? [], 'customArea' => $options['customArea'] ?? [], + 'addDeath' => $options['addDeath'] ?? true, ]; return diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 39b646c1d..cb2fcc494 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -19,6 +19,7 @@ person: woman {et elle-même} other {et lui·elle-même} } + from_the: depuis le household: Household: Ménage