Compare commits

..

1 Commits

Author SHA1 Message Date
cc1e2fde1f added case for workflow notification in vue component 2022-02-14 14:16:22 +01:00
18 changed files with 69 additions and 166 deletions

View File

@@ -9,21 +9,12 @@ and this project adheres to
* date versioning for test releases * date versioning for test releases
## Unreleased ## Unreleased
* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419)
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* [person] use the same rendering of person in similar person proposition (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/348)
* [person] move similar person matcher to PersonACLAwareRepository and replace the SimilarPersonMatcher uses (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/451)
## Test releases
### test release 2022-02-14
* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419)
* [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456)
* [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370)
* [person] accompanying course work: fix on-the-fly update of thirdParty
* fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378) * fix normalisation of accompanying course requestor api (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/378)
* [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427) * [person] add a returnPath when clicking on some Person or ThirdParty badge (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/427)
* [person] accompanying course work: fix on-the-fly update of thirdParty * [person] accompanying course work: fix on-the-fly update of thirdParty
* [on-the-fly] close modal only after validation * [on-the-fly] close modal only after validation
* [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433) * [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433)
* change order for accompanying course work list * change order for accompanying course work list
@@ -39,7 +30,8 @@ and this project adheres to
* [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459) * [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459)
* [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414)
* [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450) * [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450)
* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435)
## Test releases
### test release 2021-02-01 ### test release 2021-02-01

View File

@@ -66,6 +66,8 @@ export default {
return appMessages.fr.the_activity; return appMessages.fr.the_activity;
case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod': case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod':
return appMessages.fr.the_course; return appMessages.fr.the_course;
case 'Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow':
return appMessages.fr.workflow;
default: default:
throw 'notification type unknown'; throw 'notification type unknown';
} }
@@ -76,6 +78,8 @@ export default {
return `/fr/activity/${n.relatedEntityId}/show` return `/fr/activity/${n.relatedEntityId}/show`
case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod': case 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod':
return `/fr/parcours/${n.relatedEntityId}` return `/fr/parcours/${n.relatedEntityId}`
case 'Chill\\MainBundle\\Entity\\Workflow\\EntityWorkflow':
return `/fr/main/workflow/${n.relatedEntityId}/show`
default: default:
throw 'notification type unknown'; throw 'notification type unknown';
} }

View File

@@ -39,6 +39,7 @@ const appMessages = {
the_action: "l'action", the_action: "l'action",
the_evaluation: "l'évaluation", the_evaluation: "l'évaluation",
the_task: "la tâche", the_task: "la tâche",
workflow: "le workflow",
StartDate: "Date d'ouverture", StartDate: "Date d'ouverture",
SocialAction: "Action d'accompagnement", SocialAction: "Action d'accompagnement",
no_data: "Aucun résultats", no_data: "Aucun résultats",

View File

@@ -11,6 +11,7 @@
* buttonText string * buttonText string
* displayBadge boolean (default: false) replace button by badge, need to define buttonText for content * displayBadge boolean (default: false) replace button by badge, need to define buttonText for content
* parent object (optional) pass parent context of the targetEntity (used for course resource comment) * parent object (optional) pass parent context of the targetEntity (used for course resource comment)
* isDead boolean (default: false) is the person dead
#} #}
<span class="onthefly-container" <span class="onthefly-container"
@@ -28,6 +29,10 @@
data-button-text="{{ buttonText|e('html_attr') }}" data-button-text="{{ buttonText|e('html_attr') }}"
{% endif %} {% endif %}
{% if isDead is defined and isDead == 1 %}
data-is-dead="true"
{% endif %}
{% if displayBadge is defined and displayBadge == 1 %} {% if displayBadge is defined and displayBadge == 1 %}
data-display-badge="true" data-display-badge="true"
{% endif %} {% endif %}

View File

@@ -16,8 +16,8 @@ use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Form\CreationPersonType; use Chill\PersonBundle\Form\CreationPersonType;
use Chill\PersonBundle\Form\PersonType; use Chill\PersonBundle\Form\PersonType;
use Chill\PersonBundle\Privacy\PrivacyEvent; use Chill\PersonBundle\Privacy\PrivacyEvent;
use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Repository\PersonRepository;
use Chill\PersonBundle\Search\SimilarPersonMatcher;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
@@ -56,6 +56,11 @@ final class PersonController extends AbstractController
*/ */
protected $personRepository; protected $personRepository;
/**
* @var SimilarPersonMatcher
*/
protected $similarPersonMatcher;
/** /**
* @var TranslatorInterface * @var TranslatorInterface
*/ */
@@ -71,14 +76,13 @@ final class PersonController extends AbstractController
*/ */
private $logger; private $logger;
private PersonACLAwareRepositoryInterface $personACLAwareRepository;
/** /**
* @var ValidatorInterface * @var ValidatorInterface
*/ */
private $validator; private $validator;
public function __construct( public function __construct(
SimilarPersonMatcher $similarPersonMatcher,
TranslatorInterface $translator, TranslatorInterface $translator,
EventDispatcherInterface $eventDispatcher, EventDispatcherInterface $eventDispatcher,
PersonRepository $personRepository, PersonRepository $personRepository,
@@ -86,9 +90,9 @@ final class PersonController extends AbstractController
LoggerInterface $logger, LoggerInterface $logger,
ValidatorInterface $validator, ValidatorInterface $validator,
EntityManagerInterface $em, EntityManagerInterface $em,
Security $security, Security $security
PersonACLAwareRepositoryInterface $personACLAwareRepository
) { ) {
$this->similarPersonMatcher = $similarPersonMatcher;
$this->translator = $translator; $this->translator = $translator;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->configPersonAltNameHelper = $configPersonAltNameHelper; $this->configPersonAltNameHelper = $configPersonAltNameHelper;
@@ -97,7 +101,6 @@ final class PersonController extends AbstractController
$this->validator = $validator; $this->validator = $validator;
$this->em = $em; $this->em = $em;
$this->security = $security; $this->security = $security;
$this->personACLAwareRepository = $personACLAwareRepository;
} }
public function editAction($person_id, Request $request) public function editAction($person_id, Request $request)
@@ -233,8 +236,8 @@ final class PersonController extends AbstractController
$request->getMethod() === Request::METHOD_POST $request->getMethod() === Request::METHOD_POST
&& $form->isValid() && $form->isValid()
) { ) {
$alternatePersons = $this->personACLAwareRepository $alternatePersons = $this->similarPersonMatcher
->findMatchingPersons($person); ->matchPerson($person);
if ( if (
false === $this->isLastPostDataChanges($form, $request, true) false === $this->isLastPostDataChanges($form, $request, true)

View File

@@ -20,9 +20,9 @@ use Chill\PersonBundle\Entity\PersonNotDuplicate;
use Chill\PersonBundle\Form\PersonConfimDuplicateType; use Chill\PersonBundle\Form\PersonConfimDuplicateType;
use Chill\PersonBundle\Form\PersonFindManuallyDuplicateType; use Chill\PersonBundle\Form\PersonFindManuallyDuplicateType;
use Chill\PersonBundle\Privacy\PrivacyEvent; use Chill\PersonBundle\Privacy\PrivacyEvent;
use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
use Chill\PersonBundle\Repository\PersonNotDuplicateRepository; use Chill\PersonBundle\Repository\PersonNotDuplicateRepository;
use Chill\PersonBundle\Repository\PersonRepository; use Chill\PersonBundle\Repository\PersonRepository;
use Chill\PersonBundle\Search\SimilarPersonMatcher;
use Chill\TaskBundle\Entity\SingleTask; use Chill\TaskBundle\Entity\SingleTask;
use http\Exception\InvalidArgumentException; use http\Exception\InvalidArgumentException;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -39,11 +39,6 @@ class PersonDuplicateController extends Controller
*/ */
private $eventDispatcher; private $eventDispatcher;
/**
* @var PersonACLAwareRepositoryInterface
*/
private $personACLAwareRepository;
/** /**
* @var \Chill\PersonBundle\Actions\Remove\PersonMove * @var \Chill\PersonBundle\Actions\Remove\PersonMove
*/ */
@@ -54,19 +49,24 @@ class PersonDuplicateController extends Controller
*/ */
private $personRepository; private $personRepository;
/**
* @var \Chill\PersonBundle\Search\SimilarPersonMatcher
*/
private $similarPersonMatcher;
/** /**
* @var \Symfony\Component\Translation\TranslatorInterface * @var \Symfony\Component\Translation\TranslatorInterface
*/ */
private $translator; private $translator;
public function __construct( public function __construct(
PersonACLAwareRepositoryInterface $personACLAwareRepository, SimilarPersonMatcher $similarPersonMatcher,
TranslatorInterface $translator, TranslatorInterface $translator,
PersonRepository $personRepository, PersonRepository $personRepository,
PersonMove $personMove, PersonMove $personMove,
EventDispatcherInterface $eventDispatcher EventDispatcherInterface $eventDispatcher
) { ) {
$this->personACLAwareRepository = $personACLAwareRepository; $this->similarPersonMatcher = $similarPersonMatcher;
$this->translator = $translator; $this->translator = $translator;
$this->personRepository = $personRepository; $this->personRepository = $personRepository;
$this->personMove = $personMove; $this->personMove = $personMove;
@@ -246,11 +246,8 @@ class PersonDuplicateController extends Controller
'You are not allowed to see this person.' 'You are not allowed to see this person.'
); );
$duplicatePersons = $this->personACLAwareRepository->findMatchingPersons( $duplicatePersons = $this->similarPersonMatcher->
$person, matchPerson($person, $personNotDuplicateRepository, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL);
0.5,
PersonACLAwareRepositoryInterface::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL
);
$notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person); $notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person);

View File

@@ -30,7 +30,7 @@ class UserAccompanyingPeriodController extends AbstractController
} }
/** /**
* @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user") * @Route("/{_locale}/accompanying-periods", name="chill_person_accompanying_period_user")
*/ */
public function listAction(Request $request) public function listAction(Request $request)
{ {
@@ -44,13 +44,13 @@ class UserAccompanyingPeriodController extends AbstractController
); );
return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [ return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [
'accompanyingPeriods' => $accompanyingPeriods, 'accompanyingds' => $accompanyingPeriods,
'pagination' => $pagination, 'pagination' => $pagination,
]); ]);
} }
/** /**
* @Route("/{_locale}/person/accompanying-periods/my/drafts", name="chill_person_accompanying_period_draft_user") * @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user")
*/ */
public function listDraftsAction(Request $request) public function listDraftsAction(Request $request)
{ {

View File

@@ -71,7 +71,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository
$qb = $this->buildQueryByRecentUserHistory($user, $since); $qb = $this->buildQueryByRecentUserHistory($user, $since);
return $qb->select('a') return $qb->select('a')
->addOrderBy('userHistory.startDate', 'DESC') ->distinct(true)
->getQuery() ->getQuery()
->setMaxResults($limit) ->setMaxResults($limit)
->setFirstResult($offset) ->setFirstResult($offset)
@@ -95,7 +95,6 @@ final class AccompanyingPeriodRepository implements ObjectRepository
$qb $qb
->join('a.userHistories', 'userHistory') ->join('a.userHistories', 'userHistory')
->where($qb->expr()->eq('a.user', ':user')) ->where($qb->expr()->eq('a.user', ':user'))
->andWhere($qb->expr()->neq('a.step', "'" . AccompanyingPeriod::STEP_DRAFT . "'"))
->andWhere($qb->expr()->gte('userHistory.startDate', ':since')) ->andWhere($qb->expr()->gte('userHistory.startDate', ':since'))
->andWhere($qb->expr()->isNull('userHistory.endDate')) ->andWhere($qb->expr()->isNull('userHistory.endDate'))
->setParameter('user', $user) ->setParameter('user', $user)

View File

@@ -18,7 +18,6 @@ use Chill\MainBundle\Search\SearchApiQuery;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\PersonBundle\Templating\Entity\PersonRender;
use DateTimeInterface; use DateTimeInterface;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NonUniqueResultException; use Doctrine\ORM\NonUniqueResultException;
@@ -41,26 +40,18 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac
private EntityManagerInterface $em; private EntityManagerInterface $em;
private PersonNotDuplicateRepository $personNotDuplicateRepository;
private PersonRender $personRender;
private Security $security; private Security $security;
public function __construct( public function __construct(
Security $security, Security $security,
EntityManagerInterface $em, EntityManagerInterface $em,
CountryRepository $countryRepository, CountryRepository $countryRepository,
AuthorizationHelper $authorizationHelper, AuthorizationHelper $authorizationHelper
PersonRender $personRender,
PersonNotDuplicateRepository $personNotDuplicateRepository
) { ) {
$this->security = $security; $this->security = $security;
$this->em = $em; $this->em = $em;
$this->countryRepository = $countryRepository; $this->countryRepository = $countryRepository;
$this->authorizationHelper = $authorizationHelper; $this->authorizationHelper = $authorizationHelper;
$this->personRender = $personRender;
$this->personNotDuplicateRepository = $personNotDuplicateRepository;
} }
public function buildAuthorizedQuery( public function buildAuthorizedQuery(
@@ -306,70 +297,6 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac
return $this->fetchQueryPerson($query); return $this->fetchQueryPerson($query);
} }
/**
* @throws NonUniqueResultException
* @throws ParsingException
*
* @return array|Person[]
*/
public function findMatchingPersons(
Person $person,
float $precision = 0.15,
string $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY
): array {
$query = $this->matchPerson($person, $precision, $orderBy);
$authorizedQuery = $this->addAuthorizations($query);
return $this->fetchQueryPerson($authorizedQuery);
}
public function matchPerson(
Person $person,
float $precision = 0.15,
string $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY
): SearchApiQuery {
$fullName = $this->personRender->renderString($person, []);
$query = new SearchApiQuery();
$query->setFromClause('chill_person_person AS person');
$query->andWhereClause(
'SIMILARITY(person.fullnameCanonical, UNACCENT(LOWER(?))) >= ?',
[$fullName, $precision]
);
if (null !== $person->getId()) {
$query->andWhereClause(
'person.id != ?',
[$person->getId()]
);
$notDuplicatePersons = $this->personNotDuplicateRepository->findNotDuplicatePerson($person);
if (count($notDuplicatePersons)) {
$query->andWhereClause(
'person.id NOT IN (?)',
[$notDuplicatePersons]
);
}
}
switch ($orderBy) {
case self::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL:
$query->setSelectPertinence('person.fullnameCanonical');
break;
case self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY:
default:
$query->setSelectPertinence(
'SIMILARITY(person.fullnameCanonical, UNACCENT(LOWER(?)))',
[$fullName]
);
}
return $query;
}
private function addAuthorizations(SearchApiQuery $query): SearchApiQuery private function addAuthorizations(SearchApiQuery $query): SearchApiQuery
{ {
$authorizedCenters = $this->authorizationHelper $authorizedCenters = $this->authorizationHelper

View File

@@ -17,10 +17,6 @@ use DateTimeInterface;
interface PersonACLAwareRepositoryInterface interface PersonACLAwareRepositoryInterface
{ {
public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical';
public const SIMILAR_SEARCH_ORDER_BY_SIMILARITY = 'similarity';
public function buildAuthorizedQuery( public function buildAuthorizedQuery(
?string $default = null, ?string $default = null,
?string $firstname = null, ?string $firstname = null,
@@ -65,13 +61,4 @@ interface PersonACLAwareRepositoryInterface
?string $phonenumber = null, ?string $phonenumber = null,
?string $city = null ?string $city = null
): array; ): array;
/**
* @return array|Person[]
*/
public function findMatchingPersons(
Person $person,
float $precision = 0.15,
string $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY
): array;
} }

View File

@@ -20,8 +20,6 @@
<div class="flex-table accompanyingcourse-list"> <div class="flex-table accompanyingcourse-list">
{% for period in accompanyingPeriods %} {% for period in accompanyingPeriods %}
{% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %} {% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %}
{% else %}
<p class="chill-no-data-statement">{{ 'Any accompanying period'|trans }}</p>
{% endfor %} {% endfor %}
</div> </div>

View File

@@ -17,15 +17,6 @@
{% block title %}{{ 'Add a person'|trans }}{% endblock title %} {% block title %}{{ 'Add a person'|trans }}{% endblock title %}
{% macro button_person_after(person) %}
{% set household = person.getCurrentHousehold %}
{% if household is not null %}
<li>
<a href="{{ path('chill_person_household_summary', { 'household_id': household.id }) }}" class="btn btn-sm btn-chill-beige"><i class="fa fa-home"></i></a>
</li>
{% endif %}
{% endmacro %}
{% block content %} {% block content %}
<div class="col-md-10 col-xxl person-new"> <div class="col-md-10 col-xxl person-new">
@@ -40,24 +31,34 @@
</span> </span>
</div> </div>
<div class="flex-table"> <table class="table table-bordered border-dark">
<thead>
<tr>
<th class="chill-red">{{ 'Name'|trans }}</th>
<th class="chill-green">{{ 'Date of birth'|trans }}</th>
<th class="chill-orange">{{ 'Nationality'|trans }}</th>
</tr>
</thead>
<tbody>
{% for person in alternatePersons %} {% for person in alternatePersons %}
<div class="item-bloc"> <tr>
<td>
{{ person|chill_entity_render_box({ <a href="{{ path('chill_person_view', {'person_id': person.id } ) }}">
'render': 'bloc', {{ person|chill_entity_render_string }}{% apply spaceless %}
'addLink': true, {% if person.isOpen == false %}
'addInfo': true, <i class="icon-lock"></i>
'addAge': true, {% endif %}
'addAltNames': true, {% endapply %}
'addCenter': true, </a>
'address_multiline': false, </td>
'customButtons': { 'after': _self.button_person_after(person) } <td>{% if person.birthdate is not null %}{{ person.birthdate|format_date('long') }}{% else %}&nbsp;{% endif %}</td>
}) }} <td>
</div> {% if person.nationality is not null %}{{ person.nationality.name|localize_translatable_string }}{% else %}{{ 'Without nationality'|trans }}{% endif %}
</td>
</tr>
{% endfor %} {% endfor %}
</div> </tbody>
</table>
{% endif %} {% endif %}
{{ form_start(form, {'attr' : {'id' : 'create-form'}}) }} {{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}

View File

@@ -21,9 +21,6 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
use function count; use function count;
/**
* @deprecated
*/
class SimilarPersonMatcher class SimilarPersonMatcher
{ {
public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical'; public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical';

View File

@@ -62,6 +62,7 @@ class AccompanyingPeriodWorkVoter extends Voter
case self::UPDATE: case self::UPDATE:
return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()); return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod());
default: default:
throw new UnexpectedValueException("attribute {$attribute} is not supported"); throw new UnexpectedValueException("attribute {$attribute} is not supported");
} }

View File

@@ -161,13 +161,11 @@ class AccompanyingPeriodContext implements
'class' => Person::class, 'class' => Person::class,
'choices' => $persons, 'choices' => $persons,
'choice_label' => function (Person $p) { 'choice_label' => function (Person $p) {
return $this->personRender->renderString($p, ['addAge' => true]); return $this->personRender->renderString($p, []);
}, },
'multiple' => false, 'multiple' => false,
'expanded' => true, 'expanded' => true,
'required' => false,
'label' => $options[$key . 'Label'], 'label' => $options[$key . 'Label'],
'placeholder' => $this->translator->trans('Any person selected'),
]); ]);
} }
} }

View File

@@ -83,12 +83,6 @@ class PersonRender extends AbstractChillEntityRender
. $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')'; . $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')';
} }
if (null !== $person->getDeathDate() && $options['addAge']) {
return $person->getFirstName() . ' ' . $person->getLastName()
. ' (‡)'
. $this->addAltNames($person, false);
}
return $person->getFirstName() . ' ' . $person->getLastName() return $person->getFirstName() . ' ' . $person->getLastName()
. $this->addAltNames($person, false); . $this->addAltNames($person, false);
} }

View File

@@ -24,7 +24,7 @@ services:
Chill\PersonBundle\Controller\PersonDuplicateController: Chill\PersonBundle\Controller\PersonDuplicateController:
arguments: arguments:
$personACLAwareRepository: '@Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface' $similarPersonMatcher: '@Chill\PersonBundle\Search\SimilarPersonMatcher'
$translator: '@Symfony\Component\Translation\TranslatorInterface' $translator: '@Symfony\Component\Translation\TranslatorInterface'
$personRepository: '@Chill\PersonBundle\Repository\PersonRepository' $personRepository: '@Chill\PersonBundle\Repository\PersonRepository'
$personMove: '@Chill\PersonBundle\Actions\Remove\PersonMove' $personMove: '@Chill\PersonBundle\Actions\Remove\PersonMove'

View File

@@ -85,7 +85,6 @@ Course number: Parcours n°
Civility: Civilité Civility: Civilité
choose civility: -- choose civility: --
All genders: tous les genres All genders: tous les genres
Any person selected: Aucune personne sélectionnée
# dédoublonnage # dédoublonnage
Old person: Doublon Old person: Doublon