-
{{ item.result.profession.name.fr }}
+
{{ item.result.profession }}
{{ item.result.text }}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/notification_location_user_on_period_has_moved.fr.txt.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/notification_location_user_on_period_has_moved.fr.txt.twig
index e4509d78a..df932067c 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/notification_location_user_on_period_has_moved.fr.txt.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/notification_location_user_on_period_has_moved.fr.txt.twig
@@ -3,6 +3,7 @@
#}{{ period.user.label }},
L'usager {{ oldPersonLocation|chill_entity_render_string }} a déménagé.
+{{ app.user|chill_entity_render_string }} a enregistré ce déménagement.
Son adresse était utilisée pour localiser le parcours n°{{ period.id }}, dont vous êtes
le référent.
diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
index b8209eaeb..6555f7835 100644
--- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
+++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
@@ -79,6 +79,11 @@ class SimilarPersonMatcher
->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision')
->andWhere($qb->expr()->in('p.center', ':centers'));
+ $qb
+ ->setParameter('fullName', $this->personRender->renderString($person, []))
+ ->setParameter('centers', $centers)
+ ->setParameter('precision', $precision);
+
if (null !== $person->getBirthdate()) {
$qb->andWhere($qb->expr()->orX(
$qb->expr()->eq('p.birthdate', ':personBirthdate'),
@@ -90,13 +95,13 @@ class SimilarPersonMatcher
if ($person->getId() !== null) {
$qb->andWhere($qb->expr()->neq('p.id', ':personId'));
- $query->setParameter('personId', $person->getId());
+ $qb->setParameter('personId', $person->getId());
$notDuplicatePersons = $this->personNotDuplicateRepository->findNotDuplicatePerson($person);
if (count($notDuplicatePersons)) {
$qb->andWhere($qb->expr()->notIn('p.id', ':notDuplicatePersons'));
- $query->setParameter('notDuplicatePersons', $notDuplicatePersons);
+ $qb->setParameter('notDuplicatePersons', $notDuplicatePersons);
}
}
@@ -109,13 +114,10 @@ class SimilarPersonMatcher
case self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY:
default:
$qb->orderBy('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName)))', 'DESC');
+ $qb->setParameter('fullName', $this->personRender->renderString($person, []));
}
- $qb
- ->setParameter('fullName', $this->personRender->renderString($person, []))
- ->setParameter('centers', $centers)
- ->setParameter('precision', $precision);
-
+ dump($qb->getQuery());
return $qb->getQuery()->getResult();
}
}
diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php
index 76742951b..3c870449c 100644
--- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php
+++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php
@@ -151,21 +151,6 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
],
],
],
- [
- 'class' => \Chill\ThirdPartyBundle\Entity\ThirdPartyProfession::class,
- // 'controller' => \Chill\MainBundle\Controller\ProfessionApiController::class,
- 'name' => 'profession',
- 'base_path' => '/api/1.0/thirdparty/professions',
- 'base_role' => 'ROLE_USER',
- 'actions' => [
- '_index' => [
- 'methods' => [
- Request::METHOD_GET => true,
- Request::METHOD_HEAD => true,
- ],
- ],
- ],
- ],
],
]);
}
diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
index 2e8cebfb6..b13118168 100644
--- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
@@ -250,14 +250,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/**
* [fr] Qualité.
- *
- * @var ThirdPartyProfession
- * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession")
- * ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true)
+ * @ORM\Column(name="profession", type="text", nullable=false)
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
* @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"})
*/
- private ?ThirdPartyProfession $profession = null;
+ private string $profession = '';
/**
* @ORM\Column(name="telephone", type="phone_number", nullable=true)
@@ -491,9 +488,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
}
/**
- * @return ThirdPartyProfession
+ * @return string
*/
- public function getProfession(): ?ThirdPartyProfession
+ public function getProfession(): string
{
return $this->profession;
}
@@ -811,7 +808,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/**
* @return $this
*/
- public function setProfession(?ThirdPartyProfession $profession): ThirdParty
+ public function setProfession(string $profession): self
{
$this->profession = $profession;
diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
index 79f107575..384c743c2 100644
--- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
+++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php
@@ -20,14 +20,10 @@ use Chill\MainBundle\Form\Type\PickCivilityType;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
-use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyTypeCategoryType;
use Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter;
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeManager;
use Doctrine\ORM\EntityManagerInterface;
-use Doctrine\ORM\EntityRepository;
-use Doctrine\ORM\QueryBuilder;
-use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@@ -111,17 +107,8 @@ class ThirdPartyType extends AbstractType
'placeholder' => 'thirdparty.choose civility',
'required' => false,
])
- ->add('profession', EntityType::class, [
+ ->add('profession', TextType::class, [
'label' => 'thirdparty.Profession',
- 'class' => ThirdPartyProfession::class,
- 'choice_label' => function (ThirdPartyProfession $profession): string {
- return $this->translatableStringHelper->localize($profession->getName());
- },
- 'query_builder' => static function (EntityRepository $er): QueryBuilder {
- return $er->createQueryBuilder('p')
- ->where('p.active = true');
- },
- 'placeholder' => 'thirdparty.choose profession',
'required' => false,
])
->add('contactDataAnonymous', CheckboxType::class, [
diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
index 662911714..49066a082 100644
--- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
+++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
@@ -36,7 +36,7 @@
-
-
{{ p[0].toUpperCase() + p.slice(1).toLowerCase() }}
+ {{ getProfession[0] }}
-
@@ -136,13 +136,14 @@ export default {
getProfession() {
let profession = []
if (this.hasParent && this.thirdparty.profession) {
- profession.push(this.thirdparty.profession.name.fr)
+ profession.push(this.thirdparty.profession)
return profession;
}
if (!this.hasParent && this.thirdparty.category) {
profession = this.thirdparty.category.map((category) => category.text);
}
+
return profession;
}
/* TODO need backend normalizer to serve children without circular reference
diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
index 765d67fe8..0c830d673 100644
--- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
+++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue
@@ -73,13 +73,13 @@