From f358e78734c5195d8dc8877b25f8b33f7037c558 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 31 Jan 2022 14:39:40 +0100 Subject: [PATCH] onthefly button added to view person or thirdparty + badge changed if thirdparty is a contact --- .../views/PersonResource/list.html.twig | 31 ++++++++++++++++--- .../translations/messages.fr.yml | 1 + 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig index 820da9179..bb8a88606 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig @@ -32,10 +32,14 @@ {% elseif resource.thirdparty is not null %}
{{ resource.thirdparty }} - + + {% if resource.thirdparty.parent is not null %} + {{ 'Contact person'|trans|capitalize }} + {% else %} {{ 'thirdparty'|trans|capitalize }} - - + {% endif %} + +
{% else %}
@@ -56,7 +60,7 @@
{% endif %} - {% if is_granted('CHILL_PERSON_UPDATE', resource.person) %} + {% if is_granted('CHILL_PERSON_UPDATE', resource.personOwner) %}
    @@ -72,6 +76,25 @@ class="btn btn-sm btn-delete" title="{{ 'Delete'|trans }}"> +
  • + {% if resource.person is not null %} + + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: false, + targetEntity: { name: 'person', id: resource.person.id }, + } %} + + {% endif %} + {% if resource.thirdparty is not null %} + + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: false, + targetEntity: { name: 'thirdparty', id: resource.thirdparty.id }, + parent: resource.thirdparty.parent + } %} + + {% endif %} +
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index a2a5121a6..510dc1a64 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -237,6 +237,7 @@ no comment found: "Aucun commentaire" Select a type: "Choisissez un type" Select a person: "Choisissez un usager" Select a thirdparty: "Choisissez un tiers" +Contact person: "Personne de contact" # pickAPersonType