diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue
index 4bb2e2d1e..2dbb7c8d0 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue
@@ -19,8 +19,8 @@
-
- {{ $t('thirdparty.contact')}}
+
+ {{ $t('thirdparty.child')}}
{{ $t('thirdparty.company')}}
@@ -49,8 +49,8 @@ const i18n = {
messages: {
fr: {
thirdparty: {
- contact: "Contact",
- company: "Institution",
+ contact: "Personne physique",
+ company: "Personne morale",
child: "Personne de contact"
}
}
diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
index b309c4542..38124b645 100644
--- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
@@ -460,6 +460,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
*/
public function getAddress(): ?Address
{
+ if ($this->isChild()) {
+ return $this->getParent()->getAddress();
+ }
+
return $this->address;
}
diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig
index f7dcf3bc5..558062271 100644
--- a/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig
+++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/Entity/thirdparty.html.twig
@@ -84,7 +84,7 @@
{% if thirdparty.kind == 'company' %}
{{ 'thirdparty.company'|trans }}
{% elseif thirdparty.kind == 'child' %}
- {{ 'thirdparty.Child'|trans }}
+ {{ 'thirdparty.Child'|trans }}
{% elseif thirdparty.kind == 'contact' %}
{{ 'thirdparty.contact'|trans }}
{% endif %}
@@ -144,4 +144,16 @@
{% endfor %}
{% endif %}
+ {% if options['showParent'] and thirdparty.isChild %}
+
+ {{ 'thirdparty.Contact of'|trans }} :
+ {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
+ targetEntity: { name: 'thirdparty', id: thirdparty.parent.id },
+ action: 'show',
+ displayBadge: true,
+ buttonText: thirdparty.parent|chill_entity_render_string
+ } %}
+
+ {% endif %}
+
{%- endif -%}
diff --git a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
index db53108d4..e239c4a76 100644
--- a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
+++ b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
@@ -61,7 +61,8 @@ class ThirdPartyRender extends AbstractChillEntityRender
'hLevel' => $options['hLevel'] ?? 3,
'customButtons' => $options['customButtons'] ?? [],
'customArea' => $options['customArea'] ?? [],
- 'showContacts' => $options['showContacts'] ?? [],
+ 'showContacts' => $options['showContacts'] ?? false,
+ 'showParent' => $options['showParent'] ?? true,
];
return
diff --git a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml
index cee39297b..e6167840d 100644
--- a/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml
+++ b/src/Bundle/ChillThirdPartyBundle/translations/messages.fr.yml
@@ -33,11 +33,13 @@ thirdparty.A company: Une personne morale
thirdparty.company: Personne morale
thirdparty.A contact: Une personne physique
thirdparty.contact: Personne physique
+thirdparty.Contact of: Contact de
thirdparty.a_company_explanation: >-
- Les institutions peuvent compter un ou plusieurs contacts, interne à l'instution. Il est également possible de
+ Les personnes morales peuvent compter un ou plusieurs contacts, interne à l'instution. Il est également possible de
leur associer un acronyme, et le nom d'un service.
thirdparty.a_contact_explanation: >-
- Les personnes physiques ne disposent pas d'acronyme, de service, ou de contacts sous-jacents.
+ Les personnes physiques ne disposent pas d'acronyme, de service, ou de contacts sous-jacents. Il est possible de leur
+ indiquer une civilité et un métier.
thirdparty.Which kind of third party ?: Quel type de tiers souhaitez-vous créer ?
thirdparty.Contact data are confidential: Données de contact confidentielles