Browse Source

first base SovSkeletonTrans

master
Charly 2 years ago
parent
commit
d1d53f5a4e
100 changed files with 13349 additions and 0 deletions
  1. +37
    -0
      .env
  2. +31
    -0
      .gitignore
  3. +10
    -0
      assets/backend/common/app.common.js
  4. +0
    -0
      assets/backend/common/common.js
  5. +0
    -0
      assets/backend/common/common.scss
  6. +4
    -0
      assets/controllers.json
  7. +10
    -0
      assets/frontend/app/app.common.js
  8. +3
    -0
      assets/frontend/app/app.js
  9. +10
    -0
      assets/frontend/app/app.scss
  10. +3
    -0
      assets/frontend/js/script.js
  11. +62
    -0
      assets/frontend/scss/base.scss
  12. +114
    -0
      assets/frontend/scss/cookies.scss
  13. +0
    -0
      assets/frontend/scss/footer.scss
  14. +0
    -0
      assets/frontend/scss/header.scss
  15. +0
    -0
      assets/frontend/scss/home.scss
  16. +24
    -0
      assets/frontend/scss/mixin_responsive.scss
  17. +0
    -0
      assets/frontend/scss/page.scss
  18. +27
    -0
      assets/frontend/scss/vars.scss
  19. +43
    -0
      bin/console
  20. +13
    -0
      bin/phpunit
  21. +113
    -0
      composer.json
  22. +11187
    -0
      composer.lock
  23. +28
    -0
      config/bundles.php
  24. +13
    -0
      config/packages/a2lix.yaml
  25. +8
    -0
      config/packages/artgris_file_manager.yaml
  26. +3
    -0
      config/packages/assets.yaml
  27. +19
    -0
      config/packages/cache.yaml
  28. +4
    -0
      config/packages/dev/debug.yaml
  29. +19
    -0
      config/packages/dev/monolog.yaml
  30. +6
    -0
      config/packages/dev/web_profiler.yaml
  31. +23
    -0
      config/packages/doctrine.yaml
  32. +6
    -0
      config/packages/doctrine_migrations.yaml
  33. +8
    -0
      config/packages/fos_ckeditor.yaml
  34. +17
    -0
      config/packages/framework.yaml
  35. +8
    -0
      config/packages/lc_sov.yaml
  36. +2
    -0
      config/packages/liip_imagine.yaml
  37. +36
    -0
      config/packages/liip_imagine/base.yaml
  38. +15
    -0
      config/packages/liip_imagine/specific.yaml
  39. +3
    -0
      config/packages/mailer.yaml
  40. +4
    -0
      config/packages/mailjet.yaml
  41. +16
    -0
      config/packages/notifier.yaml
  42. +8
    -0
      config/packages/prod/deprecations.yaml
  43. +20
    -0
      config/packages/prod/doctrine.yaml
  44. +17
    -0
      config/packages/prod/monolog.yaml
  45. +3
    -0
      config/packages/prod/routing.yaml
  46. +4
    -0
      config/packages/prod/webpack_encore.yaml
  47. +7
    -0
      config/packages/routing.yaml
  48. +38
    -0
      config/packages/security.yaml
  49. +3
    -0
      config/packages/sensio_framework_extra.yaml
  50. +13
    -0
      config/packages/stof_doctrine_extensions.yaml
  51. +4
    -0
      config/packages/test/doctrine.yaml
  52. +4
    -0
      config/packages/test/framework.yaml
  53. +12
    -0
      config/packages/test/monolog.yaml
  54. +2
    -0
      config/packages/test/twig.yaml
  55. +3
    -0
      config/packages/test/validator.yaml
  56. +6
    -0
      config/packages/test/web_profiler.yaml
  57. +2
    -0
      config/packages/test/webpack_encore.yaml
  58. +6
    -0
      config/packages/translation.yaml
  59. +2
    -0
      config/packages/twig.yaml
  60. +8
    -0
      config/packages/validator.yaml
  61. +30
    -0
      config/packages/webpack_encore.yaml
  62. +5
    -0
      config/preload.php
  63. +11
    -0
      config/routes.yaml
  64. +7
    -0
      config/routes/annotations.yaml
  65. +3
    -0
      config/routes/dev/framework.yaml
  66. +7
    -0
      config/routes/dev/web_profiler.yaml
  67. +48
    -0
      config/services.yaml
  68. +0
    -0
      migrations/.gitignore
  69. +103
    -0
      migrations/Version20211123120511.php
  70. +36
    -0
      migrations/Version20211129140745.php
  71. +35
    -0
      migrations/Version20211130141718.php
  72. +30
    -0
      package.json
  73. +45
    -0
      phpunit.xml.dist
  74. +12
    -0
      public/.htaccess
  75. BIN
      public/assets/img/laclic.png
  76. +22
    -0
      public/index.php
  77. +40
    -0
      src/Container/Site/BlockContainer.php
  78. +0
    -0
      src/Controller/.gitignore
  79. +10
    -0
      src/Controller/AbstractAdminController.php
  80. +11
    -0
      src/Controller/AbstractController.php
  81. +45
    -0
      src/Controller/Admin/DashboardController.php
  82. +48
    -0
      src/Controller/Admin/PageCrudController.php
  83. +66
    -0
      src/Controller/Admin/Site/BlockAdminController.php
  84. +20
    -0
      src/Controller/Admin/UserCrudController.php
  85. +24
    -0
      src/Controller/ControllerTrait.php
  86. +25
    -0
      src/Controller/Frontend/HomeController.php
  87. +0
    -0
      src/Entity/.gitignore
  88. +31
    -0
      src/Entity/File/File.php
  89. +25
    -0
      src/Entity/Reminder/Reminder.php
  90. +25
    -0
      src/Entity/Setting/SiteSetting.php
  91. +113
    -0
      src/Entity/Site/Block.php
  92. +102
    -0
      src/Entity/Site/BlockTranslation.php
  93. +103
    -0
      src/Entity/Site/Page.php
  94. +25
    -0
      src/Entity/Site/Site.php
  95. +25
    -0
      src/Entity/Ticket/Ticket.php
  96. +25
    -0
      src/Entity/Ticket/TicketMessage.php
  97. +26
    -0
      src/Entity/User/GroupUser.php
  98. +32
    -0
      src/Entity/User/User.php
  99. +17
    -0
      src/Factory/Site/BlockFactory.php
  100. +26
    -0
      src/Field/TranslationField.php

+ 37
- 0
.env View File

@@ -0,0 +1,37 @@
# In all environments, the following files are loaded if they exist,
# the latter taking precedence over the former:
#
# * .env contains default values for the environment variables needed by the app
# * .env.local uncommitted file with local overrides
# * .env.$APP_ENV committed environment-specific defaults
# * .env.$APP_ENV.local uncommitted environment-specific overrides
#
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=555bc2aee588a05641d07ab10b081636
###< symfony/framework-bundle ###

###> symfony/mailer ###
# MAILER_DSN=smtp://localhost
###< symfony/mailer ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# 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 ###

+ 31
- 0
.gitignore View File

@@ -0,0 +1,31 @@
###> symfony/framework-bundle ###
/.php-version
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/public/uploads/
/public/userfiles/*
/public/robots.txt
/public/assets/.sass-cache/
/public/media/cache/
/var/
/vendor/
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

/Lc/*
/.idea/*
###> symfony/webpack-encore-bundle ###
/node_modules/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

/public/build/

+ 10
- 0
assets/backend/common/app.common.js View File

@@ -0,0 +1,10 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './common.scss';
import './common.js';

+ 0
- 0
assets/backend/common/common.js View File


+ 0
- 0
assets/backend/common/common.scss View File


+ 4
- 0
assets/controllers.json View File

@@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}

+ 10
- 0
assets/frontend/app/app.common.js View File

@@ -0,0 +1,10 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/

// any CSS you import will output into a single css file (app.css in this case)
import './app.scss';
import './app.js';

+ 3
- 0
assets/frontend/app/app.js View File

@@ -0,0 +1,3 @@
import 'bootstrap';

import "../js/script";

+ 10
- 0
assets/frontend/app/app.scss View File

@@ -0,0 +1,10 @@
@import "./node_modules/bootstrap/scss/bootstrap";

@import "../scss/vars";
@import "../scss/mixin_responsive";
@import "../scss/base";
@import "../scss/home";
@import "../scss/page";
@import "../scss/header";
@import "../scss/footer";
@import "../scss/cookies";

+ 3
- 0
assets/frontend/js/script.js View File

@@ -0,0 +1,3 @@
$(document).ready(function () {

});

+ 62
- 0
assets/frontend/scss/base.scss View File

@@ -0,0 +1,62 @@
html {
font-size: 62.5%;

@include large-only {
font-size: 60%;
}

@include desktop-only {
font-size: 55%;
}

@include tablet-only {
font-size: 50%;
}

@include mobile-only {
font-size: 45%;
}
}

img {
max-width: 100%;
max-height: 100%;
}

h1, h2, h3, h4, h5, h6 {
}

li, p, a, select, option {
}

p {
font-size: 2.0rem;
}

.bold {
font-weight: bold;
}

a:hover {
text-decoration: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}

.hidden {
display: none;
}

.success-post {
color: $green;
border: 2px solid $green;
text-align: center;
padding: 15px;
margin-top: 50px;
margin-bottom: 50px;
}

+ 114
- 0
assets/frontend/scss/cookies.scss View File

@@ -0,0 +1,114 @@
/* Cookies */

$color-primary-cookies: $orange;
$font-family-cookies-title: 'FranklinGothic';
$font-family-cookies-text: 'dinbold';

.ch-cookie-consent {
position: fixed;
width: 500px;
bottom: 20px !important;
left: 20px !important;
z-index: 100;
padding: 30px;
background-color: white;
border: solid 1px #e0e0e0;

&.ch-cookie-consent--bottom {
//display: none;
}

.ch-cookie-consent__title {
font-family: $font-family-cookies-title;
color: $color-primary-cookies;
font-size: 25px;
font-weight: normal;
margin-bottom: 7px;
}
.ch-cookie-consent__intro {
margin-bottom: 5px;
line-height: 20px;
font-size: 20px;
}
.ch-cookie-consent__read-more {
color: $color-primary-cookies;
display: none;
}
form.ch-cookie-consent__form {
margin-top: 20px;

.ch-cookie-consent__category-group {
.ch-cookie-consent__category {
display: -ms-flexbox;
display: flex;
padding-top: 7px;
padding-bottom: 7px;
border: 0px none;

.ch-cookie-consent__category-toggle {
input {
display: none;
}
label {
cursor: pointer;
text-align: center;
padding: 3px 10px 3px 10px;
text-transform: uppercase;
border: solid 1px $color-primary-cookies;
color: $color-primary-cookies;
font-size: 13px;
font-family: $font-family-cookies-text;
}
input:checked + label,
label:hover {
background: none;
background-color: $color-primary-cookies;
color: white;
}
}
.ch-cookie-consent__category-information {
position: relative;
top: -2px;
margin-left: 20px;
.ch-cookie-consent__category-title {
color: $color-primary-cookies;
font-family: $font-family-cookies-text;
margin-bottom: 5px;
}
.ch-cookie-consent__category-description {
color: gray;
margin-top: 0px;
font-weight: normal;
font-family: $font-family-cookies-text;
font-size: 15px;
}
}
}
}
.ch-cookie-consent__btn-group {
margin-top: 15px;
text-align: left;

button {
display: block;
margin: 0px;
padding: 10px 0px 10px 0px;
cursor: pointer;
background: none;
background-color: $color-primary-cookies;
color: white;
text-transform: uppercase;
font-family: $font-family-cookies-title;
font-weight: normal;
font-size: 15px;
border: solid 1px #e0e0e0;
width: 100%;

&:hover {
background-color: white;
color: $color-primary-cookies !important;
}
}
}
}
}

+ 0
- 0
assets/frontend/scss/footer.scss View File


+ 0
- 0
assets/frontend/scss/header.scss View File


+ 0
- 0
assets/frontend/scss/home.scss View File


+ 24
- 0
assets/frontend/scss/mixin_responsive.scss View File

@@ -0,0 +1,24 @@
//576px
@mixin mobile-only {
@media screen and (max-width: $sm) {
@content;
}
}
//768px
@mixin tablet-only {
@media screen and (max-width: $md) {
@content;
}
}
//992px
@mixin desktop-only {
@media screen and (max-width: $lg) {
@content;
}
}
//1200px
@mixin large-only {
@media screen and (max-width: $xl) {
@content;
}
}

+ 0
- 0
assets/frontend/scss/page.scss View File


+ 27
- 0
assets/frontend/scss/vars.scss View File

@@ -0,0 +1,27 @@
$dir-fonts: '/public/assets/fonts/';
$dir-img: '/public/assets/img/';

$sm: 576px;
$md: 768px;
$lg: 992px;
$xl: 1200px;

$orange: #dc5b2f;
$green: #568b6f;

//Bootstrap
$grid-columns: 12;
$grid-gutter-width: 30px;

$grid-breakpoints: (
// Extra small screen / phone
xs: 0,
// Small screen / phone
sm: $sm,
// Medium screen / tablet
md: $md,
// Large screen / desktop
lg: $lg,
// Extra large screen / wide desktop
xl: $xl
);

+ 43
- 0
bin/console View File

@@ -0,0 +1,43 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;

if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);

+ 13
- 0
bin/phpunit View File

@@ -0,0 +1,13 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';

+ 113
- 0
composer.json View File

@@ -0,0 +1,113 @@
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"a2lix/translation-form-bundle": "^3.0",
"artgris/filemanager-bundle": "^2.2",
"composer/package-versions-deprecated": "1.11.99.2",
"connectholland/cookie-consent-bundle": "^0.9.10",
"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",
"friendsofsymfony/ckeditor-bundle": "^2.3",
"knplabs/doctrine-behaviors": "^2.2",
"knplabs/knp-paginator-bundle": "^5.6",
"liip/imagine-bundle": "^2.6",
"mailjet/mailjet-bundle": "^2.0",
"mailjet/mailjet-swiftmailer": "1.0.6",
"phpdocumentor/reflection-docblock": "^5.2",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "5.3.*",
"symfony/console": "5.3.*",
"symfony/dotenv": "5.3.*",
"symfony/expression-language": "5.3.*",
"symfony/flex": "^1.3.1",
"symfony/form": "5.3.*",
"symfony/framework-bundle": "5.3.*",
"symfony/http-client": "5.3.*",
"symfony/intl": "5.3.*",
"symfony/mailer": "5.3.*",
"symfony/mime": "5.3.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.3.*",
"symfony/process": "5.3.*",
"symfony/property-access": "5.3.*",
"symfony/property-info": "5.3.*",
"symfony/proxy-manager-bridge": "5.3.*",
"symfony/security-bundle": "5.3.*",
"symfony/serializer": "5.3.*",
"symfony/string": "5.3.*",
"symfony/translation": "5.3.*",
"symfony/twig-bundle": "^5.3",
"symfony/validator": "5.3.*",
"symfony/web-link": "5.3.*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/yaml": "5.3.*",
"twig/extra-bundle": "^2.12|^3.0",
"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/stopwatch": "^5.2",
"symfony/var-dumper": "^5.2",
"symfony/web-profiler-bundle": "^5.2"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/",
"Lc\\": "Lc/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"ckeditor:install --clear=drop": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.3.*"
}
}
}

+ 11187
- 0
composer.lock
File diff suppressed because it is too large
View File


+ 28
- 0
config/bundles.php View File

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

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
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],
Knp\DoctrineBehaviors\DoctrineBehaviorsBundle::class => ['all' => true],
A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true],
A2lix\TranslationFormBundle\A2lixTranslationFormBundle::class => ['all' => true],
];

+ 13
- 0
config/packages/a2lix.yaml View File

@@ -0,0 +1,13 @@
a2lix_translation_form:
locale_provider: default # [1]
locales: [ fr, en ] # [1-a]
default_locale: fr # [1-b]
required_locales: [ ] # [1-c]
# templating: "@A2lixTranslationForm/bootstrap_4_layout.html.twig" # [2]


# [1] Custom locale provider service id. Default one relies on [1-*] values:
# [1-a] List of translations locales to display
# [1-b] Default locale
# [1-c] List of required translations locales
# [2] The default template is Twitter Bootstrap compatible. You can redefine your own here

+ 8
- 0
config/packages/artgris_file_manager.yaml View File

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

+ 3
- 0
config/packages/assets.yaml View File

@@ -0,0 +1,3 @@
framework:
assets:
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'

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

@@ -0,0 +1,19 @@
framework:
cache:
# Unique name of your app: used to compute stable namespaces for cache keys.
#prefix_seed: your_vendor_name/app_name

# The "app" cache stores to the filesystem by default.
# The data in this cache should persist between deploys.
# Other options include:

# Redis
#app: cache.adapter.redis
#default_redis_provider: redis://localhost

# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
#app: cache.adapter.apcu

# Namespaced pools use the above "app" backend by default
#pools:
#my.dedicated.cache: null

+ 4
- 0
config/packages/dev/debug.yaml View File

@@ -0,0 +1,4 @@
debug:
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser.
# See the "server:dump" command to start a new server.
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%"

+ 19
- 0
config/packages/dev/monolog.yaml View File

@@ -0,0 +1,19 @@
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
# uncomment to get logging in your browser
# you may have to allow bigger header sizes in your Web server configuration
#firephp:
# type: firephp
# level: info
#chromephp:
# type: chromephp
# level: info
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]

+ 6
- 0
config/packages/dev/web_profiler.yaml View File

@@ -0,0 +1,6 @@
web_profiler:
toolbar: true
intercept_redirects: false

framework:
profiler: { only_exceptions: false }

+ 23
- 0
config/packages/doctrine.yaml View File

@@ -0,0 +1,23 @@
doctrine:
dbal:
# IMPORTANT: DATABASE_URL *must* define the server version
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
resolve_target_entities:
Lc\SovBundle\Model\User\UserInterface: App\Entity\User\User
Lc\SovBundle\Model\File\FileInterface: App\Entity\File\File
Lc\SovBundle\Model\Setting\SiteSettingInterface: App\Entity\Setting\SiteSetting
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

+ 6
- 0
config/packages/doctrine_migrations.yaml View File

@@ -0,0 +1,6 @@
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
enable_profiler: '%kernel.debug%'

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

@@ -0,0 +1,8 @@
# Read the documentation: https://symfony.com/doc/current/bundles/FOSCKEditorBundle/index.html
fos_ck_editor:
base_path: "build/ckeditor"
js_path: "build/ckeditor/ckeditor.js"

twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'

+ 17
- 0
config/packages/framework.yaml View File

@@ -0,0 +1,17 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true

# Enables session support. Note that the session will ONLY be started if you read or write from it.
# Remove or comment this section to explicitly disable session support.
session:
handler_id: null
cookie_secure: auto
cookie_samesite: lax

esi: true
#fragments: true
php_errors:
log: true

+ 8
- 0
config/packages/lc_sov.yaml View File

@@ -0,0 +1,8 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
lc_sov:
homepage_route: 'app_homepage'
login_redirection:
redirect_referer: false
roles_redirection:
- { role: "ROLE_ADMIN", redirect: "app_admin_dashboard" }
- { role: "ROLE_SUPER_ADMIN", redirect: "app_admin_dashboard" }

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

@@ -0,0 +1,2 @@
imports:
- { resource: liip_imagine/ }

+ 36
- 0
config/packages/liip_imagine/base.yaml View File

@@ -0,0 +1,36 @@
# See dos how to configure the bundle: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html
liip_imagine:
# valid drivers options include "gd" or "gmagick" or "imagick"
driver: "gd"
filter_sets:
cache: ~
index:
quality: 80
filters:
thumbnail:
size: [ 60 ]
mode: outbound
thumbnail:
quality: 90
filters:
thumbnail:
size: [ 60 ]
mode: outbound
page:
quality: 90
filters:
thumbnail:
size: [ 240 ]
mode: outbound
mosaic_big:
quality: 90
filters:
thumbnail:
size: [ 600, 400 ]
mode: outbound
big:
quality: 90
filters:
thumbnail:
size: [ 1600 ]
mode: outbound

+ 15
- 0
config/packages/liip_imagine/specific.yaml View File

@@ -0,0 +1,15 @@
liip_imagine:
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/public"
cache_prefix: "media/cache"
# config sur le serveur d'Alwaysdata chargée lors du déploiement
#web_root: '/home/placedulocal/www/symfony/prod/shared/public/'

loaders:
default:
filesystem:
data_root: "%kernel.project_dir%/public/"
# config sur le serveur d'Alwaysdata chargée lors du déploiement
#data_root: '/home/placedulocal/www/symfony/prod/shared/public/'

+ 3
- 0
config/packages/mailer.yaml View File

@@ -0,0 +1,3 @@
framework:
mailer:
dsn: '%env(MAILER_DSN)%'

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

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


+ 16
- 0
config/packages/notifier.yaml View File

@@ -0,0 +1,16 @@
framework:
notifier:
#chatter_transports:
# slack: '%env(SLACK_DSN)%'
# telegram: '%env(TELEGRAM_DSN)%'
#texter_transports:
# twilio: '%env(TWILIO_DSN)%'
# nexmo: '%env(NEXMO_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: admin@example.com }

+ 8
- 0
config/packages/prod/deprecations.yaml View File

@@ -0,0 +1,8 @@
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
#monolog:
# channels: [deprecation]
# handlers:
# deprecation:
# type: stream
# channels: [deprecation]
# path: php://stderr

+ 20
- 0
config/packages/prod/doctrine.yaml View File

@@ -0,0 +1,20 @@
doctrine:
orm:
auto_generate_proxy_classes: false
metadata_cache_driver:
type: pool
pool: doctrine.system_cache_pool
query_cache_driver:
type: pool
pool: doctrine.system_cache_pool
result_cache_driver:
type: pool
pool: doctrine.result_cache_pool

framework:
cache:
pools:
doctrine.result_cache_pool:
adapter: cache.app
doctrine.system_cache_pool:
adapter: cache.system

+ 17
- 0
config/packages/prod/monolog.yaml View File

@@ -0,0 +1,17 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]

+ 3
- 0
config/packages/prod/routing.yaml View File

@@ -0,0 +1,3 @@
framework:
router:
strict_requirements: null

+ 4
- 0
config/packages/prod/webpack_encore.yaml View File

@@ -0,0 +1,4 @@
#webpack_encore:
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Available in version 1.2
#cache: true

+ 7
- 0
config/packages/routing.yaml View File

@@ -0,0 +1,7 @@
framework:
router:
utf8: true

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost

+ 38
- 0
config/packages/security.yaml View File

@@ -0,0 +1,38 @@
security:
enable_authenticator_manager: true
encoders:
App\Entity\User\User:
algorithm: 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)
app_user_provider:
entity:
class: App\Entity\User\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false

admin:
pattern: ^/(admin|login|logout)
lazy: true
form_login:
login_path: sov_login
check_path: sov_login
http_basic: ~
entry_point: form_login
provider: app_user_provider
custom_authenticator: Lc\SovBundle\Authenticator\LoginFormAuthenticator
logout:
path: sov_logout
target: sov_login

# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/manager, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }
- { path: ^/admin, roles: [ROLE_ADMIN, ROLE_SUPER_ADMIN] }
- { path: ^/profile, roles: ROLE_USER }

+ 3
- 0
config/packages/sensio_framework_extra.yaml View File

@@ -0,0 +1,3 @@
sensio_framework_extra:
router:
annotations: false

+ 13
- 0
config/packages/stof_doctrine_extensions.yaml View File

@@ -0,0 +1,13 @@
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/
stof_doctrine_extensions:
default_locale: '%app.default_locale%'
translation_fallback: true
orm:
default:
tree: true
timestampable: true # not needed: listeners are not enabled by default
sluggable: true
blameable: true
translatable: false


+ 4
- 0
config/packages/test/doctrine.yaml View File

@@ -0,0 +1,4 @@
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname: 'main_test%env(default::TEST_TOKEN)%'

+ 4
- 0
config/packages/test/framework.yaml View File

@@ -0,0 +1,4 @@
framework:
test: true
session:
storage_id: session.storage.mock_file

+ 12
- 0
config/packages/test/monolog.yaml View File

@@ -0,0 +1,12 @@
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [404, 405]
channels: ["!event"]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

+ 2
- 0
config/packages/test/twig.yaml View File

@@ -0,0 +1,2 @@
twig:
strict_variables: true

+ 3
- 0
config/packages/test/validator.yaml View File

@@ -0,0 +1,3 @@
framework:
validation:
not_compromised_password: false

+ 6
- 0
config/packages/test/web_profiler.yaml View File

@@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }

+ 2
- 0
config/packages/test/webpack_encore.yaml View File

@@ -0,0 +1,2 @@
#webpack_encore:
# strict_mode: false

+ 6
- 0
config/packages/translation.yaml View File

@@ -0,0 +1,6 @@
framework:
default_locale: '%app.default_locale%'
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:
- '%app.default_locale%'

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

@@ -0,0 +1,2 @@
twig:
default_path: '%kernel.project_dir%/templates'

+ 8
- 0
config/packages/validator.yaml View File

@@ -0,0 +1,8 @@
framework:
validation:
email_validation_mode: html5

# Enables validator auto-mapping support.
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
#auto_mapping:
# App\Entity\: []

+ 30
- 0
config/packages/webpack_encore.yaml View File

@@ -0,0 +1,30 @@
webpack_encore:
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
output_path: '%kernel.project_dir%/public/build'
# If multiple builds are defined (as shown below), you can disable the default build:
# output_path: false

# Set attributes that will be rendered on all script and link tags
script_attributes:
defer: true
# link_attributes:

# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
# crossorigin: 'anonymous'

# Preload all rendered script and link tags automatically via the HTTP/2 Link header
# preload: true

# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
# strict_mode: false

# If you have multiple builds:
# builds:
# pass "frontend" as the 3rg arg to the Twig functions
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}

# frontend: '%kernel.project_dir%/public/frontend/build'

# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
# Put in config/packages/prod/webpack_encore.yaml
# cache: true

+ 5
- 0
config/preload.php View File

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

if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}

+ 11
- 0
config/routes.yaml View File

@@ -0,0 +1,11 @@
sov_bundle:
resource: "@LcSovBundle/Resources/config/routes.yaml"
prefix: /

app_admin_dashboard:
path: /admin
controller: App\Controller\Admin\DashboardController::index

app_homepage:
path: /
defaults: { _controller: App\Controller\Frontend\HomeController::index , _locale: fr }

+ 7
- 0
config/routes/annotations.yaml View File

@@ -0,0 +1,7 @@
controllers:
resource: ../../src/Controller/
type: annotation

kernel:
resource: ../../src/Kernel.php
type: annotation

+ 3
- 0
config/routes/dev/framework.yaml View File

@@ -0,0 +1,3 @@
_errors:
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error

+ 7
- 0
config/routes/dev/web_profiler.yaml View File

@@ -0,0 +1,7 @@
web_profiler_wdt:
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
prefix: /_wdt

web_profiler_profiler:
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
prefix: /_profiler

+ 48
- 0
config/services.yaml View File

@@ -0,0 +1,48 @@
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
app.locales: ["fr"]
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'

services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller/'
tags: ['controller.service_arguments']

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


#Pour remplacer le form cookie consent
# app.form.extension.type.cookie_consent:
# class: App\Form\CookieConsent
# tags:
# - { name: form.type_extension, extended_type: ConnectHolland\CookieConsentBundle\Form\CookieConsentType }
# arguments:
# - '@ConnectHolland\CookieConsentBundle\Cookie\CookieChecker'
# - '%ch_cookie_consent.categories%'
# - '%ch_cookie_consent.simplified%'

+ 0
- 0
migrations/.gitignore View File


+ 103
- 0
migrations/Version20211123120511.php View File

@@ -0,0 +1,103 @@
<?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 Version20211123120511 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->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 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');
$this->addSql('CREATE TABLE site (id INT AUTO_INCREMENT NOT NULL, dev_alias VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$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_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 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_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_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_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 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');
}

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 page DROP FOREIGN KEY FK_140AB620B03A8386');
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620896DBBDE');
$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_7FD2584B2BC79580');
$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_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('DROP TABLE ch_cookieconsent_log');
$this->addSql('DROP TABLE file');
$this->addSql('DROP TABLE group_user');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE page_file');
$this->addSql('DROP TABLE reminder');
$this->addSql('DROP TABLE reminder_user_interface');
$this->addSql('DROP TABLE site');
$this->addSql('DROP TABLE site_setting');
$this->addSql('DROP TABLE ticket');
$this->addSql('DROP TABLE ticket_message');
$this->addSql('DROP TABLE user');
$this->addSql('DROP TABLE user_group_user_interface');
}
}

+ 36
- 0
migrations/Version20211129140745.php View File

@@ -0,0 +1,36 @@
<?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 Version20211129140745 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->addSql('CREATE TABLE block (id INT AUTO_INCREMENT NOT NULL, dev_alias VARCHAR(255) NOT NULL, page VARCHAR(255) NOT NULL, status DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE block_translation (id INT AUTO_INCREMENT NOT NULL, image_id INT DEFAULT NULL, translatable_id INT DEFAULT NULL, title LONGTEXT DEFAULT NULL, subtitle LONGTEXT DEFAULT NULL, description LONGTEXT DEFAULT NULL, locale VARCHAR(5) NOT NULL, INDEX IDX_6E6410B43DA5256D (image_id), INDEX IDX_6E6410B42C2AC5D3 (translatable_id), UNIQUE INDEX block_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE block_translation ADD CONSTRAINT FK_6E6410B43DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('ALTER TABLE block_translation ADD CONSTRAINT FK_6E6410B42C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES block (id) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE block_translation DROP FOREIGN KEY FK_6E6410B42C2AC5D3');
$this->addSql('DROP TABLE block');
$this->addSql('DROP TABLE block_translation');
}
}

+ 35
- 0
migrations/Version20211130141718.php View File

@@ -0,0 +1,35 @@
<?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 Version20211130141718 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->addSql('ALTER TABLE block ADD image_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE block ADD CONSTRAINT FK_831B97223DA5256D FOREIGN KEY (image_id) REFERENCES file (id)');
$this->addSql('CREATE INDEX IDX_831B97223DA5256D ON block (image_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE block DROP FOREIGN KEY FK_831B97223DA5256D');
$this->addSql('DROP INDEX IDX_831B97223DA5256D ON block');
$this->addSql('ALTER TABLE block DROP image_id');
}
}

+ 30
- 0
package.json View File

@@ -0,0 +1,30 @@
{
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"dependencies": {
"@symfony/stimulus-bridge": "^2.0.0",
"@symfony/webpack-encore": "^1.0.0",
"core-js": "^3.0.0",
"file-loader": "^6.0.0",
"regenerator-runtime": "^0.13.2",
"sass": "^1.34.0",
"stimulus": "^2.0.0",
"webpack-notifier": "^1.6.0",
"admin-lte": "^3.1.0",
"jquery": "^3.6.0",
"jquery-ui-sortable": "^1.0.0",
"sass-loader": "^11.1.1",
"bootstrap-autocomplete": "^2.3.7",
"bootstrap-daterangepicker": "^3.1.0",
"bootstrap5": "npm:bootstrap",
"ckeditor": "^4.12.1"
},
"devDependencies": {
}
}

+ 45
- 0
phpunit.xml.dist View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<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>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions>
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
-->
</phpunit>

+ 12
- 0
public/.htaccess View File

@@ -0,0 +1,12 @@
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
</IfModule>
</IfModule>

BIN
public/assets/img/laclic.png View File

Before After
Width: 523  |  Height: 106  |  Size: 9.8KB

+ 22
- 0
public/index.php View File

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

use App\Kernel;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;

require dirname(__DIR__).'/vendor/autoload.php';

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

if ($_SERVER['APP_DEBUG']) {
umask(0000);

Debug::enable();
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

+ 40
- 0
src/Container/Site/BlockContainer.php View File

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

namespace App\Container\Site;

use App\Factory\Site\BlockFactory;
use App\Repository\Site\BlockRepositoryQuery;
use App\Repository\Site\BlockStore;

class BlockContainer
{
protected BlockFactory $factory;
protected BlockRepositoryQuery $repositoryQuery;
protected BlockStore $store;

public function __construct(
BlockFactory $factory,
BlockRepositoryQuery $repositoryQuery,
BlockStore $store
) {
$this->factory = $factory;
$this->repositoryQuery = $repositoryQuery;
$this->store = $store;
}

public function getFactory(): BlockFactory
{
return $this->factory;
}

public function getRepositoryQuery(): BlockRepositoryQuery
{
return $this->repositoryQuery;
}

public function getStore(): BlockStore
{
return $this->store;
}

}

+ 0
- 0
src/Controller/.gitignore View File


+ 10
- 0
src/Controller/AbstractAdminController.php View File

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

namespace App\Controller;

use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController;

abstract class AbstractAdminController extends SovAbstractAdminController
{
use ControllerTrait;
}

+ 11
- 0
src/Controller/AbstractController.php View File

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

namespace App\Controller;

use Lc\SovBundle\Controller\AbstractController as SovAbstractController;

class AbstractController extends SovAbstractController
{
use ControllerTrait;

}

+ 45
- 0
src/Controller/Admin/DashboardController.php View File

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

namespace App\Controller\Admin;


use App\Entity\Site\Block;
use App\Entity\Site\Page;
use App\Entity\User\User;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
use Lc\SovBundle\Controller\Dashboard\DashboardAdminController as SovDashboardController;

class DashboardController extends SovDashboardController
{
public function configureMenuItems(): iterable
{
$menuItems = [
MenuItem::linkToDashboard('dashboard', 'far fa-circle'),

MenuItem::linkToCrud('page', 'far fa-copy', Page::class),

MenuItem::subMenu('account', 'fas fa-user')
->setSubItems(
[
MenuItem::linkToRoute('account_profile', 'fas fa-user-cog', 'sov_admin_account_profile'),
MenuItem::linkToRoute('account_password', 'fas fa-key', 'sov_admin_account_password'),
]
),

MenuItem::linkToCrud('user', 'fas fa-users', User::class),
MenuItem::linkToCrud('blocs', 'fas fa-tags', Block::class),
];

return $menuItems;
}

public function configureCrud(): Crud
{
$crud = parent::configureCrud();

$crud->addFormTheme('@A2lixTranslationForm/bootstrap_4_layout.html.twig');

return $crud;
}
}

+ 48
- 0
src/Controller/Admin/PageCrudController.php View File

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

namespace App\Controller\Admin;

use App\Entity\Site\Page;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\SovBundle\Controller\AbstractAdminController as AbstractCrudController;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\FileManagerField;
use Lc\SovBundle\Field\GalleryManagerField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class PageCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
return Page::class;
}

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getPageContainer()->getRepositoryQuery();
}

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
);
}


}

+ 66
- 0
src/Controller/Admin/Site/BlockAdminController.php View File

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

namespace App\Controller\Admin\Site;

use App\Container\Site\BlockContainer;
use App\Controller\AbstractAdminController;
use App\Entity\Site\Block;
use App\Field\TranslationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\ImageManagerField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Form\Common\FileManagerType;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;

class BlockAdminController extends AbstractAdminController
{
public static function getEntityFqcn(): string
{
return Block::class;
}

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getBlockContainer()->getRepositoryQuery();
}

public function createEntity(string $entityFqcn)
{
return $this->getBlockContainer()->getFactory()->create();
}

public function configureFields(string $pageName): iterable
{
if ($this->isGranted("ROLE_SUPER_ADMIN")) {
$fields[] = TextField::new('devAlias');
}

$fields[] = TextField::new('page');
$fields[] = ImageManagerField::new('image');

$fieldsConfig = [
'title' => [
'field_type' => TextareaType::class,
'required' => true,
'label' => 'titre',
],
'description' => [
'field_type' => CKEditorType::class,
'required' => true,
'label' => 'desc',
],
];

$fields[] = TranslationField::new('translations', 'Traductions', $fieldsConfig)
->setRequired(true)
->hideOnIndex();

return $fields;
}

}

+ 20
- 0
src/Controller/Admin/UserCrudController.php View File

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

namespace App\Controller\Admin;

use App\Entity\User\User;
use Lc\SovBundle\Controller\User\UserAdminController as AbstractUserCrudController;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class UserCrudController extends AbstractUserCrudController
{
public static function getEntityFqcn(): string
{
return User::class;
}

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getUserContainer()->getRepositoryQuery();
}
}

+ 24
- 0
src/Controller/ControllerTrait.php View File

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


namespace App\Controller;

use App\Container\Site\BlockContainer;

trait ControllerTrait
{
public static function getSubscribedServices()
{
return array_merge(
parent::getSubscribedServices(),
[
BlockContainer::class => BlockContainer::class,
]
);
}

public function getBlockContainer(): BlockContainer
{
return $this->get(BlockContainer::class);
}
}

+ 25
- 0
src/Controller/Frontend/HomeController.php View File

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

namespace App\Controller\Frontend;


use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;

class HomeController extends AbstractController
{

protected EntityManagerInterface $em;

public function __construct(
EntityManagerInterface $em
) {
$this->em = $em;
}

public function index(): Response
{
return $this->render('frontend/site/home.html.twig');
}
}

+ 0
- 0
src/Entity/.gitignore View File


+ 31
- 0
src/Entity/File/File.php View File

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

namespace App\Entity\File;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\File\FileModel;
use Lc\SovBundle\Repository\File\FileRepository;

/**
* @ORM\Entity(repositoryClass=FileRepository::class)
*/
class File extends FileModel implements FileInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}

public function __toString()
{
return '' . $this->getLegend();
}
}

+ 25
- 0
src/Entity/Reminder/Reminder.php View File

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


namespace App\Entity\Reminder;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Reminder\ReminderModel;

/**
* @ORM\Entity(repositoryClass=ReminderRepository::class)
*/
class Reminder extends ReminderModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Setting/SiteSetting.php View File

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

namespace App\Entity\Setting;

use Lc\SovBundle\Repository\Setting\SiteSettingRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Setting\SiteSettingModel;

/**
* @ORM\Entity(repositoryClass=SiteSettingRepository::class)
*/
class SiteSetting extends SiteSettingModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 113
- 0
src/Entity/Site/Block.php View File

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

namespace App\Entity\Site;

use App\Repository\Site\BlockRepository;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Model\File\FileInterface;

/**
* @ORM\Entity(repositoryClass=BlockRepository::class)
*/
class Block implements EntityInterface, StatusInterface, TranslatableInterface
{
use StatusTrait;
use TranslatableTrait;

/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\Column(type="string", length=255)
*/
private $devAlias;

/**
* @ORM\Column(type="string", length=255)
*/
private $page;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
*/
private $image;

// public function __call($method, $arguments)
// {
// dump('_call');
// dump($method);
// $method = ('get' === substr($method, 0, 3) || 'set' === substr($method, 0, 3)) ? $method : 'get' . ucfirst(
// $method
// );
// return $this->proxyCurrentLocaleTranslation($method, $arguments);
// }

public function __get($name)
{
$method = 'get' . ucfirst($name);
$arguments = [];
return $this->proxyCurrentLocaleTranslation($method, $arguments);
}

public function __set($name, $value)
{
$method = 'set' . ucfirst($name);
$arguments = [$value];
return $this->proxyCurrentLocaleTranslation($method, $arguments);
}

public function __toString()
{
return $this->page;
}

public function getId(): ?int
{
return $this->id;
}

public function getDevAlias(): ?string
{
return $this->devAlias;
}

public function setDevAlias(string $devAlias): self
{
$this->devAlias = $devAlias;

return $this;
}

public function getPage(): ?string
{
return $this->page;
}

public function setPage(string $page): self
{
$this->page = $page;

return $this;
}

public function getImage(): ?FileInterface
{
return $this->image;
}

public function setImage(?FileInterface $image): self
{
$this->image = $image;

return $this;
}
}

+ 102
- 0
src/Entity/Site/BlockTranslation.php View File

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

namespace App\Entity\Site;

use App\Repository\Site\BlockRepository;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
use Lc\SovBundle\Model\File\FileInterface;

/**
* @ORM\Entity(repositoryClass=BlockRepository::class)
*/
class BlockTranslation implements TranslationInterface
{
use TranslationTrait;

/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\Column(type="text", nullable=true)
*/
private $title;

/**
* @ORM\Column(type="text", nullable=true)
*/
private $subtitle;

/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
*/
private $image;

public function __toString()
{
return $this->title;
}

public function getId(): ?int
{
return $this->id;
}

public function getTitle(): ?string
{
return $this->title;
}

public function setTitle(?string $title): self
{
$this->title = $title;

return $this;
}

public function getSubtitle(): ?string
{
return $this->subtitle;
}

public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;

return $this;
}

public function getDescription(): ?string
{
return $this->description;
}

public function setDescription(?string $description): self
{
$this->description = $description;

return $this;
}

public function getImage(): ?FileInterface
{
return $this->image;
}

public function setImage(?FileInterface $image): self
{
$this->image = $image;

return $this;
}
}

+ 103
- 0
src/Entity/Site/Page.php View File

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

namespace App\Entity\Site;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use App\Entity\File\File;
use Lc\SovBundle\Repository\Site\PageRepository;

/**
* @ORM\Entity(repositoryClass=PageRepository::class)
*/
class Page extends AbstractFullEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist", "remove"})
*/
private $image;

/**
* @ORM\ManyToMany(targetEntity=File::class, cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"position" = "ASC"})
*/
private $gallery;

/**
* @ORM\ManyToOne(targetEntity=File::class, cascade={"persist"})
*/
private $file;

public function __construct()
{
$this->gallery = new ArrayCollection();
}

public function __toString()
{
return $this->title;
}

public function getId(): ?int
{
return $this->id;
}

public function getImage(): ?File
{
return $this->image;
}

public function setImage(?File $image): self
{
$this->image = $image;

return $this;
}

/**
* @return Collection|File[]
*/
public function getGallery(): Collection
{
return $this->gallery;
}

public function addGallery(File $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}

return $this;
}

public function removeGallery(File $gallery): self
{
$this->gallery->removeElement($gallery);

return $this;
}

public function getFile(): ?File
{
return $this->file;
}

public function setFile(?File $file): self
{
$this->file = $file;

return $this;
}

}

+ 25
- 0
src/Entity/Site/Site.php View File

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

namespace App\Entity\Site;

use Lc\SovBundle\Repository\Site\SiteRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Site\SiteModel;

/**
* @ORM\Entity(repositoryClass=SiteRepository::class)
*/
class Site extends SiteModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Ticket/Ticket.php View File

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


namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketModel;

/**
* @ORM\Entity(repositoryClass=TicketRepository::class)
*/
class Ticket extends TicketModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 25
- 0
src/Entity/Ticket/TicketMessage.php View File

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


namespace App\Entity\Ticket;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\Ticket\TicketMessageModel;

/**
* @ORM\Entity(repositoryClass=TicketMessageRepository::class)
*/
class TicketMessage extends TicketMessageModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 26
- 0
src/Entity/User/GroupUser.php View File

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


namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\GroupUserModel;

/**
* @ORM\Entity(repositoryClass=GroupUserRepository::class)
*/
class GroupUser extends GroupUserModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}

}

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

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

namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\UserModel as SovUserModel;
use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
* @ORM\Entity(repositoryClass="Lc\SovBundle\Repository\User\UserRepository")
* @UniqueEntity(fields={"email"}, message="There is already an account with this email")
*/
class User extends SovUserModel implements UserInterface
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

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

public function getId(): ?int
{
return $this->id;
}
}

+ 17
- 0
src/Factory/Site/BlockFactory.php View File

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

namespace App\Factory\Site;

use App\Entity\Site\Block;

class BlockFactory
{
public function create()
{
$block = new Block();

$block->setStatus(1);
return $block;
}

}

+ 26
- 0
src/Field/TranslationField.php View File

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

namespace App\Field;

use A2lix\TranslationFormBundle\Form\Type\TranslationsType;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Field\FieldTrait;

final class TranslationField implements FieldInterface
{
use FieldTrait;

public static function new(string $propertyName, ?string $label = null, $fieldsConfig = []): self
{
return (new self())
->setProperty($propertyName)
->setLabel($label)
->setFormType(TranslationsType::class)
->setFormTypeOptions(
[
'default_locale' => '%locale%',
'fields' => $fieldsConfig,
]
);
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save