Commit 4fb591c2 by Julien Jorry

BIG UPDATE : BO menu + debug + optims + FRONT OFFICE start with controller +…

BIG UPDATE : BO menu + debug + optims + FRONT OFFICE start with controller + templates + Cotisation in flux + Form types adherer / cotisation / test transfert
parent 2a5984da
/**
* STYLES IMPORTES DE BOOTSTRAP
*/
@import "~bootstrap/scss/bootstrap";
@import "~bootstrap/scss/bootstrap-grid";
/**
* STYLES DE L'APPLICATION DE L'OUTIL DE GESTION DE MONNAIE LOCALE COMPLEMENTAIRE
*/
// Modifier les couleurs de l'application :
// $primary: darken(#428bca, 20%);
// $secondary: darken(#428bca, 20%);
......@@ -7,6 +7,24 @@
// any CSS you require will output into a single css file (app.css in this case)
require('../css/app.css');
require('../css/global.scss');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
// var $ = require('jquery');
// require jQuery normally
const $ = require('jquery');
// create global $ and jQuery variables
global.$ = global.jQuery = $;
// JS is equivalent to the normal "bootstrap" package
// no need to set this to a variable, just require it
// require('popper.js/dist/popper.js');
require('bootstrap');
require('../js/flash-messages.js');
const mlc = require('../js/mlc.js');
// can be use to sort with drag'n drop in sonata admin
// require('../../public/bundles/pixsortablebehavior/js/init.js');
$('#flash-messages').flashNotification('init');
\ No newline at end of file
/* JAVASCRIPT PERMETTANT L'AFFICHAGE DE MESSAGE FLASH / NOTIFICATION */
(function($) {
var methods = {
init: function(options) {
methods.settings = $.extend({}, $.fn.flashNotification.defaults, options);
setTimeout(
function() {
$('.alert')
.show('slow')
.delay(methods.settings.hideDelay)
.hide('fast')
;
},
500
);
methods.listenIncomingMessages();
},
/**
* Listen to AJAX responses and display messages if they contain some
*/
listenIncomingMessages: function() {
$(document).ajaxComplete(function(event, xhr, settings) {
var data = $.parseJSON(xhr.responseText);
if (data.messages) {
var messages = data.messages;
var i;
if (messages.error) {
for (i = 0; i < messages.error.length; i++) {
methods.addError(messages.error[i]);
}
}
if (messages.success) {
for (i = 0; i < messages.success.length; i++) {
methods.addSuccess(messages.success[i]);
}
}
if (messages.info) {
for (i = 0; i < messages.info.length; i++) {
methods.addInfo(messages.info[i]);
}
}
}
});
},
addSuccess: function(message) {
var flashMessageElt = methods.getBasicFlash(message).addClass('alert-success');
methods.addToList(flashMessageElt);
methods.display(flashMessageElt);
},
addError: function(message) {
var flashMessageElt = methods.getBasicFlash(message).addClass('alert-error');
methods.addToList(flashMessageElt);
methods.display(flashMessageElt);
},
addInfo: function(message) {
var flashMessageElt = methods.getBasicFlash(message).addClass('alert-info');
methods.addToList(flashMessageElt);
methods.display(flashMessageElt);
},
getBasicFlash: function(message) {
var flashMessageElt = $('<div></div>')
.hide()
.addClass('alert')
.append(methods.getCloseButton())
.append($('<div></div>').html(message))
;
return flashMessageElt;
},
getCloseButton: function() {
var closeButtonElt = $('<button></button>')
.addClass('close')
.attr('data-dismiss', 'alert')
.html('&times')
;
return closeButtonElt;
},
addToList: function(flashMessageElt) {
flashMessageElt.appendTo($('#flash-messages'));
},
display: function(flashMessageElt) {
setTimeout(
function() {
flashMessageElt
.show('slow')
.delay(methods.settings.hideDelay)
.hide('fast', function() { $(this).remove(); } )
;
},
500
);
}
};
$.fn.flashNotification = function(method) {
// Method calling logic
if (methods[method]) {
return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || ! method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.flashNotification');
}
};
$.fn.flashNotification.defaults = {
'hideDelay' : 4500,
'autoHide' : true,
'animate' : true
};
})(jQuery);
\ No newline at end of file
/**
* JAVASCRIPT PRINCIPAL DE L'OUTIL DE GESTION DE MONNAIE LOCALE COMPLEMENTAIRE
*
* Mettre ici les javscripts nécessaires à votre application !
*/
\ No newline at end of file
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4f9f14bbf95662cc721ee28c2bf26582",
"content-hash": "99c6a787e9c5545a79d54dc3619b7cae",
"packages": [
{
"name": "behat/transliterator",
......@@ -4163,6 +4163,61 @@
"time": "2018-03-26T15:56:52+00:00"
},
{
"name": "prodigious/sonata-menu-bundle",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/nan-guo/Sonata-Menu-Bundle.git",
"reference": "0c1249149530cbe7dbdcb0678667d993a1c03956"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nan-guo/Sonata-Menu-Bundle/zipball/0c1249149530cbe7dbdcb0678667d993a1c03956",
"reference": "0c1249149530cbe7dbdcb0678667d993a1c03956",
"shasum": ""
},
"require": {
"doctrine/doctrine-bundle": "~1.3",
"php": ">=7.1.3",
"sonata-project/admin-bundle": "^3.2",
"sonata-project/doctrine-orm-admin-bundle": "^3.1",
"symfony/framework-bundle": "^3.0 || ^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"autoload": {
"psr-4": {
"Prodigious\\Sonata\\MenuBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nan GUO",
"email": "guonanhq@gmail.com",
"homepage": "https://github.com/nan-guo/"
},
{
"name": "Prodigious",
"homepage": "http://www.prodigious.com/"
}
],
"description": "This bundle provides menu management by sonata admin bundle (compatible with sonata page bundle).",
"homepage": "https://github.com/nan-guo/SonataMenuBundle",
"keywords": [
"Menu management",
"sonata admin menu bundle"
],
"time": "2018-11-16T15:34:38+00:00"
},
{
"name": "psr/cache",
"version": "1.0.1",
"source": {
......
......@@ -42,5 +42,6 @@ return [
Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true],
Sonata\TranslationBundle\SonataTranslationBundle::class => ['all' => true],
Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true],
Lexik\Bundle\TranslationBundle\LexikTranslationBundle::class => ['all' => true]
Lexik\Bundle\TranslationBundle\LexikTranslationBundle::class => ['all' => true],
Prodigious\Sonata\MenuBundle\ProdigiousSonataMenuBundle::class => ['all' => true],
];
# PARAMETRES DE L'APPLICATION DE GESTION DE MONNAIE LOCALE COMPLEMENTAIRE
# parameters:
# mlc_name: 'Monnaie locale complémentaire' # Nom complet (< 100 caractères)
# mlc_name_small: 'MLC' # Nom court (< 25 caractères)
# slogan: 'Un outil de gestion de la MLC' # Slogan (< 200 caractères)
\ No newline at end of file
......@@ -8,13 +8,14 @@ fos_ck_editor:
default_config: default
configs:
default:
language: fr
# default toolbar plus Format button
# toolbar:
# - [Bold, Italic, Underline, -, Cut, Copy, Paste,
# PasteText, PasteFromWord, -, Undo, Redo, -,
# NumberedList, BulletedList, -, Outdent, Indent, -,
# Blockquote, -, Image, Link, Unlink, Table]
# - [Format, Maximize, Source]
toolbar:
- [Bold, Italic, Underline, -, Cut, Copy, Paste,
PasteText, PasteFromWord, -, Undo, Redo, -,
NumberedList, BulletedList, -, Outdent, Indent, -,
Blockquote, -, Image, Link, Unlink, Table]
- [Format, Maximize, Source]
# filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser
# filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser
......
......@@ -182,6 +182,14 @@ sonata_admin:
# icon: '<i class="fa fa-list"></i>'
# items:
# - admin.flux.gerer
sonata.admin.group.news:
keep_open: false
on_top: true
label: "News"
label_catalogue: SonataAdminBundle
icon: '<i class="fa fa-bars"></i>'
items:
- admin.news.gerer
sonata.admin.group.document:
keep_open: false
on_top: true
......@@ -222,6 +230,14 @@ sonata_admin:
icon: '<i class="fa fa-euro"></i>'
items:
- admin.flux.gerer
sonata.admin.group.menu_builder:
keep_open: false
on_top: true
label: config.label_menu
label_catalogue: ProdigiousSonataMenuBundle
icon: '<i class="fa fa-magic"></i>'
items:
- prodigious_sonata_menu.admin.menu
# Gérer l'affichage du menu de l'admin en fonction des roles
# groups:
......
twig:
default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
\ No newline at end of file
strict_variables: '%kernel.debug%'
form_themes: ['bootstrap_4_layout.html.twig']
\ No newline at end of file
......@@ -7,6 +7,10 @@ parameters:
locale: 'en'
sonata.user.admin.user.controller: 'App\Controller\CRUD\CRUDController'
sonata.media.admin.media.class: 'App\Admin\MediaAdmin'
mlc_name: 'Monnaie locale complémentaire' # Nom complet (< 100 caractères)
mlc_name_small: 'MLC' # Nom court (< 25 caractères)
slogan: 'Un outil de gestion de la MLC' # Slogan (< 200 caractères)
cotisation_montant: 10
services:
# default configuration for services in *this* file
......@@ -21,7 +25,7 @@ services:
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/*'
exclude: '../src/{DependencyInjection,Listener,Entity,Migrations,Tests,Kernel.php}'
exclude: '../src/{DependencyInjection,Listener,Entity,Migrations,Tests,Twig,Kernel.php}'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
......@@ -51,6 +55,16 @@ services:
autowire: false
arguments: ['@router']
app.twig.main.extension:
class: App\Twig\AppExtension
autowire: false
arguments: ["@service_container"]
app.twig.menu.extension:
class: App\Twig\MenuExtension
autowire: false
arguments: ["@doctrine.orm.entity_manager", "@prodigious_sonata_menu.manager"]
App\Controller\RegistrationController:
autowire: false
......@@ -154,6 +168,16 @@ services:
label: "AMAP / Marchés"
public: true
admin.news.gerer:
class: App\Admin\NewsAdmin
arguments: [~, App\Entity\News, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Contenu"
label: "News"
public: true
admin.document.gerer:
class: App\Admin\DocumentAdmin
arguments: [~, App\Entity\Document, ~]
......@@ -202,7 +226,10 @@ services:
manager_type: orm
group: "Flux"
label: "Flux"
pager_type: "simple"
public: true
calls:
- [ setSubClasses, [{transaction: 'App\Entity\Transaction', transfert: 'App\Entity\Transfert', cotisation: 'App\Entity\Cotisation'}]]
# admin.flux.gerer:
# class: App\Admin\FluxAdmin
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,5 +12,10 @@
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"bootstrap": "^4.2.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.7"
}
}
......@@ -130,7 +130,7 @@ class AdherentAdmin extends AbstractAdmin
))
->end()
->with('Cotisation', ['class' => 'col-md-5'])
->add('user.cotisations.first.annee', TextType::class, array('label' => 'Année', 'data' => $now->format('Y')))
->add('user.cotisations.first.cotisationInfos.annee', TextType::class, array('label' => 'Année', 'data' => $now->format('Y')))
->add('user.cotisations.first.montant', TextType::class, array('label' => 'Montant'))
->add('user.cotisations.first.moyen', ChoiceType::class, array(
'required' => true,
......@@ -140,19 +140,19 @@ class AdherentAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice);
},
))
->add('user.cotisations.first.recu', CheckboxType::class, array('label' => 'Reçu'))
->add('user.cotisations.first.cotisationInfos.recu', CheckboxType::class, array('label' => 'Reçu'))
->end();
if (!$this->isCurrentRoute('create')) {
$formMapper
->with('Date', ['class' => 'col-md-5'])
->add('user.cotisations.first.debut', DateType::class, array(
->add('user.cotisations.first.cotisationInfos.debut', DateType::class, array(
'label' => 'Date de début',
'data' => new \DateTime(),
'widget' => 'single_text',
'html5' => false,
'attr' => ['class' => 'js-datepicker'],
))
->add('user.cotisations.first.fin', DateType::class, array(
->add('user.cotisations.first.cotisationInfos.fin', DateType::class, array(
'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text',
......
......@@ -31,8 +31,10 @@ class ComptoirAdmin extends AbstractAdmin
protected function configureFormFields(FormMapper $formMapper)
{
$comptoir = $this->getSubject();
$geoloc = new Geoloc();
$comptoir->setGeoloc($geoloc);
if ($this->isCurrentRoute('create')) {
$geoloc = new Geoloc();
$comptoir->setGeoloc($geoloc);
}
$formMapper
->with('Comptoir', ['class' => 'col-md-8'])
->add('groupe', null, array('label' => 'Groupe local'))
......
......@@ -19,7 +19,7 @@ class CotisationAdherentAdmin extends CotisationAdmin
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$query->leftJoin($query->getRootAliases()[0] . '.user', 'u')
$query->leftJoin($query->getRootAliases()[0] . '.operateur', 'u')
->andWhere('u.adherent IS NOT NULL')
;
return $query;
......@@ -48,7 +48,12 @@ class CotisationAdherentAdmin extends CotisationAdmin
{
$formMapper
->with('Cotisation', ['class' => 'col-md-8'])
->add('user', null, array('label' => 'Adhérent'), array('admin_code' => 'admin.adherent.gerer'))
->add('operateur', null, array(
'label' => 'Adhérent',
'disabled' => true
), array(
'admin_code' => 'admin.adherent.gerer'
))
->end()
;
parent::configureFormFields($formMapper);
......@@ -70,8 +75,8 @@ class CotisationAdherentAdmin extends CotisationAdmin
{
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('user.username', null, array('label' => 'Login'))
->addIdentifier('user.email', null, array('label' => 'Email'));
->addIdentifier('operateur.username', null, array('label' => 'Login'))
->addIdentifier('operateur.email', null, array('label' => 'Email'));
parent::configureListFields($listMapper);
}
}
......@@ -2,6 +2,7 @@
namespace App\Admin;
use App\Entity\Prestataire;
use App\Enum\MoyenEnum;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
......@@ -11,6 +12,7 @@ use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
class CotisationAdmin extends AbstractAdmin
{
......@@ -30,11 +32,11 @@ class CotisationAdmin extends AbstractAdmin
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{
$datagridMapper
->add('annee', null, array('label' => 'Année'))
->add('cotisationInfos.annee', null, array('label' => 'Année'))
->add('montant', null, array('label' => 'Montant'))
->add('recu', null, array('label' => 'Recu ?'))
->add('user.username', null, array('label' => 'Login'))
->add('user.email', null, array('label' => 'Email'))
->add('cotisationInfos.recu', null, array('label' => 'Recu ?'))
->add('operateur.username', null, array('label' => 'Login'))
->add('operateur.email', null, array('label' => 'Email'))
;
}
......@@ -47,7 +49,7 @@ class CotisationAdmin extends AbstractAdmin
$now = new \DateTime();
$formMapper
->with('Cotisation', ['class' => 'col-md-8'])
->add('annee', null, array('label' => 'Année', 'data' => $now->format('Y')))
->add('cotisationInfos.annee', null, array('label' => 'Année', 'data' => $now->format('Y')))
->add('montant', null, array('label' => 'Montant'))
->add('moyen', ChoiceType::class, array(
'required' => true,
......@@ -56,17 +58,17 @@ class CotisationAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice);
},
))
->add('recu', CheckboxType::class, array('label' => 'Reçu'))
->add('cotisationInfos.recu', CheckboxType::class, array('label' => 'Reçu'))
->end()
->with('Date', ['class' => 'col-md-4'])
->add('debut', null, array(
->add('cotisationInfos.debut', DateType::class, array(
'label' => 'Date de début',
'data' => new \DateTime(),
'widget' => 'single_text',
'html5' => false,
'attr' => ['class' => 'js-datepicker'],
))
->add('fin', null, array(
->add('cotisationInfos.fin', DateType::class, array(
'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text',
......@@ -79,7 +81,7 @@ class CotisationAdmin extends AbstractAdmin
protected function configureRoutes(RouteCollection $collection)
{
$collection->remove('edit');
// $collection->remove('edit');
$collection->remove('delete');
}
......@@ -91,9 +93,9 @@ class CotisationAdmin extends AbstractAdmin
unset($this->listModes['mosaic']);
$listMapper
// ->addIdentifier('user')
->addIdentifier('annee')
->addIdentifier('debut')
->addIdentifier('fin')
->addIdentifier('cotisationInfos.annee')
->addIdentifier('cotisationInfos.debut')
->addIdentifier('cotisationInfos.fin')
->addIdentifier('montant')
->addIdentifier('moyen')
->addIdentifier('createdAt')
......
......@@ -19,7 +19,7 @@ class CotisationPrestataireAdmin extends CotisationAdmin
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$query->leftJoin($query->getRootAliases()[0] . '.user', 'u')
$query->leftJoin($query->getRootAliases()[0] . '.operateur', 'u')
->andWhere('u.prestataire IS NOT NULL')
;
return $query;
......@@ -48,7 +48,12 @@ class CotisationPrestataireAdmin extends CotisationAdmin
{
$formMapper
->with('Cotisation', ['class' => 'col-md-8'])
->add('user', null, array('label' => 'Prestataire'), array('admin_code' => 'admin.prestataire.gerer'))
->add('operateur', null, array(
'label' => 'Prestataire',
'disabled' => true
), array(
'admin_code' => 'admin.prestataire.gerer'
))
->end()
;
parent::configureFormFields($formMapper);
......@@ -69,8 +74,8 @@ class CotisationPrestataireAdmin extends CotisationAdmin
{
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('user.username', null, array('label' => 'Login'))
->addIdentifier('user.email', null, array('label' => 'Email'));
->addIdentifier('operateur.username', null, array('label' => 'Login'))
->addIdentifier('operateur.email', null, array('label' => 'Email'));
parent::configureListFields($listMapper);
}
}
......@@ -32,7 +32,7 @@ class FaqAdmin extends AbstractAdmin
->add('name', TextType::class, array(
'label' => 'Titre :'
))
->add('text', CKEditorType::class, array(
->add('content', CKEditorType::class, array(
'label' => 'Texte',
'required' => false
))
......@@ -62,7 +62,7 @@ class FaqAdmin extends AbstractAdmin
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('name', null, array('label' => 'Titre'))
->addIdentifier('text', 'html', array('label' => 'Text'))
->addIdentifier('content', 'html', array('label' => 'Text'))
->addIdentifier('fichier', null, array('label' => 'Fichier'))
->addIdentifier('image', null, array('label' => 'Image'))
->addIdentifier('user', null, array('label' => 'Utilisateur'))
......
......@@ -40,13 +40,8 @@ class FluxAdmin extends AbstractAdmin
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{
$datagridMapper
->add('type', null, array(
'label' => 'Type',
'advanced_filter' => false,
'show_filter' => true
))
->add('transfert_or_transaction', 'doctrine_orm_callback', array(
'label' => "Transfert ou transaction ?",
'label' => "Type",
'callback' => function ($queryBuilder, $alias, $field, $value) {
if (!$value['value']) {
return;
......@@ -60,12 +55,17 @@ class FluxAdmin extends AbstractAdmin
'show_filter' => true,
'field_type' => SChoiceType::class,
'field_options' => array(
'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert'),
'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert', 'Cotisations' => 'cotisation'),
'placeholder' => 'Indifférent',
'expanded' => true,
'multiple' => false
)
))
->add('type', null, array(
'label' => 'Type plus précis',
'advanced_filter' => false,
'show_filter' => true
))
->add('operateur', null, array(
'label' => 'Operateur',
'advanced_filter' => false,
......@@ -85,15 +85,24 @@ class FluxAdmin extends AbstractAdmin
public function getTotalLabel()
{
return $this->translator->trans('Total des transactions :');
return $this->translator->trans('Total :');
}
public function getTotal()
{
$datagrid = $this->getDatagrid();
$datagrid->buildPager();
$query = $datagrid->getQuery();
$query2 = clone $datagrid->getQuery();
$query2
->select('SUM( ' . $query2->getRootAlias() . '.montant) as total')
->setFirstResult(null)
->setMaxResults(null);
$result2 = $query2->execute(array(), \Doctrine\ORM\Query::HYDRATE_SINGLE_SCALAR);
$query = clone $datagrid->getQuery();
$query
->select('SUM( ' . $query->getRootAlias() . '.montant) as total')
->andWhere($query->getRootAlias().".parenttype = :type")
......@@ -104,7 +113,7 @@ class FluxAdmin extends AbstractAdmin
$result = $query->execute(array(), \Doctrine\ORM\Query::HYDRATE_SINGLE_SCALAR);
return $result;
return $result2.' (Transactions: '.$result.')';
}
/**
......@@ -117,8 +126,7 @@ class FluxAdmin extends AbstractAdmin
->addIdentifier('type', null, array('label' => 'Type'))
->addIdentifier('createdAt', null, array('label' => 'Date'))
->addIdentifier('operateur', User::class, array('label' => 'Operateur'))
// ->addIdentifier('expediteur', null, array('label' => 'Expediteur'))
->addIdentifier('expediteur', null, array('label' => 'Expediteur'))//, 'template' => 'block/flux_entity.html.twig'))
->addIdentifier('expediteur', null, array('label' => 'Expediteur'))
->addIdentifier('destinataire', null, array('label' => 'Destinataire'))
->addIdentifier('montant', null, array('label' => 'Montant'))
->addIdentifier('reference', null, array('label' => 'Reference'))
......
<?php
namespace App\Admin;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
class GlobalConfigurationAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureShowFields(ShowMapper $showMapper)
{
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$document = $this->getSubject();
}
protected function configureRoutes(RouteCollection $collection)
{
$collection->remove('delete');
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
}
}
......@@ -35,6 +35,10 @@ class GroupeprestataireAdmin extends AbstractAdmin
{
$groupepresta = $this->getSubject();
$formMapper
->add('type', TextType::class, array(
'label' => 'Type (marche/amap) :',
'required' => true
))
->add('name', TextType::class, array(
'label' => 'Nom du groupe :',
'required' => true
......@@ -65,6 +69,9 @@ class GroupeprestataireAdmin extends AbstractAdmin
->addIdentifier('name', null, array(
'label' => 'Nom du groupe'
))
->addIdentifier('type', null, array(
'label' => 'Type'
))
->addIdentifier('horaires', 'html', array(
'label' => 'Horaires',
'strip' => true,
......
<?php
namespace App\Admin;
use App\Entity\User;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\MediaBundle\Form\Type\MediaType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
class NewsAdmin extends AbstractAdmin
{
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
$document = $this->getSubject();
$formMapper
->add('user', HiddenType::class, array(
'data' => $this->getConfigurationPool()->getContainer()->get('security.token_storage')->getToken()->getUser()->getId(),
'data_class' => null,
'entity_class' => User::class,
'em' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getEntityManager()
))
->add('media', MediaType::class, array(
'provider' => 'sonata.media.provider.file',
'context' => 'document',
'label' => 'Document'
))
->add('name', TextType::class, array(
'label' => 'Titre :'
))
->add('content', CKEditorType::class, array(
'label' => 'Texte',
'required' => false,
))
->add('enabled', CheckboxType::class, array(
'label' => 'Activé ?',
'required' => false,
'label_attr' => array('class' => 'checkbox-inline')
))
->add('visibleByAllGroups', CheckboxType::class, array(
'label' => 'Visible par tous les groupes ?',
'required' => false,
'label_attr' => array('class' => 'checkbox-inline')
))
;
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('name', null, array('label' => 'Titre'))
->addIdentifier('content', 'html', array('truncate' => array('length' => 80), 'label' => 'Description'))
->addIdentifier('media', null, array('label' => 'Fichier'))
->addIdentifier('enabled', null, array('label' => 'Activé', 'datatype' => 'App.Document', 'template' => '@SonataAdmin/Boolean/editable_boolean.html.twig'))
;
}
}
......@@ -24,6 +24,7 @@ use Sonata\MediaBundle\Form\Type\MediaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
......@@ -63,25 +64,30 @@ class PrestataireAdmin extends AbstractAdmin
{
// Initialize prestataire
$presta = $this->getSubject();
$user = $this->userManager->createUser();
$groupe = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Usergroup::class)->findOneByName('Prestataire');
$user->setEnabled(true);
$user->addGroup($groupe);
$user->addRole('ROLE_PRESTATAIRE');
// $presta = new Prestataire();
$presta->setGeoloc(new Geoloc());
$now = new \DateTime();
$cotisation = new Cotisation();
$cotisation->setDebut($now);
$cotisation->setFin(new \DateTime('+ 1 year'));
$user->addCotisation($cotisation);
$user->setPrestataire($presta);
$presta->setUser($user);
if ($this->isCurrentRoute('create')) {
$user = $this->userManager->createUser();
$groupe = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Usergroup::class)->findOneByName('Prestataire');
$user->setEnabled(true);
$user->addGroup($groupe);
$user->addRole('ROLE_PRESTATAIRE');
$user->setPrestataire($presta);
$presta->setUser($user);
}
if (count($presta->getUser()->getCotisations()) <= 0) {
$cotisation = new Cotisation();
$cotisation->setDebut($now);
$cotisation->setFin(new \DateTime('+ 1 year'));
$user->addCotisation($cotisation);
}
if ($presta->getGeoloc() == null) {
$presta->setGeoloc(new Geoloc());
}
// get the current Image instance
$imageHelp = null;
if (!empty($user->getPrestataire()) && !empty($user->getPrestataire()->getMedia())) {
$image = $user->getPrestataire()->getMedia();
if (!empty($presta) && !empty($presta->getMedia())) {
$image = $presta->getMedia();
if ($image && ($webPath = $image->getWebPath())) {
// get the container so the full path to the image can be set
$container = $this->getConfigurationPool()->getContainer();
......@@ -94,6 +100,11 @@ class PrestataireAdmin extends AbstractAdmin
$formMapper
->tab('Prestataire')
->with('Identité', ['class' => 'col-md-7'])
->add('typeprestataire', null, array(
'label' => 'Type :',
'required' => true,
'expanded' => true
))
->add('user.firstname', TextType::class, array(
'label' => 'Prénom :',
'required' => true
......@@ -101,7 +112,16 @@ class PrestataireAdmin extends AbstractAdmin
->add('user.lastname', TextType::class, array(
'label' => 'Nom :',
'required' => true
))
));
if (!$this->isCurrentRoute('create')) {
$formMapper
->add('user.username', TextType::class, array(
'label' => 'Username :',
'required' => true,
'disabled' => true
));
}
$formMapper
->add('user.phone', TextType::class, array(
'label' => 'Téléphone :',
'required' => true
......@@ -119,7 +139,7 @@ class PrestataireAdmin extends AbstractAdmin
))
->end()
->with('Cotisation', ['class' => 'col-md-5'])
->add('user.cotisations.first.annee', TextType::class, array('label' => 'Année', 'data' => $now->format('Y')))
->add('user.cotisations.first.cotisationInfos.annee', TextType::class, array('label' => 'Année', 'data' => $now->format('Y')))
->add('user.cotisations.first.montant', TextType::class, array('label' => 'Montant'))
->add('user.cotisations.first.moyen', ChoiceType::class, array(
'required' => true,
......@@ -129,8 +149,28 @@ class PrestataireAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice);
},
))
->add('user.cotisations.first.recu', CheckboxType::class, array('label' => 'Reçu'))
->end()
->add('user.cotisations.first.cotisationInfos.recu', CheckboxType::class, array('label' => 'Reçu'))
->end();
if (!$this->isCurrentRoute('create')) {
$formMapper
->with('Date', ['class' => 'col-md-5'])
->add('user.cotisations.first.cotisationInfos.debut', DateType::class, array(
'label' => 'Date de début',
'data' => new \DateTime(),
'widget' => 'single_text',
'html5' => false,
'attr' => ['class' => 'js-datepicker'],
))
->add('user.cotisations.first.cotisationInfos.fin', DateType::class, array(
'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text',
'html5' => false,
'attr' => ['class' => 'js-datepicker'],
))
->end();
}
$formMapper
->with('Société', ['class' => 'col-md-7'])
->add('raison', TextType::class, array(
'label' => 'Raison :',
......@@ -228,6 +268,7 @@ class PrestataireAdmin extends AbstractAdmin
{
parent::configureDatagridFilters($datagridMapper);
$datagridMapper
->add('typeprestataire')
->add('raison')
->add('statut')
;
......
<?php
namespace App\Controller;
use App\Entity\Adherent;
use App\Entity\Cotisation;
use App\Entity\Geoloc;
use App\Entity\Usergroup;
use App\Form\Type\AdhererFormType;
use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Model\UserManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class AdherentController extends AbstractController
{
protected $em;
protected $um;
public function __construct(EntityManagerInterface $em, UserManagerInterface $um)
{
$this->em = $em;
$this->um = $um;
}
/**
* @Route("/adherer", name="adherer")
*/
public function adhererAction(Request $request)
{
$adherent = new Adherent();
$user = $this->um->createUser();
$groupe = $this->em->getRepository(Usergroup::class)->findOneByName('Adherent');
$user->setEnabled(true);
$user->addGroup($groupe);
$user->addRole('ROLE_ADHERENT');
$adherent->setEcompte('0');
$user->setAdherent($adherent);
$adherent->setUser($user);
if (count($adherent->getUser()->getCotisations()) <= 0) {
$cotisation = new Cotisation();
$cotisation->setDebut(new \DateTime());
$cotisation->setFin(new \DateTime('+ 1 year'));
$adherent->getUser()->addCotisation($cotisation);
}
if ($adherent->getGeoloc() == null) {
$adherent->setGeoloc(new Geoloc());
}
$form = $this->createForm(AdhererFormType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
}
return $this->render('adherent/adherer.html.twig', array(
'user' => $this->getUser(),
'form' => $form->createView()
));
}
}
......@@ -46,15 +46,15 @@ class AdminController extends Controller
return new JsonResponse(array('status' => $status, 'newvalue' => ($object->isEnabled()?'true':'false')));
}
/**
* Voir tous les dashboards
* Route admin_index
* @Route("/a", name="settings")
*/
public function settings()
{
return $this->render('admin/settings.html.twig', [
'controller_name' => 'AdminController',
]);
}
// /**
// * Voir tous les dashboards
// * Route admin_index
// * @Route("/a", name="settings")
// */
// public function settings()
// {
// return $this->render('admin/settings.html.twig', [
// 'controller_name' => 'AdminController',
// ]);
// }
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class ComptoirController extends AbstractController
{
/**
* @Route("/comptoirs/liste", name="comptoirs_liste")
*/
public function listeComptoirAction()
{
return $this->render('comptoir/liste.html.twig', array(
'user' => $this->getUser()
));
}
/**
* @Route("/comptoirs/carte", name="comptoirs_carte")
*/
public function carteComptoirAction()
{
return $this->render('comptoir/carte.html.twig', array(
'user' => $this->getUser()
));
}
}
<?php
namespace App\Controller;
use App\Entity\Groupeprestataire;
use App\Entity\Prestataire;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
class GroupePrestaController extends AbstractController
{
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/**
* @Route("/groupe/prestataires/{typeslug}/liste", name="groupepresta_liste")
*/
public function listeGroupePrestaAction($typeslug, Request $request)
{
$groupe = $this->em->getRepository(Groupeprestataire::class)->findBy(array('typeslug' => $typeslug, 'enabled' => true));
if (empty($groupes)) {
return $this->redirectToRoute('index');
}
return $this->render('groupepresta/liste.html.twig', array(
'groupes' => $groupes
));
}
/**
* @Route("/groupe/prestataires/{typeslug}/carte", name="groupepresta_carte")
*/
public function carteGroupePrestaAction($typeslug, Request $request)
{
$groupes = $this->em->getRepository(Groupeprestataire::class)->findBy(array('typeslug' => $typeslug, 'enabled' => true));
if (empty($groupes)) {
return $this->redirectToRoute('index');
}
return $this->render('groupepresta/carte.html.twig', array(
'groupes' => $groupes
));
}
}
......@@ -2,8 +2,10 @@
namespace App\Controller;
use App\Entity\Faq;
use App\Entity\User;
use App\Form\Type\TransactionAdherentPrestataireFormType;
use Doctrine\ORM\EntityManagerInterface;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery;
use Nelmio\ApiDocBundle\Annotation\Model;
......@@ -15,6 +17,13 @@ use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/**
* @Route("/", name="index")
*/
......@@ -34,4 +43,45 @@ class IndexController extends AbstractController
'news' => array(),
]);
}
/**
* @Route("/charte", name="charte")
*/
public function charteAction()
{
return $this->render('charte.html.twig', array(
// 'user' => $this->getUser()
));
}
/**
* @Route("/faq", name="faq")
*/
public function faqAction()
{
return $this->render('faq/liste.html.twig', array(
'faqs' => $this->em->getRepository(Faq::class)->findBy(array('enabled' => true), array('createdAt' => 'DESC'))
));
}
/**
* @Route("/faq/{slug}", name="show_faq")
*/
public function showFaqAction(Faq $faq)
{
return $this->render('faq/show.html.twig', array(
'faq' => $faq
));
}
/**
* @Route("/contact", name="contact")
*/
public function contactqAction()
{
return $this->render('contact.html.twig', array(
// 'user' => $this->getUser()
));
}
}
<?php
namespace App\Controller;
use App\Entity\News;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class NewsController extends AbstractController
{
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/**
* @Route("/news", name="news")
*/
public function listeNewsAction()
{
return $this->render('news/liste.html.twig', array(
'news' => $this->em->getRepository(News::class)->findBy(array('enabled' => true), array('createdAt' => 'DESC'))
));
}
/**
* @Route("/news/{slug}", name="news_show")
*/
public function showNewsAction(News $news)
{
return $this->render('news/show.html.twig', array(
'news' => $news
));
}
}
<?php
namespace App\Controller;
use App\Entity\Prestataire;
use App\Entity\Rubrique;
use App\Entity\TypePrestataire;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class PrestaController extends AbstractController
{
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/**
* @Route("/prestataire/{slug}", name="show_prestataire")
*/
public function showPrestaAction(Prestataire $prestataire)
{
return $this->render('presta/show.html.twig', array(
'presta' => $prestataire
));
}
/**
* @Route("/prestataires/liste", name="liste_prestataire")
*/
public function listePrestaAction()
{
$type_presta = $this->em->getRepository(TypePrestataire::class)->findOneBy(array('slug' => 'prestataire'));
$prestas = $this->em->getRepository(Prestataire::class)->findBy(array('enabled' => true, 'typeprestataire' => $type_presta), array('raison' => 'ASC'));
return $this->render('presta/liste_prestataires.html.twig', array(
'prestas' => $prestas,
'type' => 'Prestataires'
));
}
/**
* @Route("/partenaires/liste", name="liste_partenaire")
*/
public function listePartnerAction()
{
$type_partner = $this->em->getRepository(TypePrestataire::class)->findOneBy(array('slug' => 'partenaire'));
$partners = $this->em->getRepository(Prestataire::class)->findBy(array('enabled' => true, 'typeprestataire' => $type_partner), array('raison' => 'ASC'));
return $this->render('presta/liste_prestataires.html.twig', array(
'prestas' => $partners,
'type' => 'Partenaires'
));
}
/**
* @Route("/prestataires/carte", name="carte_prestataire")
*/
public function cartePrestaAction()
{
$prestas = $this->em->getRepository(Prestataire::class)->findBy(array('enabled' => true), array('raison' => 'ASC'));
return $this->render('presta/carte.html.twig', array(
'prestas' => $prestas
));
}
/**
* @Route("/prestataires/rubriques", name="rubriques_prestataire")
*/
public function rubriquesAction()
{
$rubriques = $this->em->getRepository(Rubrique::class)->findBy(array('enabled' => true), array('name' => 'ASC'));
return $this->render('presta/rubriques.html.twig', array(
'rubriques' => $rubriques
));
}
/**
* @Route("/prestataires/rubrique/{slug}", name="show_rubrique")
*/
public function showRubriqueAction(Rubrique $rubrique)
{
return $this->render('presta/show_rubrique.html.twig', array(
'rubrique' => $rubrique
));
}
}
......@@ -4,12 +4,12 @@ namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity(repositoryClass="App\Repository\AdherentRepository")
* @ORM\Table(name="adherent")
*/
class Adherent
{
......
......@@ -7,7 +7,6 @@ use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
......
......@@ -2,103 +2,61 @@
namespace App\Entity;
use App\Entity\User;
use App\Enum\MoyenEnum;
use App\Entity\CotisationInfos;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Cotisation d'un utilisateur
*
* @ORM\Entity
* @ORM\Table(name="cotisation")
*/
class Cotisation
class Cotisation extends Flux
{
use TimestampableEntity;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @var int
*
* @ORM\Column(name="annee", type="integer", length=4)
*/
private $annee;
/**
* @var \DateTime
*
* @ORM\Column(name="debut", type="date")
*/
private $debut;
/**
* @var \DateTime
*
* @ORM\Column(name="fin", type="date")
*/
private $fin;
/**
* @var float
*
* @ORM\Column(name="montant", type="decimal", precision=6, scale=2)
*/
private $montant;
/**
* @var string
*
* @ORM\Column(name="moyen", type="string", length=100)
* @ORM\OneToOne(targetEntity="Siege")
* @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=true)
*/
private $moyen;
protected $destinataire;
/**
* RECU ENVOYE ?
* @var bool
*
* @ORM\Column(name="recu", type="boolean", nullable=false)
* @ORM\OneToOne(targetEntity="CotisationInfos", inversedBy="cotisation")
* @ORM\JoinColumn(name="cotisationinfos_id", referencedColumnName="id", nullable=true)
*/
private $recu;
protected $cotisationInfos;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="cotisations")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
* Constructeur
*/
private $user;
public function __construct()
{
$this->cotisationInfos = new CotisationInfos();
}
/**
* @return mixed
* @return string
*/
public function getId(): int
public function getParenttype(): string
{
return $this->id;
return 'cotisation';
}
/**
* @return User
*/
public function getUser(): ?User
* Get cotisationInfos
* @return cotisationInfos
*/
public function getCotisationInfos(): ?CotisationInfos
{
return $this->user;
return $this->cotisationInfos;
}
/**
* @param User $user
* @return $this
*/
public function setUser(User $user)
* Set CotisationInfos cotisationInfos
* @return $this
*/
public function setCotisationInfos(CotisationInfos $cotisationInfos)
{
$this->user = $user;
$this->cotisationInfos = $cotisationInfos;
return $this;
}
......@@ -107,7 +65,7 @@ class Cotisation
*/
public function getAnnee(): ?int
{
return $this->annee;
return $this->cotisationInfos->getAnnee();
}
/**
......@@ -116,7 +74,7 @@ class Cotisation
*/
public function setAnnee(int $annee)
{
$this->annee = $annee;
$this->cotisationInfos->setAnnee($annee);
return $this;
}
......@@ -125,7 +83,7 @@ class Cotisation
*/
public function getDebut(): ?\DateTime
{
return $this->debut;
return $this->cotisationInfos->getDebut();
}
/**
......@@ -134,7 +92,7 @@ class Cotisation
*/
public function setDebut(\DateTime $debut)
{
$this->debut = $debut;
$this->cotisationInfos->setDebut($debut);
return $this;
}
......@@ -143,7 +101,7 @@ class Cotisation
*/
public function getFin(): ?\DateTime
{
return $this->fin;
return $this->cotisationInfos->getFin();
}
/**
......@@ -152,43 +110,7 @@ class Cotisation
*/
public function setFin(\DateTime $fin)
{
$this->fin = $fin;
return $this;
}
/**
* @return float
*/
public function getMontant(): ?float
{
return $this->montant;
}
/**
* @param float $montant
* @return Cotisation
*/
public function setMontant(float $montant)
{
$this->montant = $montant;
return $this;
}
/**
* @return string
*/
public function getMoyen(): ?string
{
return $this->moyen;
}
public function setMoyen($moyen)
{
if (!in_array($moyen, MoyenEnum::getAvailableTypes())) {
throw new \InvalidArgumentException("Moyen de paiement invalide !");
}
$this->moyen = $moyen;
$this->cotisationInfos->setFin($fin);
return $this;
}
......@@ -197,7 +119,7 @@ class Cotisation
*/
public function isRecu(): ?bool
{
return $this->recu;
return $this->cotisationInfos->isRecu();
}
/**
......@@ -206,7 +128,7 @@ class Cotisation
*/
public function setRecu(bool $recu)
{
$this->recu = $recu;
$this->cotisationInfos->setRecu($recu);
return $this;
}
}
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* TRANSACTION
* - Cotisation d'un adhérent
*
* @ORM\Entity
*/
class CotisationAdherent extends Cotisation
{
/**
* @ORM\OneToOne(targetEntity="Adherent")
* @ORM\JoinColumn(name="adherent_id", referencedColumnName="id", nullable=true)
*/
protected $expediteur;
/**
* @return string
*/
public function getType(): string
{
return 'cotisation_adherent';
}
}
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Cotisation d'un utilisateur
*
* @ORM\Entity
* @ORM\Table(name="cotisationinfos")
*/
class CotisationInfos
{
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="Cotisation", cascade={"all"}, mappedBy="cotisationInfos")
*/
protected $cotisation;
/**
* @var int
*
* @ORM\Column(name="annee", type="integer", length=4)
*/
private $annee;
/**
* @var \DateTime
*
* @ORM\Column(name="debut", type="date")
*/
private $debut;
/**
* @var \DateTime
*
* @ORM\Column(name="fin", type="date")
*/
private $fin;
/**
* RECU
* @var bool
*
* @ORM\Column(name="recu", type="boolean", nullable=false)
*/
private $recu;
/**
* Constructeur
*/
public function __construct()
{
$now = new \DateTime();
$this->annee = $now->format('Y');
$this->debut = $now;
$this->fin = new \DateTime('+1 year');
$this->recu = false;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Cotisation
*/
public function getCotisation(): ?Cotisation
{
return $this->cotisation;
}
/**
* @param Cotisation $cotisation
* @return Cotisation
*/
public function setCotisation(Cotisation $cotisation)
{
$this->cotisation = $cotisation;
return $this;
}
/**
* @return int
*/
public function getAnnee(): ?int
{
return $this->annee;
}
/**
* @param int $annee
* @return Cotisation
*/
public function setAnnee(int $annee)
{
$this->annee = $annee;
return $this;
}
/**
* @return \DateTime
*/
public function getDebut(): ?\DateTime
{
return $this->debut;
}
/**
* @param \DateTime $debut
* @return Cotisation
*/
public function setDebut(\DateTime $debut)
{
$this->debut = $debut;
return $this;
}
/**
* @return \DateTime
*/
public function getFin(): ?\DateTime
{
return $this->fin;
}
/**
* @param \DateTime $fin
* @return Cotisation
*/
public function setFin(\DateTime $fin)
{
$this->fin = $fin;
return $this;
}
/**
* @return bool
*/
public function isRecu(): ?bool
{
return $this->recu;
}
/**
* @param bool $recu
* @return Cotisation
*/
public function setRecu(bool $recu)
{
$this->recu = $recu;
return $this;
}
}
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* TRANSACTION
* - Cotisation d'un prestataire
*
* @ORM\Entity
*/
class CotisationPrestataire extends Cotisation
{
/**
* @ORM\OneToOne(targetEntity="Prestataire")
* @ORM\JoinColumn(name="prestataire_id", referencedColumnName="id", nullable=true)
*/
protected $expediteur;
/**
* @return string
*/
public function getType(): string
{
return 'cotisation_prestataire';
}
}
......@@ -3,7 +3,6 @@
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\User;
use Symfony\Component\Validator\Constraints as Assert;
/**
......
......@@ -29,14 +29,9 @@ class Faq
protected $id;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* @var \Application\Sonata\MediaBundle\Entity\Media
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id", nullable=true)
* @ORM\JoinColumn(name="fichier_id", referencedColumnName="id", nullable=true)
*/
protected $fichier;
......
......@@ -3,9 +3,6 @@
namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\Transaction;
use App\Entity\Transfert;
use App\Entity\User;
use App\Enum\MoyenEnum;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
......@@ -16,7 +13,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"transfert" = "Transfert", "transaction" = "Transaction", "tro_adh_pre" = "TransactionAdherentPrestataire", "tro_pre_adh" = "TransactionPrestataireAdherent", "tro_pre_pre" = "TransactionPrestatairePrestataire", "tre_cpt_adh" = "TransfertComptoirAdherent", "tre_cpt_grp" = "TransfertComptoirGroupe", "tre_cpt_pre" = "TransfertComptoirPrestataire", "tre_grp_cpt" = "TransfertGroupeComptoir", "tre_pre_cpt" = "TransfertPrestataireComptoir", "tre_sie_grp" = "TransfertSiegeGroupe"})
* @ORM\DiscriminatorMap({"cotisation" = "Cotisation", "cotisation_adherent" = "CotisationAdherent", "cotisation_prestataire" = "CotisationPrestataire", "tro_adh_pre" = "TransactionAdherentPrestataire", "tro_pre_adh" = "TransactionPrestataireAdherent", "tro_pre_pre" = "TransactionPrestatairePrestataire", "tre_cpt_adh" = "TransfertComptoirAdherent", "tre_cpt_grp" = "TransfertComptoirGroupe", "tre_cpt_pre" = "TransfertComptoirPrestataire", "tre_grp_cpt" = "TransfertGroupeComptoir", "tre_pre_cpt" = "TransfertPrestataireComptoir", "tre_sie_grp" = "TransfertSiegeGroupe"})
*/
abstract class Flux
{
......@@ -76,6 +73,7 @@ abstract class Flux
protected $expediteur = null;
protected $destinataire = null;
protected $cotisationInfos = null;
abstract public function getParenttype();
......
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\GlobalConfigurationRepository")
*/
class GlobalConfiguration
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
private $mlcname;
/**
* @ORM\Column(type="string", length=50)
*/
private $mlcsmallname;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $charte;
/**
* @Assert\Image(maxSize="2M", minWidth="50", minHeight="50")
* @Vich\UploadableField(mapping="logo", fileNameProperty="path")
* @Assert\File(maxSize="2M", mimeTypes={"image/*"})
*/
protected $logo;
/**
* @var string
*
* @ORM\Column(name="pathlogo", type="text", nullable=true)
*/
private $pathlogo;
public function getId(): ?int
{
return $this->id;
}
public function getMlcname(): ?string
{
return $this->mlcname;
}
public function setMlcname(string $mlcname): self
{
$this->mlcname = $mlcname;
return $this;
}
public function getMlcsmallname(): ?string
{
return $this->mlcsmallname;
}
public function setMlcsmallname(string $mlcsmallname): self
{
$this->mlcsmallname = $mlcsmallname;
return $this;
}
public function getCharte(): ?string
{
return $this->charte;
}
public function setCharte(?string $charte): self
{
$this->charte = $charte;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $image
*/
public function setLogo(File $image = null)
{
$this->logo = $image;
if ($image) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updated = new \DateTimeImmutable();
}
}
public function getLogo()
{
return $this->logo;
}
/**
* Set path
*
* @param string $path
* @return Photo
*/
public function setPathLogo($path)
{
$this->pathlogo = $path;
return $this;
}
/**
* Get path
*
* @return string
*/
public function getPathLogo()
{
return $this->pathlogo;
}
}
......@@ -2,14 +2,9 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Comptoir;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Prestataire;
use App\Entity\Siege;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
......
......@@ -38,6 +38,23 @@ class Groupeprestataire
protected $id;
/**
* @var string|null
*
* @ORM\Column(length=50)
* @Assert\NotBlank
* @Assert\Length(max=50)
*/
protected $type;
/**
* @var string|null
*
* @Gedmo\Slug(fields={"type"})
* @ORM\Column(length=50, unique=true)
*/
protected $typeslug;
/**
* @var ArrayCollection|Prestataire[]
*
* @ORM\ManyToMany(targetEntity="Prestataire", inversedBy="groupeprestataires", cascade={"persist"}, fetch="EXTRA_LAZY")
......@@ -65,6 +82,44 @@ class Groupeprestataire
}
/**
* Get type
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set type
* @return $this
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get typeslug
* @return string
*/
public function getTypeSlug()
{
return $this->typeslug;
}
/**
* Set typeslug
* @return $this
*/
public function setTypeSlug($typeslug)
{
$this->typeslug = $typeslug;
return $this;
}
/**
* Get horaires
* @return string Horaires
*/
......
......@@ -82,19 +82,19 @@ class News
/**
* @param User $user
* @param null|User $user
* @return $this
*/
public function setuser(User $user)
public function setUser(?User $user)
{
$this->user = $user;
return $this;
}
/**
* @return User
* @return null|User
*/
public function getuser(): User
public function getUser(): ?User
{
return $this->user;
}
......@@ -116,4 +116,17 @@ class News
$this->visibleByAllGroups = $visibleByAllGroups;
return $this;
}
public function __toString(): string
{
$return = '';
if ($this->getName() != null) {
$return = $this->getName();
}
if ($this->getCreatedAt() != null) {
$return .= ' (crée le '.$this->getCreatedAt()->format('d/m/Y H:i').')';
}
return $return;
}
}
......@@ -5,20 +5,15 @@ namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\Groupe;
use App\Entity\Groupeprestataire;
use App\Entity\Image;
use App\Entity\Rubrique;
use App\Entity\TypePrestataire;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Mapping\Annotation\Slug;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Entity(repositoryClass="App\Repository\PrestataireRepository")
* @ORM\Table(name="prestataire")
*/
class Prestataire
......@@ -45,6 +40,14 @@ class Prestataire
private $raison;
/**
* @var string|null
*
* @Gedmo\Slug(fields={"raison"})
* @ORM\Column(length=100, unique=true)
*/
protected $slug;
/**
* @var string
*
* @ORM\Column(name="metier", type="string", length=100)
......@@ -184,6 +187,17 @@ class Prestataire
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug)
{
$this->slug = $slug;
return $this;
}
/**
* @return string
*/
......
......@@ -4,7 +4,6 @@ namespace App\Entity;
use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
......
......@@ -2,7 +2,6 @@
namespace App\Entity;
use App\Entity\Flux;
use Doctrine\ORM\Mapping as ORM;
/**
......@@ -22,7 +21,7 @@ use Doctrine\ORM\Mapping as ORM;
*
* @ORM\Entity
*/
class Transaction extends Flux
abstract class Transaction extends Flux
{
/**
* @return string
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,7 +2,6 @@
namespace App\Entity;
use App\Entity\Flux;
use Doctrine\ORM\Mapping as ORM;
/**
......@@ -23,9 +22,9 @@ use Doctrine\ORM\Mapping as ORM;
* - COMPTOIRS => PRESTATAIRES (Diffusion de monnaie papier auprès des prestataires)
* - PRESTATAIRES => COMPTOIRS (Reconversion)
*
* @ORM\Entity()
* @ORM\Entity
*/
class Transfert extends Flux
abstract class Transfert extends Flux
{
/**
* @return string
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Comptoir;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Groupe;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Prestataire;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Groupe;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Prestataire;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -2,9 +2,6 @@
namespace App\Entity;
use App\Entity\Groupe;
use App\Entity\Siege;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM;
/**
......
......@@ -5,7 +5,6 @@ namespace App\Entity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\EntityTrait\EnablableEntityTrait;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use App\Entity\Prestataire;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
......
......@@ -2,12 +2,6 @@
namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Document;
use App\Entity\EmailToken;
use App\Entity\Faq;
use App\Entity\Flux;
use App\Entity\Prestataire;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM;
......@@ -17,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Entity()
* @ORM\Table(name="user")
* @UniqueEntity(
* fields={"firstname", "lastname", "email"},
......@@ -59,13 +53,6 @@ class User extends BaseUser
protected $prestataire;
/**
* @var ArrayCollection|Cotisation[]
*
* @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"persist"})
*/
private $cotisations;
/**
* @var ArrayCollection|Document[]
*
* @ORM\OneToMany(targetEntity="Document", mappedBy="user", cascade={"persist"})
......@@ -81,6 +68,7 @@ class User extends BaseUser
/**
* @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur")
* @ORM\OrderBy({"createdAt" = "DESC"})
*/
protected $flux;
......@@ -244,18 +232,27 @@ class User extends BaseUser
*/
public function getCotisations()
{
return $this->cotisations;
if (count($this->flux) > 0) {
$return = new ArrayCollection();
foreach ($this->flux as $flux) {
if ($flux->getParenttype() == 'cotisation') {
$return->add($flux);
}
}
return $return;
}
return new ArrayCollection();
}
/**
* @param Cotisation $cotisation
* @param $cotisation
* @return $this
*/
public function addCotisation(Cotisation $cotisation)
public function addCotisation($cotisation)
{
if (!$this->cotisations->contains($cotisation)) {
$this->cotisations[] = $cotisation;
$cotisation->setUser($this);
$this->flux[] = $cotisation;
$cotisation->setOperateur($this);
}
return $this;
}
......
<?php
namespace App\Form\Type;
use App\Entity\Adherent;
use App\Entity\Groupe;
use App\Entity\Prestataire;
use App\Entity\User;
use App\Enum\MoyenEnum;
use App\Form\Type\CotisationFormType;
use App\Form\Type\GeolocFormType;
use App\Form\Type\RegistrationFormType;
use Doctrine\DBAL\Types\FloatType;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class AdhererFormType extends AbstractType
{
protected $container;
protected $em;
protected $tk;
public function __construct(ContainerInterface $container, EntityManagerInterface $em, TokenStorageInterface $tk)
{
$this->container = $container;
$this->em = $em;
$this->tk = $tk;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('user', RegistrationFormType::class, array(
'label' => false,
'required' => false
))
->add('groupe', ChoiceType::class, array(
'required' => true,
'label' => 'GROUPE LOCAL',
'choices' => $this->container->get('doctrine')->getRepository(Groupe::class)->findAll(),
'choice_label' => 'name',
'placeholder' => 'Choisir un groupe',
))
->add('geoloc', GeolocFormType::class, array(
'label' => 'ADRESSE',
'required' => false
))
->add('cotisation', CotisationFormType::class, array(
'label' => 'COTISATION',
'required' => false
))
->add('save', SubmitType::class, ['label' => "Valider l'adhésion"])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Adherent::class,
'cascade_validation' => true
]);
}
public function getBlockPrefix()
{
return 'formAdherer';
}
}
<?php
namespace App\Form\Type;
use App\Entity\User;
use App\Enum\MoyenEnum;
use Doctrine\DBAL\Types\FloatType;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CotisationFormType extends FluxFormType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('type', HiddenType::class, array(
'data' => 'cotisation',
'data_class' => null
))
;
}
public function getParent()
{
return FluxFormType::class;
}
public function getBlockPrefix()
{
return 'formCotisation';
}
}
<?php
namespace App\Form\Type;
use App\Entity\Geoloc;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class GeolocFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('adresse', TextType::class, array(
'label' => 'Addresse :',
'required' => false
))
->add('cpostal', TextType::class, array(
'label' => 'Code postal :',
'required' => false
))
->add('ville', TextType::class, array(
'label' => 'Ville :',
'required' => false
))
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Geoloc::class
]);
}
public function getBlockPrefix()
{
return 'formGeoloc';
}
}
......@@ -5,8 +5,10 @@ namespace App\Form\Type;
use App\Entity\User;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use FOS\UserBundle\Form\Type\RegistrationFormType as FOSRegistrationFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
......@@ -15,46 +17,60 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class RegistrationFormType extends AbstractRegistrationFormType
class RegistrationFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->remove('username')
->add('email', TextType::class, array('label' => 'form_label_email'))
->add('firstname', TextType::class, array('label' => 'form_label_first_name'))
->add('lastname', TextType::class, array('label' => 'form_label_family_name'))
->add('email', EmailType::class, array(
'label' => 'form.email',
'required' => true,
'translation_domain' => 'FOSUserBundle'
))
->add('firstname', TextType::class, array(
'label' => 'Prénom',
'required' => false,
))
->add('lastname', TextType::class, array(
'label' => 'Nom',
'required' => false,
))
->add('plainPassword', RepeatedType::class, array(
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'type' => PasswordType::class,
'options' => array(
'translation_domain' => 'FOSUserBundle',
'attr' => array(
'autocomplete' => 'new-password',
),
),
'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch',
'error_bubbling' => true
))
->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($builder) {
$repo = $this->em->getRepository(User::class);
$emailExist = $repo->findBy(array('email' => $event->getForm()->get('email')->getData()));
if (count($emailExist) > 0) {
$event->getForm()->get('email')->addError(new FormError('form_label_email_used'));
$event->getForm()->get('email')->addError(new FormError('form.error.email_used'));
}
})
;
}
public function getParent()
{
return 'FOS\UserBundle\Form\Type\RegistrationFormType';
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'cascade_validation' => true,
'type' => null
// 'type' => null
));
}
public function getParent()
{
return FOSRegistrationFormType::class;
}
public function getBlockPrefix()
{
return 'app_user_registration';
......
......@@ -39,4 +39,4 @@ class Flash implements EventSubscriberInterface
KernelEvents::RESPONSE => 'onKernelResponse',
);
}
}
\ No newline at end of file
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190207172333 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE global_configuration');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE global_configuration (id INT AUTO_INCREMENT NOT NULL, mlcname VARCHAR(100) NOT NULL COLLATE utf8_general_ci, mlcsmallname VARCHAR(50) NOT NULL COLLATE utf8_general_ci, charte LONGTEXT DEFAULT NULL COLLATE utf8_general_ci, pathlogo LONGTEXT DEFAULT NULL COLLATE utf8_general_ci, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190208141356 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE sonata_menu (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE sonata_menu_item (id INT AUTO_INCREMENT NOT NULL, parent INT DEFAULT NULL, menu INT NOT NULL, name VARCHAR(255) NOT NULL, url VARCHAR(255) DEFAULT NULL, class_attribute VARCHAR(255) DEFAULT NULL, position SMALLINT UNSIGNED DEFAULT NULL, target TINYINT(1) DEFAULT \'0\', enabled TINYINT(1) DEFAULT \'1\', INDEX IDX_57D4FCFA3D8E604F (parent), INDEX IDX_57D4FCFA7D053A93 (menu), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE sonata_menu_item ADD CONSTRAINT FK_57D4FCFA3D8E604F FOREIGN KEY (parent) REFERENCES sonata_menu_item (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE sonata_menu_item ADD CONSTRAINT FK_57D4FCFA7D053A93 FOREIGN KEY (menu) REFERENCES sonata_menu (id) ON DELETE CASCADE');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE sonata_menu_item DROP FOREIGN KEY FK_57D4FCFA7D053A93');
$this->addSql('ALTER TABLE sonata_menu_item DROP FOREIGN KEY FK_57D4FCFA3D8E604F');
$this->addSql('DROP TABLE sonata_menu');
$this->addSql('DROP TABLE sonata_menu_item');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190208174745 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire ADD type VARCHAR(50) NOT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire DROP type');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190208234646 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire ADD typeslug VARCHAR(50) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FB9ABBCED7E16479 ON groupeprestaire (typeslug)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP INDEX UNIQ_FB9ABBCED7E16479 ON groupeprestaire');
$this->addSql('ALTER TABLE groupeprestaire DROP typeslug');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190209181817 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE prestataire ADD slug VARCHAR(100) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_60A26480989D9B62 ON prestataire (slug)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP INDEX UNIQ_FB9ABBCED7E16479 ON groupeprestaire');
$this->addSql('DROP INDEX UNIQ_60A26480989D9B62 ON prestataire');
$this->addSql('ALTER TABLE prestataire DROP slug');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190209182635 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE groupeprestaire ADD typeslug VARCHAR(50) NOT NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_FB9ABBCED7E16479 ON groupeprestaire (typeslug)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP INDEX UNIQ_FB9ABBCED7E16479 ON groupeprestaire');
$this->addSql('ALTER TABLE groupeprestaire DROP typeslug');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211150525 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE cotisation');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313A25F06C53');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313A7A45358C');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313AAEB0C1F5');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313ABE3DB2B7');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313ABF006E8B');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313AECEF536E');
$this->addSql('DROP INDEX IDX_7252313ABF006E8B ON flux');
$this->addSql('DROP INDEX IDX_7252313ABE3DB2B7 ON flux');
$this->addSql('DROP INDEX IDX_7252313A7A45358C ON flux');
$this->addSql('DROP INDEX IDX_7252313A25F06C53 ON flux');
$this->addSql('DROP INDEX IDX_7252313AAEB0C1F5 ON flux');
$this->addSql('DROP INDEX IDX_7252313AECEF536E ON flux');
$this->addSql('ALTER TABLE flux DROP adherent_id, DROP prestataire_id, DROP prestataire_dest_id, DROP comptoir_id, DROP groupe_id, DROP siege_id');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE cotisation (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, annee INT NOT NULL, debut DATE NOT NULL, fin DATE NOT NULL, montant NUMERIC(6, 2) NOT NULL, moyen VARCHAR(100) NOT NULL COLLATE utf8mb4_unicode_ci, recu TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_AE64D2EDA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE flux ADD adherent_id INT DEFAULT NULL, ADD prestataire_id INT DEFAULT NULL, ADD prestataire_dest_id INT DEFAULT NULL, ADD comptoir_id INT DEFAULT NULL, ADD groupe_id INT DEFAULT NULL, ADD siege_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313A25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313A7A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AAEB0C1F5 FOREIGN KEY (comptoir_id) REFERENCES comptoir (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313ABE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313ABF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AECEF536E FOREIGN KEY (prestataire_dest_id) REFERENCES prestataire (id)');
$this->addSql('CREATE INDEX IDX_7252313ABF006E8B ON flux (siege_id)');
$this->addSql('CREATE INDEX IDX_7252313ABE3DB2B7 ON flux (prestataire_id)');
$this->addSql('CREATE INDEX IDX_7252313A7A45358C ON flux (groupe_id)');
$this->addSql('CREATE INDEX IDX_7252313A25F06C53 ON flux (adherent_id)');
$this->addSql('CREATE INDEX IDX_7252313AAEB0C1F5 ON flux (comptoir_id)');
$this->addSql('CREATE INDEX IDX_7252313AECEF536E ON flux (prestataire_dest_id)');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211150957 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE transaction (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, prestataire_dest_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL, type VARCHAR(200) NOT NULL, parenttype VARCHAR(20) NOT NULL, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_723705D1A76ED395 (user_id), INDEX IDX_723705D125F06C53 (adherent_id), INDEX IDX_723705D1BE3DB2B7 (prestataire_id), INDEX IDX_723705D1ECEF536E (prestataire_dest_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE transfert (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, comptoir_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, groupe_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, siege_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL, type VARCHAR(200) NOT NULL, parenttype VARCHAR(20) NOT NULL, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_1E4EACBBA76ED395 (user_id), INDEX IDX_1E4EACBBAEB0C1F5 (comptoir_id), INDEX IDX_1E4EACBB25F06C53 (adherent_id), INDEX IDX_1E4EACBB7A45358C (groupe_id), INDEX IDX_1E4EACBBBE3DB2B7 (prestataire_id), INDEX IDX_1E4EACBBBF006E8B (siege_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D125F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1ECEF536E FOREIGN KEY (prestataire_dest_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBAEB0C1F5 FOREIGN KEY (comptoir_id) REFERENCES comptoir (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBB25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBB7A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBBE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBBF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('DROP TABLE flux');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE flux (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, type VARCHAR(200) NOT NULL COLLATE utf8_general_ci, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL COLLATE utf8_general_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL COLLATE utf8_general_ci, parenttype VARCHAR(20) NOT NULL COLLATE utf8_general_ci, moyen VARCHAR(100) NOT NULL COLLATE utf8_general_ci, INDEX IDX_7252313AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('DROP TABLE transaction');
$this->addSql('DROP TABLE transfert');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211151206 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE cotisation (id INT AUTO_INCREMENT NOT NULL, siege_id INT DEFAULT NULL, user_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL, annee INT NOT NULL, debut DATE NOT NULL, fin DATE NOT NULL, recu TINYINT(1) NOT NULL, type VARCHAR(200) NOT NULL, parenttype VARCHAR(20) NOT NULL, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_AE64D2EDBF006E8B (siege_id), INDEX IDX_AE64D2EDA76ED395 (user_id), INDEX IDX_AE64D2ED25F06C53 (adherent_id), INDEX IDX_AE64D2EDBE3DB2B7 (prestataire_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2ED25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE cotisation');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211162828 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE flux (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, prestataire_dest_id INT DEFAULT NULL, comptoir_id INT DEFAULT NULL, groupe_id INT DEFAULT NULL, siege_id INT DEFAULT NULL, type VARCHAR(200) NOT NULL, parenttype VARCHAR(20) NOT NULL, montant NUMERIC(7, 2) NOT NULL, moyen VARCHAR(100) NOT NULL, reference VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL, INDEX IDX_7252313AA76ED395 (user_id), INDEX IDX_7252313A25F06C53 (adherent_id), INDEX IDX_7252313ABE3DB2B7 (prestataire_id), INDEX IDX_7252313AECEF536E (prestataire_dest_id), INDEX IDX_7252313AAEB0C1F5 (comptoir_id), INDEX IDX_7252313A7A45358C (groupe_id), INDEX IDX_7252313ABF006E8B (siege_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313A25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313ABE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AECEF536E FOREIGN KEY (prestataire_dest_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313AAEB0C1F5 FOREIGN KEY (comptoir_id) REFERENCES comptoir (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313A7A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313ABF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('DROP TABLE cotisation');
$this->addSql('DROP TABLE transaction');
$this->addSql('DROP TABLE transfert');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE cotisation (id INT AUTO_INCREMENT NOT NULL, siege_id INT DEFAULT NULL, user_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL COLLATE utf8_general_ci, annee INT NOT NULL, debut DATE NOT NULL, fin DATE NOT NULL, recu TINYINT(1) NOT NULL, type VARCHAR(200) NOT NULL COLLATE utf8_general_ci, parenttype VARCHAR(20) NOT NULL COLLATE utf8_general_ci, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL COLLATE utf8_general_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL COLLATE utf8_general_ci, INDEX IDX_AE64D2ED25F06C53 (adherent_id), INDEX IDX_AE64D2EDA76ED395 (user_id), INDEX IDX_AE64D2EDBF006E8B (siege_id), INDEX IDX_AE64D2EDBE3DB2B7 (prestataire_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE transaction (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, prestataire_dest_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL COLLATE utf8_general_ci, type VARCHAR(200) NOT NULL COLLATE utf8_general_ci, parenttype VARCHAR(20) NOT NULL COLLATE utf8_general_ci, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL COLLATE utf8_general_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL COLLATE utf8_general_ci, INDEX IDX_723705D1BE3DB2B7 (prestataire_id), INDEX IDX_723705D125F06C53 (adherent_id), INDEX IDX_723705D1A76ED395 (user_id), INDEX IDX_723705D1ECEF536E (prestataire_dest_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE transfert (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, comptoir_id INT DEFAULT NULL, adherent_id INT DEFAULT NULL, groupe_id INT DEFAULT NULL, prestataire_id INT DEFAULT NULL, siege_id INT DEFAULT NULL, moyen VARCHAR(100) NOT NULL COLLATE utf8_general_ci, type VARCHAR(200) NOT NULL COLLATE utf8_general_ci, parenttype VARCHAR(20) NOT NULL COLLATE utf8_general_ci, montant NUMERIC(7, 2) NOT NULL, reference VARCHAR(255) DEFAULT NULL COLLATE utf8_general_ci, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, discr VARCHAR(255) NOT NULL COLLATE utf8_general_ci, INDEX IDX_1E4EACBB25F06C53 (adherent_id), INDEX IDX_1E4EACBBBF006E8B (siege_id), INDEX IDX_1E4EACBBAEB0C1F5 (comptoir_id), INDEX IDX_1E4EACBBBE3DB2B7 (prestataire_id), INDEX IDX_1E4EACBBA76ED395 (user_id), INDEX IDX_1E4EACBB7A45358C (groupe_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2ED25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE cotisation ADD CONSTRAINT FK_AE64D2EDBF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D125F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1ECEF536E FOREIGN KEY (prestataire_dest_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBB25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBB7A45358C FOREIGN KEY (groupe_id) REFERENCES groupe (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBAEB0C1F5 FOREIGN KEY (comptoir_id) REFERENCES comptoir (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBBE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
$this->addSql('ALTER TABLE transfert ADD CONSTRAINT FK_1E4EACBBBF006E8B FOREIGN KEY (siege_id) REFERENCES siege (id)');
$this->addSql('DROP TABLE flux');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211163824 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE cotisationinfos (id INT AUTO_INCREMENT NOT NULL, annee INT NOT NULL, debut DATE NOT NULL, fin DATE NOT NULL, recu TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE cotisationinfos');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211164400 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE flux ADD cotisationinfos_id INT DEFAULT NULL, ADD annee INT DEFAULT NULL, ADD debut DATE DEFAULT NULL, ADD fin DATE DEFAULT NULL, ADD recu TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE flux ADD CONSTRAINT FK_7252313A2CB102AD FOREIGN KEY (cotisationinfos_id) REFERENCES cotisationinfos (id)');
$this->addSql('CREATE INDEX IDX_7252313A2CB102AD ON flux (cotisationinfos_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE flux DROP FOREIGN KEY FK_7252313A2CB102AD');
$this->addSql('DROP INDEX IDX_7252313A2CB102AD ON flux');
$this->addSql('ALTER TABLE flux DROP cotisationinfos_id, DROP annee, DROP debut, DROP fin, DROP recu');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190211172020 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE flux DROP annee, DROP debut, DROP fin, DROP recu');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE flux ADD annee INT DEFAULT NULL, ADD debut DATE DEFAULT NULL, ADD fin DATE DEFAULT NULL, ADD recu TINYINT(1) DEFAULT NULL');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190212114916 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE faq DROP text');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE faq ADD text LONGTEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci');
}
}
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190212115211 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE faq ADD fichier_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE faq ADD CONSTRAINT FK_E8FF75CCF915CFE FOREIGN KEY (fichier_id) REFERENCES media__media (id)');
$this->addSql('CREATE INDEX IDX_E8FF75CCF915CFE ON faq (fichier_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE faq DROP FOREIGN KEY FK_E8FF75CCF915CFE');
$this->addSql('DROP INDEX IDX_E8FF75CCF915CFE ON faq');
$this->addSql('ALTER TABLE faq DROP fichier_id');
}
}
......@@ -18,33 +18,4 @@ class AdherentRepository extends ServiceEntityRepository
{
parent::__construct($registry, Adherent::class);
}
// /**
// * @return Adherent[] Returns an array of Adherent objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('a')
->andWhere('a.exampleField = :val')
->setParameter('val', $value)
->orderBy('a.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Adherent
{
return $this->createQueryBuilder('a')
->andWhere('a.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use App\Entity\Comptoir;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Comptoir|null find($id, $lockMode = null, $lockVersion = null)
* @method Comptoir|null findOneBy(array $criteria, array $orderBy = null)
* @method Comptoir[] findAll()
* @method Comptoir[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ComptoirRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Comptoir::class);
}
/*
public function findOneBySomeField($value): ?Adherent
{
return $this->createQueryBuilder('a')
->andWhere('a.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use App\Entity\GlobalConfiguration;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method GlobalConfiguration|null find($id, $lockMode = null, $lockVersion = null)
* @method GlobalConfiguration|null findOneBy(array $criteria, array $orderBy = null)
* @method GlobalConfiguration[] findAll()
* @method GlobalConfiguration[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class GlobalConfigurationRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, GlobalConfiguration::class);
}
// /**
// * @return GlobalConfiguration[] Returns an array of GlobalConfiguration objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('g')
->andWhere('g.exampleField = :val')
->setParameter('val', $value)
->orderBy('g.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?GlobalConfiguration
{
return $this->createQueryBuilder('g')
->andWhere('g.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use App\Entity\Horaire;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Horaire|null find($id, $lockMode = null, $lockVersion = null)
* @method Horaire|null findOneBy(array $criteria, array $orderBy = null)
* @method Horaire[] findAll()
* @method Horaire[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class HoraireRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Horaire::class);
}
// /**
// * @return Horaire[] Returns an array of Horaire objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->orderBy('h.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Horaire
{
return $this->createQueryBuilder('h')
->andWhere('h.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Repository;
use App\Entity\Groupeprestataire;
use App\Entity\Prestataire;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Prestataire|null find($id, $lockMode = null, $lockVersion = null)
* @method Prestataire|null findOneBy(array $criteria, array $orderBy = null)
* @method Prestataire[] findAll()
* @method Prestataire[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PrestataireRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Prestataire::class);
}
/**
* @return Prestataire[] Returns an array of Prestataire objects
*/
public function findByGroupeprestataire(Groupeprestataire $groupe)
{
$qb = $this->createQueryBuilder('p');
return $qb
->where($qb->expr()->isMemberOf(':groupe', 'p.groupeprestataires'))
->andWhere('p.enabled = :enabled')
->setParameter('groupe', $groupe)
->setParameter('enabled', true)
->orderBy('p.raison', 'ASC')
->getQuery()
->getResult()
;
}
}
<?php
namespace App\Repository;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
class UserRepository extends EntityRepository
{
}
......@@ -9,15 +9,22 @@ use Twig\TwigTest;
class AppExtension extends AbstractExtension
{
// public function getFilters(): array
// {
// return [
// // If your filter generates SAFE HTML, you should add a third
// // parameter: ['is_safe' => ['html']]
// // Reference: https://twig.symfony.com/doc/2.x/advanced.html#automatic-escaping
// new TwigFilter('toto', [$this, 'doSomething']),
// ];
// }
public $container;
public function __construct($container)
{
$this->container = $container;
}
public function getFunctions()
{
return [
new \Twig_SimpleFunction('parameter', function($name)
{
return $this->container->getParameter($name);
})
];
}
public function getTests(): array
{
......
<?php
namespace App\Twig;
use Doctrine\ORM\EntityManagerInterface;
use Prodigious\Sonata\MenuBundle\Manager\MenuManager;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
use Twig\TwigTest;
class MenuExtension extends AbstractExtension
{
protected $em;
protected $mm;
public function __construct(EntityManagerInterface $em, MenuManager $mm)
{
$this->em = $em;
$this->mm = $mm;
}
/**
* {@inheritdoc}
*/
public function getFunctions()
{
return array(
new \Twig_SimpleFunction('getMenuItemsFromAlias', array($this, 'getMenuItemsFromAlias'))
);
}
public function getMenuItemsFromAlias($alias)
{
$menu = $this->mm->loadByAlias($alias);
if ($menu == null) {
return null;
}
// getMenuItems($menu, $root = MenuManager::ITEM_CHILD, $status = MenuManager::STATUS_ALL)
$menuItems = $this->mm->getMenuItems($menu, true, true);
return $menuItems;
}
}
......@@ -293,6 +293,9 @@
"pixassociates/sortable-behavior-bundle": {
"version": "v1.5"
},
"prodigious/sonata-menu-bundle": {
"version": "3.0.1"
},
"psr/cache": {
"version": "1.0.1"
},
......
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container'>
<h4>Adhérer</h4>
<p>
{{form_start(form)}}
{{ form_row(form.user) }}
{{ form_row(form.groupe) }}
{{ form_row(form.geoloc) }}
{{ form_row(form.cotisation) }}
{{ form_row(form.save) }}
{{form_end(form)}}
</p>
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
adherent index
{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Hello {{ controller_name }}!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ 'src/Controller/AdminController.php'|file_link(0) }}">src/Controller/AdminController.php</a></code></li>
<li>Your template at <code><a href="{{ 'templates/admin/index.html.twig'|file_link(0) }}">templates/admin/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container'>
<h4>Charte</h4>
<p class="paragraf">
Cette Charte des valeurs a été adoptée lors de l'assemblée générale du 25 janvier 2014.<br>
<br>
<strong>En signant cette Charte des valeurs, je m'engage en tant que consommateur ou prestataire à utiliser la monnaie locale comme </strong>&nbsp;: <br>
porteuse de valeurs éthiques, écologiques et sociales dans une recherche de mieux être collectif, outil pour inciter chacun à mieux comprendre sa façon de produire et de consommer, moyen de contribuer à une alternative non-spéculative au modèle économique actuel<br>
<strong>En signant cette Charte des valeurs, je m'engage en tant que consommateur ou prestataire à favoriser&nbsp;</strong>:
</p>
{# <p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/proximite.gif" style="float:left;margin-right:10px;width:36px;"> L'activité et les emplois locaux en privilégiant les productions, les services et les commerces de proximité, dans une démarche de qualité.<br>
</p><p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/environnement.gif" style="float:left;margin-right:10px;width:36px;"> Les pratiques respectueuses de la nature et de notre environnement.<br>
</p>
<p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/cooperation.gif" style="float:left;margin-right:10px;width:36px;"> Les échanges entre acteurs locaux dans un esprit de complémentarité, de coopération et de solidarité.<br>
</p>
<p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/populaire.gif" style="float:left;margin-right:10px;width:36px;"> L'accès à la qualité des biens et des services au plus grand nombre.<br>
</p>
<p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/relations.gif" style="float:left;margin-right:10px;width:36px;"> De bonnes relations et conditions de travail.<br>
</p>
<p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/biologique.gif" style="float:left;margin-right:10px;width:36px;"> Le bio avant tout.<br>
</p>
<p class="paragraf" style="min-height:60px;">
<img src="./pictocharte/motivation.gif" style="float:left;margin-right:10px;width:36px;"> Le degré de motivation.<br>
</p> #}
</div>
{% endblock %}
<div id="flash-messages">
{% for flashMessage in app.session.flashbag.get('success') %}
<div class="alert alert-success">
<button class="close" data-dismiss="alert">&times;</button>
{{ flashMessage|trans|raw|nl2br }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('error') %}
<div class="alert alert-danger">
<button class="close" data-dismiss="alert">&times;</button>
{{ flashMessage|trans|raw|nl2br }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('info') %}
<div class="alert alert-info">
<button class="close" data-dismiss="alert">&times;</button>
{{ flashMessage|trans|raw|nl2br }}
</div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('warning') %}
<div class="alert alert-warning">
<button class="close" data-dismiss="alert">&times;</button>
{{ flashMessage|trans|raw|nl2br }}
</div>
{% endfor %}
</div>
\ No newline at end of file
<footer class="container clearfix footer">
{# TODO : ajouter crédit et lien vers la solution de gestion de la monnaie locale complémentaire libre de droits #}
</footer>
\ No newline at end of file
<header class="container header">
{% block menu %}
{% include 'common/menu.html.twig' %}
{% endblock menu %}
</header>
\ No newline at end of file
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