{% extends 'knp_menu.html.twig' %} {% block label %} {#% if item.labelAttribute('icon') %}{% endif %#} {% if not item.labelAttribute('iconOnly') %} {% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|trans|raw }}{% else %}{{ item.label|trans }}{% endif %} {% endif %} {#% if item.labelAttribute('data-image') %}{{ item.name }}{% endif %#} {#% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} {% endif %#} {% endblock %} {% block list %} {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %} {% import "knp_menu.html.twig" as macros %} {% if matcher.isAncestor(item) %} {%- set listAttributes = listAttributes|merge({class: (listAttributes.class|default('') ~ ' in')|trim}) -%} {% endif %} {% if not item.isRoot %} {%- set listAttributes = listAttributes|merge({class: (listAttributes.class|default('') ~ ' treeview-menu')|trim}) -%} {% endif %} {{ block('children') }} {% endif %} {% endblock %} {% macro attributes(attributes) %} {% for name, value in attributes %} {%- if value is not none and value is not same as(false) -%} {{- ' %s="%s"'|format(name, value is same as(true) ? name|e : value|e)|raw -}} {%- endif -%} {%- endfor -%} {% endmacro %} {% block spanElement %} {% import "knp_menu.html.twig" as macros %} {% if item.attribute('class') matches '/(^|\s+)header(\s+|$)/' %} {{ block('label') }} {% else %} {{ block('label') }} {% endif %} {% endblock %} {% block linkElement %} {% import _self as knp_menu %} {% if ( (item.name != 'Activités par commune') or ((is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD') or app.user.direction) and item.name == 'Activités par commune') and (item.name != 'Activités par arrondissement') or ((is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD') or app.user.commune) and item.name == 'Activités par arrondissement') ) %} {% if item.attribute('icon') is not empty %} {% else %} {% endif %}

{% if item.name == 'Sensibilité par ministère' %} {% if is_granted('ROLE_MANAGER') %} Sensibilité par entité {% elseif app.user.direction %} Sensibilité du ministère {% elseif app.user.commune %} Sensibilité de la commune {% elseif is_granted('ROLE_DDD') %} Sensibilité par commune {% endif %} {% elseif item.name == 'Ministère / ODD' %} {% if is_granted('ROLE_MANAGER') %} Structure / ODD {% elseif app.user.direction %} Ministère / ODD {% elseif app.user.commune %} Commune / ODD {% elseif is_granted('ROLE_DDD') %} Commune / ODD {% endif %} {% elseif item.name == 'Ministère / Cible' %} {% if is_granted('ROLE_MANAGER') %} Structure / Cible {% elseif app.user.direction %} Ministère / Cible {% elseif app.user.commune %} Commune / Cible {% elseif is_granted('ROLE_DDD') %} Commune / Cible {% endif %} {% elseif item.name == 'ODD / Ministère' %} {% if is_granted('ROLE_MANAGER') %} ODD / Structure {% elseif app.user.direction %} ODD / Ministère {% elseif app.user.commune %} ODD / Commune {% elseif is_granted('ROLE_DDD') %} ODD / Commune {% endif %} {% elseif item.name == 'Activité / Ministère' %} {% if is_granted('ROLE_MANAGER') %} Activités / Structure {% elseif app.user.direction %} Activités / Ministère {% elseif app.user.commune %} Activités / Commune {% elseif is_granted('ROLE_DDD') %} Activités / Commune {% endif %} {% elseif item.name == 'Validation du PTA' %} {% if is_granted('ROLE_FOCAL') and app.user.commune %} Soumission du PTA {% else %} Validation du PTA {% endif %} {% else %} {{ block('label') }} {% endif %} {% if item.hasChildren %} {% endif %}

{% endif %} {% endblock %}