{% if menuItems is not defined %}
{% set menuItems = getMenuItemsFromAlias('main') %}
{% endif %}
{% if (KOH_ALLOW_ADHESION is defined and KOH_ALLOW_ADHESION == 'true') and app.user is null and ((KOH_USE_WORDPRESS is defined and KOH_USE_PAYZEN == 'true') or (KOH_USE_HELLOASSO is defined and KOH_USE_HELLOASSO == 'true')) %}
{% endif %}
{% if KOH_USE_WORDPRESS is not defined %}
{% set KOH_USE_WORDPRESS = true %}
{% endif %}
{% if KOH_USE_WORDPRESS == 'false' and menuItems is not null and menuItems|length > 0 %}
{% import '@kohinos/common/menu_tree_macro.html.twig' as tree %}
{% set currentPath = app.request.requestUri %}
{{ tree.menu(menuItems, currentPath) }}
{% endif %}
{# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #}
{% if app.user and is_granted('ROLE_ADMIN') %}
{% endif %}
{% set printBugReport = KOH_BUG_REPORT|default('ROLE_ADMIN') %}
{% if app.user and (is_granted('ROLE_ADMIN') and printBugReport == 'ROLE_ADMIN') or (is_granted('ROLE_USER') and printBugReport == 'ROLE_USER') %}
{% endif %}
{# MENU UTILISATEUR CONNECTE #}
{% if app.user %}
{# COMPTE ou ECOMPTE - affichage selon KOH_ALLOW_MLC et KOH_ALLOW_SSA #}
{% set allow_mlc = (KOH_ALLOW_MLC is defined and KOH_ALLOW_MLC|default('false') == 'true') %}
{% set allow_ssa = (KOH_ALLOW_SSA is defined and KOH_ALLOW_SSA|default('false') == 'true') %}
{# Affichage du compte MLC pour adhérent #}
{% if allow_mlc and app.user and is_granted('ROLE_ADHERENT') and app.user.adherent and app.user.adherent.emlcAccount %}
Ecompte : {{app.user.adherent.emlcAccount.balance }}
{# Affichage du compte MLC pour prestataire #}
{% elseif allow_mlc and app.user and is_granted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null and getCurrentPrestataire().emlcAccount %}
Ecompte : {{getCurrentPrestataire().emlcAccount.balance }}
{# Affichage du compte MLC pour groupe #}
{% elseif allow_mlc and getCurrentGroupe() != null and getCurrentGroupe().mlcAccount %}
Compte : {{getCurrentGroupe().mlcAccount.balance }}
{# Affichage du compte MLC pour comptoir #}
{% elseif allow_mlc and getCurrentComptoir() != null and getCurrentComptoir().mlcAccount %}
Compte : {{getCurrentComptoir().mlcAccount.balance }}
{% endif %}
{# Affichage du/des compte(s) SSA pour adhérent #}
{% if allow_ssa and app.user and is_granted('ROLE_ADHERENT') and app.user.adherent %}
{% set ssas = getAllSsa() %}
{% for ssa in ssas %}
{% if app.user.adherent.ssaEmlcAccount(ssa) != null and app.user.adherent.ssaEmlcAccount(ssa).balance > 0 %}
Solde SSA : {{ app.user.adherent.ssaEmlcAccount(ssa).balance }}
{% endif %}
{% endfor %}
{% endif %}
{% if app.user %}
{{ 'Mon compte'|trans }}
{% endif %}
{% if app.user.possiblegroups|length > 1 %}
{{ 'Choix du rôle'|trans }}
{% endif %}
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
{{ 'RETOUR SUPER ADMIN'|trans }}
{% endif %}
{{ 'Déconnexion'|trans }}