diff --git a/app/config/packages/backoffice_menu.yaml b/app/config/packages/backoffice_menu.yaml index e12d71d71..18d44567e 100644 --- a/app/config/packages/backoffice_menu.yaml +++ b/app/config/packages/backoffice_menu.yaml @@ -81,9 +81,9 @@ parameters: niveau: 'ROLE_SITE' url : '/admin/site/feuilles' extra_routes: - - admin_site_sheets_list - - admin_site_sheets_add - - admin_site_sheets_edit + - admin_site_feuilles_list + - admin_site_feuilles_add + - admin_site_feuilles_edit site_rubriques: nom: 'Rubriques' niveau: 'ROLE_SITE' diff --git a/app/config/packages/doctrine.yaml b/app/config/packages/doctrine.yaml index 29b1215fe..652e639e1 100644 --- a/app/config/packages/doctrine.yaml +++ b/app/config/packages/doctrine.yaml @@ -9,6 +9,8 @@ doctrine: profiling_collect_backtrace: '%kernel.debug%' use_savepoints: true + types: + unix_timestamp: AppBundle\Doctrine\Type\UnixTimestampType orm: auto_generate_proxy_classes: true enable_lazy_ghost_objects: true @@ -18,6 +20,9 @@ doctrine: auto_mapping: true controller_resolver: auto_mapping: false + dql: + datetime_functions: + UNIX_TIMESTAMP: DoctrineExtensions\Query\Mysql\UnixTimestamp mappings: Accounting: type: attribute diff --git a/app/config/routing/admin_site.yml b/app/config/routing/admin_site.yml index 2f4c03a77..5568085cb 100644 --- a/app/config/routing/admin_site.yml +++ b/app/config/routing/admin_site.yml @@ -38,22 +38,22 @@ admin_site_articles_delete: requirements: id: '\d+' -admin_site_sheets_list: +admin_site_feuilles_list: path: /feuilles - defaults: {_controller: AppBundle\Controller\Admin\Site\Sheet\ListSheetsAction} + defaults: {_controller: AppBundle\Controller\Admin\Site\Feuille\ListFeuillesAction} -admin_site_sheets_add: +admin_site_feuilles_add: path: /feuilles/add - defaults: {_controller: AppBundle\Controller\Admin\Site\Sheet\AddSheetAction} + defaults: {_controller: AppBundle\Controller\Admin\Site\Feuille\AddFeuilleAction} -admin_site_sheets_edit: +admin_site_feuilles_edit: path: /feuilles/edit/{id} - defaults: {_controller: AppBundle\Controller\Admin\Site\Sheet\EditSheetAction} + defaults: {_controller: AppBundle\Controller\Admin\Site\Feuille\EditFeuilleAction} requirements: id: '\d+' -admin_site_sheets_delete: +admin_site_feuilles_delete: path: /feuilles/delete/{id}/{token} - defaults: {_controller: AppBundle\Controller\Admin\Site\Sheet\DeleteSheetAction} + defaults: {_controller: AppBundle\Controller\Admin\Site\Feuille\DeleteFeuilleAction} requirements: id: '\d+' diff --git a/composer.json b/composer.json index a8291d476..dc7ec63a2 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,7 @@ "ext-pdo": "*", "ext-zip": "*", "algolia/algoliasearch-client-php": "^3.4", + "beberlei/doctrineextensions": "^1.5", "captioning/captioning": "^2.6", "ccmbenchmark/ting_bundle": "^3.8", "cocur/slugify": "^2.3", diff --git a/composer.lock b/composer.lock index e556507a6..dd9517217 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24faf7187ee126fe6d33a5a04c296ac2", + "content-hash": "6f95cfdb5c3f4fc801ed23ffcdd47e67", "packages": [ { "name": "algolia/algoliasearch-client-php", @@ -147,6 +147,68 @@ }, "time": "2023-04-25T13:21:16+00:00" }, + { + "name": "beberlei/doctrineextensions", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/beberlei/DoctrineExtensions.git", + "reference": "281f1650641c2f438b0a54d8eaa7ba50ac7e3eb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/beberlei/DoctrineExtensions/zipball/281f1650641c2f438b0a54d8eaa7ba50ac7e3eb6", + "reference": "281f1650641c2f438b0a54d8eaa7ba50ac7e3eb6", + "shasum": "" + }, + "require": { + "doctrine/orm": "^2.19 || ^3.0", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^1.14 || ^2", + "doctrine/coding-standard": "^9.0.2 || ^12.0", + "nesbot/carbon": "^2.72 || ^3", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5 || ^9.6", + "squizlabs/php_codesniffer": "^3.8", + "symfony/cache": "^5.4 || ^6.4 || ^7.0", + "symfony/yaml": "^5.4 || ^6.4 || ^7.0", + "vimeo/psalm": "^3.18 || ^5.22", + "zf1/zend-date": "^1.12", + "zf1/zend-registry": "^1.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "DoctrineExtensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Steve Lacey", + "email": "steve@steve.ly" + } + ], + "description": "A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.", + "keywords": [ + "database", + "doctrine", + "orm" + ], + "support": { + "source": "https://github.com/beberlei/DoctrineExtensions/tree/v1.5.0" + }, + "time": "2024-03-03T17:55:15+00:00" + }, { "name": "cakephp/chronos", "version": "3.1.0", diff --git a/sources/Afup/Corporate/Page.php b/sources/Afup/Corporate/Page.php index 7500e01de..183b656d1 100644 --- a/sources/Afup/Corporate/Page.php +++ b/sources/Afup/Corporate/Page.php @@ -4,13 +4,14 @@ namespace Afup\Site\Corporate; -use AppBundle\Site\Model\Repository\SheetRepository; +use AppBundle\Site\Entity\Feuille as FeuilleEntity; +use AppBundle\Site\Entity\Repository\FeuilleRepository; use Symfony\Component\Security\Core\User\UserInterface; final readonly class Page { public function __construct( - private SheetRepository $sheetRepository, + private FeuilleRepository $feuilleRepository, ) {} public function header($url = null, UserInterface $user = null): string @@ -18,41 +19,33 @@ public function header($url = null, UserInterface $user = null): string $url = urldecode((string) $url); $str = '