{# Template to render a thirdparty OPTIONS * render string ['raw'|'label'|'bloc'] * with_valid_from bool * addLink bool * addEntity bool * addId bool * addInfo bool * isConfidential bool * hLevel integer * customButtons [ 'before' Twig\Markup, (injected with macro) 'replace' Twig\Markup, 'after' Twig\Markup ] * customArea [ 'beforeLabel' Twig\Markup, 'afterLabel' Twig\Markup, ] #} {% macro raw(thirdparty, options) %} {{ thirdparty|chill_entity_render_string }} {% endmacro raw %} {% macro label(thirdparty, options) %}
{%- if options['addLink'] and is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%} {%- endif -%} {% if options['customArea']['beforeLabel'] is defined %} {{ options['customArea']['beforeLabel'] }} {% endif %} {{ _self.raw(thirdparty, options) }} {% if options['customArea']['afterLabel'] is defined %} {{ options['customArea']['afterLabel'] }} {% endif %} {%- if options['addLink'] and is_granted('CHILL_3PARTY_3PARTY_SHOW', thirdparty) -%} {%- endif -%} {%- if options['addEntity'] -%} {{ 'Third party'|trans }} {%- endif -%} {%- if options['addId'] -%} {{ thirdparty.id|upper }} {%- endif -%}
{%- if options['addInfo'] -%}

{# {{ thirdparty.nameCompany }} {{ thirdparty.acronym }} #} plus d'infos

{%- endif -%} {#- tricks to remove easily whitespace after template -#} {%- if true -%}
{%- endif -%} {% endmacro label %} {%- if render == 'raw' -%} {{ _self.raw(thirdparty, options) }} {%- endif -%} {%- if render == 'label' -%} {{ _self.label(thirdparty, options) }} {%- endif -%} {%- if render == 'bloc' -%}
{{ _self.label(thirdparty, options) }} {% if thirdparty.kind == 'child' %} {{ 'thirdparty.child'|trans }} {% elseif thirdparty.kind == 'company' %} {{ 'thirdparty.company'|trans }} {% else %} {{ 'thirdparty.contact'|trans }} {% endif %}
{% if options['isConfidential'] %}
{% else %} {%- endif -%}
{% if options['showContacts'] and thirdparty.activeChildren|length > 0 %}
{{ 'thirdparty.Children'|trans ~ ': ' }}
{% for c in thirdparty.activeChildren %} {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { targetEntity: { name: 'thirdparty', id: c.id }, action: 'show', displayBadge: true, buttonText: c|chill_entity_render_string } %} {% 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 -%}