Commit cff21086 by Julien Jorry

Fix : Voir le menu Administration en super admin à nouveau => app.user.isgranted to is_granted

parent ad22d3c7
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
{% endfor %} {% endfor %}
</ul> </ul>
{% if ((app.user and app.user.isGranted('ROLE_ADHERENT') and app.user.adherent) or (app.user and app.user.isGranted('ROLE_PRESTATAIRE') and app.session.has('_prestagere'))) %} {% if ((app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) or (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere'))) %}
<a class='btn btn-xs btn-primary' href='{{ path('cotiser') }}'> <a class='btn btn-xs btn-primary' href='{{ path('cotiser') }}'>
{{ 'Cotiser en MLC'|trans }} {{ 'Cotiser en MLC'|trans }}
</a> </a>
......
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %} {% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %}
{% if object is instanceof("App\\Entity\\Flux") and (app.user.isGranted('ROLE_SUPER_ADMIN') or app.user.isGranted('ROLE_TRESORIER')) %} {% if object is instanceof("App\\Entity\\Flux") and (is_granted('ROLE_SUPER_ADMIN') or is_granted('ROLE_TRESORIER')) %}
{% block field%} {% block field%}
{%- spaceless %} {%- spaceless %}
{% if value %} {% if value %}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{{ 'RETOUR SUPER ADMIN'|trans }} {{ 'RETOUR SUPER ADMIN'|trans }}
</a> </a>
</div> </div>
{% elseif app.user and app.user.isGranted('ROLE_SUPER_ADMIN') %} {% elseif app.user and is_granted('ROLE_SUPER_ADMIN') %}
<div class='mb-2 group text-center'> <div class='mb-2 group text-center'>
{% if isDevFixture('user_prestataire') %} {% if isDevFixture('user_prestataire') %}
<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'> <a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'>
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #} {# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion"> <div id="accordion">
{% if not app.request.session.has('_choixGroup') %} {% if not app.request.session.has('_choixGroup') %}
{% if app.user and app.user.isGranted('ROLE_ADMIN_SIEGE') %} {% if app.user and is_granted('ROLE_ADMIN_SIEGE') %}
{% set siege = getSiege() %} {% set siege = getSiege() %}
{% set compte = siege.getCompte() %} {% set compte = siege.getCompte() %}
...@@ -73,12 +73,12 @@ ...@@ -73,12 +73,12 @@
{% include 'siege/block/transfert_siegegroupe.html.twig' %} {% include 'siege/block/transfert_siegegroupe.html.twig' %}
{% include 'siege/block/transfert_groupesiege.html.twig' %} {% include 'siege/block/transfert_groupesiege.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_REDACTEUR') %} {% elseif app.user and is_granted('ROLE_REDACTEUR') %}
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %} {% include 'block/userpassword.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_TRESORIER') %} {% elseif app.user and is_granted('ROLE_TRESORIER') %}
{% set siege = getSiege() %} {% set siege = getSiege() %}
{% set compte = siege.getCompte() %} {% set compte = siege.getCompte() %}
...@@ -88,11 +88,11 @@ ...@@ -88,11 +88,11 @@
{% include 'block/userpassword.html.twig' %} {% include 'block/userpassword.html.twig' %}
{# {% include 'block/soldegroupes.html.twig' %} #} {# {% include 'block/soldegroupes.html.twig' %} #}
{% elseif app.user and app.user.isGranted('ROLE_CONTROLEUR') %} {% elseif app.user and is_granted('ROLE_CONTROLEUR') %}
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_GESTION_GROUPE') %} {% elseif app.user and is_granted('ROLE_GESTION_GROUPE') %}
{% if getCurrentGroupe() != null %} {% if getCurrentGroupe() != null %}
{% set compte = getCurrentGroupe().compte %} {% set compte = getCurrentGroupe().compte %}
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
{% include 'groupe/block/transaction_comptoir.html.twig' %} {% include 'groupe/block/transaction_comptoir.html.twig' %}
{% include 'groupe/block/retourgroupe.html.twig' %} {% include 'groupe/block/retourgroupe.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_COMPTOIR') %} {% elseif app.user and is_granted('ROLE_COMPTOIR') %}
{% if getCurrentComptoir() != null %} {% if getCurrentComptoir() != null %}
{% set compte = getCurrentComptoir().compte %} {% set compte = getCurrentComptoir().compte %}
...@@ -123,13 +123,13 @@ ...@@ -123,13 +123,13 @@
{% include 'comptoir/block/retrait_adherent.html.twig' %} {% include 'comptoir/block/retrait_adherent.html.twig' %}
{% include 'comptoir/block/reconversion.html.twig' %} {% include 'comptoir/block/reconversion.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_CONTACT') %} {% elseif app.user and is_granted('ROLE_CONTACT') %}
{% include 'groupe/block/infos.html.twig' %} {% include 'groupe/block/infos.html.twig' %}
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %} {% include 'block/userpassword.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_SUPER_ADMIN') %} {% elseif app.user and is_granted('ROLE_SUPER_ADMIN') %}
{% set siege = getSiege() %} {% set siege = getSiege() %}
{% set compte = siege.getCompte() %} {% set compte = siege.getCompte() %}
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %} {% include 'block/userpassword.html.twig' %}
{% elseif app.user and app.user.isGranted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null %} {% elseif app.user and is_granted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null %}
{% set esoldelabel = 'Solde e-mlc'|trans %} {% set esoldelabel = 'Solde e-mlc'|trans %}
{% include 'block/solde.html.twig' with {'compte': getCurrentPrestataire().ecompte, 'soldelabel': esoldelabel} %} {% include 'block/solde.html.twig' with {'compte': getCurrentPrestataire().ecompte, 'soldelabel': esoldelabel} %}
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
{% include 'presta/block/reconversion.html.twig' %} {% include 'presta/block/reconversion.html.twig' %}
{% endif %} {% endif %}
{% elseif app.user and app.user.isGranted('ROLE_ADHERENT') and app.user.adherent %} {% elseif app.user and is_granted('ROLE_ADHERENT') and app.user.adherent %}
{% set esoldelabel = 'Solde e-mlc'|trans %} {% set esoldelabel = 'Solde e-mlc'|trans %}
{% include 'block/solde.html.twig' with {'compte': app.user.adherent.ecompte, 'soldelabel': esoldelabel} %} {% include 'block/solde.html.twig' with {'compte': app.user.adherent.ecompte, 'soldelabel': esoldelabel} %}
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
{{ tree.menu(menuItems, currentPath) }} {{ tree.menu(menuItems, currentPath) }}
{% endif %} {% endif %}
{# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #} {# MENU UTILISATEUR AYANT ACCES A L'ADMIN CONNECTE #}
{% if app.user and app.user.isGranted('ROLE_ADMIN') %} {% if app.user and is_granted('ROLE_ADMIN') %}
<li class="nav-item" role="menu-item"> <li class="nav-item" role="menu-item">
<a href="{{ path('sonata_admin_dashboard') }}" class="nav-link" data-toggle="tooltip" data-placement="bottom" title="{{ 'Administration'|trans }}"> <a href="{{ path('sonata_admin_dashboard') }}" class="nav-link" data-toggle="tooltip" data-placement="bottom" title="{{ 'Administration'|trans }}">
<i class="fas fa-cog text-primary"></i>{% if KOH_USE_WORDPRESS != 'false' %}<span class='ml-1 text-primary'>Administration</span>{% endif %} <i class="fas fa-cog text-primary"></i>{% if KOH_USE_WORDPRESS != 'false' %}<span class='ml-1 text-primary'>Administration</span>{% endif %}
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
</a> </a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUC"> <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUC">
{# COMPTE ou ECOMPTE : @TODO : mettre plutôt dans le header en visible tout le temps ? #} {# COMPTE ou ECOMPTE : @TODO : mettre plutôt dans le header en visible tout le temps ? #}
{% if app.user and app.user.isGranted('ROLE_ADHERENT') %} {% if app.user and is_granted('ROLE_ADHERENT') %}
<b class="dropdown-item bg-primary text-white"> Ecompte : {{app.user.adherent.ecompte }}</b> <b class="dropdown-item bg-primary text-white"> Ecompte : {{app.user.adherent.ecompte }}</b>
{% elseif app.user and app.user.isGranted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null %} {% elseif app.user and is_granted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null %}
<b class="dropdown-item bg-primary text-white"> Ecompte : {{getCurrentPrestataire().ecompte }}</b> <b class="dropdown-item bg-primary text-white"> Ecompte : {{getCurrentPrestataire().ecompte }}</b>
{% elseif getCurrentGroupe() != null %} {% elseif getCurrentGroupe() != null %}
<b class="dropdown-item bg-primary text-white"> Compte : {{getCurrentGroupe().compte }}</b> <b class="dropdown-item bg-primary text-white"> Compte : {{getCurrentGroupe().compte }}</b>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<i class="fa fa-check"> </i> {{ showMlcStats('prestataire') }} <a href="{{ path('liste_prestataire') }}" title="{{ 'Nombre de prestataires'|trans }}">{{'prestataires'|trans}}</a> {{'et'|trans}} {{ showMlcStats('partenaire') }} <a href="{{ path('liste_partenaire') }}" title="{{'Nombre de partenaires'|trans}}">{{ 'partenaires'|trans }}</a> <i class="fa fa-check"> </i> {{ showMlcStats('prestataire') }} <a href="{{ path('liste_prestataire') }}" title="{{ 'Nombre de prestataires'|trans }}">{{'prestataires'|trans}}</a> {{'et'|trans}} {{ showMlcStats('partenaire') }} <a href="{{ path('liste_partenaire') }}" title="{{'Nombre de partenaires'|trans}}">{{ 'partenaires'|trans }}</a>
</p> </p>
<p> <p>
<i class="fa fa-check"> </i> {{ showMlcStats('groupe') }} <a href="{#{ path('groupe_liste') }#}" title="{{ 'Nombre de groupes locaux'|trans }}">{{ 'groupes locaux'|trans }}</a> <i class="fa fa-check"> </i> {{ showMlcStats('groupe') }} <a href="#{#{ path('groupe_liste') }#}" title="{{ 'Nombre de groupes locaux'|trans }}">{{ 'groupes locaux'|trans }}</a>
</p> </p>
<p> <p>
<i class="fa fa-check"> </i> {{ showMlcStats('comptoir') }} <a href="{{ path('comptoirs_liste') }}" title="{{ 'Nombre de comptoirs'|trans }}">{{ 'comptoirs'|trans }}</a> <i class="fa fa-check"> </i> {{ showMlcStats('comptoir') }} <a href="{{ path('comptoirs_liste') }}" title="{{ 'Nombre de comptoirs'|trans }}">{{ 'comptoirs'|trans }}</a>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<div class='container' style='max-width: 800px;'> <div class='container' style='max-width: 800px;'>
<h2 class='text-center w-100 mt-3'>{{ "Cotiser pour l'année"|trans }} {{ "now"|date('Y') }}</h2> <h2 class='text-center w-100 mt-3'>{{ "Cotiser pour l'année"|trans }} {{ "now"|date('Y') }}</h2>
<div class='text-center mb-5'> <div class='text-center mb-5'>
{% if app.user and app.user.isGranted('ROLE_ADHERENT') %} {% if app.user and is_granted('ROLE_ADHERENT') %}
<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.user.adherent.ecompte }}</b></h4> <h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.user.adherent.ecompte }}</b></h4>
<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT|default('') }}</b></h5> <h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT|default('') }}</b></h5>
{% elseif app.user and app.user.isGranted('ROLE_PRESTATAIRE') %} {% elseif app.user and is_granted('ROLE_PRESTATAIRE') %}
<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.session.get('_prestagere').ecompte }}</b></h4> <h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.session.get('_prestagere').ecompte }}</b></h4>
<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE|default('') }}</b></h5> <h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE|default('') }}</b></h5>
{% endif %} {% endif %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment