From 9c752523b4e0355ac3e48b7cd3e4d1a4ba30384c Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 25 Aug 2023 15:42:28 +0200 Subject: [PATCH] =?UTF-8?q?rest=20breakday=20depuis=20depuis=20d=C3=A9but?= =?UTF-8?q?=20ninebadge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dicos/25_schedule.xml | 6 +- src/schedule-2.0/composer.json | 5 +- src/schedule-2.0/scripts/.env.model | 77 ------------------- .../src/Controller/RestController.php | 6 +- src/schedule-2.0/symfony.lock | 14 ++++ 5 files changed, 23 insertions(+), 85 deletions(-) delete mode 100644 src/schedule-2.0/scripts/.env.model diff --git a/dicos/25_schedule.xml b/dicos/25_schedule.xml index b93f7ac..e9152fd 100644 --- a/dicos/25_schedule.xml +++ b/dicos/25_schedule.xml @@ -6,8 +6,10 @@ - schedule-apps - + + schedule diff --git a/src/schedule-2.0/composer.json b/src/schedule-2.0/composer.json index b8f9564..1a59124 100644 --- a/src/schedule-2.0/composer.json +++ b/src/schedule-2.0/composer.json @@ -51,7 +51,10 @@ "preferred-install": { "*": "dist" }, - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "symfony/flex": true + } }, "autoload": { "psr-4": { diff --git a/src/schedule-2.0/scripts/.env.model b/src/schedule-2.0/scripts/.env.model deleted file mode 100644 index 331f47b..0000000 --- a/src/schedule-2.0/scripts/.env.model +++ /dev/null @@ -1,77 +0,0 @@ -# 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_SECRET=52c1cb88ee822cd2643abe29e16a68a6 -#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 -#TRUSTED_HOSTS='^(localhost|example\.com)$' -###< symfony/framework-bundle ### - -###> symfony/mailer ### -# MAILER_DSN=smtp://localhost -###< symfony/mailer ### - -###< doctrine/doctrine-bundle ### - -# Basic -APP_ALIAS=schedule -APP_AUTH=MYSQL -APP_NAME=Schedule -APP_ENV=PROD -APP_CRON=true - -# Office hours -OFFICE_HOUR_START=09:00 -OFFICE_HOUR_END=17:30 - -# MAIL sendmail / smtp -MAILER_METHOD=sendmail -MAILER_URL= -MAILER_NOREPLY=noreply@noreply.fr -MAILER_DEFAULT_NOTIF= - -# BDD -DATABASE_NAME= -DATABASE_USER= -DATABASE_PASSWORD= -DATABASE_HOST= - -# If APP_AUTH = CAS -CAS_HOST= -CAS_PORT= -CAS_PATH= -CAS_USERNAME=username -CAS_EMAIL=email -CAS_LASTNAME=lastname -CAS_FIRSTNAME=firstname - -## Sentry DSN -SENTRY_DSN= - -# Dolibar -DOLIBARR_ACTIVE=false -DOLIBARR_API_KEY= -DOLIBARR_URI= - -###> sentry/sentry-symfony ### -SENTRY_DSN= -###< sentry/sentry-symfony ### - -###> symfony/swiftmailer-bundle ### -# For Gmail as a transport, use: "gmail://username:password@localhost" -# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode=" -# Delivery is disabled by default via "null://localhost" -MAILER_URL=null://localhost -###< symfony/swiftmailer-bundle ### diff --git a/src/schedule-2.0/src/Controller/RestController.php b/src/schedule-2.0/src/Controller/RestController.php index 6ab8efe..079f8c0 100644 --- a/src/schedule-2.0/src/Controller/RestController.php +++ b/src/schedule-2.0/src/Controller/RestController.php @@ -64,14 +64,10 @@ class RestController extends AbstractFOSRestController } // On formate le tableau de jour - $mini=new \Datetime('2022-03-07 00:00'); - $start=new \Datetime('00:00'); - $start->modify("monday this week"); + $start=new \Datetime('2022-03-07 00:00'); $end=new \Datetime('00:00'); $end->modify("last day of this month"); $end->modify("next sunday"); - $start->modify("previous month"); - if($start<$mini) $start=clone $mini; $events = $em ->createQueryBuilder('event') diff --git a/src/schedule-2.0/symfony.lock b/src/schedule-2.0/symfony.lock index be06f39..d0113b1 100644 --- a/src/schedule-2.0/symfony.lock +++ b/src/schedule-2.0/symfony.lock @@ -227,6 +227,20 @@ "phpdocumentor/type-resolver": { "version": "1.1.0" }, + "phpunit/phpunit": { + "version": "8.5", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "4.7", + "ref": "db276258424d15e572d35a4eb834b8f815662b25" + }, + "files": [ + ".env.test", + "phpunit.xml.dist", + "tests/bootstrap.php" + ] + }, "psr/cache": { "version": "1.0.1" },