Commit f5810d8a by Damien Moulard

Résolution conflits

parents dc15442f f778573e
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
###> symfony/framework-bundle ###
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=ThisTokenIsNotSoSecretChangeIt
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2,10.0.2.2
#TRUSTED_HOSTS=localhost,example.com,kohinos.test
###< symfony/framework-bundle ###
###> doctrine/doctrine-bundle ###
# Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
DATABASE_URL=mysql://logindb:passworddb@127.0.0.1:3306/bddname
###< doctrine/doctrine-bundle ###
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=smtp://localhost:25?encryption=&auth_mode=
###< symfony/swiftmailer-bundle ###
###> nelmio/cors-bundle ###
CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
###< nelmio/cors-bundle ###
## API AUTHENTIFICATION JWT (NOT USED AT THE MOMENT) ##
###> lexik/jwt-authentication-bundle ###
#JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
#JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
#JWT_PASSPHRASE=2162f52d0600275e618fccd274c080f2
###< lexik/jwt-authentication-bundle ###
......@@ -34,7 +34,3 @@ yarn-error.log
/mlc.test-access.log
/mlc.test-error.log
###< symfony/webpack-encore-bundle ###
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###
......@@ -11,18 +11,20 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl" : "*",
"api-platform/api-pack": "^1.2",
"beberlei/doctrineextensions": "^1.2",
"doctrine/annotations": "^1.8",
"doctrine/migrations": "^3.0",
"doctrine/doctrine-migrations-bundle": "^3.0",
"friendsofsymfony/user-bundle": "^2.1",
"geocoder-php/cache-provider": "^4.1",
"geocoder-php/google-maps-provider": "^4.3",
"geocoder-php/nominatim-provider": "^5.0",
"knplabs/knp-paginator-bundle": "^2.8",
"lexik/jwt-authentication-bundle": "^2.6",
"lexik/translation-bundle": "~4.0",
"liip/imagine-bundle": "^2.1",
"nelmio/api-doc-bundle": "^3.3",
......
......@@ -49,5 +49,4 @@ return [
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Sonata\ClassificationBundle\SonataClassificationBundle::class => ['all' => true],
App\Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle::class => ['all' => true],
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
];
lexik_jwt_authentication:
secret_key: '%env(resolve:JWT_SECRET_KEY)%'
public_key: '%env(resolve:JWT_PUBLIC_KEY)%'
pass_phrase: '%env(JWT_PASSPHRASE)%'
......@@ -39,26 +39,7 @@ security:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
# -> custom firewall for the admin area of the URL
# admin:
# pattern: /admin(.*)
# form_login:
# provider: fos_userbundle
# login_path: fos_user_security_login
# check_path: /admin/login_check
# use_forward: false
# failure_path: null
# success_handler: redirect.after.login
# logout:
# path: /admin/logout
# target: /admin/login
# anonymous: true
# switch_user:
# provider: fos_userbundle
# context: mlc_context
# access_denied_handler: App\Security\AccessDeniedHandler
# -> end custom configuration
## API WITH JWT AUTH (login/password)
# login:
# pattern: ^/api/login
# stateless: true
......
......@@ -9,12 +9,6 @@
>
<php>
<ini name="error_reporting" value="-1" />
<!-- ###+ lexik/jwt-authentication-bundle ### -->
<env name="JWT_SECRET_KEY" value="%kernel.project_dir%/config/jwt/private.pem"/>
<env name="JWT_PUBLIC_KEY" value="%kernel.project_dir%/config/jwt/public.pem"/>
<env name="JWT_PASSPHRASE" value="5dcea5f3b1917d7a4829199d10e219c9"/>
<!-- ###- lexik/jwt-authentication-bundle ### -->
</php>
<testsuites>
......
......@@ -99,13 +99,13 @@ class GroupeAdmin extends AbstractAdmin
public function postPersist($object)
{
$this->addFlash(
'sonata_flash_success',
$this->trans(
"Après avoir créer le groupe %name%, il est conseiller d'ajouter un gestionnaire de groupe",
['%name%' => $this->escapeHtml($this->admin->toString($object))]
)
);
// $this->addFlash(
// 'sonata_flash_success',
// $this->trans(
// "Après avoir créer le groupe %name%, il est conseiller d'ajouter un gestionnaire de groupe",
// ['%name%' => $this->escapeHtml($this->admin->toString($object))]
// )
// );
}
/**
......
......@@ -136,7 +136,6 @@ class IndexController extends AbstractController
$user->setEnabled(true);
$user->addPossiblegroup($group);
$user->addGroup($group);
$user->addRole('ROLE_SUPER_ADMIN');
$form = $this->createForm(InstallFormType::class, ['user' => $user]);
$form->handleRequest($request);
......@@ -159,7 +158,6 @@ class IndexController extends AbstractController
$presta->setSiret(' ');
$groupePresta = $repogroup->findOneBy(array('name' => 'Prestataire'));
$user->addPossiblegroup($groupePresta);
$user->addGroup($groupePresta);
$presta->addUser($user);
$presta->setGroupe($groupe);
......
......@@ -19,6 +19,7 @@ use App\Form\Type\TransactionAdherentPrestataireFormType;
use App\Form\Type\TransfertGroupeComptoirFormType;
use App\Form\Type\TransfertGroupeSiegeFormType;
use App\Form\Type\TransfertSiegeGroupeFormType;
use App\Form\Type\SoldeSiegeFormType;
use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Model\UserManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
......@@ -94,4 +95,35 @@ class UserSiegeController extends FluxController
$this->translator->trans('Transaction du groupe au siège')
);
}
/**
* @Route("/solde/siege/", name="soldeSiege")
* @Security("is_granted('ROLE_ADMIN_SIEGE') or is_granted('ROLE_SUPER_ADMIN')")
*/
public function soldeSiegeAction(Request $request)
{
$siege = $this->em->getRepository(Siege::class)->findOneById(1);
$form = $this->createForm(SoldeSiegeFormType::class, $siege);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();
$this->em->persist($data);
$this->em->flush();
$this->addFlash(
'success',
$this->translator->trans('Solde bien modifié !')
);
$referer = $request->headers->get('referer');
if ($referer && !$request->isXmlHttpRequest()) {
return $this->redirect($referer);
} elseif (!$request->isXmlHttpRequest()) {
return new Response('', Response::HTTP_BAD_REQUEST);
}
}
return $this->render('siege/block/solde_edit_page.html.twig', [
'form' => $form->createView(),
'title' => $this->translator->trans('Solde de billet au siège')
]);
}
}
......@@ -122,6 +122,12 @@ class Adherent
public function __toString(): string
{
return (!empty($this->getUser() && $this->getUser()->getUsername())?$this->getUser()->getUsername():'Adherent '.$this->getId());
if (!empty($this->getUser()->getLastname().$this->getUser()->getFirstname())) {
return $this->getUser()->getLastname().' '.$this->getUser()->getFirstname();
}
if (!empty($this->getUser()->getUsername())) {
return $this->getUser()->getUsername();
}
return 'Adhérent ['.$this->getId().']';
}
}
......@@ -138,6 +138,16 @@ class Comptoir
}
/**
* @param User[]|ArrayCollection
* @return $this
*/
public function setGestionnaires($gestionnaires): self
{
$this->gestionnaires = $gestionnaires;
return $this;
}
/**
* @param User $gestionnaire
* @return $this
*/
......
......@@ -34,7 +34,6 @@ class TransfertSiegeGroupe extends Transfert
public function getUsersToNotify()
{
// @TODO : notify siege ?
return $this->getDestinataire()->getGestionnaires()->toArray();
return array_merge(['siege'], $this->getDestinataire()->getGestionnaires()->toArray());
}
}
......@@ -107,17 +107,18 @@ class MLCEventListener implements EventSubscriberInterface
public function onFlux(FluxEvent $event)
{
dump("onflux");
foreach ($event->getFlux()->getUsersToNotify() as $user) {
dump($user);
if ($user instanceof User && $user->getAlertemailflux()) {
$this->sendMail($user, $event->getFlux());
} elseif ($user == 'siege') {
$userTable = $this->em->getMetadataFactory()->getMetadataFor(User::class)->getTableName();
$users = $this->em
->createQuery("SELECT u FROM $userTable u WHERE u.roles LIKE :role")
->setParameter('role', '%"ROLE_ADMIN_SIEGE"%')
->getResult();
$users = $this->em->getRepository(User::class)->findByRole('ROLE_ADMIN_SIEGE');
dump($users);
foreach ($users as $userAdminSiege) {
$this->sendMail($userAdminSiege, $event->getFlux());
if ($userAdminSiege->getAlertemailflux()) {
$this->sendMail($userAdminSiege, $event->getFlux());
}
}
}
}
......@@ -125,6 +126,7 @@ class MLCEventListener implements EventSubscriberInterface
private function sendMail(User $user, Flux $flux)
{
// @TODO => un mail différent en fonction du type de flux (et de l'utilisateur ?)
$subject = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NAME_SMALL).' : ';
$mail = (new \Swift_Message($subject))
->setFrom($this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NOTIF_EMAIL))
......
......@@ -19,6 +19,7 @@ use App\Entity\RetraitComptoirAdherent;
use App\Entity\RetraitComptoirPrestataire;
use App\Entity\VenteComptoirAdherent;
use App\Entity\VenteComptoirPrestataire;
use App\Entity\Siege;
use App\Entity\AchatMonnaieAdherent;
use App\Entity\AchatMonnaiePrestataire;
use App\Entity\User;
......@@ -41,11 +42,13 @@ use App\Form\Type\TransfertPrestataireSiegeFormType;
use App\Form\Type\TransfertSiegeGroupeFormType;
use App\Form\Type\RetraitComptoirAdherentFormType;
use App\Form\Type\RetraitComptoirPrestataireFormType;
use App\Form\Type\SoldeSiegeFormType;
use App\Form\Type\VenteComptoirAdherentFormType;
use App\Form\Type\VenteComptoirPrestataireFormType;
use App\Form\Type\AchatMonnaieAdherentFormType;
use App\Form\Type\AchatMonnaiePrestataireFormType;
use App\Form\Type\UserInfosFormType;
use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Form\Type\ChangePasswordFormType;
use Symfony\Component\Form\FormFactoryInterface as FormF;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
......@@ -53,15 +56,17 @@ use Symfony\Component\Routing\RouterInterface;
class FormFactory
{
public $ff;
public $router;
public $session;
private $ff;
private $router;
private $session;
private $em;
public function __construct(FormF $ff, RouterInterface $router, SessionInterface $session)
public function __construct(FormF $ff, RouterInterface $router, SessionInterface $session, EntityManagerInterface $em)
{
$this->ff = $ff;
$this->router = $router;
$this->session = $session;
$this->em = $em;
}
public function getUserInfosForm(User $user)
......@@ -290,6 +295,17 @@ class FormFactory
return $form->createView();
}
public function getSoldeSiegeForm(User $user)
{
if (empty($user) || !$user->hasRole('ROLE_ADMIN_SIEGE')) {
throw new \Exception("[FORM 16] Opération impossible !");
}
$siege = $this->em->getRepository(Siege::class)->findOneById(1);
$form = $this->ff->create(SoldeSiegeFormType::class, $siege, array('action' => $this->router->generate('soldeSiege')));
return $form->createView();
}
public function getAchatMonnaieAdherentForm(User $user)
{
if (empty($user) || empty($user->getAdherent())) {
......@@ -302,7 +318,6 @@ class FormFactory
return $form->createView();
}
public function getAchatMonnaiePrestataireForm(User $user)
{
if (empty($user) || empty($this->session->get('_prestagere'))) {
......
......@@ -31,7 +31,7 @@ class AddCotisationFormType extends AbstractType
{
$now = new \DateTime();
$flux = $options['data'];
if (empty($this->security) && !empty($this->security->getUser())) {
if (empty($this->security) || empty($this->security->getUser())) {
throw new \Exception("Opération impossible ! Utilisateur non connecté !");
}
$builder
......
......@@ -40,7 +40,7 @@ class AdherentCotiserFormType extends CotiserFormType
{
$now = new \DateTime();
if (empty($this->security) && !empty($this->security->getUser())) {
if (empty($this->security) || empty($this->security->getUser())) {
throw new \Exception("Opération impossible ! Utilisateur non connecté !");
}
$builder
......
......@@ -40,7 +40,7 @@ class CotiserFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
if (empty($this->security) && !empty($this->security->getUser())) {
if (empty($this->security) || empty($this->security->getUser())) {
throw new \Exception("Opération impossible ! Utilisateur non connecté !");
}
$now = new \DateTime();
......
<?php
namespace App\Form\Type;
use App\Entity\Siege;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;
class SoldeSiegeFormType extends AbstractType
{
protected $security;
public function __construct(Security $security)
{
$this->security = $security;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
if (empty($this->security->getUser())) {
throw new \Exception("[FORM SOLDE SIEGE EDIT] Opération impossible !");
}
$builder
->add('compte', MoneyType::class, array(
'label' => 'Solde :',
'required' => true
))
->add('save', SubmitType::class, ['label' => "Valider"])
;
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'class' => Siege::class,
));
}
public function getBlockPrefix()
{
return 'formSoldeSiege';
}
}
......@@ -122,7 +122,7 @@ class UnitOfWorkListener implements EventSubscriber
}
}
if ($hasRemovedRoleAdminSiege) {
$usersAdminSiege = $this->em->getRepository(User::class)->findByRole('ROLE_SUPER_ADMIN');
$usersAdminSiege = $this->em->getRepository(User::class)->findByRole('ROLE_ADMIN_SIEGE');
if (count($usersAdminSiege) <= 1) {
$this->session->getFlashBag()->add('error', 'Impossible de désactiver ou supprimer le dernier utilisateur ADMIN SIEGE, ajoutez en un autre avant !');
$uow->detach($entity);
......@@ -140,7 +140,7 @@ class UnitOfWorkListener implements EventSubscriber
}
}
if ($entity->hasRole('ROLE_ADMIN_SIEGE')) {
$usersAdminSiege = $this->em->getRepository(User::class)->findByRole('ROLE_SUPER_ADMIN');
$usersAdminSiege = $this->em->getRepository(User::class)->findByRole('ROLE_ADMIN_SIEGE');
if (count($usersAdminSiege) <= 1) {
$this->session->getFlashBag()->add('error', 'Impossible de désactiver ou supprimer le dernier utilisateur ADMIN SIEGE, ajoutez en un autre avant !');
$uow->detach($entity);
......
......@@ -26,10 +26,11 @@ class UserRepository extends ServiceEntityRepository
{
$qb = $this->createQueryBuilder('p');
return $qb
->leftjoin('p.user', 'u')
->where('p.enabled = :enabled')
->where('u.enabled = :enabled')
->setParameter('enabled', true)
->orderBy('u.lastname', 'ASC')
->addOrderBy('u.firstname', 'ASC')
->addOrderBy('u.username', 'ASC')
->getQuery()
->getResult()
;
......@@ -45,8 +46,11 @@ class UserRepository extends ServiceEntityRepository
$qb = $this->_em->createQueryBuilder();
$qb->select('u')
->from($this->_entityName, 'u')
->leftjoin('u.groups', 'g')
->where('u.roles LIKE :roles')
->setParameter('roles', '%"'.$role.'"%');
->orWhere('g.roles LIKE :roles')
->setParameter('roles', '%"'.$role.'"%')
;
return $qb->getQuery()->getResult();
}
......
......@@ -42,6 +42,7 @@ class FormExtension extends AbstractExtension
new \Twig_SimpleFunction('getTransfertGroupeComptoirForm', array($this, 'getTransfertGroupeComptoirForm')),
new \Twig_SimpleFunction('getTransfertSiegeGroupeForm', array($this, 'getTransfertSiegeGroupeForm')),
new \Twig_SimpleFunction('getTransfertGroupeSiegeForm', array($this, 'getTransfertGroupeSiegeForm')),
new \Twig_SimpleFunction('getSoldeSiegeForm', array($this, 'getSoldeSiegeForm')),
new \Twig_SimpleFunction('getAchatMonnaieAdherentForm', array($this, 'getAchatMonnaieAdherentForm')),
new \Twig_SimpleFunction('getAchatMonnaiePrestataireForm', array($this, 'getAchatMonnaiePrestataireForm')),
];
......@@ -123,6 +124,9 @@ class FormExtension extends AbstractExtension
{
return $this->container->get('app.formfactory')->getTransfertGroupeSiegeForm($user);
}
public function getSoldeSiegeForm(User $user)
{
return $this->container->get('app.formfactory')->getSoldeSiegeForm($user);
public function getAchatMonnaieAdherentForm(User $user)
{
return $this->container->get('app.formfactory')->getAchatMonnaieAdherentForm($user);
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{'Virement vers un adhérent'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{'Virement vers un adhérent'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransactionAdherentAdherentForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{'Virement vers un prestataire'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{'Virement vers un prestataire'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransactionAdherentPrestataireForm(app.user) %}
......
......@@ -22,7 +22,7 @@
{% endfor %}
</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') }}'>
{{ 'Cotiser en MLC'|trans }}
</a>
......
{% 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%}
{%- spaceless %}
{% if value %}
......
......@@ -7,7 +7,7 @@
{{ 'RETOUR SUPER ADMIN'|trans }}
</a>
</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'>
{% if isDevFixture('user_prestataire') %}
<a class='btn btn-xs m-1 btn-primary' href='{{path('index', [], true)}}?_switch_user=user_prestataire'>
......@@ -61,7 +61,7 @@
{# ACTIONS PRINCIPALES POUR CHAQUE UTILISATEUR CONNECTE #}
<div id="accordion">
{% 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 compte = siege.getCompte() %}
......@@ -71,15 +71,16 @@
{% include 'block/solde.html.twig' with {'compte': siege.getCompteNantie(), 'soldelabel': 'Monnaie nantie'} %}
{% 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 app.user.isGranted('ROLE_REDACTEUR') %}
{% elseif app.user and is_granted('ROLE_REDACTEUR') %}
{% include 'block/userinfos.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 compte = siege.getCompte() %}
......@@ -89,11 +90,11 @@
{% include 'block/userpassword.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' %}
{% elseif app.user and app.user.isGranted('ROLE_GESTION_GROUPE') %}
{% elseif app.user and is_granted('ROLE_GESTION_GROUPE') %}
{% if getCurrentGroupe() != null %}
{% set compte = getCurrentGroupe().compte %}
......@@ -107,7 +108,7 @@
{% include 'groupe/block/transaction_comptoir.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 %}
{% set compte = getCurrentComptoir().compte %}
......@@ -124,13 +125,13 @@
{% include 'comptoir/block/retrait_adherent.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 'block/userinfos.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 compte = siege.getCompte() %}
......@@ -140,7 +141,7 @@
{% include 'block/userinfos.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 %}
{% include 'block/solde.html.twig' with {'compte': getCurrentPrestataire().ecompte, 'soldelabel': esoldelabel} %}
......@@ -161,7 +162,7 @@
{% include 'presta/block/reconversion.html.twig' %}
{% 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 %}
{% include 'block/solde.html.twig' with {'compte': app.user.adherent.ecompte, 'soldelabel': esoldelabel} %}
......
......@@ -25,7 +25,7 @@
{{ tree.menu(menuItems, currentPath) }}
{% endif %}
{# 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">
<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 %}
......@@ -63,9 +63,9 @@
</a>
<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 ? #}
{% 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>
{% 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>
{% elseif getCurrentGroupe() != null %}
<b class="dropdown-item bg-primary text-white"> Compte : {{getCurrentGroupe().compte }}</b>
......
......@@ -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>
</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>
<i class="fa fa-check"> </i> {{ showMlcStats('comptoir') }} <a href="{{ path('comptoirs_liste') }}" title="{{ 'Nombre de comptoirs'|trans }}">{{ 'comptoirs'|trans }}</a>
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ "Retrait d'un adhérent"|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ "Retrait d'un adhérent"|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getRetraitComptoirToXForm(app.user, 'adherent') %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ "Retrait d'un prestataire"|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ "Retrait d'un prestataire"|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getRetraitComptoirToXForm(app.user, 'prestataire') %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ 'Vente à un adhérent'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ 'Vente à un adhérent'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getVenteComptoirToXForm(app.user, 'adherent') %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ 'Vente à un prestataire'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ 'Vente à un prestataire'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getVenteComptoirToXForm(app.user, 'prestataire') %}
......
......@@ -4,10 +4,10 @@
<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>
<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>
<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>
<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE|default('') }}</b></h5>
{% endif %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ 'Transfert au comptoir'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ 'Transfert au comptoir'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransfertGroupeComptoirForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> Virement vers un adhérent
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> Virement vers un adhérent
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransactionPrestataireAdherentForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> Virement vers un prestataire
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> Virement vers un prestataire
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransactionPrestatairePrestataireForm(app.user) %}
......
{% extends 'block/block_collapse.html.twig' %}
{% block blocktitle %}
<i class="fa fa-euro fa-euro-sign mr-4"></i> Solde de billets au siège
{% endblock blocktitle %}
{% block blocksubtitle %}
{% endblock blocksubtitle %}
{% block blockcontent %}
{% set form = getSoldeSiegeForm(app.user) %}
{{ form_start(form) }}
{% if form.compte is defined %}
{{ form_row(form.compte) }}
{% endif %}
{% if form.save is defined %}
{{ form_row(form.save) }}
{% endif %}
{{ form_end(form) }}
{% endblock blockcontent %}
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container groupeshow mt-5 mb-5' style='max-width:800px;'>
<h4>{{ title }} :</h4>
{{ form_start(form) }}
{% if form.compte is defined %}
{{ form_row(form.compte) }}
{% endif %}
{% if form.save is defined %}
{{ form_row(form.save) }}
{% endif %}
{{ form_end(form) }}
</div>
{% endblock %}
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ 'Transfert du groupe au siège'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ 'Transfert du groupe au siège'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransfertGroupeSiegeForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %}
<i class="fa fa-exchange-alt mr-4"></i> {{ 'Transfert à un groupe'|trans }}
<i class="fa fa-exchange fa-exchange-alt mr-4"></i> {{ 'Transfert à un groupe'|trans }}
{% endblock blocktitle %}
{% block blockcontent %}
{% set form = getTransfertSiegeGroupeForm(app.user) %}
......
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