useradmin.html.twig 9.51 KB
Newer Older
Damien Moulard committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
{# UNIQUEMENT POUR LES TESTS => fixture de dev #}
{% if app.environment == 'dev' and isDevFixture() and (is_granted('ROLE_ADMIN') or is_granted('ROLE_PREVIOUS_ADMIN')) %}
	{% set routeName = routeName|default('index') %}
	{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
		<div class='w-100 text-center mb-2'>
			<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=_exit'>
				{{ 'RETOUR SUPER ADMIN'|trans }}
			</a>
		</div>
	{% elseif app.user and is_granted('ROLE_SUPER_ADMIN') %}
		<div class='mb-2 group text-center'>
			{% if isDevFixture('user_prestataire') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'>
					{{ 'PRESTATAIRE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_adherent') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_adherent'>
					{{ 'ADHERENT'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_adminsiege') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_adminsiege'>
					{{ 'ADMIN SIEGE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_comptoir') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_comptoir'>
					{{ 'COMPTOIR'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_gestiongroupe') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_gestiongroupe'>
					{{ 'GESTION GROUPE'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_contact') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_contact'>
					{{ 'CONTACT'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_tresorier') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_tresorier'>
					{{ 'TRESORIER'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_controleur') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_controleur'>
					{{ 'CONTROLEUR'|trans }}
				</a>
			{% endif %}
			{% if isDevFixture('user_redacteur') %}
				<a class='btn btn-xs m-1 btn-primary' href='{{path(routeName, [], true)}}?_switch_user=user_redacteur'>
					{{ 'REDACTEUR'|trans }}
				</a>
			{% endif %}
		</div>
	{% endif %}
{% endif %}

{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion">
	{% if not app.request.session.has('_choixGroup') %}
		{% if app.user and is_granted('ROLE_ADMIN_SIEGE') %}

			{% set siege = getSiege() %}
			{% set compte = siege.getCompte() %}
68 69 70
			{% set compteNanti = siege.getCompteNantie() %}
			{% set ecompteNanti = siege.getECompte() %}
			{% set soldelabel = 'Billets au siège'|trans %}
Damien Moulard committed
71
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
72 73
			{% include 'block/solde.html.twig' with {'compte': compteNanti, 'soldelabel': 'Billets nantis'} %}
			{% include 'block/solde.html.twig' with {'compte': ecompteNanti, 'soldelabel': 'Monnaie numérique distribuée'} %}
74
			{% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %}
Damien Moulard committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
			{% include 'siege/block/solde_edit.html.twig' %}
			{% include 'siege/block/transfert_siegegroupe.html.twig' %}
			{% include 'siege/block/transfert_groupesiege.html.twig' %}

		{% elseif app.user and is_granted('ROLE_REDACTEUR') %}

			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif app.user and is_granted('ROLE_TRESORIER') %}

			{% set siege = getSiege() %}
			{% set compte = siege.getCompte() %}
90 91
			{% set compteNanti = siege.getCompteNantie() %}
			{% set ecompteNanti = siege.getECompte() %}
92
			{% set soldelabel = 'Billets au siège'|trans %}
Damien Moulard committed
93
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
94 95
			{% include 'block/solde.html.twig' with {'compte': compteNanti, 'soldelabel': 'Billets nantis'} %}
			{% include 'block/solde.html.twig' with {'compte': ecompteNanti, 'soldelabel': 'Monnaie numérique distribuée'} %}
96
			{% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %}
Damien Moulard committed
97 98 99 100 101 102
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
			{# {% include 'block/soldegroupes.html.twig' %} #}

		{% elseif app.user and is_granted('ROLE_CONTROLEUR') %}

103
			{% set siege = getSiege() %}
104 105 106 107 108 109 110
			{% set compte = siege.getCompte() %}
			{% set compteNanti = siege.getCompteNantie() %}
			{% set ecompteNanti = siege.getECompte() %}
			{% set soldelabel = 'Billets au siège'|trans %}
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
			{% include 'block/solde.html.twig' with {'compte': compteNanti, 'soldelabel': 'Billets nantis'} %}
			{% include 'block/solde.html.twig' with {'compte': ecompteNanti, 'soldelabel': 'Monnaie numérique distribuée'} %}
111
			{% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %}
Damien Moulard committed
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
			{% include 'block/userinfos.html.twig' %}

		{% elseif app.user and is_granted('ROLE_GESTION_GROUPE') %}

			{% if getCurrentGroupe() != null %}
				{% set compte = getCurrentGroupe().compte %}
				{% set soldelabel = 'Solde du groupe'|trans %}
				{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
			{% endif %}
			{% include 'groupe/block/infos.html.twig' %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
			{% include 'block/transactions.html.twig' %}
			{% include 'groupe/block/transaction_comptoir.html.twig' %}
			{% include 'groupe/block/retourgroupe.html.twig' %}

		{% elseif app.user and is_granted('ROLE_COMPTOIR') %}

			{% if getCurrentComptoir() != null %}
				{% set compte = getCurrentComptoir().compte %}
				{% set soldelabel = 'Solde du comptoir "'|trans ~ getCurrentComptoir() ~ '"' %}
				{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
			{% endif %}
			{% include 'comptoir/block/infos.html.twig' %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
			{% include 'block/transactions.html.twig' %}
			{% include 'comptoir/block/vente_adherent.html.twig' %}
			{% include 'comptoir/block/vente_prestataire.html.twig' %}
			{% include 'comptoir/block/retrait_prestataire.html.twig' %}
			{% include 'comptoir/block/retrait_adherent.html.twig' %}
			{% include 'comptoir/block/reconversion.html.twig' %}

		{% elseif app.user and is_granted('ROLE_CONTACT') %}

			{% include 'groupe/block/infos.html.twig' %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif app.user and is_granted('ROLE_SUPER_ADMIN') %}

			{% set siege = getSiege() %}
			{% set compte = siege.getCompte() %}
155 156 157
			{% set compteNanti = siege.getCompteNantie() %}
			{% set ecompteNanti = siege.getECompte() %}
			{% set soldelabel = 'Billets au siège'|trans %}
Damien Moulard committed
158
			{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
159
			{% include 'block/solde.html.twig' with {'compte': compteNanti, 'soldelabel': 'Billets nantis'} %}
160
			{% include 'block/solde.html.twig' with {'compte': ecompteNanti, 'soldelabel': 'Monnaie numérique distribuée'} %}
161
			{% include 'block/solde.html.twig' with {'compte': compteNanti + ecompteNanti, 'soldelabel': 'Monnaie nantie'} %}
Damien Moulard committed
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}

		{% elseif app.user and is_granted('ROLE_PRESTATAIRE') and getCurrentPrestataire() != null %}

			{% set esoldelabel = 'Solde e-mlc'|trans %}
			{% include 'block/solde.html.twig' with {'compte': getCurrentPrestataire().ecompte, 'soldelabel': esoldelabel} %}
			{% if getCurrentPrestataire().mlc == false %}
				{% include 'presta/block/infos.html.twig' %}
			{% endif %}
			{% include 'block/userinfos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
			{% include 'block/transactions.html.twig' %}
			{% if getCurrentPrestataire().mlc == false %}
				{% include 'block/cotisations.html.twig' %}
				{% include 'groupepresta/block/inscription.html.twig' %}
			{% endif %}
			{% if isPayzenEnabled() %}
				{% include 'presta/block/achat_monnaie.html.twig' %}
			{% endif %}
			{% include 'presta/block/transaction_presta.html.twig' %}
			{% include 'presta/block/transaction_adherent.html.twig' %}
			{% if getCurrentPrestataire().mlc == false and getCurrentPrestataire().ecompte > 0 %}
				{% include 'presta/block/reconversion.html.twig' %}
			{% endif %}

		{% elseif app.user and is_granted('ROLE_ADHERENT') and app.user.adherent %}

			{% set esoldelabel = 'Solde e-mlc'|trans %}
			{% include 'block/solde.html.twig' with {'compte': app.user.adherent.ecompte, 'soldelabel': esoldelabel} %}
			{% if isPayzenEnabled() %}
				{% include 'adherent/block/achat_monnaie.html.twig' %}
			{% endif %}
			{% include 'adherent/block/transaction_presta.html.twig' %}
			{% include 'adherent/block/transaction_adherent.html.twig' %}
197 198 199 200
			{% include 'block/transactions.html.twig' %}
			{% include 'block/cotisations.html.twig' %}
			{% include 'adherent/block/infos.html.twig' %}
			{% include 'block/userpassword.html.twig' %}
Damien Moulard committed
201 202 203 204 205 206 207 208

		{% else %}
			{% if KOH_USE_WORDPRESS is defined and KOH_USE_WORDPRESS == 'false' %}
				{% include 'presta/block/carte.html.twig' with {'title': 'Situer les Prestataires'|trans}%}
			{% endif %}
		{% endif %}
	{% endif %}
</div>