Commit f778573e by Julien Jorry

Fix : Suppression de JWT Auth + ajout du .env.dist + Ajout de l'édition du…

Fix : Suppression de JWT Auth + ajout du .env.dist + Ajout de l'édition du compte de billet au siège par l'Admin Siège + fix icone sur les block transaction + fix erreur sur une vérification dans les cotisations
parent cff21086
# 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 ###
...@@ -11,18 +11,20 @@ ...@@ -11,18 +11,20 @@
} }
], ],
"require": { "require": {
"php": "^7.1.3", "php": "^7.4",
"ext-ctype": "*", "ext-ctype": "*",
"ext-iconv": "*", "ext-iconv": "*",
"ext-intl" : "*",
"api-platform/api-pack": "^1.2", "api-platform/api-pack": "^1.2",
"beberlei/doctrineextensions": "^1.2", "beberlei/doctrineextensions": "^1.2",
"doctrine/annotations": "^1.8", "doctrine/annotations": "^1.8",
"doctrine/migrations": "^3.0",
"doctrine/doctrine-migrations-bundle": "^3.0",
"friendsofsymfony/user-bundle": "^2.1", "friendsofsymfony/user-bundle": "^2.1",
"geocoder-php/cache-provider": "^4.1", "geocoder-php/cache-provider": "^4.1",
"geocoder-php/google-maps-provider": "^4.3", "geocoder-php/google-maps-provider": "^4.3",
"geocoder-php/nominatim-provider": "^5.0", "geocoder-php/nominatim-provider": "^5.0",
"knplabs/knp-paginator-bundle": "^2.8", "knplabs/knp-paginator-bundle": "^2.8",
"lexik/jwt-authentication-bundle": "^2.6",
"lexik/translation-bundle": "~4.0", "lexik/translation-bundle": "~4.0",
"liip/imagine-bundle": "^2.1", "liip/imagine-bundle": "^2.1",
"nelmio/api-doc-bundle": "^3.3", "nelmio/api-doc-bundle": "^3.3",
......
...@@ -49,5 +49,4 @@ return [ ...@@ -49,5 +49,4 @@ return [
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Sonata\ClassificationBundle\SonataClassificationBundle::class => ['all' => true], Sonata\ClassificationBundle\SonataClassificationBundle::class => ['all' => true],
App\Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle::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: ...@@ -39,26 +39,7 @@ security:
dev: dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/ pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false security: false
# -> custom firewall for the admin area of the URL ## API WITH JWT AUTH (login/password)
# 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
# login: # login:
# pattern: ^/api/login # pattern: ^/api/login
# stateless: true # stateless: true
......
...@@ -9,12 +9,6 @@ ...@@ -9,12 +9,6 @@
> >
<php> <php>
<ini name="error_reporting" value="-1" /> <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> </php>
<testsuites> <testsuites>
......
...@@ -99,13 +99,13 @@ class GroupeAdmin extends AbstractAdmin ...@@ -99,13 +99,13 @@ class GroupeAdmin extends AbstractAdmin
public function postPersist($object) public function postPersist($object)
{ {
$this->addFlash( // $this->addFlash(
'sonata_flash_success', // 'sonata_flash_success',
$this->trans( // $this->trans(
"Après avoir créer le groupe %name%, il est conseiller d'ajouter un gestionnaire de groupe", // "Après avoir créer le groupe %name%, il est conseiller d'ajouter un gestionnaire de groupe",
['%name%' => $this->escapeHtml($this->admin->toString($object))] // ['%name%' => $this->escapeHtml($this->admin->toString($object))]
) // )
); // );
} }
/** /**
......
...@@ -19,6 +19,7 @@ use App\Form\Type\TransactionAdherentPrestataireFormType; ...@@ -19,6 +19,7 @@ use App\Form\Type\TransactionAdherentPrestataireFormType;
use App\Form\Type\TransfertGroupeComptoirFormType; use App\Form\Type\TransfertGroupeComptoirFormType;
use App\Form\Type\TransfertGroupeSiegeFormType; use App\Form\Type\TransfertGroupeSiegeFormType;
use App\Form\Type\TransfertSiegeGroupeFormType; use App\Form\Type\TransfertSiegeGroupeFormType;
use App\Form\Type\SoldeSiegeFormType;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Model\UserManagerInterface; use FOS\UserBundle\Model\UserManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
...@@ -94,4 +95,35 @@ class UserSiegeController extends FluxController ...@@ -94,4 +95,35 @@ class UserSiegeController extends FluxController
$this->translator->trans('Transaction du groupe au siège') $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 ...@@ -122,6 +122,12 @@ class Adherent
public function __toString(): string 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 ...@@ -138,6 +138,16 @@ class Comptoir
} }
/** /**
* @param User[]|ArrayCollection
* @return $this
*/
public function setGestionnaires($gestionnaires): self
{
$this->gestionnaires = $gestionnaires;
return $this;
}
/**
* @param User $gestionnaire * @param User $gestionnaire
* @return $this * @return $this
*/ */
......
...@@ -34,7 +34,6 @@ class TransfertSiegeGroupe extends Transfert ...@@ -34,7 +34,6 @@ class TransfertSiegeGroupe extends Transfert
public function getUsersToNotify() public function getUsersToNotify()
{ {
// @TODO : notify siege ? return array_merge(['siege'], $this->getDestinataire()->getGestionnaires()->toArray());
return $this->getDestinataire()->getGestionnaires()->toArray();
} }
} }
...@@ -107,17 +107,18 @@ class MLCEventListener implements EventSubscriberInterface ...@@ -107,17 +107,18 @@ class MLCEventListener implements EventSubscriberInterface
public function onFlux(FluxEvent $event) public function onFlux(FluxEvent $event)
{ {
dump("onflux");
foreach ($event->getFlux()->getUsersToNotify() as $user) { foreach ($event->getFlux()->getUsersToNotify() as $user) {
dump($user);
if ($user instanceof User && $user->getAlertemailflux()) { if ($user instanceof User && $user->getAlertemailflux()) {
$this->sendMail($user, $event->getFlux()); $this->sendMail($user, $event->getFlux());
} elseif ($user == 'siege') { } elseif ($user == 'siege') {
$userTable = $this->em->getMetadataFactory()->getMetadataFor(User::class)->getTableName(); $users = $this->em->getRepository(User::class)->findByRole('ROLE_ADMIN_SIEGE');
$users = $this->em dump($users);
->createQuery("SELECT u FROM $userTable u WHERE u.roles LIKE :role")
->setParameter('role', '%"ROLE_ADMIN_SIEGE"%')
->getResult();
foreach ($users as $userAdminSiege) { 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 ...@@ -125,6 +126,7 @@ class MLCEventListener implements EventSubscriberInterface
private function sendMail(User $user, Flux $flux) 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).' : '; $subject = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NAME_SMALL).' : ';
$mail = (new \Swift_Message($subject)) $mail = (new \Swift_Message($subject))
->setFrom($this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NOTIF_EMAIL)) ->setFrom($this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_NOTIF_EMAIL))
......
...@@ -19,6 +19,7 @@ use App\Entity\RetraitComptoirAdherent; ...@@ -19,6 +19,7 @@ use App\Entity\RetraitComptoirAdherent;
use App\Entity\RetraitComptoirPrestataire; use App\Entity\RetraitComptoirPrestataire;
use App\Entity\VenteComptoirAdherent; use App\Entity\VenteComptoirAdherent;
use App\Entity\VenteComptoirPrestataire; use App\Entity\VenteComptoirPrestataire;
use App\Entity\Siege;
use App\Entity\User; use App\Entity\User;
use App\Enum\MoyenEnum; use App\Enum\MoyenEnum;
use App\Form\Type\AdherentInfosFormType; use App\Form\Type\AdherentInfosFormType;
...@@ -39,9 +40,11 @@ use App\Form\Type\TransfertPrestataireSiegeFormType; ...@@ -39,9 +40,11 @@ use App\Form\Type\TransfertPrestataireSiegeFormType;
use App\Form\Type\TransfertSiegeGroupeFormType; use App\Form\Type\TransfertSiegeGroupeFormType;
use App\Form\Type\RetraitComptoirAdherentFormType; use App\Form\Type\RetraitComptoirAdherentFormType;
use App\Form\Type\RetraitComptoirPrestataireFormType; use App\Form\Type\RetraitComptoirPrestataireFormType;
use App\Form\Type\SoldeSiegeFormType;
use App\Form\Type\VenteComptoirAdherentFormType; use App\Form\Type\VenteComptoirAdherentFormType;
use App\Form\Type\VenteComptoirPrestataireFormType; use App\Form\Type\VenteComptoirPrestataireFormType;
use App\Form\Type\UserInfosFormType; use App\Form\Type\UserInfosFormType;
use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Form\Type\ChangePasswordFormType; use FOS\UserBundle\Form\Type\ChangePasswordFormType;
use Symfony\Component\Form\FormFactoryInterface as FormF; use Symfony\Component\Form\FormFactoryInterface as FormF;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
...@@ -49,15 +52,17 @@ use Symfony\Component\Routing\RouterInterface; ...@@ -49,15 +52,17 @@ use Symfony\Component\Routing\RouterInterface;
class FormFactory class FormFactory
{ {
public $ff; private $ff;
public $router; private $router;
public $session; 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->ff = $ff;
$this->router = $router; $this->router = $router;
$this->session = $session; $this->session = $session;
$this->em = $em;
} }
public function getUserInfosForm(User $user) public function getUserInfosForm(User $user)
...@@ -285,4 +290,15 @@ class FormFactory ...@@ -285,4 +290,15 @@ class FormFactory
return $form->createView(); 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();
}
} }
...@@ -31,7 +31,7 @@ class AddCotisationFormType extends AbstractType ...@@ -31,7 +31,7 @@ class AddCotisationFormType extends AbstractType
{ {
$now = new \DateTime(); $now = new \DateTime();
$flux = $options['data']; $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é !"); throw new \Exception("Opération impossible ! Utilisateur non connecté !");
} }
$builder $builder
......
...@@ -40,7 +40,7 @@ class AdherentCotiserFormType extends CotiserFormType ...@@ -40,7 +40,7 @@ class AdherentCotiserFormType extends CotiserFormType
{ {
$now = new \DateTime(); $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é !"); throw new \Exception("Opération impossible ! Utilisateur non connecté !");
} }
$builder $builder
......
...@@ -40,7 +40,7 @@ class CotiserFormType extends AbstractType ...@@ -40,7 +40,7 @@ class CotiserFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) 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é !"); throw new \Exception("Opération impossible ! Utilisateur non connecté !");
} }
$now = new \DateTime(); $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 ...@@ -122,7 +122,7 @@ class UnitOfWorkListener implements EventSubscriber
} }
} }
if ($hasRemovedRoleAdminSiege) { 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) { 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 !'); $this->session->getFlashBag()->add('error', 'Impossible de désactiver ou supprimer le dernier utilisateur ADMIN SIEGE, ajoutez en un autre avant !');
$uow->detach($entity); $uow->detach($entity);
...@@ -140,7 +140,7 @@ class UnitOfWorkListener implements EventSubscriber ...@@ -140,7 +140,7 @@ class UnitOfWorkListener implements EventSubscriber
} }
} }
if ($entity->hasRole('ROLE_ADMIN_SIEGE')) { 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) { 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 !'); $this->session->getFlashBag()->add('error', 'Impossible de désactiver ou supprimer le dernier utilisateur ADMIN SIEGE, ajoutez en un autre avant !');
$uow->detach($entity); $uow->detach($entity);
......
...@@ -26,10 +26,11 @@ class UserRepository extends ServiceEntityRepository ...@@ -26,10 +26,11 @@ class UserRepository extends ServiceEntityRepository
{ {
$qb = $this->createQueryBuilder('p'); $qb = $this->createQueryBuilder('p');
return $qb return $qb
->leftjoin('p.user', 'u') ->where('u.enabled = :enabled')
->where('p.enabled = :enabled')
->setParameter('enabled', true) ->setParameter('enabled', true)
->orderBy('u.lastname', 'ASC') ->orderBy('u.lastname', 'ASC')
->addOrderBy('u.firstname', 'ASC')
->addOrderBy('u.username', 'ASC')
->getQuery() ->getQuery()
->getResult() ->getResult()
; ;
...@@ -45,8 +46,11 @@ class UserRepository extends ServiceEntityRepository ...@@ -45,8 +46,11 @@ class UserRepository extends ServiceEntityRepository
$qb = $this->_em->createQueryBuilder(); $qb = $this->_em->createQueryBuilder();
$qb->select('u') $qb->select('u')
->from($this->_entityName, 'u') ->from($this->_entityName, 'u')
->leftjoin('u.groups', 'g')
->where('u.roles LIKE :roles') ->where('u.roles LIKE :roles')
->setParameter('roles', '%"'.$role.'"%'); ->orWhere('g.roles LIKE :roles')
->setParameter('roles', '%"'.$role.'"%')
;
return $qb->getQuery()->getResult(); return $qb->getQuery()->getResult();
} }
......
...@@ -42,6 +42,7 @@ class FormExtension extends AbstractExtension ...@@ -42,6 +42,7 @@ class FormExtension extends AbstractExtension
new \Twig_SimpleFunction('getTransfertGroupeComptoirForm', array($this, 'getTransfertGroupeComptoirForm')), new \Twig_SimpleFunction('getTransfertGroupeComptoirForm', array($this, 'getTransfertGroupeComptoirForm')),
new \Twig_SimpleFunction('getTransfertSiegeGroupeForm', array($this, 'getTransfertSiegeGroupeForm')), new \Twig_SimpleFunction('getTransfertSiegeGroupeForm', array($this, 'getTransfertSiegeGroupeForm')),
new \Twig_SimpleFunction('getTransfertGroupeSiegeForm', array($this, 'getTransfertGroupeSiegeForm')), new \Twig_SimpleFunction('getTransfertGroupeSiegeForm', array($this, 'getTransfertGroupeSiegeForm')),
new \Twig_SimpleFunction('getSoldeSiegeForm', array($this, 'getSoldeSiegeForm')),
]; ];
} }
...@@ -121,4 +122,8 @@ class FormExtension extends AbstractExtension ...@@ -121,4 +122,8 @@ class FormExtension extends AbstractExtension
{ {
return $this->container->get('app.formfactory')->getTransfertGroupeSiegeForm($user); return $this->container->get('app.formfactory')->getTransfertGroupeSiegeForm($user);
} }
public function getSoldeSiegeForm(User $user)
{
return $this->container->get('app.formfactory')->getSoldeSiegeForm($user);
}
} }
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransactionAdherentAdherentForm(app.user) %} {% set form = getTransactionAdherentAdherentForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransactionAdherentPrestataireForm(app.user) %} {% set form = getTransactionAdherentPrestataireForm(app.user) %}
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
{% include 'block/solde.html.twig' with {'compte': siege.getCompteNantie(), 'soldelabel': 'Monnaie nantie'} %} {% include 'block/solde.html.twig' with {'compte': siege.getCompteNantie(), 'soldelabel': 'Monnaie nantie'} %}
{% include 'block/userinfos.html.twig' %} {% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.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_siegegroupe.html.twig' %}
{% include 'siege/block/transfert_groupesiege.html.twig' %} {% include 'siege/block/transfert_groupesiege.html.twig' %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getRetraitComptoirToXForm(app.user, 'adherent') %} {% set form = getRetraitComptoirToXForm(app.user, 'adherent') %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getRetraitComptoirToXForm(app.user, 'prestataire') %} {% set form = getRetraitComptoirToXForm(app.user, 'prestataire') %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getVenteComptoirToXForm(app.user, 'adherent') %} {% set form = getVenteComptoirToXForm(app.user, 'adherent') %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getVenteComptoirToXForm(app.user, 'prestataire') %} {% set form = getVenteComptoirToXForm(app.user, 'prestataire') %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransfertGroupeComptoirForm(app.user) %} {% set form = getTransfertGroupeComptoirForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransactionPrestataireAdherentForm(app.user) %} {% set form = getTransactionPrestataireAdherentForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransactionPrestatairePrestataireForm(app.user) %} {% 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' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransfertGroupeSiegeForm(app.user) %} {% set form = getTransfertGroupeSiegeForm(app.user) %}
......
{% extends 'block/onetransaction.html.twig' %} {% extends 'block/onetransaction.html.twig' %}
{% block blocktitle %} {% 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 %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set form = getTransfertSiegeGroupeForm(app.user) %} {% 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