translation of company & contact and show parent in list

This commit is contained in:
Julien Fastré 2021-10-11 17:34:52 +02:00
parent acbb33918f
commit 313c17826e
5 changed files with 27 additions and 8 deletions

View File

@ -19,8 +19,8 @@
</div>
<div class="right_actions">
<span class="badge bg-chill-red" v-if="item.result.kind == 'child'">
{{ $t('thirdparty.contact')}}
<span class="badge bg-chill-blue" v-if="item.result.kind == 'child'">
{{ $t('thirdparty.child')}}
</span>
<span class="badge bg-info" v-else-if="item.result.kind == 'company'">
{{ $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"
}
}

View File

@ -460,6 +460,10 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
*/
public function getAddress(): ?Address
{
if ($this->isChild()) {
return $this->getParent()->getAddress();
}
return $this->address;
}

View File

@ -84,7 +84,7 @@
{% if thirdparty.kind == 'company' %}
<span class="badge bg-info">{{ 'thirdparty.company'|trans }}</span>
{% elseif thirdparty.kind == 'child' %}
<span class="badge bg-chill-red">{{ 'thirdparty.Child'|trans }}</span>
<span class="badge bg-chill-blue">{{ 'thirdparty.Child'|trans }}</span>
{% elseif thirdparty.kind == 'contact' %}
<span class="badge bg-secondary">{{ 'thirdparty.contact'|trans }}</span>
{% endif %}
@ -144,4 +144,16 @@
{% endfor %}
</div>
{% endif %}
{% if options['showParent'] and thirdparty.isChild %}
<div class="item-row">
{{ 'thirdparty.Contact of'|trans }}&nbsp;:
{% 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
} %}
</div>
{% endif %}
{%- endif -%}

View File

@ -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

View File

@ -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