From 50b7df1f4ade75d122fe89477db1d0fb51af84ca Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 11 Feb 2022 15:16:28 +0100 Subject: [PATCH 1/6] adding thirdparty info --- .../views/PersonResource/list.html.twig | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig index 62b9701ec..9b0586779 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/list.html.twig @@ -14,6 +14,25 @@ {{ encore_entry_link_tags('mod_pickentity_type') }} {% endblock %} +{% macro rowCustomButtons(tp) %} + {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %} +
  • + +
  • + {% endif %} + {% if is_granted('CHILL_3PARTY_3PARTY_SHOW', tp) %} +
  • + +
  • + {% endif %} +{% endmacro %} + {% block personcontent %}

    {{ 'List of resources'|trans }}

    @@ -25,18 +44,27 @@
    {% if resource.person is not null %} -
    - +
    + {{ resource.person|chill_entity_render_box() }} + {# {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { action: 'show', displayBadge: true, targetEntity: { name: 'person', id: resource.person.id }, buttonText: resource.person|chill_entity_render_string, isDead: resource.person.deathdate is not null } %} - + #}
    {% elseif resource.thirdparty is not null %} -
    +
    + {{ resource.thirdparty|chill_entity_render_box({ + 'render': 'bloc', + 'showContacts': false, + 'addLink': false, + 'isConfidential': (resource.thirdparty.contactDataAnonymous ? true : false) + }) }} +
    + {#
    {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { action: 'show', displayBadge: true, @@ -45,7 +73,7 @@ parent: resource.thirdparty.parent } %} -
    +
    #} {% else %}
    {{ resource.freetext }} From 753a007172ed90696f28d796caa82fd8e3201f45 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 11 Feb 2022 16:32:28 +0100 Subject: [PATCH 2/6] translation added for kind of resource --- src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 60cf842af..234afcff2 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -238,6 +238,7 @@ Select a type: "Choisissez un type" Select a person: "Choisissez un usager" Select a thirdparty: "Choisissez un tiers" Contact person: "Personne de contact" +Kind: "Type" # pickAPersonType From f9154233e4d3d1bce7f67047c2ea5afde7be8cf4 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 11 Feb 2022 17:02:31 +0100 Subject: [PATCH 3/6] using renderbox and adjusting style + show button if person or thirdparty --- .../Resources/views/Entity/person.html.twig | 2 +- .../views/PersonResource/form.html.twig | 5 ++ .../views/PersonResource/list.html.twig | 87 +++++++------------ 3 files changed, 37 insertions(+), 57 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index 9bee504a9..02fc00e4c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -172,7 +172,7 @@ {%- if options['customButtons']['replace'] is defined -%} {{ options['customButtons']['replace'] }} - {%- elseif is_granted('CHILL_PERSON_SEE', person) -%} + {%- elseif is_granted('CHILL_PERSON_SEE', person) and options['addLink'] -%}
  • diff --git a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/form.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/form.html.twig index 6fa294336..9bda2856b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/form.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/PersonResource/form.html.twig @@ -56,6 +56,11 @@ {% if action is defined %}