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 @@ ...@@ -7,6 +7,24 @@
// any CSS you require will output into a single css file (app.css in this case) // any CSS you require will output into a single css file (app.css in this case)
require('../css/app.css'); require('../css/app.css');
require('../css/global.scss');
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it. // 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 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "4f9f14bbf95662cc721ee28c2bf26582", "content-hash": "99c6a787e9c5545a79d54dc3619b7cae",
"packages": [ "packages": [
{ {
"name": "behat/transliterator", "name": "behat/transliterator",
...@@ -4163,6 +4163,61 @@ ...@@ -4163,6 +4163,61 @@
"time": "2018-03-26T15:56:52+00:00" "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", "name": "psr/cache",
"version": "1.0.1", "version": "1.0.1",
"source": { "source": {
......
...@@ -42,5 +42,6 @@ return [ ...@@ -42,5 +42,6 @@ return [
Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true], Bazinga\GeocoderBundle\BazingaGeocoderBundle::class => ['all' => true],
Sonata\TranslationBundle\SonataTranslationBundle::class => ['all' => true], Sonata\TranslationBundle\SonataTranslationBundle::class => ['all' => true],
Sonata\IntlBundle\SonataIntlBundle::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: ...@@ -8,13 +8,14 @@ fos_ck_editor:
default_config: default default_config: default
configs: configs:
default: default:
language: fr
# default toolbar plus Format button # default toolbar plus Format button
# toolbar: toolbar:
# - [Bold, Italic, Underline, -, Cut, Copy, Paste, - [Bold, Italic, Underline, -, Cut, Copy, Paste,
# PasteText, PasteFromWord, -, Undo, Redo, -, PasteText, PasteFromWord, -, Undo, Redo, -,
# NumberedList, BulletedList, -, Outdent, Indent, -, NumberedList, BulletedList, -, Outdent, Indent, -,
# Blockquote, -, Image, Link, Unlink, Table] Blockquote, -, Image, Link, Unlink, Table]
# - [Format, Maximize, Source] - [Format, Maximize, Source]
# filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser # filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser
# filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser # filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser
......
...@@ -182,6 +182,14 @@ sonata_admin: ...@@ -182,6 +182,14 @@ sonata_admin:
# icon: '<i class="fa fa-list"></i>' # icon: '<i class="fa fa-list"></i>'
# items: # items:
# - admin.flux.gerer # - 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: sonata.admin.group.document:
keep_open: false keep_open: false
on_top: true on_top: true
...@@ -222,6 +230,14 @@ sonata_admin: ...@@ -222,6 +230,14 @@ sonata_admin:
icon: '<i class="fa fa-euro"></i>' icon: '<i class="fa fa-euro"></i>'
items: items:
- admin.flux.gerer - 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 # Gérer l'affichage du menu de l'admin en fonction des roles
# groups: # groups:
......
...@@ -2,3 +2,4 @@ twig: ...@@ -2,3 +2,4 @@ twig:
default_path: '%kernel.project_dir%/templates' default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%' debug: '%kernel.debug%'
strict_variables: '%kernel.debug%' strict_variables: '%kernel.debug%'
form_themes: ['bootstrap_4_layout.html.twig']
\ No newline at end of file
...@@ -7,6 +7,10 @@ parameters: ...@@ -7,6 +7,10 @@ parameters:
locale: 'en' locale: 'en'
sonata.user.admin.user.controller: 'App\Controller\CRUD\CRUDController' sonata.user.admin.user.controller: 'App\Controller\CRUD\CRUDController'
sonata.media.admin.media.class: 'App\Admin\MediaAdmin' 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: services:
# default configuration for services in *this* file # default configuration for services in *this* file
...@@ -21,7 +25,7 @@ services: ...@@ -21,7 +25,7 @@ services:
# this creates a service per class whose id is the fully-qualified class name # this creates a service per class whose id is the fully-qualified class name
App\: App\:
resource: '../src/*' 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 # controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class # as action arguments even if you don't extend any base controller class
...@@ -51,6 +55,16 @@ services: ...@@ -51,6 +55,16 @@ services:
autowire: false autowire: false
arguments: ['@router'] 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: App\Controller\RegistrationController:
autowire: false autowire: false
...@@ -154,6 +168,16 @@ services: ...@@ -154,6 +168,16 @@ services:
label: "AMAP / Marchés" label: "AMAP / Marchés"
public: true 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: admin.document.gerer:
class: App\Admin\DocumentAdmin class: App\Admin\DocumentAdmin
arguments: [~, App\Entity\Document, ~] arguments: [~, App\Entity\Document, ~]
...@@ -202,7 +226,10 @@ services: ...@@ -202,7 +226,10 @@ services:
manager_type: orm manager_type: orm
group: "Flux" group: "Flux"
label: "Flux" label: "Flux"
pager_type: "simple"
public: true public: true
calls:
- [ setSubClasses, [{transaction: 'App\Entity\Transaction', transfert: 'App\Entity\Transfert', cotisation: 'App\Entity\Cotisation'}]]
# admin.flux.gerer: # admin.flux.gerer:
# class: App\Admin\FluxAdmin # class: App\Admin\FluxAdmin
......
# Configuration des données initiales
App\Entity\Siege: App\Entity\Siege:
siege_1: siege_1:
name: 'Siege MLC' name: 'Siege MLC'
content: 'MLC' content: 'MLC'
App\Entity\TypePrestataire:
typepresta1:
name: 'Prestataire'
typepresta2:
name: 'Partenaire'
App\Entity\Usergroup:
usergroup_adherent:
__construct: ['Adherent', ['ROLE_ADHERENT']]
usergroup_prestataire:
__construct: ['Prestataire', ['ROLE_PRESTATAIRE']]
usergroup_adminsiege:
__construct: ['Administrateur du Siege', ['ROLE_ADMIN_SIEGE']]
usergroup_redacteur:
__construct: ['Rédacteur', ['ROLE_REDACTEUR']]
usergroup_tresorier:
__construct: ['Trésorier', [
'ROLE_TRESORIER',
'ROLE_ADMIN_ADHERENT_GERER_ALL',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_PRESTATAIRE_GERER_ALL',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_ALL',
'ROLE_ADMIN_DOCUMENT_GERER_ALL',
'ROLE_ADMIN_RUBRIQUE_GERER_ALL',
'ROLE_ADMIN_FAQ_GERER_ALL',
'ROLE_ADMIN_FLUX_GERER_ALL']]
usergroup_gestiongroupe:
__construct: ['Gestionnaire de Groupe', ['ROLE_GESTION_GROUPE']]
usergroup_comptoir:
__construct: ['Comptoir', ['ROLE_COMPTOIR']]
usergroup_contact:
__construct: ['Contact', ['ROLE_CONTACT']]
usergroup_admin:
__construct: ['Admin', ['ROLE_ADMIN', 'ROLE_SUPER_ADMIN']]
usergroup_superadmin:
__construct: ['Super Admin', ['ROLE_SUPER_ADMIN']]
App\Entity\Groupe: App\Entity\Groupe:
groupe{1..10}: groupe{1..10}:
name: '<text(10)>' name: '<text(10)>'
...@@ -30,55 +68,21 @@ App\Entity\Comptoir: ...@@ -30,55 +68,21 @@ App\Entity\Comptoir:
App\Entity\Groupeprestataire: App\Entity\Groupeprestataire:
grppresta1: grppresta1:
name: 'AMAP de test' name: 'AMAP de test'
type: 'amap'
horaires: 'Tous les Jeudis de 12h à 14h' horaires: 'Tous les Jeudis de 12h à 14h'
grppresta2: grppresta2:
name: 'AMAP de test 2' name: 'AMAP de test 2'
type: 'amap'
horaires: 'Tous les Mercredis de 12h à 14h' horaires: 'Tous les Mercredis de 12h à 14h'
grppresta3: grppresta3:
name: 'Marché de test' name: 'Marché de test'
type: 'marche'
horaires: 'Tous les Dimanches de 8h à 12h' horaires: 'Tous les Dimanches de 8h à 12h'
grppresta4: grppresta4:
name: 'Marché de test 2' name: 'Marché de test 2'
type: 'marche'
horaires: 'Tous les 1er Dimanches du mois de 8h à 12h et de 18h à 20h' horaires: 'Tous les 1er Dimanches du mois de 8h à 12h et de 18h à 20h'
App\Entity\TypePrestataire:
typepresta_prestataire:
name: 'Prestataire'
typepresta_partenaire:
name: 'Partenaire'
App\Entity\Usergroup:
usergroup_adherent:
__construct: ['Adherent', ['ROLE_ADHERENT']]
usergroup_prestataire:
__construct: ['Prestataire', ['ROLE_PRESTATAIRE']]
usergroup_adminsiege:
__construct: ['Administrateur du Siege', ['ROLE_ADMIN_SIEGE']]
usergroup_redacteur:
__construct: ['Rédacteur', ['ROLE_REDACTEUR']]
usergroup_tresorier:
__construct: ['Trésorier', [
'ROLE_TRESORIER',
'ROLE_ADMIN_ADHERENT_GERER_ALL',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_PRESTATAIRE_GERER_ALL',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_ALL',
'ROLE_ADMIN_DOCUMENT_GERER_ALL',
'ROLE_ADMIN_RUBRIQUE_GERER_ALL',
'ROLE_ADMIN_FAQ_GERER_ALL',
'ROLE_ADMIN_FLUX_GERER_ALL']]
usergroup_gestiongroupe:
__construct: ['Gestionnaire de Groupe', ['ROLE_GESTION_GROUPE']]
usergroup_comptoir:
__construct: ['Comptoir', ['ROLE_COMPTOIR']]
usergroup_contact:
__construct: ['Contact', ['ROLE_CONTACT']]
usergroup_admin:
__construct: ['Admin', ['ROLE_ADMIN', 'ROLE_SUPER_ADMIN']]
usergroup_superadmin:
__construct: ['Super Admin', ['ROLE_SUPER_ADMIN']]
App\Entity\Adherent: App\Entity\Adherent:
adherent{1..11}: adherent{1..11}:
ecompte: '<randomFloat(2, 0, 50)>' ecompte: '<randomFloat(2, 0, 50)>'
...@@ -95,7 +99,7 @@ App\Entity\Prestataire: ...@@ -95,7 +99,7 @@ App\Entity\Prestataire:
siret: '<text(10)>' siret: '<text(10)>'
geoloc (unique): '@geoloc<numberBetween(1,70)>' geoloc (unique): '@geoloc<numberBetween(1,70)>'
# user (unique): '@user<numberBetween(11,30)>' # user (unique): '@user<numberBetween(11,30)>'
typeprestataire: '@typepresta_prestataire' typeprestataire: '@typepresta<numberBetween(1,2)>'
groupe: '@groupe<numberBetween(1, 10)>' groupe: '@groupe<numberBetween(1, 10)>'
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h" horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
prestataire{22..32}: prestataire{22..32}:
...@@ -107,7 +111,7 @@ App\Entity\Prestataire: ...@@ -107,7 +111,7 @@ App\Entity\Prestataire:
siret: <text(10)> siret: <text(10)>
geoloc (unique): '@geoloc<numberBetween(1,70)>' geoloc (unique): '@geoloc<numberBetween(1,70)>'
# user (unique): '@user<numberBetween(11,30)>' # user (unique): '@user<numberBetween(11,30)>'
typeprestataire: '@typepresta_prestataire' typeprestataire: '@typepresta<numberBetween(1,2)>'
groupeprestataires: '2x @grppresta<numberBetween(1, 4)>' groupeprestataires: '2x @grppresta<numberBetween(1, 4)>'
groupe: '@groupe<numberBetween(1, 4)>' groupe: '@groupe<numberBetween(1, 4)>'
horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h" horaires: "<dayOfWeek()> de <time('H')>h à <time('H')>h"
...@@ -119,31 +123,47 @@ App\Entity\Rubrique: ...@@ -119,31 +123,47 @@ App\Entity\Rubrique:
enabled: true enabled: true
prestataires: '<numberBetween(1, 8)>x @prestataire<numberBetween(1, 32)>' prestataires: '<numberBetween(1, 8)>x @prestataire<numberBetween(1, 32)>'
App\Entity\Cotisation: App\Entity\CotisationInfos:
cotisation1: cotisationInfos1:
annee: '2019' annee: '2019'
debut: '<dateTimeBetween("-1 days", "now")>' debut: '<dateTimeBetween("-1 days", "now")>'
fin: '<dateTimeBetween("+1 years", "+2 years")>' fin: '<dateTimeBetween("+1 years", "+2 years")>'
montant: '10'
moyen: 'espece'
recu: 'true' recu: 'true'
user: '@useradherent' cotisationInfos{2..44}:
cotisation{2..11}:
annee: '2019' annee: '2019'
debut: '<dateTimeBetween("-15 days", "now")>' debut: '<dateTimeBetween("-15 days", "now")>'
fin: '<dateTimeBetween("+1 years", "+2 years")>' fin: '<dateTimeBetween("+1 years", "+2 years")>'
recu: 'true'
App\Entity\CotisationAdherent:
cotisation1:
operateur: '@useradherent'
type: 'cotisation_adherent'
cotisationInfos: '@cotisationInfos1'
montant: '10'
moyen: 'espece'
expediteur: '@adherent1'
destinataire: '@siege_1'
createdAt: '<dateTimeBetween("-200 days", "now")>'
cotisation{2..11}:
operateur: '@usera<current()>'
type: 'cotisation_adherent'
cotisationInfos: '@cotisationInfos<current()>'
montant: '10' montant: '10'
moyen: 'cb' moyen: 'cb'
recu: 'true' expediteur: '@adherent<current()>'
user: '@usera<current()>' destinataire: '@siege_1'
createdAt: '<dateTimeBetween("-200 days", "now")>'
App\Entity\CotisationPrestataire:
cotisationp{2..32}: cotisationp{2..32}:
annee: '2019' operateur: '@userp<current()>'
debut: '<dateTimeBetween("-15 days", "now")>' type: 'cotisation_prestataire'
fin: '<dateTimeBetween("+1 years", "+2 years")>' cotisationInfos: '@cotisationInfos<numberBetween(12, 43)>'
montant: '10' montant: '10'
moyen: 'cb' moyen: 'cb'
recu: 'true' expediteur: '@prestataire<current()>'
user: '@userp<current()>' destinataire: '@siege_1'
createdAt: '<dateTimeBetween("-200 days", "now")>'
App\Entity\User: App\Entity\User:
usersuperadmin: usersuperadmin:
...@@ -338,3 +358,142 @@ App\Entity\TransfertSiegeGroupe: ...@@ -338,3 +358,142 @@ App\Entity\TransfertSiegeGroupe:
destinataire: '@groupe<numberBetween(1,10)>' destinataire: '@groupe<numberBetween(1,10)>'
createdAt: '<dateTimeBetween("-200 days", "now")>' createdAt: '<dateTimeBetween("-200 days", "now")>'
parenttype: 'transfert' parenttype: 'transfert'
Prodigious\Sonata\MenuBundle\Entity\Menu:
menu_main:
name: 'Main menu'
alias: 'main'
Prodigious\Sonata\MenuBundle\Entity\MenuItem:
menuitem1:
menu: '@menu_main'
name: 'Adhérer'
url: '#'
position: 0
target: 0
enabled: 1
menuitem2:
menu: '@menu_main'
name: 'Adhérer à la MLC'
parent: '@menuitem1'
url: '/adherer'
position: 0
target: 0
enabled: 1
menuitem3:
menu: '@menu_main'
name: 'Charte'
parent: '@menuitem1'
url: '/charte'
position: 1
target: 0
enabled: 1
menuitem4:
menu: '@menu_main'
name: 'Professionnels'
url: '#'
position: 1
target: 0
enabled: 1
menuitem5:
menu: '@menu_main'
name: 'Carte des prestataires'
parent: '@menuitem4'
url: '/prestataires/carte'
position: 0
target: 0
enabled: 1
menuitem6:
menu: '@menu_main'
name: 'Liste des prestataires'
parent: '@menuitem4'
url: '/prestataires/liste'
position: 1
target: 0
enabled: 1
menuitem7:
menu: '@menu_main'
name: 'Liste des partenaires'
parent: '@menuitem4'
url: '/partenaires/liste'
position: 2
target: 0
enabled: 1
menuitem8:
menu: '@menu_main'
name: 'Rubriques'
parent: '@menuitem4'
url: '/prestataires/rubriques'
position: 3
target: 0
enabled: 1
menuitem9:
menu: '@menu_main'
name: 'Comptoirs'
url: '#'
position: 2
target: 0
enabled: 1
menuitem10:
menu: '@menu_main'
name: 'Carte des comptoirs'
parent: '@menuitem9'
url: '/comptoirs/carte'
position: 0
target: 0
enabled: 1
menuitem11:
menu: '@menu_main'
name: 'Liste des comptoirs'
parent: '@menuitem9'
url: '/comptoirs/liste'
position: 1
target: 0
enabled: 1
menuitem12:
menu: '@menu_main'
name: 'Carte des amaps'
parent: '@menuitem9'
url: '/groupe/prestataires/amap/carte'
position: 2
target: 0
enabled: 1
menuitem13:
menu: '@menu_main'
name: 'Carte des marchés'
parent: '@menuitem9'
url: '/groupe/prestataires/marche/carte'
position: 3
target: 0
enabled: 1
menuitem14:
menu: '@menu_main'
name: 'Aide'
url: '#'
position: 3
target: 0
enabled: 1
menuitem15:
menu: '@menu_main'
name: 'Foire aux questions'
parent: '@menuitem14'
url: '/faq'
position: 0
target: 0
enabled: 1
menuitem16:
menu: '@menu_main'
name: 'Nous contacter'
parent: '@menuitem14'
url: '/contact'
position: 1
target: 0
enabled: 1
menuitem17:
menu: '@menu_main'
name: 'Actualités'
url: '/news'
position: 4
target: 0
enabled: 1
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,5 +12,10 @@ ...@@ -12,5 +12,10 @@
"dev": "encore dev", "dev": "encore dev",
"watch": "encore dev --watch", "watch": "encore dev --watch",
"build": "encore production --progress" "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 ...@@ -130,7 +130,7 @@ class AdherentAdmin extends AbstractAdmin
)) ))
->end() ->end()
->with('Cotisation', ['class' => 'col-md-5']) ->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.montant', TextType::class, array('label' => 'Montant'))
->add('user.cotisations.first.moyen', ChoiceType::class, array( ->add('user.cotisations.first.moyen', ChoiceType::class, array(
'required' => true, 'required' => true,
...@@ -140,19 +140,19 @@ class AdherentAdmin extends AbstractAdmin ...@@ -140,19 +140,19 @@ class AdherentAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice); 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(); ->end();
if (!$this->isCurrentRoute('create')) { if (!$this->isCurrentRoute('create')) {
$formMapper $formMapper
->with('Date', ['class' => 'col-md-5']) ->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', 'label' => 'Date de début',
'data' => new \DateTime(), 'data' => new \DateTime(),
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, 'html5' => false,
'attr' => ['class' => 'js-datepicker'], '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', 'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'), 'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text', 'widget' => 'single_text',
......
...@@ -31,8 +31,10 @@ class ComptoirAdmin extends AbstractAdmin ...@@ -31,8 +31,10 @@ class ComptoirAdmin extends AbstractAdmin
protected function configureFormFields(FormMapper $formMapper) protected function configureFormFields(FormMapper $formMapper)
{ {
$comptoir = $this->getSubject(); $comptoir = $this->getSubject();
if ($this->isCurrentRoute('create')) {
$geoloc = new Geoloc(); $geoloc = new Geoloc();
$comptoir->setGeoloc($geoloc); $comptoir->setGeoloc($geoloc);
}
$formMapper $formMapper
->with('Comptoir', ['class' => 'col-md-8']) ->with('Comptoir', ['class' => 'col-md-8'])
->add('groupe', null, array('label' => 'Groupe local')) ->add('groupe', null, array('label' => 'Groupe local'))
......
...@@ -19,7 +19,7 @@ class CotisationAdherentAdmin extends CotisationAdmin ...@@ -19,7 +19,7 @@ class CotisationAdherentAdmin extends CotisationAdmin
public function createQuery($context = 'list') public function createQuery($context = 'list')
{ {
$query = parent::createQuery($context); $query = parent::createQuery($context);
$query->leftJoin($query->getRootAliases()[0] . '.user', 'u') $query->leftJoin($query->getRootAliases()[0] . '.operateur', 'u')
->andWhere('u.adherent IS NOT NULL') ->andWhere('u.adherent IS NOT NULL')
; ;
return $query; return $query;
...@@ -48,7 +48,12 @@ class CotisationAdherentAdmin extends CotisationAdmin ...@@ -48,7 +48,12 @@ class CotisationAdherentAdmin extends CotisationAdmin
{ {
$formMapper $formMapper
->with('Cotisation', ['class' => 'col-md-8']) ->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() ->end()
; ;
parent::configureFormFields($formMapper); parent::configureFormFields($formMapper);
...@@ -70,8 +75,8 @@ class CotisationAdherentAdmin extends CotisationAdmin ...@@ -70,8 +75,8 @@ class CotisationAdherentAdmin extends CotisationAdmin
{ {
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
->addIdentifier('user.username', null, array('label' => 'Login')) ->addIdentifier('operateur.username', null, array('label' => 'Login'))
->addIdentifier('user.email', null, array('label' => 'Email')); ->addIdentifier('operateur.email', null, array('label' => 'Email'));
parent::configureListFields($listMapper); parent::configureListFields($listMapper);
} }
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\Admin; namespace App\Admin;
use App\Entity\Prestataire;
use App\Enum\MoyenEnum; use App\Enum\MoyenEnum;
use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper;
...@@ -11,6 +12,7 @@ use Sonata\AdminBundle\Route\RouteCollection; ...@@ -11,6 +12,7 @@ use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper; use Sonata\AdminBundle\Show\ShowMapper;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
class CotisationAdmin extends AbstractAdmin class CotisationAdmin extends AbstractAdmin
{ {
...@@ -30,11 +32,11 @@ class CotisationAdmin extends AbstractAdmin ...@@ -30,11 +32,11 @@ class CotisationAdmin extends AbstractAdmin
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{ {
$datagridMapper $datagridMapper
->add('annee', null, array('label' => 'Année')) ->add('cotisationInfos.annee', null, array('label' => 'Année'))
->add('montant', null, array('label' => 'Montant')) ->add('montant', null, array('label' => 'Montant'))
->add('recu', null, array('label' => 'Recu ?')) ->add('cotisationInfos.recu', null, array('label' => 'Recu ?'))
->add('user.username', null, array('label' => 'Login')) ->add('operateur.username', null, array('label' => 'Login'))
->add('user.email', null, array('label' => 'Email')) ->add('operateur.email', null, array('label' => 'Email'))
; ;
} }
...@@ -47,7 +49,7 @@ class CotisationAdmin extends AbstractAdmin ...@@ -47,7 +49,7 @@ class CotisationAdmin extends AbstractAdmin
$now = new \DateTime(); $now = new \DateTime();
$formMapper $formMapper
->with('Cotisation', ['class' => 'col-md-8']) ->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('montant', null, array('label' => 'Montant'))
->add('moyen', ChoiceType::class, array( ->add('moyen', ChoiceType::class, array(
'required' => true, 'required' => true,
...@@ -56,17 +58,17 @@ class CotisationAdmin extends AbstractAdmin ...@@ -56,17 +58,17 @@ class CotisationAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice); return MoyenEnum::getTypeName($choice);
}, },
)) ))
->add('recu', CheckboxType::class, array('label' => 'Reçu')) ->add('cotisationInfos.recu', CheckboxType::class, array('label' => 'Reçu'))
->end() ->end()
->with('Date', ['class' => 'col-md-4']) ->with('Date', ['class' => 'col-md-4'])
->add('debut', null, array( ->add('cotisationInfos.debut', DateType::class, array(
'label' => 'Date de début', 'label' => 'Date de début',
'data' => new \DateTime(), 'data' => new \DateTime(),
'widget' => 'single_text', 'widget' => 'single_text',
'html5' => false, 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'attr' => ['class' => 'js-datepicker'],
)) ))
->add('fin', null, array( ->add('cotisationInfos.fin', DateType::class, array(
'label' => 'Date de fin', 'label' => 'Date de fin',
'data' => new \DateTime('+ 1 year'), 'data' => new \DateTime('+ 1 year'),
'widget' => 'single_text', 'widget' => 'single_text',
...@@ -79,7 +81,7 @@ class CotisationAdmin extends AbstractAdmin ...@@ -79,7 +81,7 @@ class CotisationAdmin extends AbstractAdmin
protected function configureRoutes(RouteCollection $collection) protected function configureRoutes(RouteCollection $collection)
{ {
$collection->remove('edit'); // $collection->remove('edit');
$collection->remove('delete'); $collection->remove('delete');
} }
...@@ -91,9 +93,9 @@ class CotisationAdmin extends AbstractAdmin ...@@ -91,9 +93,9 @@ class CotisationAdmin extends AbstractAdmin
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
// ->addIdentifier('user') // ->addIdentifier('user')
->addIdentifier('annee') ->addIdentifier('cotisationInfos.annee')
->addIdentifier('debut') ->addIdentifier('cotisationInfos.debut')
->addIdentifier('fin') ->addIdentifier('cotisationInfos.fin')
->addIdentifier('montant') ->addIdentifier('montant')
->addIdentifier('moyen') ->addIdentifier('moyen')
->addIdentifier('createdAt') ->addIdentifier('createdAt')
......
...@@ -19,7 +19,7 @@ class CotisationPrestataireAdmin extends CotisationAdmin ...@@ -19,7 +19,7 @@ class CotisationPrestataireAdmin extends CotisationAdmin
public function createQuery($context = 'list') public function createQuery($context = 'list')
{ {
$query = parent::createQuery($context); $query = parent::createQuery($context);
$query->leftJoin($query->getRootAliases()[0] . '.user', 'u') $query->leftJoin($query->getRootAliases()[0] . '.operateur', 'u')
->andWhere('u.prestataire IS NOT NULL') ->andWhere('u.prestataire IS NOT NULL')
; ;
return $query; return $query;
...@@ -48,7 +48,12 @@ class CotisationPrestataireAdmin extends CotisationAdmin ...@@ -48,7 +48,12 @@ class CotisationPrestataireAdmin extends CotisationAdmin
{ {
$formMapper $formMapper
->with('Cotisation', ['class' => 'col-md-8']) ->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() ->end()
; ;
parent::configureFormFields($formMapper); parent::configureFormFields($formMapper);
...@@ -69,8 +74,8 @@ class CotisationPrestataireAdmin extends CotisationAdmin ...@@ -69,8 +74,8 @@ class CotisationPrestataireAdmin extends CotisationAdmin
{ {
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
->addIdentifier('user.username', null, array('label' => 'Login')) ->addIdentifier('operateur.username', null, array('label' => 'Login'))
->addIdentifier('user.email', null, array('label' => 'Email')); ->addIdentifier('operateur.email', null, array('label' => 'Email'));
parent::configureListFields($listMapper); parent::configureListFields($listMapper);
} }
} }
...@@ -32,7 +32,7 @@ class FaqAdmin extends AbstractAdmin ...@@ -32,7 +32,7 @@ class FaqAdmin extends AbstractAdmin
->add('name', TextType::class, array( ->add('name', TextType::class, array(
'label' => 'Titre :' 'label' => 'Titre :'
)) ))
->add('text', CKEditorType::class, array( ->add('content', CKEditorType::class, array(
'label' => 'Texte', 'label' => 'Texte',
'required' => false 'required' => false
)) ))
...@@ -62,7 +62,7 @@ class FaqAdmin extends AbstractAdmin ...@@ -62,7 +62,7 @@ class FaqAdmin extends AbstractAdmin
unset($this->listModes['mosaic']); unset($this->listModes['mosaic']);
$listMapper $listMapper
->addIdentifier('name', null, array('label' => 'Titre')) ->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('fichier', null, array('label' => 'Fichier'))
->addIdentifier('image', null, array('label' => 'Image')) ->addIdentifier('image', null, array('label' => 'Image'))
->addIdentifier('user', null, array('label' => 'Utilisateur')) ->addIdentifier('user', null, array('label' => 'Utilisateur'))
......
...@@ -40,13 +40,8 @@ class FluxAdmin extends AbstractAdmin ...@@ -40,13 +40,8 @@ class FluxAdmin extends AbstractAdmin
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{ {
$datagridMapper $datagridMapper
->add('type', null, array(
'label' => 'Type',
'advanced_filter' => false,
'show_filter' => true
))
->add('transfert_or_transaction', 'doctrine_orm_callback', array( ->add('transfert_or_transaction', 'doctrine_orm_callback', array(
'label' => "Transfert ou transaction ?", 'label' => "Type",
'callback' => function ($queryBuilder, $alias, $field, $value) { 'callback' => function ($queryBuilder, $alias, $field, $value) {
if (!$value['value']) { if (!$value['value']) {
return; return;
...@@ -60,12 +55,17 @@ class FluxAdmin extends AbstractAdmin ...@@ -60,12 +55,17 @@ class FluxAdmin extends AbstractAdmin
'show_filter' => true, 'show_filter' => true,
'field_type' => SChoiceType::class, 'field_type' => SChoiceType::class,
'field_options' => array( 'field_options' => array(
'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert'), 'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert', 'Cotisations' => 'cotisation'),
'placeholder' => 'Indifférent', 'placeholder' => 'Indifférent',
'expanded' => true, 'expanded' => true,
'multiple' => false 'multiple' => false
) )
)) ))
->add('type', null, array(
'label' => 'Type plus précis',
'advanced_filter' => false,
'show_filter' => true
))
->add('operateur', null, array( ->add('operateur', null, array(
'label' => 'Operateur', 'label' => 'Operateur',
'advanced_filter' => false, 'advanced_filter' => false,
...@@ -85,15 +85,24 @@ class FluxAdmin extends AbstractAdmin ...@@ -85,15 +85,24 @@ class FluxAdmin extends AbstractAdmin
public function getTotalLabel() public function getTotalLabel()
{ {
return $this->translator->trans('Total des transactions :'); return $this->translator->trans('Total :');
} }
public function getTotal() public function getTotal()
{ {
$datagrid = $this->getDatagrid(); $datagrid = $this->getDatagrid();
$datagrid->buildPager(); $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 $query
->select('SUM( ' . $query->getRootAlias() . '.montant) as total') ->select('SUM( ' . $query->getRootAlias() . '.montant) as total')
->andWhere($query->getRootAlias().".parenttype = :type") ->andWhere($query->getRootAlias().".parenttype = :type")
...@@ -104,7 +113,7 @@ class FluxAdmin extends AbstractAdmin ...@@ -104,7 +113,7 @@ class FluxAdmin extends AbstractAdmin
$result = $query->execute(array(), \Doctrine\ORM\Query::HYDRATE_SINGLE_SCALAR); $result = $query->execute(array(), \Doctrine\ORM\Query::HYDRATE_SINGLE_SCALAR);
return $result; return $result2.' (Transactions: '.$result.')';
} }
/** /**
...@@ -117,8 +126,7 @@ class FluxAdmin extends AbstractAdmin ...@@ -117,8 +126,7 @@ class FluxAdmin extends AbstractAdmin
->addIdentifier('type', null, array('label' => 'Type')) ->addIdentifier('type', null, array('label' => 'Type'))
->addIdentifier('createdAt', null, array('label' => 'Date')) ->addIdentifier('createdAt', null, array('label' => 'Date'))
->addIdentifier('operateur', User::class, array('label' => 'Operateur')) ->addIdentifier('operateur', User::class, array('label' => 'Operateur'))
// ->addIdentifier('expediteur', null, array('label' => 'Expediteur')) ->addIdentifier('expediteur', null, array('label' => 'Expediteur'))
->addIdentifier('expediteur', null, array('label' => 'Expediteur'))//, 'template' => 'block/flux_entity.html.twig'))
->addIdentifier('destinataire', null, array('label' => 'Destinataire')) ->addIdentifier('destinataire', null, array('label' => 'Destinataire'))
->addIdentifier('montant', null, array('label' => 'Montant')) ->addIdentifier('montant', null, array('label' => 'Montant'))
->addIdentifier('reference', null, array('label' => 'Reference')) ->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 ...@@ -35,6 +35,10 @@ class GroupeprestataireAdmin extends AbstractAdmin
{ {
$groupepresta = $this->getSubject(); $groupepresta = $this->getSubject();
$formMapper $formMapper
->add('type', TextType::class, array(
'label' => 'Type (marche/amap) :',
'required' => true
))
->add('name', TextType::class, array( ->add('name', TextType::class, array(
'label' => 'Nom du groupe :', 'label' => 'Nom du groupe :',
'required' => true 'required' => true
...@@ -65,6 +69,9 @@ class GroupeprestataireAdmin extends AbstractAdmin ...@@ -65,6 +69,9 @@ class GroupeprestataireAdmin extends AbstractAdmin
->addIdentifier('name', null, array( ->addIdentifier('name', null, array(
'label' => 'Nom du groupe' 'label' => 'Nom du groupe'
)) ))
->addIdentifier('type', null, array(
'label' => 'Type'
))
->addIdentifier('horaires', 'html', array( ->addIdentifier('horaires', 'html', array(
'label' => 'Horaires', 'label' => 'Horaires',
'strip' => true, '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; ...@@ -24,6 +24,7 @@ use Sonata\MediaBundle\Form\Type\MediaType;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; 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\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
...@@ -63,25 +64,30 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -63,25 +64,30 @@ class PrestataireAdmin extends AbstractAdmin
{ {
// Initialize prestataire // Initialize prestataire
$presta = $this->getSubject(); $presta = $this->getSubject();
$now = new \DateTime();
if ($this->isCurrentRoute('create')) {
$user = $this->userManager->createUser(); $user = $this->userManager->createUser();
$groupe = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Usergroup::class)->findOneByName('Prestataire'); $groupe = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Usergroup::class)->findOneByName('Prestataire');
$user->setEnabled(true); $user->setEnabled(true);
$user->addGroup($groupe); $user->addGroup($groupe);
$user->addRole('ROLE_PRESTATAIRE'); $user->addRole('ROLE_PRESTATAIRE');
// $presta = new Prestataire(); $user->setPrestataire($presta);
$presta->setGeoloc(new Geoloc()); $presta->setUser($user);
$now = new \DateTime(); }
if (count($presta->getUser()->getCotisations()) <= 0) {
$cotisation = new Cotisation(); $cotisation = new Cotisation();
$cotisation->setDebut($now); $cotisation->setDebut($now);
$cotisation->setFin(new \DateTime('+ 1 year')); $cotisation->setFin(new \DateTime('+ 1 year'));
$user->addCotisation($cotisation); $user->addCotisation($cotisation);
$user->setPrestataire($presta); }
$presta->setUser($user); if ($presta->getGeoloc() == null) {
$presta->setGeoloc(new Geoloc());
}
// get the current Image instance // get the current Image instance
$imageHelp = null; $imageHelp = null;
if (!empty($user->getPrestataire()) && !empty($user->getPrestataire()->getMedia())) { if (!empty($presta) && !empty($presta->getMedia())) {
$image = $user->getPrestataire()->getMedia(); $image = $presta->getMedia();
if ($image && ($webPath = $image->getWebPath())) { if ($image && ($webPath = $image->getWebPath())) {
// get the container so the full path to the image can be set // get the container so the full path to the image can be set
$container = $this->getConfigurationPool()->getContainer(); $container = $this->getConfigurationPool()->getContainer();
...@@ -94,6 +100,11 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -94,6 +100,11 @@ class PrestataireAdmin extends AbstractAdmin
$formMapper $formMapper
->tab('Prestataire') ->tab('Prestataire')
->with('Identité', ['class' => 'col-md-7']) ->with('Identité', ['class' => 'col-md-7'])
->add('typeprestataire', null, array(
'label' => 'Type :',
'required' => true,
'expanded' => true
))
->add('user.firstname', TextType::class, array( ->add('user.firstname', TextType::class, array(
'label' => 'Prénom :', 'label' => 'Prénom :',
'required' => true 'required' => true
...@@ -101,7 +112,16 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -101,7 +112,16 @@ class PrestataireAdmin extends AbstractAdmin
->add('user.lastname', TextType::class, array( ->add('user.lastname', TextType::class, array(
'label' => 'Nom :', 'label' => 'Nom :',
'required' => true '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( ->add('user.phone', TextType::class, array(
'label' => 'Téléphone :', 'label' => 'Téléphone :',
'required' => true 'required' => true
...@@ -119,7 +139,7 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -119,7 +139,7 @@ class PrestataireAdmin extends AbstractAdmin
)) ))
->end() ->end()
->with('Cotisation', ['class' => 'col-md-5']) ->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.montant', TextType::class, array('label' => 'Montant'))
->add('user.cotisations.first.moyen', ChoiceType::class, array( ->add('user.cotisations.first.moyen', ChoiceType::class, array(
'required' => true, 'required' => true,
...@@ -129,8 +149,28 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -129,8 +149,28 @@ class PrestataireAdmin extends AbstractAdmin
return MoyenEnum::getTypeName($choice); 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() ->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']) ->with('Société', ['class' => 'col-md-7'])
->add('raison', TextType::class, array( ->add('raison', TextType::class, array(
'label' => 'Raison :', 'label' => 'Raison :',
...@@ -228,6 +268,7 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -228,6 +268,7 @@ class PrestataireAdmin extends AbstractAdmin
{ {
parent::configureDatagridFilters($datagridMapper); parent::configureDatagridFilters($datagridMapper);
$datagridMapper $datagridMapper
->add('typeprestataire')
->add('raison') ->add('raison')
->add('statut') ->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 ...@@ -46,15 +46,15 @@ class AdminController extends Controller
return new JsonResponse(array('status' => $status, 'newvalue' => ($object->isEnabled()?'true':'false'))); return new JsonResponse(array('status' => $status, 'newvalue' => ($object->isEnabled()?'true':'false')));
} }
/** // /**
* Voir tous les dashboards // * Voir tous les dashboards
* Route admin_index // * Route admin_index
* @Route("/a", name="settings") // * @Route("/a", name="settings")
*/ // */
public function settings() // public function settings()
{ // {
return $this->render('admin/settings.html.twig', [ // return $this->render('admin/settings.html.twig', [
'controller_name' => 'AdminController', // '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 @@ ...@@ -2,8 +2,10 @@
namespace App\Controller; namespace App\Controller;
use App\Entity\Faq;
use App\Entity\User; use App\Entity\User;
use App\Form\Type\TransactionAdherentPrestataireFormType; use App\Form\Type\TransactionAdherentPrestataireFormType;
use Doctrine\ORM\EntityManagerInterface;
use Geocoder\Provider\Nominatim\Nominatim; use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery; use Geocoder\Query\GeocodeQuery;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
...@@ -15,6 +17,13 @@ use Symfony\Component\Routing\Annotation\Route; ...@@ -15,6 +17,13 @@ use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController class IndexController extends AbstractController
{ {
private $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
/** /**
* @Route("/", name="index") * @Route("/", name="index")
*/ */
...@@ -34,4 +43,45 @@ class IndexController extends AbstractController ...@@ -34,4 +43,45 @@ class IndexController extends AbstractController
'news' => array(), '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; ...@@ -4,12 +4,12 @@ namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait; use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
/** /**
* @ORM\Entity(repositoryClass="App\Repository\AdherentRepository") * @ORM\Entity(repositoryClass="App\Repository\AdherentRepository")
* @ORM\Table(name="adherent")
*/ */
class Adherent class Adherent
{ {
......
...@@ -7,7 +7,6 @@ use App\Entity\EntityTrait\EnablableEntityTrait; ...@@ -7,7 +7,6 @@ use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait; use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity; use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait; use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
......
...@@ -2,103 +2,61 @@ ...@@ -2,103 +2,61 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\User; use App\Entity\CotisationInfos;
use App\Enum\MoyenEnum;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* Cotisation d'un utilisateur
*
* @ORM\Entity * @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\OneToOne(targetEntity="Siege")
* * @ORM\JoinColumn(name="siege_id", referencedColumnName="id", nullable=true)
* @ORM\Column(name="fin", type="date")
*/ */
private $fin; protected $destinataire;
/** /**
* @var float * @ORM\OneToOne(targetEntity="CotisationInfos", inversedBy="cotisation")
* * @ORM\JoinColumn(name="cotisationinfos_id", referencedColumnName="id", nullable=true)
* @ORM\Column(name="montant", type="decimal", precision=6, scale=2)
*/ */
private $montant; protected $cotisationInfos;
/** /**
* @var string * Constructeur
*
* @ORM\Column(name="moyen", type="string", length=100)
*/ */
private $moyen; public function __construct()
{
/** $this->cotisationInfos = new CotisationInfos();
* RECU ENVOYE ? }
* @var bool
*
* @ORM\Column(name="recu", type="boolean", nullable=false)
*/
private $recu;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="cotisations")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
private $user;
/** /**
* @return mixed * @return string
*/ */
public function getId(): int public function getParenttype(): string
{ {
return $this->id; return 'cotisation';
} }
/** /**
* @return User * Get cotisationInfos
* @return cotisationInfos
*/ */
public function getUser(): ?User public function getCotisationInfos(): ?CotisationInfos
{ {
return $this->user; return $this->cotisationInfos;
} }
/** /**
* @param User $user * Set CotisationInfos cotisationInfos
* @return $this * @return $this
*/ */
public function setUser(User $user) public function setCotisationInfos(CotisationInfos $cotisationInfos)
{ {
$this->user = $user; $this->cotisationInfos = $cotisationInfos;
return $this; return $this;
} }
...@@ -107,7 +65,7 @@ class Cotisation ...@@ -107,7 +65,7 @@ class Cotisation
*/ */
public function getAnnee(): ?int public function getAnnee(): ?int
{ {
return $this->annee; return $this->cotisationInfos->getAnnee();
} }
/** /**
...@@ -116,7 +74,7 @@ class Cotisation ...@@ -116,7 +74,7 @@ class Cotisation
*/ */
public function setAnnee(int $annee) public function setAnnee(int $annee)
{ {
$this->annee = $annee; $this->cotisationInfos->setAnnee($annee);
return $this; return $this;
} }
...@@ -125,7 +83,7 @@ class Cotisation ...@@ -125,7 +83,7 @@ class Cotisation
*/ */
public function getDebut(): ?\DateTime public function getDebut(): ?\DateTime
{ {
return $this->debut; return $this->cotisationInfos->getDebut();
} }
/** /**
...@@ -134,7 +92,7 @@ class Cotisation ...@@ -134,7 +92,7 @@ class Cotisation
*/ */
public function setDebut(\DateTime $debut) public function setDebut(\DateTime $debut)
{ {
$this->debut = $debut; $this->cotisationInfos->setDebut($debut);
return $this; return $this;
} }
...@@ -143,7 +101,7 @@ class Cotisation ...@@ -143,7 +101,7 @@ class Cotisation
*/ */
public function getFin(): ?\DateTime public function getFin(): ?\DateTime
{ {
return $this->fin; return $this->cotisationInfos->getFin();
} }
/** /**
...@@ -152,43 +110,7 @@ class Cotisation ...@@ -152,43 +110,7 @@ class Cotisation
*/ */
public function setFin(\DateTime $fin) public function setFin(\DateTime $fin)
{ {
$this->fin = $fin; $this->cotisationInfos->setFin($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;
return $this; return $this;
} }
...@@ -197,7 +119,7 @@ class Cotisation ...@@ -197,7 +119,7 @@ class Cotisation
*/ */
public function isRecu(): ?bool public function isRecu(): ?bool
{ {
return $this->recu; return $this->cotisationInfos->isRecu();
} }
/** /**
...@@ -206,7 +128,7 @@ class Cotisation ...@@ -206,7 +128,7 @@ class Cotisation
*/ */
public function setRecu(bool $recu) public function setRecu(bool $recu)
{ {
$this->recu = $recu; $this->cotisationInfos->setRecu($recu);
return $this; 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 @@ ...@@ -3,7 +3,6 @@
namespace App\Entity; namespace App\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use App\Entity\User;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
......
...@@ -29,14 +29,9 @@ class Faq ...@@ -29,14 +29,9 @@ class Faq
protected $id; protected $id;
/** /**
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* @var \Application\Sonata\MediaBundle\Entity\Media * @var \Application\Sonata\MediaBundle\Entity\Media
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY") * @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; protected $fichier;
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\Transaction;
use App\Entity\Transfert;
use App\Entity\User;
use App\Enum\MoyenEnum; use App\Enum\MoyenEnum;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
...@@ -16,7 +13,7 @@ use Symfony\Component\Validator\Constraints as Assert; ...@@ -16,7 +13,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Entity * @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE") * @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discr", type="string") * @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 abstract class Flux
{ {
...@@ -76,6 +73,7 @@ abstract class Flux ...@@ -76,6 +73,7 @@ abstract class Flux
protected $expediteur = null; protected $expediteur = null;
protected $destinataire = null; protected $destinataire = null;
protected $cotisationInfos = null;
abstract public function getParenttype(); 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 @@ ...@@ -2,14 +2,9 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Comptoir;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity; use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait; use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Prestataire;
use App\Entity\Siege;
use App\Entity\User;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
......
...@@ -38,6 +38,23 @@ class Groupeprestataire ...@@ -38,6 +38,23 @@ class Groupeprestataire
protected $id; 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[] * @var ArrayCollection|Prestataire[]
* *
* @ORM\ManyToMany(targetEntity="Prestataire", inversedBy="groupeprestataires", cascade={"persist"}, fetch="EXTRA_LAZY") * @ORM\ManyToMany(targetEntity="Prestataire", inversedBy="groupeprestataires", cascade={"persist"}, fetch="EXTRA_LAZY")
...@@ -65,6 +82,44 @@ class Groupeprestataire ...@@ -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 * Get horaires
* @return string Horaires * @return string Horaires
*/ */
......
...@@ -82,19 +82,19 @@ class News ...@@ -82,19 +82,19 @@ class News
/** /**
* @param User $user * @param null|User $user
* @return $this * @return $this
*/ */
public function setuser(User $user) public function setUser(?User $user)
{ {
$this->user = $user; $this->user = $user;
return $this; return $this;
} }
/** /**
* @return User * @return null|User
*/ */
public function getuser(): User public function getUser(): ?User
{ {
return $this->user; return $this->user;
} }
...@@ -116,4 +116,17 @@ class News ...@@ -116,4 +116,17 @@ class News
$this->visibleByAllGroups = $visibleByAllGroups; $this->visibleByAllGroups = $visibleByAllGroups;
return $this; 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; ...@@ -5,20 +5,15 @@ namespace App\Entity;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use App\Entity\EntityTrait\GeolocEntityTrait; use App\Entity\EntityTrait\GeolocEntityTrait;
use App\Entity\EntityTrait\HasCompteEntity; 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\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Mapping\Annotation\Slug;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* @ORM\Entity * @ORM\Entity(repositoryClass="App\Repository\PrestataireRepository")
* @ORM\Table(name="prestataire") * @ORM\Table(name="prestataire")
*/ */
class Prestataire class Prestataire
...@@ -45,6 +40,14 @@ class Prestataire ...@@ -45,6 +40,14 @@ class Prestataire
private $raison; private $raison;
/** /**
* @var string|null
*
* @Gedmo\Slug(fields={"raison"})
* @ORM\Column(length=100, unique=true)
*/
protected $slug;
/**
* @var string * @var string
* *
* @ORM\Column(name="metier", type="string", length=100) * @ORM\Column(name="metier", type="string", length=100)
...@@ -184,6 +187,17 @@ class Prestataire ...@@ -184,6 +187,17 @@ class Prestataire
return $this; return $this;
} }
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug)
{
$this->slug = $slug;
return $this;
}
/** /**
* @return string * @return string
*/ */
......
...@@ -4,7 +4,6 @@ namespace App\Entity; ...@@ -4,7 +4,6 @@ namespace App\Entity;
use App\Entity\EntityTrait\HasCompteEntity; use App\Entity\EntityTrait\HasCompteEntity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait; use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\Groupe;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Flux;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
...@@ -22,7 +21,7 @@ use Doctrine\ORM\Mapping as ORM; ...@@ -22,7 +21,7 @@ use Doctrine\ORM\Mapping as ORM;
* *
* @ORM\Entity * @ORM\Entity
*/ */
class Transaction extends Flux abstract class Transaction extends Flux
{ {
/** /**
* @return string * @return string
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\Transaction;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Flux;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
...@@ -23,9 +22,9 @@ 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) * - COMPTOIRS => PRESTATAIRES (Diffusion de monnaie papier auprès des prestataires)
* - PRESTATAIRES => COMPTOIRS (Reconversion) * - PRESTATAIRES => COMPTOIRS (Reconversion)
* *
* @ORM\Entity() * @ORM\Entity
*/ */
class Transfert extends Flux abstract class Transfert extends Flux
{ {
/** /**
* @return string * @return string
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Adherent;
use App\Entity\Comptoir;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Groupe;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Prestataire;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Groupe;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Comptoir;
use App\Entity\Prestataire;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
namespace App\Entity; namespace App\Entity;
use App\Entity\Groupe;
use App\Entity\Siege;
use App\Entity\Transfert;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
/** /**
......
...@@ -5,7 +5,6 @@ namespace App\Entity; ...@@ -5,7 +5,6 @@ namespace App\Entity;
use App\Entity\EntityTrait\NameSlugContentEntityTrait; use App\Entity\EntityTrait\NameSlugContentEntityTrait;
use App\Entity\EntityTrait\EnablableEntityTrait; use App\Entity\EntityTrait\EnablableEntityTrait;
use Gedmo\Timestampable\Traits\TimestampableEntity; use Gedmo\Timestampable\Traits\TimestampableEntity;
use App\Entity\Prestataire;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
......
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
namespace App\Entity; 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\Common\Collections\ArrayCollection;
use Doctrine\ORM\Event\LifecycleEventArgs; use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
...@@ -17,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; ...@@ -17,7 +11,7 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
/** /**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository") * @ORM\Entity()
* @ORM\Table(name="user") * @ORM\Table(name="user")
* @UniqueEntity( * @UniqueEntity(
* fields={"firstname", "lastname", "email"}, * fields={"firstname", "lastname", "email"},
...@@ -59,13 +53,6 @@ class User extends BaseUser ...@@ -59,13 +53,6 @@ class User extends BaseUser
protected $prestataire; protected $prestataire;
/** /**
* @var ArrayCollection|Cotisation[]
*
* @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"persist"})
*/
private $cotisations;
/**
* @var ArrayCollection|Document[] * @var ArrayCollection|Document[]
* *
* @ORM\OneToMany(targetEntity="Document", mappedBy="user", cascade={"persist"}) * @ORM\OneToMany(targetEntity="Document", mappedBy="user", cascade={"persist"})
...@@ -81,6 +68,7 @@ class User extends BaseUser ...@@ -81,6 +68,7 @@ class User extends BaseUser
/** /**
* @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur") * @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur")
* @ORM\OrderBy({"createdAt" = "DESC"})
*/ */
protected $flux; protected $flux;
...@@ -244,18 +232,27 @@ class User extends BaseUser ...@@ -244,18 +232,27 @@ class User extends BaseUser
*/ */
public function getCotisations() 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 * @return $this
*/ */
public function addCotisation(Cotisation $cotisation) public function addCotisation($cotisation)
{ {
if (!$this->cotisations->contains($cotisation)) { if (!$this->cotisations->contains($cotisation)) {
$this->cotisations[] = $cotisation; $this->flux[] = $cotisation;
$cotisation->setUser($this); $cotisation->setOperateur($this);
} }
return $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; ...@@ -5,8 +5,10 @@ namespace App\Form\Type;
use App\Entity\User; use App\Entity\User;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository; 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\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\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
...@@ -15,46 +17,60 @@ use Symfony\Component\Form\FormEvent; ...@@ -15,46 +17,60 @@ use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
class RegistrationFormType extends AbstractRegistrationFormType class RegistrationFormType extends AbstractType
{ {
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->remove('username') ->remove('username')
->add('email', TextType::class, array('label' => 'form_label_email')) ->add('email', EmailType::class, array(
->add('firstname', TextType::class, array('label' => 'form_label_first_name')) 'label' => 'form.email',
->add('lastname', TextType::class, array('label' => 'form_label_family_name')) '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( ->add('plainPassword', RepeatedType::class, array(
'type' => 'password', 'type' => PasswordType::class,
'options' => array('translation_domain' => 'FOSUserBundle'), 'options' => array(
'translation_domain' => 'FOSUserBundle',
'attr' => array(
'autocomplete' => 'new-password',
),
),
'first_options' => array('label' => 'form.password'), 'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'), 'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch', 'invalid_message' => 'fos_user.password.mismatch',
'error_bubbling' => true
)) ))
->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($builder) { ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($builder) {
$repo = $this->em->getRepository(User::class); $repo = $this->em->getRepository(User::class);
$emailExist = $repo->findBy(array('email' => $event->getForm()->get('email')->getData())); $emailExist = $repo->findBy(array('email' => $event->getForm()->get('email')->getData()));
if (count($emailExist) > 0) { 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) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults(array( $resolver->setDefaults(array(
'cascade_validation' => true, 'cascade_validation' => true,
'type' => null // 'type' => null
)); ));
} }
public function getParent()
{
return FOSRegistrationFormType::class;
}
public function getBlockPrefix() public function getBlockPrefix()
{ {
return 'app_user_registration'; return 'app_user_registration';
......
<?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 ...@@ -18,33 +18,4 @@ class AdherentRepository extends ServiceEntityRepository
{ {
parent::__construct($registry, Adherent::class); 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; ...@@ -9,15 +9,22 @@ use Twig\TwigTest;
class AppExtension extends AbstractExtension class AppExtension extends AbstractExtension
{ {
// public function getFilters(): array public $container;
// {
// return [ public function __construct($container)
// // If your filter generates SAFE HTML, you should add a third {
// // parameter: ['is_safe' => ['html']] $this->container = $container;
// // Reference: https://twig.symfony.com/doc/2.x/advanced.html#automatic-escaping }
// new TwigFilter('toto', [$this, 'doSomething']),
// ]; public function getFunctions()
// } {
return [
new \Twig_SimpleFunction('parameter', function($name)
{
return $this->container->getParameter($name);
})
];
}
public function getTests(): array 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 @@ ...@@ -293,6 +293,9 @@
"pixassociates/sortable-behavior-bundle": { "pixassociates/sortable-behavior-bundle": {
"version": "v1.5" "version": "v1.5"
}, },
"prodigious/sonata-menu-bundle": {
"version": "3.0.1"
},
"psr/cache": { "psr/cache": {
"version": "1.0.1" "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
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="fr"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="fr">
<!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{title|default('mlc_title'|trans) }}</title>
<meta name="description" content="{{ description|default('mlc_description'|trans) }}" />
<meta name="keywords" content="{{ keywords|default('mlc_keywords'|trans) }}" />
<meta name="author" content="{{ 'mlc_author'|trans }}">
{# POUR AJOUTER DES META ( like og: ) #}
{% block meta %}
{% endblock meta %}
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock stylesheets %}
{# POUR AJOUTER DES CSS #}
{% block css %} {% endblock css %}
</head>
<body>
{% include 'common/flash-messages.html.twig' %}
<!-- HEADER -->
{% block header %}
{% include 'common/header.html.twig' %}
{% endblock header %}
<!-- CONTAINER -->
<div class="container">
{% block content %}
<!-- CONTENT -->
{% endblock content %}
</div>
<!-- FOOTER -->
{% block footer %}
{% include 'common/footer.html.twig' %}
{% endblock footer %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock javascripts %}
{# POUR AJOUTER DES JS #}
{% block js %} {% endblock js %}
</body>
</html>
{% if menuItems is not defined %}
{% set menuItems = getMenuItemsFromAlias('main') %}
{% endif %}
{% if menuItems is not null and menuItems|length > 0 %}
<nav class="menu navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="{{ url('index') }}">
<img src="/images/logo.png" height="45" class="d-inline-block align-top" alt="{{ parameter('mlc_name') }}">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
{% import 'common/menu_tree_macro.html.twig' as tree %}
{% set currentPath = app.request.requestUri %}
<div class="collapse navbar-collapse" id="navbarSupportedContent">
{{ tree.menu(menuItems, currentPath) }}
</div>
</nav>
{% endif %}
\ No newline at end of file
{% macro menu(items, currentPath) %}
{% import _self as self %}
<ul class="navbar-nav mr-auto">
{% for menuItem in items %}
{% set url = menuItem.url %}
{% set attributes = "menu-item" %}
{% if menuItem.classAttribute %}
{% set attributes = attributes ~ ' ' ~ menuItem.classAttribute %}
{% endif %}
{% if menuItem.hasChild() %}
{% set attributes = attributes ~ ' has-child dropdown' %}
{% for childItem in menuItem.children %}
{% set childUrl = childItem.url %}
{% if childUrl == currentPath %}
{% set attributes = attributes ~ ' active current-parent' %}
{% endif %}
{% endfor %}
{% endif %}
<li class="nav-item {% if menuItem.hasChild() %}dropdown{% endif %}{{ attributes }}" role="menu-item">
{% if menuItem.hasChild() %}
<a href="#" id="navbarDropdown{{ menuItem.id }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="nav-link parent dropdown-toggle {% if currentPath == url %}current{% endif %}" {% if menuItem.target %} target="_blank"{% endif %}>{{ menuItem.name }}</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown{{ menuItem.id }}">
{{ self.menuchild(menuItem.children, currentPath) }}
</div>
{% else %}
<a href="{{ url }}" class="nav-link {% if currentPath == url %}current{% endif %}" {% if menuItem.target %} target="_blank"{% endif %}>{{ menuItem.name }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endmacro %}
{% macro menuchild(items, currentPath) %}
{% import _self as self %}
{% for menuItem in items %}
{% set url = menuItem.url %}
<a href="{{ url }}" class="dropdown-item {% if currentPath == url %}current{% endif %}" {% if menuItem.target %} target="_blank"{% endif %}>{{ menuItem.name }}</a>
{% endfor %}
{% endmacro %}
\ No newline at end of file
{% extends 'common/layout.html.twig' %}
{% block content %}
Carte des comptoirs :
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
Liste des comptoirs :
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
Contact :
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container faqlist mt-5'>
<h1>Foire Aux Questions</h1>
{% for faq in faqs %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<ul>
<li><a href="{{ path('show_faq', {'slug': faq.slug}) }}">{{faq.name}}</a></li>
</ul>
</div>
{% endfor %}
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container faqshow mt-5'>
<h1>{{faq.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentnews p-4 mt-5">
<p>
{{faq.content|raw}}
</p>
{% if faq.fichier is not null %}
<a href="{% path faq.fichier, 'reference' %}">Voir le fichier</a>
{% endif %}
{% if faq.image is not null %}
{% thumbnail faq.image, 'small' with {'class': 'myclass'} %}
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
Carte groupe de prestataire :
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
Liste groupes de prestataire :
{% endblock %}
{% extends 'base.html.twig' %} {% extends 'common/layout.html.twig' %}
{% block title %}Hello !{% endblock %} {% block content %}
Page d'accueil
{% 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>Helloa {{ getLastNews(5) }}! ✅</h1> #}
{# TRANSLATION :
{% trans %}Hello %name%{% endtrans %}
{% transchoice count %}
{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples
{% endtranschoice %} #}
This friendly message is coming from:
<ul>
<li>Your controller at <code><a href="{{ 'src/Controller/IndexController.php'|file_link(0) }}">src/Controller/IndexController.php</a></code></li>
<li>Your template at <code><a href="{{ 'templates/index.html.twig'|file_link(0) }}">templates/index.html.twig</a></code></li>
</ul>
</div>
{% endblock %} {% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>Actualités</h1>
{% for new in news %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<h2><a href="{{ path('news_show', {'slug': new.slug}) }}">{{new.name}}</a></h2>
<div class="contentnews p-4 mt-5">
{{new.content|raw}}
</div>
</div>
{% endfor %}
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>{{news.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentnews p-4 mt-5">
{{news.content|raw}}
</div>
</div>
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
Carte prestataires :
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>{{type}} :</h1>
{% for presta in prestas %}
<div class="contentnews p-4 mt-5">
<span>{{presta.statut}} ({{presta.siret}})</span>
<small class='ml-5'>Responsable : {{presta.responsable}} ({{presta.metier}})</small>
{% if presta.web is not empty %}
<p><a href='{{presta.web}}'>Site web</a></p>
{% endif %}
</div>
{% endfor %}
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>Rubriques</h1>
{% for rubrique in rubriques %}
<div class="my-3 p-3 bg-white rounded box-shadow">
<h2><a href="{{ path('show_rubrique', {'slug': rubrique.slug}) }}">{{rubrique.name}}</a></h2>
<h3>{{rubrique.prestataires|length}} prestataires</h3>
<div class="contentnews p-4 mt-5">
{{rubrique.content|raw}}
</div>
</div>
{% endfor %}
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>{{presta.raison}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<div class="contentnews p-4 mt-5">
<h2>{{presta.statut}}</h2>
<h3>Responsable : {{presta.responsable}} ({{presta.metier}})</h3>
<h4>SIRET : {{presta.siret}}</h4>
{% if presta.web is not empty %}
<h4><a href='{{presta.web}}'>Site web</a></h4>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container newslist mt-5'>
<h1>{{rubrique.name}}</h1>
<div class="my-3 p-3 bg-white rounded box-shadow">
<p>{{rubrique.content|raw}}</p>
<h3>Prestataires : </h3>
{% for prestataire in rubrique.prestataires %}
<div class="my-3 p-3 bg-grey rounded box-shadow">
<span><a href="{{ path('show_prestataire', {'slug': prestataire.slug}) }}">{{prestataire.raison}}</a></span>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
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