Browse Source

Adapatation à symfony6 et easyadmin4

feature/symfony6.1
Fabien Normand 1 year ago
parent
commit
226ae5e574
23 changed files with 1749 additions and 2984 deletions
  1. +0
    -5
      .env
  2. +32
    -34
      composer.json
  3. +1562
    -2811
      composer.lock
  4. +4
    -5
      config/bundles.php
  5. +32
    -0
      config/dependencies.php
  6. +7
    -7
      config/packages/artgris_file_manager.yaml
  7. +2
    -0
      config/packages/ch_cookie_consent.yaml
  8. +2
    -1
      config/packages/doctrine.yaml
  9. +0
    -19
      config/packages/fos_ckeditor.yaml
  10. +1
    -1
      config/packages/framework.yaml
  11. +0
    -4
      config/packages/mailjet.yaml
  12. +6
    -3
      config/packages/security.yaml
  13. +1
    -1
      config/packages/test/framework.yaml
  14. +2
    -0
      config/routes/ch_cookie_consent.yaml
  15. +1
    -2
      config/services.yaml
  16. +29
    -25
      migrations/Version20221206140936.php
  17. +0
    -5
      phpunit.xml.dist
  18. +2
    -15
      src/Controller/Admin/PageCrudController.php
  19. +40
    -0
      src/Definition/Field/Site/PageFieldDefinition.php
  20. +16
    -0
      src/Dependency/Site/PageDependency.php
  21. +0
    -4
      src/Entity/User/User.php
  22. +2
    -1
      src/Kernel.php
  23. +8
    -41
      symfony.lock

+ 0
- 5
.env View File

@@ -30,8 +30,3 @@ APP_SECRET=555bc2aee588a05641d07ab10b081636
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

###> mailjet/mailjet-bundle ###
MAILJET_APIKEY_PUBLIC=your-api_key
MAILJET_APIKEY_PRIVATE=@@your-secret_key
###< mailjet/mailjet-bundle ###

+ 32
- 34
composer.json View File

@@ -4,61 +4,58 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.4",
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"artgris/filemanager-bundle": "^2.2",
"composer/package-versions-deprecated": "1.11.99.2",
"connectholland/cookie-consent-bundle": "^0.9.10",
"connectholland/cookie-consent-bundle": "^0.11",
"doctrine/annotations": "^1.0",
"doctrine/doctrine-bundle": "^2.3",
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/orm": "^2.8",
"dompdf/dompdf": "^1.0",
"easycorp/easyadmin-bundle": "^3.3",
"easycorp/easyadmin-bundle": "^4.4",
"friendsofsymfony/ckeditor-bundle": "^2.3",
"knplabs/knp-paginator-bundle": "^5.6",
"liip/imagine-bundle": "^2.6",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^5.1",
"sensio/framework-extra-bundle": "^6.2",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "5.4.*",
"symfony/console": "5.4.*",
"symfony/dotenv": "5.4.*",
"symfony/expression-language": "5.4.*",
"symfony/asset": "6.1.*",
"symfony/console": "6.1.*",
"symfony/dotenv": "6.1.*",
"symfony/expression-language": "6.1.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.4.*",
"symfony/framework-bundle": "5.4.*",
"symfony/http-client": "5.4.*",
"symfony/intl": "5.4.*",
"symfony/mailer": "5.4.*",
"symfony/mime": "5.4.*",
"symfony/form": "6.1.*",
"symfony/framework-bundle": "6.1.*",
"symfony/http-client": "6.1.*",
"symfony/intl": "6.1.*",
"symfony/mailer": "6.1.*",
"symfony/mime": "6.1.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.4.*",
"symfony/process": "5.4.*",
"symfony/property-access": "5.4.*",
"symfony/property-info": "5.4.*",
"symfony/proxy-manager-bridge": "5.4.*",
"symfony/security-bundle": "5.4.*",
"symfony/serializer": "5.4.*",
"symfony/string": "5.4.*",
"symfony/translation": "5.4.*",
"symfony/twig-bundle": "^5.4",
"symfony/validator": "5.4.*",
"symfony/web-link": "5.4.*",
"symfony/notifier": "6.1.*",
"symfony/process": "6.1.*",
"symfony/property-access": "6.1.*",
"symfony/property-info": "6.1.*",
"symfony/proxy-manager-bridge": "6.1.*",
"symfony/security-bundle": "6.1.*",
"symfony/serializer": "6.1.*",
"symfony/string": "6.1.*",
"symfony/translation": "6.1.*",
"symfony/twig-bundle": "^6.1",
"symfony/validator": "6.1.*",
"symfony/web-link": "6.1.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.4.*",
"symfony/yaml": "6.1.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0",
"mailjet/mailjet-bundle": "^2.0",
"mailjet/mailjet-swiftmailer": "1.0.6"
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/phpunit-bridge": "^6.1",
"symfony/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
@@ -90,7 +87,8 @@
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"ckeditor:install": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
@@ -105,7 +103,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.4.*"
"require": "6.1.*"
}
}
}

+ 1562
- 2811
composer.lock
File diff suppressed because it is too large
View File


+ 4
- 5
config/bundles.php View File

@@ -14,12 +14,11 @@ return [
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
Artgris\Bundle\FileManagerBundle\ArtgrisFileManagerBundle::class => ['all' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
Lc\SovBundle\LcSovBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
ConnectHolland\CookieConsentBundle\CHCookieConsentBundle::class => ['all' => true],
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
Mailjet\MailjetBundle\MailjetBundle::class => ['all' => true],
ConnectHolland\CookieConsentBundle\CHCookieConsentBundle::class => ['all' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
Artgris\Bundle\FileManagerBundle\ArtgrisFileManagerBundle::class => ['all' => true],
];

+ 32
- 0
config/dependencies.php View File

@@ -0,0 +1,32 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return function(ContainerConfigurator $configurator) {

$services = $configurator->services();

$baseDirectoryDependency = dirname(__FILE__).'/../src/Dependency/';
$directoriesDenpendencyInjection = scandir($baseDirectoryDependency);
$dependencies = [];
foreach($directoriesDenpendencyInjection as $directory) {
if($directory != '.' && $directory != '..' && is_dir($baseDirectoryDependency.$directory)) {
$filesDenpendencyInjection = scandir($baseDirectoryDependency.$directory);
foreach($filesDenpendencyInjection as $file) {
if($file != '.' && $file != '..') {
$classDependency = 'App\Dependency\\'.$directory.'\\'.str_replace('.php', '', $file) ;
$dependencies[] = new $classDependency;
}
}
}
}

foreach($dependencies as $dependency) {
$aliases = $dependency->getAliases();

foreach($aliases as $alias => $final) {
$services->alias($alias, $final);
}
}

};

+ 7
- 7
config/packages/artgris_file_manager.yaml View File

@@ -1,8 +1,8 @@
artgris_file_manager:
conf:
image:
dir: "../public%app.path_uploads%"
type: 'image'
file:
dir: "../public%app.path_uploads%"
type: 'file'
conf:
image:
dir: "../public%app.path_uploads%"
type: 'image'
file:
dir: "../public%app.path_uploads%"
type: 'file'

+ 2
- 0
config/packages/ch_cookie_consent.yaml View File

@@ -0,0 +1,2 @@
ch_cookie_consent:
categories: ['analytics', 'tracking', 'social_media', 'marketing']

+ 2
- 1
config/packages/doctrine.yaml View File

@@ -20,4 +20,5 @@ doctrine:
Lc\SovBundle\Model\Site\SiteInterface: App\Entity\Site\Site
Lc\SovBundle\Model\Ticket\TicketMessageInterface: App\Entity\Ticket\TicketMessage
Lc\SovBundle\Model\Ticket\TicketInterface: App\Entity\Ticket\Ticket
Lc\SovBundle\Model\User\GroupUserInterface: App\Entity\User\GroupUser
Lc\SovBundle\Model\User\GroupUserInterface: App\Entity\User\GroupUser
Lc\SovBundle\Model\Reminder\ReminderInterface: App\Entity\Reminder\Reminder

+ 0
- 19
config/packages/fos_ckeditor.yaml View File

@@ -1,24 +1,5 @@
# Read the documentation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html

fos_ck_editor:
input_sync: true
default_config: base_config
configs:
base_config:
filebrowserBrowseRoute: file_manager
filebrowserBrowseRouteParameters:
conf: default
module: ckeditor
format_tags: 'p;h2;h3'
toolbar:
- { name: "styles", items: ['Bold', 'Italic','Underline', 'Strike']}
- { name: "paragraph", items: ['Format', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'] }
- { name: "link", items: [ 'Link', 'Unlink'] }
- {name: 'insert', items: [ 'Image' ]}
- {name: 'document', items: [ 'Source' ]}
simple_config:
toolbar:
- { items: ['Bold', 'Italic', 'Underline', 'Colors', 'Source'] }
twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'

+ 1
- 1
config/packages/framework.yaml View File

@@ -10,7 +10,7 @@ framework:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native
esi: true
#fragments: true
php_errors:

+ 0
- 4
config/packages/mailjet.yaml View File

@@ -1,4 +0,0 @@
mailjet:
api_key: "%env(MAILJET_APIKEY_PUBLIC)%"
secret_key: "%env(MAILJET_APIKEY_PRIVATE)%"


+ 6
- 3
config/packages/security.yaml View File

@@ -1,9 +1,12 @@
security:
enable_authenticator_manager: true
encoders:
App\Entity\User\User:
algorithm: auto
# encoders:
# App\Entity\User\User:
# algorithm: auto


password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
# used to reload user from session & other features (e.g. switch_user)

+ 1
- 1
config/packages/test/framework.yaml View File

@@ -1,4 +1,4 @@
framework:
test: true
session:
storage_id: session.storage.mock_file
storage_factory_id: session.storage.factory.native

+ 2
- 0
config/routes/ch_cookie_consent.yaml View File

@@ -0,0 +1,2 @@
ch_cookie_consent:
resource: "@CHCookieConsentBundle/Resources/config/routing.yaml"

+ 1
- 2
config/services.yaml View File

@@ -8,7 +8,6 @@ parameters:
app.default_locale: "fr"
app.path_uploads: '/uploads'
app.admin.logo: 'laclic.png'
app.reminder.route_render_modal: 'sov_admin_reminder_render_modal'
app.assets_directory: '%kernel.project_dir%/public/assets/'
app.path.images: '/uploads'

@@ -34,7 +33,7 @@ services:
resource: '../src/Controller/'
tags: ['controller.service_arguments']

Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport: '@swiftmailer.mailer.transport.mailjet'
# Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport: '@swiftmailer.mailer.transport.mailjet'


#Pour remplacer le form cookie consent

migrations/Version20211123120511.php → migrations/Version20221206140936.php View File

@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211123120511 extends AbstractMigration
final class Version20221206140936 extends AbstractMigration
{
public function getDescription(): string
{
@@ -22,8 +22,8 @@ final class Version20211123120511 extends AbstractMigration
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE ch_cookieconsent_log (id INT AUTO_INCREMENT NOT NULL, ip_address VARCHAR(255) NOT NULL, cookie_consent_key VARCHAR(255) NOT NULL, cookie_name VARCHAR(255) NOT NULL, cookie_value VARCHAR(255) NOT NULL, timestamp DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE file (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, legend VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locales_enabled LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', position DOUBLE PRECISION NOT NULL, INDEX IDX_8C9F3610B03A8386 (created_by_id), INDEX IDX_8C9F3610896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE group_user (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_A4C98D39B03A8386 (created_by_id), INDEX IDX_A4C98D39896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, file_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB62093CB796C (file_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE group_user (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, open_graph_image_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', open_graph_title VARCHAR(255) DEFAULT NULL, open_graph_description LONGTEXT DEFAULT NULL, slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_A4C98D39B03A8386 (created_by_id), INDEX IDX_A4C98D39896DBBDE (updated_by_id), INDEX IDX_A4C98D3936DB1841 (open_graph_image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, file_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, open_graph_image_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, meta_title VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, old_urls LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', open_graph_title VARCHAR(255) DEFAULT NULL, open_graph_description LONGTEXT DEFAULT NULL, slug VARCHAR(255) NOT NULL, position DOUBLE PRECISION NOT NULL, status DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, INDEX IDX_140AB6203DA5256D (image_id), INDEX IDX_140AB62093CB796C (file_id), INDEX IDX_140AB620B03A8386 (created_by_id), INDEX IDX_140AB620896DBBDE (updated_by_id), INDEX IDX_140AB62036DB1841 (open_graph_image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE page_file (page_id INT NOT NULL, file_id INT NOT NULL, INDEX IDX_B5B2ACAC4663E4 (page_id), INDEX IDX_B5B2ACA93CB796C (file_id), PRIMARY KEY(page_id, file_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reminder (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, crud_action VARCHAR(64) DEFAULT NULL, crud_controller_fqcn VARCHAR(255) DEFAULT NULL, entity_id INT DEFAULT NULL, date_reminder DATE DEFAULT NULL, done TINYINT(1) NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_40374F40B03A8386 (created_by_id), INDEX IDX_40374F40896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE reminder_user_interface (reminder_id INT NOT NULL, user_interface_id INT NOT NULL, INDEX IDX_7FD2584BD987BE75 (reminder_id), INDEX IDX_7FD2584B2BC79580 (user_interface_id), PRIMARY KEY(reminder_id, user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
@@ -31,30 +31,32 @@ final class Version20211123120511 extends AbstractMigration
$this->addSql('CREATE TABLE site_setting (id INT AUTO_INCREMENT NOT NULL, site_id INT NOT NULL, file_id INT DEFAULT NULL, name VARCHAR(63) DEFAULT NULL, text LONGTEXT DEFAULT NULL, date DATETIME DEFAULT NULL, INDEX IDX_64D05A53F6BD1646 (site_id), INDEX IDX_64D05A5393CB796C (file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, type VARCHAR(32) NOT NULL, status VARCHAR(32) NOT NULL, subject VARCHAR(255) NOT NULL, tags LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', visitor_firstname VARCHAR(64) DEFAULT NULL, visitor_lastname VARCHAR(64) DEFAULT NULL, visitor_email VARCHAR(128) DEFAULT NULL, visitor_token VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_97A0ADA3A76ED395 (user_id), INDEX IDX_97A0ADA3B03A8386 (created_by_id), INDEX IDX_97A0ADA3896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ticket_message (id INT AUTO_INCREMENT NOT NULL, ticket_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, message LONGTEXT NOT NULL, answer_by_admin TINYINT(1) DEFAULT NULL, image_filename VARCHAR(255) DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, status DOUBLE PRECISION NOT NULL, INDEX IDX_BA71692D700047D2 (ticket_id), INDEX IDX_BA71692DB03A8386 (created_by_id), INDEX IDX_BA71692D896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, lastname VARCHAR(255) DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, gender TINYINT(1) DEFAULT NULL, birthdate DATE DEFAULT NULL, is_verified TINYINT(1) NOT NULL, ticket_types_notification LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, lastname VARCHAR(255) DEFAULT NULL, firstname VARCHAR(255) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, gender TINYINT(1) DEFAULT NULL, birthdate DATE DEFAULT NULL, is_verified TINYINT(1) NOT NULL, ticket_types_notification LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', last_login DATETIME DEFAULT NULL, dev_alias VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_group_user_interface (user_id INT NOT NULL, group_user_interface_id INT NOT NULL, INDEX IDX_12B87B34A76ED395 (user_id), INDEX IDX_12B87B34F583BABC (group_user_interface_id), PRIMARY KEY(user_id, group_user_interface_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D39896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE group_user ADD CONSTRAINT FK_A4C98D3936DB1841 FOREIGN KEY (open_graph_image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6203DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB62093CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB62036DB1841 FOREIGN KEY (open_graph_image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACAC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE page_file ADD CONSTRAINT FK_B5B2ACA93CB796C FOREIGN KEY (file_id) REFERENCES file (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE reminder_user_interface ADD CONSTRAINT FK_7FD2584BD987BE75 FOREIGN KEY (reminder_id) REFERENCES reminder (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE reminder_user_interface ADD CONSTRAINT FK_7FD2584B2BC79580 FOREIGN KEY (user_interface_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE site_setting ADD CONSTRAINT FK_64D05A53F6BD1646 FOREIGN KEY (site_id) REFERENCES site (id)');
$this->addSql('ALTER TABLE site_setting ADD CONSTRAINT FK_64D05A5393CB796C FOREIGN KEY (file_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D700047D2 FOREIGN KEY (ticket_id) REFERENCES ticket (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692DB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692DB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE ticket_message ADD CONSTRAINT FK_BA71692D896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE user_group_user_interface ADD CONSTRAINT FK_12B87B34A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_group_user_interface ADD CONSTRAINT FK_12B87B34F583BABC FOREIGN KEY (group_user_interface_id) REFERENCES group_user (id) ON DELETE CASCADE');
}
@@ -62,30 +64,32 @@ final class Version20211123120511 extends AbstractMigration
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB62093CB796C');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE site_setting DROP FOREIGN KEY FK_64D05A5393CB796C');
$this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34F583BABC');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584BD987BE75');
$this->addSql('ALTER TABLE site_setting DROP FOREIGN KEY FK_64D05A53F6BD1646');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D700047D2');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610B03A8386');
$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610896DBBDE');
$this->addSql('ALTER TABLE group_user DROP FOREIGN KEY FK_A4C98D39B03A8386');
$this->addSql('ALTER TABLE group_user DROP FOREIGN KEY FK_A4C98D39896DBBDE');
$this->addSql('ALTER TABLE group_user DROP FOREIGN KEY FK_A4C98D3936DB1841');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB6203DA5256D');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB62093CB796C');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB62036DB1841');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACAC4663E4');
$this->addSql('ALTER TABLE page_file DROP FOREIGN KEY FK_B5B2ACA93CB796C');
$this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40B03A8386');
$this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40896DBBDE');
$this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584BD987BE75');
$this->addSql('ALTER TABLE reminder_user_interface DROP FOREIGN KEY FK_7FD2584B2BC79580');
$this->addSql('ALTER TABLE site_setting DROP FOREIGN KEY FK_64D05A53F6BD1646');
$this->addSql('ALTER TABLE site_setting DROP FOREIGN KEY FK_64D05A5393CB796C');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3A76ED395');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3B03A8386');
$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA3896DBBDE');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D700047D2');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692DB03A8386');
$this->addSql('ALTER TABLE ticket_message DROP FOREIGN KEY FK_BA71692D896DBBDE');
$this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34A76ED395');
$this->addSql('ALTER TABLE user_group_user_interface DROP FOREIGN KEY FK_12B87B34F583BABC');
$this->addSql('DROP TABLE ch_cookieconsent_log');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE group_user');

+ 0
- 5
phpunit.xml.dist View File

@@ -13,11 +13,6 @@
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="8.5" />

<!-- ###+ mailjet/mailjet-bundle ### -->
<env name="MAILJET_APIKEY_PUBLIC" value="your-api_key"/>
<env name="MAILJET_APIKEY_PRIVATE" value="@@your-secret_key"/>
<!-- ###- mailjet/mailjet-bundle ### -->
</php>

<testsuites>

+ 2
- 15
src/Controller/Admin/PageCrudController.php View File

@@ -27,21 +27,8 @@ class PageCrudController extends AbstractCrudController

public function configureFields(string $pageName): iterable
{
$panel = parent::configureFields($pageName);

return array_merge(
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
CKEditorField::new('description'),
FileManagerField::new('file'),
StatusField::new('status'),
FormField::addPanel('gallery'),
GalleryManagerField::new('gallery')
],
$panel
);
return $this->getPageContainer()->getFieldDefinition()
->getFields($pageName);
}



+ 40
- 0
src/Definition/Field/Site/PageFieldDefinition.php View File

@@ -0,0 +1,40 @@
<?php

namespace App\Definition\Field\Site;

use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Definition\Field\Site\PageFieldDefinition as SovPageFieldDefinition;

class PageFieldDefinition extends SovPageFieldDefinition
{
public function configureIndex(): array
{
return [
'id',
'title',
'description',
'image',
'status',
'createdBy'

];
}

public function configurePanelGeneral(): array
{
return [
'title',
'description',
'image',
'status',
];
}

public function configureFields(): array
{
return array_merge(parent::configureFields(), [
'image' => ImageManagerField::new('image'),
]);
}

}

+ 16
- 0
src/Dependency/Site/PageDependency.php View File

@@ -0,0 +1,16 @@
<?php

namespace App\Dependency\Site;

use Lc\SovBundle\Definition\Field\Site\PageFieldDefinition as SovPageFieldDefinition;
use App\Definition\Field\Site\PageFieldDefinition as PageFieldDefinition;

class PageDependency
{
public function getAliases()
{
return [
SovPageFieldDefinition::class => PageFieldDefinition::class
];
}
}

+ 0
- 4
src/Entity/User/User.php View File

@@ -20,10 +20,6 @@ class User extends SovUserModel implements UserInterface
*/
private $id;

public function __toString()
{
return $this->firstname . " " . $this->lastname;
}

public function getId(): ?int
{

+ 2
- 1
src/Kernel.php View File

@@ -14,10 +14,11 @@ class Kernel extends BaseKernel
protected function configureContainer(ContainerConfigurator $container): void
{
$container->import('../config/{packages}/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.yaml');
$container->import('../config/{packages}/'.$this->environment.'/*.{yaml,php}');

if (is_file(\dirname(__DIR__).'/config/services.yaml')) {
$container->import('../config/services.yaml');
$container->import('../config/dependencies.php');
$container->import('../config/{services}_'.$this->environment.'.yaml');
} elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) {
(require $path)($container->withPath($path), $this);

+ 8
- 41
symfony.lock View File

@@ -1,21 +1,18 @@
{
"artgris/filemanager-bundle": {
"version": "2.2.3"
"version": "2.5.0"
},
"behat/transliterator": {
"version": "v1.3.0"
},
"composer/installers": {
"version": "v1.11.0"
},
"composer/package-versions-deprecated": {
"version": "1.11.99.2"
},
"connectholland/cookie-consent-bundle": {
"version": "0.4",
"version": "0.11",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"branch": "main",
"version": "0.4",
"ref": "9725d24dc996a1041f25b9e29fc1567a861f98e4"
},
@@ -108,10 +105,10 @@
"version": "v1.1.0"
},
"easycorp/easyadmin-bundle": {
"version": "3.0",
"version": "4.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"branch": "main",
"version": "3.0",
"ref": "b131e6cbfe1b898a508987851963fff485986285"
}
@@ -123,12 +120,12 @@
"version": "v1.0.5"
},
"friendsofsymfony/ckeditor-bundle": {
"version": "2.0",
"version": "2.4",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"branch": "main",
"version": "2.0",
"ref": "8eb1cd0962ded6a6d6e1e5a9b6d3e888f9f94ff6"
"ref": "f5ad42002183a6881962683e6d84bbb25cdfce5d"
},
"files": [
"config/packages/fos_ckeditor.yaml"
@@ -167,18 +164,6 @@
"ref": "5a5bdc2d0e2533ed6935d5ae562f2b318a8fc1ee"
}
},
"mailjet/mailjet-bundle": {
"version": "2.0",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "1.0",
"ref": "48a7f92015372654b5056855da5e94d54bd8d948"
},
"files": [
"config/packages/mailjet.yaml"
]
},
"mockery/mockery": {
"version": "1.4.4"
},
@@ -188,9 +173,6 @@
"nikic/php-parser": {
"version": "v4.10.5"
},
"oomphinc/composer-installers-extender": {
"version": "2.0.0"
},
"phenx/php-font-lib": {
"version": "0.5.2"
},
@@ -469,18 +451,9 @@
"symfony/polyfill-mbstring": {
"version": "v1.22.1"
},
"symfony/polyfill-php73": {
"version": "v1.22.1"
},
"symfony/polyfill-php80": {
"version": "v1.22.1"
},
"symfony/polyfill-php81": {
"version": "v1.23.0"
},
"symfony/polyfill-uuid": {
"version": "v1.22.1"
},
"symfony/process": {
"version": "v5.2.7"
},
@@ -528,9 +501,6 @@
"symfony/security-csrf": {
"version": "v5.2.7"
},
"symfony/security-guard": {
"version": "v5.2.8"
},
"symfony/security-http": {
"version": "v5.2.9"
},
@@ -549,9 +519,6 @@
"symfony/string": {
"version": "v5.2.8"
},
"symfony/templating": {
"version": "v5.3.7"
},
"symfony/test-pack": {
"version": "v1.0.7"
},

Loading…
Cancel
Save