From facf7e7718dea7b15523a06cc3197742c27d0ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 27 Nov 2024 11:44:28 +0100 Subject: [PATCH 01/33] fix: ignore deleted and called off assignments for feedback todos --- src/Repository/DispositionRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Repository/DispositionRepository.php b/src/Repository/DispositionRepository.php index 1cec5e7..826cfee 100644 --- a/src/Repository/DispositionRepository.php +++ b/src/Repository/DispositionRepository.php @@ -182,6 +182,7 @@ class DispositionRepository extends ServiceEntityRepository ->innerJoin('assignment.destination', 'destination') ->leftJoin('disposition.feedback', 'feedback') ->where($qb->expr()->andX( + $qb->expr()->notIn('assignment.status', ':status'), $qb->expr()->orX( $qb->expr()->andX( $qb->expr()->isNotNull('assignment.dateTo'), @@ -191,6 +192,7 @@ class DispositionRepository extends ServiceEntityRepository ), $qb->expr()->isNull('feedback') )) + ->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED]) ->setParameter('dateTo', new \DateTimeImmutable()) ; From bcefb4cb6cc3772269c74e47daeccb5cd94a9984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 10:44:07 +0100 Subject: [PATCH 02/33] chore: update wording in table column header --- templates/administrative/assignment/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/administrative/assignment/index.html.twig b/templates/administrative/assignment/index.html.twig index f204ccf..5b93dc1 100644 --- a/templates/administrative/assignment/index.html.twig +++ b/templates/administrative/assignment/index.html.twig @@ -50,7 +50,7 @@ {{ knp_pagination_sortable(pagination, 'Jobprofil', 'job_profile.name') }} - {{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }} + {{ knp_pagination_sortable(pagination, 'Busbegleitung', 'assignment.pickup') }} {% if is_granted('ROLE_ADMIN') %} From 04c3983518449e05d554b2a7db47ecc9fa79dbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 10:44:29 +0100 Subject: [PATCH 03/33] feat: display special agreements directly --- .../assignment/detail.html.twig | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/templates/administrative/assignment/detail.html.twig b/templates/administrative/assignment/detail.html.twig index 2a59438..b95deb4 100644 --- a/templates/administrative/assignment/detail.html.twig +++ b/templates/administrative/assignment/detail.html.twig @@ -164,13 +164,18 @@ {{ disposition.remarks|default('-')|nl2br }} - +
+
+ {{ disposition.specialAgreements|default('-')|nl2br }} +
+ +
From dffffee6897b5e90eca8a756127259760806f4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 10:44:51 +0100 Subject: [PATCH 04/33] chore: update project dependencies --- composer.lock | 358 +++++++++++++++++++++++++------------------------- 1 file changed, 180 insertions(+), 178 deletions(-) diff --git a/composer.lock b/composer.lock index 85f3928..205f34f 100644 --- a/composer.lock +++ b/composer.lock @@ -139,16 +139,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.3", + "version": "1.5.4", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2" + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/3b1fc3f0be055baa7c6258b1467849c3e8204eb2", - "reference": "3b1fc3f0be055baa7c6258b1467849c3e8204eb2", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/bc0593537a463e55cadf45fd938d23b75095b7e1", + "reference": "bc0593537a463e55cadf45fd938d23b75095b7e1", "shasum": "" }, "require": { @@ -195,7 +195,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.3" + "source": "https://github.com/composer/ca-bundle/tree/1.5.4" }, "funding": [ { @@ -211,7 +211,7 @@ "type": "tidelift" } ], - "time": "2024-11-04T10:15:26+00:00" + "time": "2024-11-27T15:35:25+00:00" }, { "name": "doctrine/cache", @@ -3333,16 +3333,16 @@ }, { "name": "symfony/cache", - "version": "v6.4.14", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "36fb8aa88833708e9f29014b6f15fac051a8b613" + "reference": "70d60e9a3603108563010f8592dff15a6f15dfae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/36fb8aa88833708e9f29014b6f15fac051a8b613", - "reference": "36fb8aa88833708e9f29014b6f15fac051a8b613", + "url": "https://api.github.com/repos/symfony/cache/zipball/70d60e9a3603108563010f8592dff15a6f15dfae", + "reference": "70d60e9a3603108563010f8592dff15a6f15dfae", "shasum": "" }, "require": { @@ -3409,7 +3409,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.14" + "source": "https://github.com/symfony/cache/tree/v6.4.16" }, "funding": [ { @@ -3425,20 +3425,20 @@ "type": "tidelift" } ], - "time": "2024-11-05T15:34:40+00:00" + "time": "2024-11-20T10:10:54+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197" + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/df6a1a44c890faded49a5fca33c2d5c5fd3c2197", - "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", + "reference": "15a4f8e5cd3bce9aeafc882b1acab39ec8de2c1b", "shasum": "" }, "require": { @@ -3485,7 +3485,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/cache-contracts/tree/v3.5.1" }, "funding": [ { @@ -3501,7 +3501,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/clock", @@ -3748,16 +3748,16 @@ }, { "name": "symfony/dependency-injection", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "70ab1f65a4516ef741e519ea938e6aa465e6aa36" + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/70ab1f65a4516ef741e519ea938e6aa465e6aa36", - "reference": "70ab1f65a4516ef741e519ea938e6aa465e6aa36", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7a379d8871f6a36f01559c14e11141cc02eb8dc8", + "reference": "7a379d8871f6a36f01559c14e11141cc02eb8dc8", "shasum": "" }, "require": { @@ -3809,7 +3809,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.15" + "source": "https://github.com/symfony/dependency-injection/tree/v6.4.16" }, "funding": [ { @@ -3825,20 +3825,20 @@ "type": "tidelift" } ], - "time": "2024-11-09T06:56:25+00:00" + "time": "2024-11-25T14:52:46+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -3876,7 +3876,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -3892,20 +3892,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "402d5831a73217ea76ab7e032cc05045cd3fa678" + "reference": "429a4b6786901afcc085ee16dc3f2be621f33488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/402d5831a73217ea76ab7e032cc05045cd3fa678", - "reference": "402d5831a73217ea76ab7e032cc05045cd3fa678", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/429a4b6786901afcc085ee16dc3f2be621f33488", + "reference": "429a4b6786901afcc085ee16dc3f2be621f33488", "shasum": "" }, "require": { @@ -3935,7 +3935,7 @@ }, "require-dev": { "doctrine/collections": "^1.0|^2.0", - "doctrine/data-fixtures": "^1.1", + "doctrine/data-fixtures": "^1.1|^2", "doctrine/dbal": "^2.13.1|^3|^4", "doctrine/orm": "^2.15|^3", "psr/log": "^1|^2|^3", @@ -3984,7 +3984,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.13" + "source": "https://github.com/symfony/doctrine-bridge/tree/v6.4.16" }, "funding": [ { @@ -4000,7 +4000,7 @@ "type": "tidelift" } ], - "time": "2024-10-18T09:23:39+00:00" + "time": "2024-11-25T12:00:20+00:00" }, { "name": "symfony/doctrine-messenger", @@ -4076,16 +4076,16 @@ }, { "name": "symfony/dotenv", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dotenv.git", - "reference": "436ae2dd89360fea8c7d5ff3f48ecf523c80bfb4" + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dotenv/zipball/436ae2dd89360fea8c7d5ff3f48ecf523c80bfb4", - "reference": "436ae2dd89360fea8c7d5ff3f48ecf523c80bfb4", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/1ac5e7e7e862d4d574258daf08bd569ba926e4a5", + "reference": "1ac5e7e7e862d4d574258daf08bd569ba926e4a5", "shasum": "" }, "require": { @@ -4130,7 +4130,7 @@ "environment" ], "support": { - "source": "https://github.com/symfony/dotenv/tree/v6.4.13" + "source": "https://github.com/symfony/dotenv/tree/v6.4.16" }, "funding": [ { @@ -4146,7 +4146,7 @@ "type": "tidelift" } ], - "time": "2024-09-28T07:43:51+00:00" + "time": "2024-11-27T11:08:19+00:00" }, { "name": "symfony/error-handler", @@ -4305,16 +4305,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", - "reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { @@ -4361,7 +4361,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -4377,7 +4377,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/expression-language", @@ -4889,23 +4889,23 @@ }, { "name": "symfony/http-client", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "cb4073c905cd12b8496d24ac428a9228c1750670" + "reference": "60a113666fa67e598abace38e5f46a0954d8833d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/cb4073c905cd12b8496d24ac428a9228c1750670", - "reference": "cb4073c905cd12b8496d24ac428a9228c1750670", + "url": "https://api.github.com/repos/symfony/http-client/zipball/60a113666fa67e598abace38e5f46a0954d8833d", + "reference": "60a113666fa67e598abace38e5f46a0954d8833d", "shasum": "" }, "require": { "php": ">=8.1", "psr/log": "^1|^2|^3", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/http-client-contracts": "^3.4.1", + "symfony/http-client-contracts": "~3.4.3|^3.5.1", "symfony/service-contracts": "^2.5|^3" }, "conflict": { @@ -4962,7 +4962,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.4.15" + "source": "https://github.com/symfony/http-client/tree/v6.4.16" }, "funding": [ { @@ -4978,20 +4978,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:40:18+00:00" + "time": "2024-11-27T11:52:33+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "20414d96f391677bf80078aa55baece78b82647d" + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/20414d96f391677bf80078aa55baece78b82647d", - "reference": "20414d96f391677bf80078aa55baece78b82647d", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", "shasum": "" }, "require": { @@ -5040,7 +5040,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" }, "funding": [ { @@ -5056,20 +5056,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-11-25T12:02:18+00:00" }, { "name": "symfony/http-foundation", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6" + "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6", - "reference": "9b3165eb2f04aeaa1a5a2cfef73e63fe3b22dff6", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/431771b7a6f662f1575b3cfc8fd7617aa9864d57", + "reference": "431771b7a6f662f1575b3cfc8fd7617aa9864d57", "shasum": "" }, "require": { @@ -5117,7 +5117,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.4.15" + "source": "https://github.com/symfony/http-foundation/tree/v6.4.16" }, "funding": [ { @@ -5133,20 +5133,20 @@ "type": "tidelift" } ], - "time": "2024-11-08T16:09:24+00:00" + "time": "2024-11-13T18:58:10+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "b002a5b3947653c5aee3adac2a024ea615fd3ff5" + "reference": "8838b5b21d807923b893ccbfc2cbeda0f1bc00f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b002a5b3947653c5aee3adac2a024ea615fd3ff5", - "reference": "b002a5b3947653c5aee3adac2a024ea615fd3ff5", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8838b5b21d807923b893ccbfc2cbeda0f1bc00f0", + "reference": "8838b5b21d807923b893ccbfc2cbeda0f1bc00f0", "shasum": "" }, "require": { @@ -5231,7 +5231,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.4.15" + "source": "https://github.com/symfony/http-kernel/tree/v6.4.16" }, "funding": [ { @@ -5247,7 +5247,7 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:57:37+00:00" + "time": "2024-11-27T12:49:36+00:00" }, { "name": "symfony/intl", @@ -5414,16 +5414,16 @@ }, { "name": "symfony/messenger", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/messenger.git", - "reference": "f9d4bae8301dced6f12e110a7956d2fd441573f1" + "reference": "b20092876c3d23c172a6469f9c0d7ef1de445257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/messenger/zipball/f9d4bae8301dced6f12e110a7956d2fd441573f1", - "reference": "f9d4bae8301dced6f12e110a7956d2fd441573f1", + "url": "https://api.github.com/repos/symfony/messenger/zipball/b20092876c3d23c172a6469f9c0d7ef1de445257", + "reference": "b20092876c3d23c172a6469f9c0d7ef1de445257", "shasum": "" }, "require": { @@ -5481,7 +5481,7 @@ "description": "Helps applications send and receive messages to/from other applications or via message queues", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/messenger/tree/v6.4.15" + "source": "https://github.com/symfony/messenger/tree/v6.4.16" }, "funding": [ { @@ -5497,7 +5497,7 @@ "type": "tidelift" } ], - "time": "2024-11-09T07:05:35+00:00" + "time": "2024-11-25T02:02:03+00:00" }, { "name": "symfony/mime", @@ -5824,16 +5824,16 @@ }, { "name": "symfony/options-resolver", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0a62a9f2504a8dd27083f89d21894ceb01cc59db", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { @@ -5871,7 +5871,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.13" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -5887,7 +5887,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/password-hasher", @@ -6662,16 +6662,16 @@ }, { "name": "symfony/property-info", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "9d7b576bb643c72bf3b60eb8e89c98725d00afd0" + "reference": "e4782ec1c2b6896e820896357f6a3d02249e63eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/9d7b576bb643c72bf3b60eb8e89c98725d00afd0", - "reference": "9d7b576bb643c72bf3b60eb8e89c98725d00afd0", + "url": "https://api.github.com/repos/symfony/property-info/zipball/e4782ec1c2b6896e820896357f6a3d02249e63eb", + "reference": "e4782ec1c2b6896e820896357f6a3d02249e63eb", "shasum": "" }, "require": { @@ -6679,17 +6679,18 @@ "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { + "doctrine/annotations": "<1.12", "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<5.4", - "symfony/serializer": "<6.4" + "symfony/dependency-injection": "<5.4|>=6.0,<6.4" }, "require-dev": { + "doctrine/annotations": "^1.12|^2", "phpdocumentor/reflection-docblock": "^5.2", "phpstan/phpdoc-parser": "^1.0|^2.0", "symfony/cache": "^5.4|^6.0|^7.0", "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/serializer": "^6.4|^7.0" + "symfony/serializer": "^5.4|^6.4|^7.0" }, "type": "library", "autoload": { @@ -6725,7 +6726,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.4.15" + "source": "https://github.com/symfony/property-info/tree/v6.4.16" }, "funding": [ { @@ -6741,20 +6742,20 @@ "type": "tidelift" } ], - "time": "2024-11-07T16:39:46+00:00" + "time": "2024-11-27T10:18:02+00:00" }, { "name": "symfony/routing", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "640a74250d13f9c30d5ca045b6aaaabcc8215278" + "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/640a74250d13f9c30d5ca045b6aaaabcc8215278", - "reference": "640a74250d13f9c30d5ca045b6aaaabcc8215278", + "url": "https://api.github.com/repos/symfony/routing/zipball/91e02e606b4b705c2f4fb42f7e7708b7923a3220", + "reference": "91e02e606b4b705c2f4fb42f7e7708b7923a3220", "shasum": "" }, "require": { @@ -6808,7 +6809,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v6.4.13" + "source": "https://github.com/symfony/routing/tree/v6.4.16" }, "funding": [ { @@ -6824,7 +6825,7 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:30:56+00:00" + "time": "2024-11-13T15:31:34+00:00" }, { "name": "symfony/runtime", @@ -7019,16 +7020,16 @@ }, { "name": "symfony/security-core", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "bbd1a919aec8696a95bf8749d5577fbe74de973c" + "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/bbd1a919aec8696a95bf8749d5577fbe74de973c", - "reference": "bbd1a919aec8696a95bf8749d5577fbe74de973c", + "url": "https://api.github.com/repos/symfony/security-core/zipball/19cdb7de86e556202ab16e0cffd1a97348231bc0", + "reference": "19cdb7de86e556202ab16e0cffd1a97348231bc0", "shasum": "" }, "require": { @@ -7085,7 +7086,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v6.4.13" + "source": "https://github.com/symfony/security-core/tree/v6.4.16" }, "funding": [ { @@ -7101,7 +7102,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-11-27T09:48:51+00:00" }, { "name": "symfony/security-csrf", @@ -7359,16 +7360,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -7422,7 +7423,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -7438,7 +7439,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stimulus-bundle", @@ -7820,16 +7821,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a" + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", - "reference": "b9d2189887bb6b2e0367a9fc7136c5239ab9b05a", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/4667ff3bd513750603a09c8dedbea942487fb07c", + "reference": "4667ff3bd513750603a09c8dedbea942487fb07c", "shasum": "" }, "require": { @@ -7878,7 +7879,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.5.1" }, "funding": [ { @@ -7894,20 +7895,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/twig-bridge", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "ec3511eef0576f378b2758da9e1c157086babd59" + "reference": "32ec012ed4f6426441a66014471bdb26674744be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ec3511eef0576f378b2758da9e1c157086babd59", - "reference": "ec3511eef0576f378b2758da9e1c157086babd59", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/32ec012ed4f6426441a66014471bdb26674744be", + "reference": "32ec012ed4f6426441a66014471bdb26674744be", "shasum": "" }, "require": { @@ -7987,7 +7988,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v6.4.13" + "source": "https://github.com/symfony/twig-bridge/tree/v6.4.16" }, "funding": [ { @@ -8003,7 +8004,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-11-25T11:59:11+00:00" }, { "name": "symfony/twig-bundle", @@ -8248,16 +8249,16 @@ }, { "name": "symfony/validator", - "version": "v6.4.15", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "7541055cdaf54ff95f0735bf703d313374e8b20b" + "reference": "9b0d1988b56511706bc91d96ead39acd77aaf34d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/7541055cdaf54ff95f0735bf703d313374e8b20b", - "reference": "7541055cdaf54ff95f0735bf703d313374e8b20b", + "url": "https://api.github.com/repos/symfony/validator/zipball/9b0d1988b56511706bc91d96ead39acd77aaf34d", + "reference": "9b0d1988b56511706bc91d96ead39acd77aaf34d", "shasum": "" }, "require": { @@ -8325,7 +8326,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v6.4.15" + "source": "https://github.com/symfony/validator/tree/v6.4.16" }, "funding": [ { @@ -8341,7 +8342,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T15:28:48+00:00" + "time": "2024-11-27T09:48:51+00:00" }, { "name": "symfony/var-dumper", @@ -8822,7 +8823,7 @@ }, { "name": "twig/extra-bundle", - "version": "v3.15.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", @@ -8880,7 +8881,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.15.0" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.16.0" }, "funding": [ { @@ -8896,7 +8897,7 @@ }, { "name": "twig/html-extra", - "version": "v3.15.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/twigphp/html-extra.git", @@ -8948,7 +8949,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/html-extra/tree/v3.15.0" + "source": "https://github.com/twigphp/html-extra/tree/v3.16.0" }, "funding": [ { @@ -8964,16 +8965,16 @@ }, { "name": "twig/intl-extra", - "version": "v3.15.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/twigphp/intl-extra.git", - "reference": "92a127a58857597acc6eca2e34d5ef90057dcc59" + "reference": "4eeab2a3f8d04d1838be7251ab2d183f817aea7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/92a127a58857597acc6eca2e34d5ef90057dcc59", - "reference": "92a127a58857597acc6eca2e34d5ef90057dcc59", + "url": "https://api.github.com/repos/twigphp/intl-extra/zipball/4eeab2a3f8d04d1838be7251ab2d183f817aea7b", + "reference": "4eeab2a3f8d04d1838be7251ab2d183f817aea7b", "shasum": "" }, "require": { @@ -9012,7 +9013,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/intl-extra/tree/v3.15.0" + "source": "https://github.com/twigphp/intl-extra/tree/v3.16.0" }, "funding": [ { @@ -9024,20 +9025,20 @@ "type": "tidelift" } ], - "time": "2024-09-16T10:21:35+00:00" + "time": "2024-11-20T13:19:52+00:00" }, { "name": "twig/string-extra", - "version": "v3.15.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "b098bd4910aba185afb70e40b8e23071fce8c656" + "reference": "3f90208078a7d55ad4a561301ee3929d3e3840e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/b098bd4910aba185afb70e40b8e23071fce8c656", - "reference": "b098bd4910aba185afb70e40b8e23071fce8c656", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/3f90208078a7d55ad4a561301ee3929d3e3840e0", + "reference": "3f90208078a7d55ad4a561301ee3929d3e3840e0", "shasum": "" }, "require": { @@ -9079,7 +9080,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.15.0" + "source": "https://github.com/twigphp/string-extra/tree/v3.16.0" }, "funding": [ { @@ -9091,20 +9092,20 @@ "type": "tidelift" } ], - "time": "2024-11-03T14:08:48+00:00" + "time": "2024-11-20T13:10:15+00:00" }, { "name": "twig/twig", - "version": "v3.15.0", + "version": "v3.16.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02" + "reference": "475ad2dc97d65d8631393e721e7e44fb544f0561" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/2d5b3964cc21d0188633d7ddce732dc8e874db02", - "reference": "2d5b3964cc21d0188633d7ddce732dc8e874db02", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/475ad2dc97d65d8631393e721e7e44fb544f0561", + "reference": "475ad2dc97d65d8631393e721e7e44fb544f0561", "shasum": "" }, "require": { @@ -9115,6 +9116,7 @@ "symfony/polyfill-php81": "^1.29" }, "require-dev": { + "phpstan/phpstan": "^2.0", "psr/container": "^1.0|^2.0", "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, @@ -9158,7 +9160,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.15.0" + "source": "https://github.com/twigphp/Twig/tree/v3.16.0" }, "funding": [ { @@ -9170,7 +9172,7 @@ "type": "tidelift" } ], - "time": "2024-11-17T15:59:19+00:00" + "time": "2024-11-29T08:27:05+00:00" }, { "name": "ua-parser/uap-php", @@ -9557,16 +9559,16 @@ "packages-dev": [ { "name": "deployer/deployer", - "version": "v7.5.5", + "version": "v7.5.8", "source": { "type": "git", "url": "https://github.com/deployphp/deployer.git", - "reference": "1b37d639e0ffad980f6cc3873859b16de29ecad7" + "reference": "4900fe799ce5566d54a14103cdfd6e865b7c5d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/deployphp/deployer/zipball/1b37d639e0ffad980f6cc3873859b16de29ecad7", - "reference": "1b37d639e0ffad980f6cc3873859b16de29ecad7", + "url": "https://api.github.com/repos/deployphp/deployer/zipball/4900fe799ce5566d54a14103cdfd6e865b7c5d72", + "reference": "4900fe799ce5566d54a14103cdfd6e865b7c5d72", "shasum": "" }, "require": { @@ -9607,7 +9609,7 @@ "type": "github" } ], - "time": "2024-11-08T13:18:44+00:00" + "time": "2024-11-27T21:35:20+00:00" }, { "name": "marcocesarato/php-conventional-changelog", @@ -11584,16 +11586,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "ae074dffb018c37a57071990d16e6152728dd972" + "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/ae074dffb018c37a57071990d16e6152728dd972", - "reference": "ae074dffb018c37a57071990d16e6152728dd972", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4304e6ad5c894a9c72831ad459f627bfd35d766d", + "reference": "4304e6ad5c894a9c72831ad459f627bfd35d766d", "shasum": "" }, "require": { @@ -11631,7 +11633,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v6.4.13" + "source": "https://github.com/symfony/dom-crawler/tree/v6.4.16" }, "funding": [ { @@ -11647,7 +11649,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-11-13T15:06:22+00:00" }, { "name": "symfony/maker-bundle", @@ -11743,16 +11745,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "e6377bea5b114f70de6332fe935e160da5014ce8" + "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/e6377bea5b114f70de6332fe935e160da5014ce8", - "reference": "e6377bea5b114f70de6332fe935e160da5014ce8", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/cebafe2f1ad2d1e745c1015b7c2519592341e4e6", + "reference": "cebafe2f1ad2d1e745c1015b7c2519592341e4e6", "shasum": "" }, "require": { @@ -11772,8 +11774,8 @@ "type": "symfony-bridge", "extra": { "thanks": { - "name": "phpunit/phpunit", - "url": "https://github.com/sebastianbergmann/phpunit" + "url": "https://github.com/sebastianbergmann/phpunit", + "name": "phpunit/phpunit" } }, "autoload": { @@ -11805,7 +11807,7 @@ "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.13" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.4.16" }, "funding": [ { @@ -11821,20 +11823,20 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-13T15:06:22+00:00" }, { "name": "symfony/web-profiler-bundle", - "version": "v6.4.14", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/web-profiler-bundle.git", - "reference": "bfbade623f1cc7f1e243ce5488af33861a8f5be7" + "reference": "2d58fd04ac0d3c6279cadd0105959083ef1d7f5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/bfbade623f1cc7f1e243ce5488af33861a8f5be7", - "reference": "bfbade623f1cc7f1e243ce5488af33861a8f5be7", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/2d58fd04ac0d3c6279cadd0105959083ef1d7f5b", + "reference": "2d58fd04ac0d3c6279cadd0105959083ef1d7f5b", "shasum": "" }, "require": { @@ -11887,7 +11889,7 @@ "dev" ], "support": { - "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.14" + "source": "https://github.com/symfony/web-profiler-bundle/tree/v6.4.16" }, "funding": [ { @@ -11903,7 +11905,7 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:33:53+00:00" + "time": "2024-11-19T10:11:25+00:00" }, { "name": "theseer/tokenizer", From 4b5556995ff485ecc9bfa6b1fc37ac0971f19f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 12:27:00 +0100 Subject: [PATCH 05/33] fix: incorrect use of form option --- src/Controller/Teamer/Profile/IndexController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Controller/Teamer/Profile/IndexController.php b/src/Controller/Teamer/Profile/IndexController.php index 53e0d5c..13bd416 100644 --- a/src/Controller/Teamer/Profile/IndexController.php +++ b/src/Controller/Teamer/Profile/IndexController.php @@ -55,7 +55,6 @@ class IndexController extends AbstractController $form = $this->createForm(TeamerProfileType::class, $teamer, [ 'upload_session' => $uploadSession, - 'admin_mode' => $this->isGranted('IS_IMPERSONATOR'), ]); $form->handleRequest($request); From 1c55b4785c10151751e27b47547dc51ff9c140ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 12:27:18 +0100 Subject: [PATCH 06/33] fix: ensure correct argument type --- src/Twig/AppRuntime.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index d3afdfd..aee00db 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -88,9 +88,9 @@ class AppRuntime implements RuntimeExtensionInterface return 'ab '.$pickup->getCity(); } - public function hasPickup(?int $pickupId, Teamer $teamer): bool + public function hasPickup($pickupId, Teamer $teamer): bool { - return $this->pickupResolver->hasPickup($pickupId, $teamer); + return $this->pickupResolver->hasPickup((int) $pickupId, $teamer); } public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string From 30111df4083703b5981f64807145a103dcc8a596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 29 Nov 2024 12:55:32 +0100 Subject: [PATCH 07/33] feat: generate image thumbnails after deployment --- config/services.yaml | 5 ++ deploy.php | 5 ++ src/Command/GenerateThumbnailsCommand.php | 66 +++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 src/Command/GenerateThumbnailsCommand.php diff --git a/config/services.yaml b/config/services.yaml index 28fcf25..d396b6f 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -53,6 +53,11 @@ services: $connection: '@doctrine.dbal.default_connection' $xmlFilesPath: '%kernel.project_dir%/xmlexport' + App\Command\GenerateThumbnailsCommand: + arguments: + $cacheManager: '@liip_imagine.cache.manager' + $filterService: '@liip_imagine.service.filter' + App\BusProNet\ApiClient: arguments: $logger: '@monolog.logger.bpn' diff --git a/deploy.php b/deploy.php index 47bd5a1..ba5509d 100644 --- a/deploy.php +++ b/deploy.php @@ -92,6 +92,7 @@ task('deploy', [ 'database:migrate', 'deploy:publish', 'cachetool:clear:opcache', + 'deploy:thumbnails', // 'deploy:stop-workers', ]); @@ -103,4 +104,8 @@ task('deploy:assets', function () { runLocally('npm i && npm run build'); }); +task('deploy:thumbnails', function () { + run('{{bin/console}} app:generate-thumbnails'); +}); + after('deploy:failed', 'deploy:unlock'); diff --git a/src/Command/GenerateThumbnailsCommand.php b/src/Command/GenerateThumbnailsCommand.php new file mode 100644 index 0000000..b1ac599 --- /dev/null +++ b/src/Command/GenerateThumbnailsCommand.php @@ -0,0 +1,66 @@ +entityManager + ->getRepository(Teamer::class) + ->createQueryBuilder('t') + ->select('t.id', 'p.filename') + ->innerJoin('t.photo', 'p') + ->getQuery() + ->getArrayResult() + ; + + $imagesCount = count($images); + + $io->info('Generating thumbnails for '.$imagesCount.' profile images...'); + + $progressbar = $io->createProgressBar($imagesCount); + $progressbar->start(); + + foreach ($images as $image) { + try { + $this->filterService->warmUpCache($image['filename'], 'thumbnail'); + $this->filterService->warmUpCache($image['filename'], 'profile'); + $this->cacheManager->getBrowserPath($image['filename'], 'thumbnail'); + $this->cacheManager->getBrowserPath($image['filename'], 'profile'); + } catch (\Exception $e) { + } + + $progressbar->advance(); + } + + $progressbar->finish(); + + return Command::SUCCESS; + } +} \ No newline at end of file From a378bc2e410f9eb7dcb23e21d835ed97af3b39dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 2 Dec 2024 11:53:39 +0100 Subject: [PATCH 08/33] chore: simplify query --- src/Repository/DispositionRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Repository/DispositionRepository.php b/src/Repository/DispositionRepository.php index 826cfee..f9c2f74 100644 --- a/src/Repository/DispositionRepository.php +++ b/src/Repository/DispositionRepository.php @@ -281,10 +281,11 @@ class DispositionRepository extends ServiceEntityRepository ->select('disposition', 'assignment', 'destination', 'document') ->innerJoin('disposition.assignment', 'assignment') ->innerJoin('assignment.destination', 'destination') - ->leftJoin('disposition.documents', 'document', Join::WITH, 'document.type = :documentType') + ->leftJoin('disposition.documents', 'document') ->where($qb->expr()->andX( $qb->expr()->lte('disposition.createdAt', ':dueDate'), $qb->expr()->eq('disposition.status', ':status'), + $qb->expr()->eq('document.type', ':documentType'), $qb->expr()->isNull('document') )) ->setParameter('documentType', Upload::TYPE_CONTRACT) From 44d130414cb3f1628e1a7686cb84660d9aabbc0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 2 Dec 2024 14:19:35 +0100 Subject: [PATCH 09/33] feat: filter assignments by id --- src/Form/AssignmentFilterType.php | 31 ++++++++++++------- src/Model/AssignmentFilterDto.php | 13 ++++++++ src/Repository/AssignmentRepository.php | 7 +++++ .../Common/AssignmentFilterHandler.php | 4 +++ .../common/modal_assignment_filter.html.twig | 9 ++++-- 5 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/Form/AssignmentFilterType.php b/src/Form/AssignmentFilterType.php index 0b20917..5f30d12 100644 --- a/src/Form/AssignmentFilterType.php +++ b/src/Form/AssignmentFilterType.php @@ -12,6 +12,7 @@ use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -27,6 +28,7 @@ class AssignmentFilterType extends AbstractType $builder ->add('dateFrom', DatepickerType::class, [ 'label' => 'Zeitraum von', + 'required' => false, 'min_date' => $options['min_date'], 'max_date' => $options['max_date'], 'attr' => [ @@ -35,6 +37,7 @@ class AssignmentFilterType extends AbstractType ]) ->add('dateTo', DatepickerType::class, [ 'label' => 'Zeitraum bis', + 'required' => false, 'min_date' => $options['min_date'], 'max_date' => $options['max_date'], 'attr' => [ @@ -65,17 +68,23 @@ class AssignmentFilterType extends AbstractType ; if ($this->security->isGranted('ROLE_ADMINISTRATIVE')) { - $builder->add('status', MultiselectType::class, [ - 'label' => 'Status', - 'required' => false, - 'empty_label' => 'nicht filtern', - 'choices' => [ - 'voll besetzt' => Assignment::STATUS_STAFFED, - 'teilweise besetzt' => Assignment::STATUS_PARTLY_STAFFED, - 'unbesetzt' => Assignment::STATUS_UNSTAFFED, - 'mit Bewerbungen' => Assignment::STATUS_STAFFING, - ], - ]); + $builder + ->add('id', IntegerType::class, [ + 'label' => 'ID', + 'required' => false, + ]) + ->add('status', MultiselectType::class, [ + 'label' => 'Status', + 'required' => false, + 'empty_label' => 'nicht filtern', + 'choices' => [ + 'voll besetzt' => Assignment::STATUS_STAFFED, + 'teilweise besetzt' => Assignment::STATUS_PARTLY_STAFFED, + 'unbesetzt' => Assignment::STATUS_UNSTAFFED, + 'mit Bewerbungen' => Assignment::STATUS_STAFFING, + ], + ]) + ; } if (0 < count($options['job_profiles'])) { diff --git a/src/Model/AssignmentFilterDto.php b/src/Model/AssignmentFilterDto.php index 5d50392..4ca6c91 100644 --- a/src/Model/AssignmentFilterDto.php +++ b/src/Model/AssignmentFilterDto.php @@ -12,6 +12,7 @@ class AssignmentFilterDto extends AbstractFilterDto public const DURATION_FULL_WEEK = 3; public const DURATION_MORE = 4; + protected ?int $id = null; protected ?\DateTimeImmutable $dateFrom = null; protected ?\DateTimeImmutable $dateTo = null; protected array $jobProfiles = []; @@ -20,6 +21,18 @@ class AssignmentFilterDto extends AbstractFilterDto protected array $status = []; protected bool $includePast = false; + public function getId(): ?int + { + return $this->id; + } + + public function setId(?int $id): static + { + $this->id = $id; + + return $this; + } + public function getDateFrom(): ?\DateTimeImmutable { return $this->dateFrom; diff --git a/src/Repository/AssignmentRepository.php b/src/Repository/AssignmentRepository.php index 7e01eb4..4951af4 100644 --- a/src/Repository/AssignmentRepository.php +++ b/src/Repository/AssignmentRepository.php @@ -85,6 +85,13 @@ class AssignmentRepository extends ServiceEntityRepository private function applyFilterSettings(AssignmentFilterDto $filterDto, QueryBuilder $qb): void { + if (null !== $filterDto->getId()) { + $qb + ->andWhere($qb->expr()->eq('assignment.id', ':id')) + ->setParameter('id', $filterDto->getId()) + ; + } + if (false === $filterDto->isIncludePast()) { $qb ->andWhere($qb->expr()->gte('destination.dateFrom', ':now')) diff --git a/src/Service/Common/AssignmentFilterHandler.php b/src/Service/Common/AssignmentFilterHandler.php index 8d58a06..e0d1c19 100644 --- a/src/Service/Common/AssignmentFilterHandler.php +++ b/src/Service/Common/AssignmentFilterHandler.php @@ -18,6 +18,9 @@ class AssignmentFilterHandler extends AbstractFilterHandler $filterDto = new AssignmentFilterDto(); + if (isset($data['id'])) { + $filterDto->setId($data['id']); + } if (isset($data['date_from'])) { $filterDto->setDateFrom($data['date_from']); } @@ -52,6 +55,7 @@ class AssignmentFilterHandler extends AbstractFilterHandler { /** @var AssignmentFilterDto $filterDto */ $this->getSession()->set($this->namespace, [ + 'id' => $filterDto->getId(), 'date_from' => $filterDto->getDateFrom(), 'date_to' => $filterDto->getDateTo(), 'job_profiles' => array_map(function (JobProfile $jobProfile) { diff --git a/templates/common/modal_assignment_filter.html.twig b/templates/common/modal_assignment_filter.html.twig index f1afe0c..a155a01 100644 --- a/templates/common/modal_assignment_filter.html.twig +++ b/templates/common/modal_assignment_filter.html.twig @@ -5,11 +5,16 @@ {% block content %} {{ form_start(filterForm, { 'attr': { 'hx-post': app.request.uri, 'hx-target': '#htmx-modal', 'hx-swap': 'outerHTML' } }) }}
+ {% if filterForm.id is defined %} + {{ form_row(filterForm.id) }} + {% endif %} {% if filterForm.status is defined %} {{ form_row(filterForm.status) }} {% endif %} - {{ form_row(filterForm.dateFrom) }} - {{ form_row(filterForm.dateTo) }} +
+ {{ form_row(filterForm.dateFrom) }} + {{ form_row(filterForm.dateTo) }} +
{{ form_row(filterForm.jobProfiles) }} {{ form_row(filterForm.hotels) }} {{ form_row(filterForm.duration) }} From 8aca2a5e8750200b0f95ae85099804aaece976c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 2 Dec 2024 14:22:31 +0100 Subject: [PATCH 10/33] feat: created and updated timestamps in assignment details --- .../_assignment_info_compact.html.twig | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/templates/_partials/_assignment_info_compact.html.twig b/templates/_partials/_assignment_info_compact.html.twig index f74b6c6..e3b8e83 100644 --- a/templates/_partials/_assignment_info_compact.html.twig +++ b/templates/_partials/_assignment_info_compact.html.twig @@ -80,5 +80,25 @@ {% endif %}
+
+
+ erstellt +
+
+ {{ assignment.createdAt|date('d.m.Y, H:i') }} Uhr +
+
+
+
+ aktualisiert +
+
+ {% if assignment.updatedAt %} + {{ assignment.updatedAt|date('d.m.Y, H:i') }} Uhr + {% else %} + - + {% endif %} +
+
From 4d2f37eec10f4372fae275b4aae5aff6bcd8452e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 2 Dec 2024 14:27:40 +0100 Subject: [PATCH 11/33] feat: allow withdrawal of application unless rejected --- src/Security/Voter/ApplicationVoter.php | 12 +++++++----- templates/teamer/assignment/detail.html.twig | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Security/Voter/ApplicationVoter.php b/src/Security/Voter/ApplicationVoter.php index f86cf78..347e87b 100644 --- a/src/Security/Voter/ApplicationVoter.php +++ b/src/Security/Voter/ApplicationVoter.php @@ -54,12 +54,14 @@ class ApplicationVoter extends Voter if ($this->security->isGranted('ROLE_TEAMER') && in_array($attribute, $teamerAttributes)) { $teamer = $user->getTeamer(); + + if ($teamer !== $application->getTeamer()) { + return false; + } + return match ($attribute) { - static::WITHDRAW => $teamer === $application->getTeamer(), - static::DELETE => $teamer === $application->getTeamer() - && Application::STATUS_REJECTED === $status, - static::VIEW => $teamer === $application->getTeamer() - && Application::STATUS_REJECTED !== $status, + static::DELETE => Application::STATUS_REJECTED === $status, + static::VIEW, static::WITHDRAW => Application::STATUS_REJECTED !== $status, default => false, }; } diff --git a/templates/teamer/assignment/detail.html.twig b/templates/teamer/assignment/detail.html.twig index 60dc181..ad07250 100644 --- a/templates/teamer/assignment/detail.html.twig +++ b/templates/teamer/assignment/detail.html.twig @@ -22,12 +22,14 @@ {% if application.comment and application.commentVisible %} Begründung: {{ application.comment|nl2br}} {% endif %} - {% elseif application.status == constant('App\\Entity\\Application::STATUS_PENDING') %} + {% endif %} + {% if application.status == constant('App\\Entity\\Application::STATUS_PENDING') %} {% if application.comment and application.commentVisible %} Begründung: {{ application.comment|nl2br}} {% endif %} - {% else %} + {% endif %} + {% if is_granted('WITHDRAW', application) %} {% include '_partials/_dot.html.twig' %} {{ assignment.effectivePeriod.start|date('d.m.y') }} - {{ assignment.effectivePeriod.end|date('d.m.y') }} {% include '_partials/_dot.html.twig' %} From fe7298eb2d4a4560265b7bbc28a97e46191b3c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 11 Dec 2024 12:39:13 +0100 Subject: [PATCH 16/33] chore: update project dependencies --- composer.lock | 182 +++++++++++++++++++++++++------------------------- 1 file changed, 90 insertions(+), 92 deletions(-) diff --git a/composer.lock b/composer.lock index cd592f4..924cd99 100644 --- a/composer.lock +++ b/composer.lock @@ -598,29 +598,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -628,7 +626,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -639,9 +637,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "doctrine/doctrine-bundle", @@ -1611,20 +1609,20 @@ }, { "name": "imagine/imagine", - "version": "1.4.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/php-imagine/Imagine.git", - "reference": "2c8887dc7e84e97283037f02dd9c957d4b3a0b82" + "reference": "80ab21434890dee9ba54969d31c51ac8d4d551e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-imagine/Imagine/zipball/2c8887dc7e84e97283037f02dd9c957d4b3a0b82", - "reference": "2c8887dc7e84e97283037f02dd9c957d4b3a0b82", + "url": "https://api.github.com/repos/php-imagine/Imagine/zipball/80ab21434890dee9ba54969d31c51ac8d4d551e0", + "reference": "80ab21434890dee9ba54969d31c51ac8d4d551e0", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4 || ^9.3" @@ -1657,7 +1655,7 @@ "homepage": "http://avalanche123.com" } ], - "description": "Image processing for PHP 5.3", + "description": "Image processing for PHP", "homepage": "http://imagine.readthedocs.org/", "keywords": [ "drawing", @@ -1667,9 +1665,9 @@ ], "support": { "issues": "https://github.com/php-imagine/Imagine/issues", - "source": "https://github.com/php-imagine/Imagine/tree/1.4.0" + "source": "https://github.com/php-imagine/Imagine/tree/1.5.0" }, - "time": "2024-11-18T07:44:52+00:00" + "time": "2024-12-03T14:37:55+00:00" }, { "name": "knplabs/knp-components", @@ -2078,16 +2076,16 @@ }, { "name": "monolog/monolog", - "version": "3.8.0", + "version": "3.8.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67" + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/32e515fdc02cdafbe4593e30a9350d486b125b67", - "reference": "32e515fdc02cdafbe4593e30a9350d486b125b67", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", + "reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "shasum": "" }, "require": { @@ -2165,7 +2163,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.8.0" + "source": "https://github.com/Seldaek/monolog/tree/3.8.1" }, "funding": [ { @@ -2177,7 +2175,7 @@ "type": "tidelift" } ], - "time": "2024-11-12T13:57:08+00:00" + "time": "2024-12-05T17:15:07+00:00" }, { "name": "nelmio/security-bundle", @@ -2509,16 +2507,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -2567,9 +2565,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-11-12T11:25:25+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -3030,16 +3028,16 @@ }, { "name": "setasign/fpdi", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/Setasign/FPDI.git", - "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f" + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDI/zipball/09a816004fcee9ed3405bd164147e3fdbb79a56f", - "reference": "09a816004fcee9ed3405bd164147e3fdbb79a56f", + "url": "https://api.github.com/repos/Setasign/FPDI/zipball/9e013b376939c0d4029f54150d2a16f3c67a5797", + "reference": "9e013b376939c0d4029f54150d2a16f3c67a5797", "shasum": "" }, "require": { @@ -3090,7 +3088,7 @@ ], "support": { "issues": "https://github.com/Setasign/FPDI/issues", - "source": "https://github.com/Setasign/FPDI/tree/v2.6.1" + "source": "https://github.com/Setasign/FPDI/tree/v2.6.2" }, "funding": [ { @@ -3098,7 +3096,7 @@ "type": "tidelift" } ], - "time": "2024-09-02T10:17:15+00:00" + "time": "2024-12-10T13:12:19+00:00" }, { "name": "spatie/enum", @@ -4999,12 +4997,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -5984,8 +5982,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6147,8 +6145,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6229,8 +6227,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6313,8 +6311,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6387,8 +6385,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -6469,8 +6467,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -7443,16 +7441,16 @@ }, { "name": "symfony/stimulus-bundle", - "version": "v2.22.0", + "version": "v2.22.1", "source": { "type": "git", "url": "https://github.com/symfony/stimulus-bundle.git", - "reference": "2e840a3b12f06b33441cc3eb8907f51b806a7e4b" + "reference": "e13034d428354023c82a1db108d40fdf6cec2d36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stimulus-bundle/zipball/2e840a3b12f06b33441cc3eb8907f51b806a7e4b", - "reference": "2e840a3b12f06b33441cc3eb8907f51b806a7e4b", + "url": "https://api.github.com/repos/symfony/stimulus-bundle/zipball/e13034d428354023c82a1db108d40fdf6cec2d36", + "reference": "e13034d428354023c82a1db108d40fdf6cec2d36", "shasum": "" }, "require": { @@ -7492,7 +7490,7 @@ "symfony-ux" ], "support": { - "source": "https://github.com/symfony/stimulus-bundle/tree/v2.22.0" + "source": "https://github.com/symfony/stimulus-bundle/tree/v2.22.1" }, "funding": [ { @@ -7508,7 +7506,7 @@ "type": "tidelift" } ], - "time": "2024-11-20T07:57:38+00:00" + "time": "2024-12-06T14:30:33+00:00" }, { "name": "symfony/stopwatch", @@ -8166,16 +8164,16 @@ }, { "name": "symfony/ux-twig-component", - "version": "v2.22.0", + "version": "v2.22.1", "source": { "type": "git", "url": "https://github.com/symfony/ux-twig-component.git", - "reference": "03177a494399fbdcbb1f5f2aee017ccf8df581d9" + "reference": "9b347f6ca2d9e18cee630787f0a6aa453982bf18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/ux-twig-component/zipball/03177a494399fbdcbb1f5f2aee017ccf8df581d9", - "reference": "03177a494399fbdcbb1f5f2aee017ccf8df581d9", + "url": "https://api.github.com/repos/symfony/ux-twig-component/zipball/9b347f6ca2d9e18cee630787f0a6aa453982bf18", + "reference": "9b347f6ca2d9e18cee630787f0a6aa453982bf18", "shasum": "" }, "require": { @@ -8229,7 +8227,7 @@ "twig" ], "support": { - "source": "https://github.com/symfony/ux-twig-component/tree/v2.22.0" + "source": "https://github.com/symfony/ux-twig-component/tree/v2.22.1" }, "funding": [ { @@ -8245,7 +8243,7 @@ "type": "tidelift" } ], - "time": "2024-11-23T06:59:34+00:00" + "time": "2024-12-07T18:05:50+00:00" }, { "name": "symfony/validator", @@ -8823,7 +8821,7 @@ }, { "name": "twig/extra-bundle", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/twigphp/twig-extra-bundle.git", @@ -8881,7 +8879,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.16.0" + "source": "https://github.com/twigphp/twig-extra-bundle/tree/v3.17.0" }, "funding": [ { @@ -8897,7 +8895,7 @@ }, { "name": "twig/html-extra", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/twigphp/html-extra.git", @@ -8949,7 +8947,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/html-extra/tree/v3.16.0" + "source": "https://github.com/twigphp/html-extra/tree/v3.17.0" }, "funding": [ { @@ -8965,7 +8963,7 @@ }, { "name": "twig/intl-extra", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/twigphp/intl-extra.git", @@ -9013,7 +9011,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/intl-extra/tree/v3.16.0" + "source": "https://github.com/twigphp/intl-extra/tree/v3.17.0" }, "funding": [ { @@ -9029,16 +9027,16 @@ }, { "name": "twig/string-extra", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/twigphp/string-extra.git", - "reference": "3f90208078a7d55ad4a561301ee3929d3e3840e0" + "reference": "cb4eec11de02f63ad8ea9d065a1f27752d0bf752" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/string-extra/zipball/3f90208078a7d55ad4a561301ee3929d3e3840e0", - "reference": "3f90208078a7d55ad4a561301ee3929d3e3840e0", + "url": "https://api.github.com/repos/twigphp/string-extra/zipball/cb4eec11de02f63ad8ea9d065a1f27752d0bf752", + "reference": "cb4eec11de02f63ad8ea9d065a1f27752d0bf752", "shasum": "" }, "require": { @@ -9080,7 +9078,7 @@ "unicode" ], "support": { - "source": "https://github.com/twigphp/string-extra/tree/v3.16.0" + "source": "https://github.com/twigphp/string-extra/tree/v3.17.0" }, "funding": [ { @@ -9092,20 +9090,20 @@ "type": "tidelift" } ], - "time": "2024-11-20T13:10:15+00:00" + "time": "2024-11-30T08:42:13+00:00" }, { "name": "twig/twig", - "version": "v3.16.0", + "version": "v3.17.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "475ad2dc97d65d8631393e721e7e44fb544f0561" + "reference": "d3a64b742a5e74c57e3964d766e1032982145872" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/475ad2dc97d65d8631393e721e7e44fb544f0561", - "reference": "475ad2dc97d65d8631393e721e7e44fb544f0561", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d3a64b742a5e74c57e3964d766e1032982145872", + "reference": "d3a64b742a5e74c57e3964d766e1032982145872", "shasum": "" }, "require": { @@ -9160,7 +9158,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.16.0" + "source": "https://github.com/twigphp/Twig/tree/v3.17.0" }, "funding": [ { @@ -9172,7 +9170,7 @@ "type": "tidelift" } ], - "time": "2024-11-29T08:27:05+00:00" + "time": "2024-12-10T15:19:11+00:00" }, { "name": "ua-parser/uap-php", @@ -10313,16 +10311,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -10333,7 +10331,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -10396,7 +10394,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -10412,7 +10410,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "sebastian/cli-parser", From 343aa2445045a4b3f551faa3766bbeef3b6f47c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 16 Dec 2024 09:45:01 +0100 Subject: [PATCH 17/33] fix: avoid type error --- src/Service/Teamer/PickupResolver.php | 4 ++-- src/Twig/AppRuntime.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Service/Teamer/PickupResolver.php b/src/Service/Teamer/PickupResolver.php index 2542dc3..2a3bf2f 100644 --- a/src/Service/Teamer/PickupResolver.php +++ b/src/Service/Teamer/PickupResolver.php @@ -23,8 +23,8 @@ class PickupResolver return false; } - $teamerPickups = array_map(function (int $id) { - return $this->pickupDataProvider->get($id); + $teamerPickups = array_map(function (mixed $id) { + return $this->pickupDataProvider->get((int) $id); }, $teamer->getPickups()); foreach ($teamerPickups as $teamerPickup) { diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index aee00db..d3afdfd 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -88,9 +88,9 @@ class AppRuntime implements RuntimeExtensionInterface return 'ab '.$pickup->getCity(); } - public function hasPickup($pickupId, Teamer $teamer): bool + public function hasPickup(?int $pickupId, Teamer $teamer): bool { - return $this->pickupResolver->hasPickup((int) $pickupId, $teamer); + return $this->pickupResolver->hasPickup($pickupId, $teamer); } public function fileIconFilter(Environment $environment, string $mimeType, ?string $classes = 'w-4 h-4'): string From 9e8b82086d66a133ab8604904edc0b641884b79c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 16 Dec 2024 09:45:31 +0100 Subject: [PATCH 18/33] fix: remove incomplete pickup selection on form submit --- src/Form/TeamerProfileType.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Form/TeamerProfileType.php b/src/Form/TeamerProfileType.php index 303ee09..707ca26 100644 --- a/src/Form/TeamerProfileType.php +++ b/src/Form/TeamerProfileType.php @@ -79,6 +79,7 @@ class TeamerProfileType extends AbstractType 'entry_type' => BpnPickupType::class, 'allow_add' => true, 'allow_delete' => true, + 'delete_empty' => true, ]) ->add('language', TextType::class, [ 'label' => 'Sprache(n)', From d39e05462173cd756f6f7b2be930768ec756fef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 16 Dec 2024 09:46:04 +0100 Subject: [PATCH 19/33] chore: update project dependencies --- composer.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/composer.lock b/composer.lock index 924cd99..8ee9a65 100644 --- a/composer.lock +++ b/composer.lock @@ -1970,16 +1970,16 @@ }, { "name": "liip/imagine-bundle", - "version": "2.13.2", + "version": "2.13.3", "source": { "type": "git", "url": "https://github.com/liip/LiipImagineBundle.git", - "reference": "98e0318ea0f7b9500343236e63cc29ded58a1d43" + "reference": "3faccde327f91368e51d05ecad49a9cd915abd81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/98e0318ea0f7b9500343236e63cc29ded58a1d43", - "reference": "98e0318ea0f7b9500343236e63cc29ded58a1d43", + "url": "https://api.github.com/repos/liip/LiipImagineBundle/zipball/3faccde327f91368e51d05ecad49a9cd915abd81", + "reference": "3faccde327f91368e51d05ecad49a9cd915abd81", "shasum": "" }, "require": { @@ -2070,9 +2070,9 @@ ], "support": { "issues": "https://github.com/liip/LiipImagineBundle/issues", - "source": "https://github.com/liip/LiipImagineBundle/tree/2.13.2" + "source": "https://github.com/liip/LiipImagineBundle/tree/2.13.3" }, - "time": "2024-09-04T12:55:26+00:00" + "time": "2024-12-12T09:38:23+00:00" }, { "name": "monolog/monolog", @@ -4980,16 +4980,16 @@ }, { "name": "symfony/http-client-contracts", - "version": "v3.5.1", + "version": "v3.5.2", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9" + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/c2f3ad828596624ca39ea40f83617ef51ca8bbf9", - "reference": "c2f3ad828596624ca39ea40f83617ef51ca8bbf9", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/ee8d807ab20fcb51267fdace50fbe3494c31e645", + "reference": "ee8d807ab20fcb51267fdace50fbe3494c31e645", "shasum": "" }, "require": { @@ -5038,7 +5038,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.1" + "source": "https://github.com/symfony/http-client-contracts/tree/v3.5.2" }, "funding": [ { @@ -5054,7 +5054,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T12:02:18+00:00" + "time": "2024-12-07T08:49:48+00:00" }, { "name": "symfony/http-foundation", @@ -9094,16 +9094,16 @@ }, { "name": "twig/twig", - "version": "v3.17.0", + "version": "v3.17.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "d3a64b742a5e74c57e3964d766e1032982145872" + "reference": "677ef8da6497a03048192aeeb5aa3018e379ac71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/d3a64b742a5e74c57e3964d766e1032982145872", - "reference": "d3a64b742a5e74c57e3964d766e1032982145872", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/677ef8da6497a03048192aeeb5aa3018e379ac71", + "reference": "677ef8da6497a03048192aeeb5aa3018e379ac71", "shasum": "" }, "require": { @@ -9158,7 +9158,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.17.0" + "source": "https://github.com/twigphp/Twig/tree/v3.17.1" }, "funding": [ { @@ -9170,7 +9170,7 @@ "type": "tidelift" } ], - "time": "2024-12-10T15:19:11+00:00" + "time": "2024-12-12T09:58:10+00:00" }, { "name": "ua-parser/uap-php", From 2ebcb3cc99dc857ec2c1bfb5b0cfb076792b9dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 16 Dec 2024 16:32:18 +0100 Subject: [PATCH 20/33] feat: reject potential other applications on contract confirmation --- .../RejectApplicationListener.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/EventListener/RejectApplicationListener.php diff --git a/src/EventListener/RejectApplicationListener.php b/src/EventListener/RejectApplicationListener.php new file mode 100644 index 0000000..6d44ea2 --- /dev/null +++ b/src/EventListener/RejectApplicationListener.php @@ -0,0 +1,57 @@ +getDocument(); + if (Upload::TYPE_CONTRACT !== $document->getType()) { + return; + } + + $disposition = $document->getDisposition(); + $teamer = $disposition->getTeamer(); + $otherApplications = $disposition + ->getAssignment() + ->getApplications() + ->filter(function (Application $application) use ($teamer) { + return $application->getTeamer() !== $teamer; + }) + ; + + foreach ($otherApplications as $application) { + $application + ->setStatus(Application::STATUS_REJECTED) + ->setComment('Abgelehnt, da Einsatz bereits anderweitig besetzt') + ; + } + + $this->entityManager->flush(); + + foreach ($otherApplications as $application) { + $statusDto = new ApplicationStatusDto($application); + $this->eventDispatcher->dispatch( + new ApplicationStatusEvent($statusDto), + ApplicationStatusEvent::NAME + ); + } + } +} From 185c8580c7b49e7ab09fcb389e4a7060a9b1902c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 17 Dec 2024 08:49:03 +0100 Subject: [PATCH 21/33] fix: avoid null pointer exception in template rendering --- templates/_partials/_assignment_requirements_info.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/_partials/_assignment_requirements_info.html.twig b/templates/_partials/_assignment_requirements_info.html.twig index cd17d5b..1223c9a 100644 --- a/templates/_partials/_assignment_requirements_info.html.twig +++ b/templates/_partials/_assignment_requirements_info.html.twig @@ -1,5 +1,5 @@
    - {% if assignment.pickup %} + {% if assignment.destination.pickup(assignment.pickup) %}
  • Busbegleitung ab {{ assignment.destination.pickup(assignment.pickup).city }} From 6278dbe42a5b596f211349cdf8cf4a10070d7b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 17 Dec 2024 11:48:47 +0100 Subject: [PATCH 22/33] fix: avoid another null pointer exception --- src/Entity/Destination.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Entity/Destination.php b/src/Entity/Destination.php index 7b5047e..e0cab10 100644 --- a/src/Entity/Destination.php +++ b/src/Entity/Destination.php @@ -175,8 +175,12 @@ class Destination implements TimestampableEntityInterface, SoftDeletableEntityIn return $this; } - public function getPickup(int $id): ?Pickup + public function getPickup(?int $id): ?Pickup { + if (null === $id) { + return null; + } + foreach ($this->getPickups() as $pickup) { if ($id === $pickup['busProId']) { return Pickup::fromArray($pickup); From f324ff21f85cac4694cf51213be2f70aaf693f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 17 Dec 2024 13:24:14 +0100 Subject: [PATCH 23/33] feat: raise maximum file size for uploads --- templates/_partials/_upload_collection_form.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/_partials/_upload_collection_form.html.twig b/templates/_partials/_upload_collection_form.html.twig index 68740d1..2166f9b 100644 --- a/templates/_partials/_upload_collection_form.html.twig +++ b/templates/_partials/_upload_collection_form.html.twig @@ -2,11 +2,11 @@ 'endpointUpload': endpoint_upload, 'endpointDelete': path('app_upload_delete'), 'maxFiles': max_files|default(10), - 'maxFilesize': max_filesize|default(1), + 'maxFilesize': max_filesize|default(5), 'acceptedFiles': accepted_files|default(null), 'params': upload_session_params|default(null), 'language': { - 'fileTooBig': 'uploader.file_too_big'|trans({ '%maxFilesize%': 1 }), + 'fileTooBig': 'uploader.file_too_big'|trans({ '%maxFilesize%': 5 }), 'invalidFileType': 'uploader.invalid_file_type'|trans, 'maxFilesExceeded': 'uploader.max_files_exceeded'|trans({ '%maxFiles%': 10 }) } From fb8a503e80664036c32451b8d0e20b0aee64d498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 18 Dec 2024 09:38:17 +0100 Subject: [PATCH 24/33] fix: avoid null pointer exception --- templates/_partials/_assignment_requirements_info.html.twig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/_partials/_assignment_requirements_info.html.twig b/templates/_partials/_assignment_requirements_info.html.twig index 1223c9a..2aa5c73 100644 --- a/templates/_partials/_assignment_requirements_info.html.twig +++ b/templates/_partials/_assignment_requirements_info.html.twig @@ -1,8 +1,9 @@
      - {% if assignment.destination.pickup(assignment.pickup) %} + {% set pickup = assignment.destination.pickup(assignment.pickup) %} + {% if pickup is not null %}
    • - Busbegleitung ab {{ assignment.destination.pickup(assignment.pickup).city }} + Busbegleitung ab {{ pickup.city }} {% if has_pickup(assignment.pickup, teamer) %} {{ icon('check', 'w-5 h-5 text-green-500 shrink-0') }} {% else %} From 68ffa216f849396ed5a300b31a3554e77329481e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 18 Dec 2024 09:59:07 +0100 Subject: [PATCH 25/33] feat: overdue feedbacks on admin dashboard --- src/Controller/Admin/IndexController.php | 2 ++ src/Repository/DispositionRepository.php | 13 +++++--- src/Service/Cron/FeedbackReminderService.php | 2 +- templates/admin/index.html.twig | 31 ++++++++++++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/src/Controller/Admin/IndexController.php b/src/Controller/Admin/IndexController.php index ad8fa7e..d010f6f 100644 --- a/src/Controller/Admin/IndexController.php +++ b/src/Controller/Admin/IndexController.php @@ -45,6 +45,7 @@ class IndexController extends AbstractController $dispositionRepository = $this->entityManager->getRepository(Disposition::class); $overdueContracts = $dispositionRepository->findOverdueContracts(); $newDispositions = $dispositionRepository->getNew(); + $overdueFeedbacks = $dispositionRepository->findDispositionsWithOverdueFeedback(7); return $this->render('admin/index.html.twig', [ 'applications' => $applications, @@ -59,6 +60,7 @@ class IndexController extends AbstractController 'pendingDocumentsCount' => $pendingDocumentsCount, 'overdueContracts' => $overdueContracts, 'newDispositions' => $newDispositions, + 'overdueFeedbacks' => $overdueFeedbacks, ]); } } \ No newline at end of file diff --git a/src/Repository/DispositionRepository.php b/src/Repository/DispositionRepository.php index 9893e40..98e0ee2 100644 --- a/src/Repository/DispositionRepository.php +++ b/src/Repository/DispositionRepository.php @@ -170,7 +170,7 @@ class DispositionRepository extends ServiceEntityRepository ; } - public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null): Query + public function getDispositionsWithPendingFeedbackQuery(?string $hotelCode = null, ?int $offsetDays = null): Query { $qb = $this->createQueryBuilder('disposition'); @@ -191,9 +191,14 @@ class DispositionRepository extends ServiceEntityRepository $qb->expr()->isNull('feedback') )) ->setParameter('status', [Assignment::STATUS_CALLED_OFF, Assignment::STATUS_DELETED]) - ->setParameter('dateTo', new \DateTimeImmutable()) ; + $dateTo = new \DateTimeImmutable(); + if (null !== $offsetDays) { + $dateTo = $dateTo->modify('-'.$offsetDays.' days'); + } + $qb->setParameter('dateTo', $dateTo); + if (null !== $hotelCode) { $qb ->andWhere($qb->expr()->like('destination.hotelCode', ':hotelCode')) @@ -204,10 +209,10 @@ class DispositionRepository extends ServiceEntityRepository return $qb->getQuery(); } - public function findDispositionsWithPendingFeedback(): array + public function findDispositionsWithOverdueFeedback(?int $offsetDays = null): array { return $this - ->getDispositionsWithPendingFeedbackQuery() + ->getDispositionsWithPendingFeedbackQuery(null, $offsetDays) ->getResult() ; } diff --git a/src/Service/Cron/FeedbackReminderService.php b/src/Service/Cron/FeedbackReminderService.php index 7953fe2..cfa815f 100644 --- a/src/Service/Cron/FeedbackReminderService.php +++ b/src/Service/Cron/FeedbackReminderService.php @@ -24,7 +24,7 @@ class FeedbackReminderService public function sendFeedbackReminders(): string { /** @var Disposition[] $dispositionsWithPendingFeedbacks */ - $dispositionsWithPendingFeedbacks = $this->dispositionRepository->findDispositionsWithPendingFeedback(); + $dispositionsWithPendingFeedbacks = $this->dispositionRepository->findDispositionsWithOverdueFeedback(); $sortedFeedbacks = []; diff --git a/templates/admin/index.html.twig b/templates/admin/index.html.twig index 388137e..b9469e8 100644 --- a/templates/admin/index.html.twig +++ b/templates/admin/index.html.twig @@ -171,6 +171,37 @@ {% endfor %}
    +

    Überfällige Honorarverträge From 9046a9940ba331d6eb974acab1f0618373b4c608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 18 Dec 2024 18:25:45 +0100 Subject: [PATCH 26/33] fix: ensure authenticated uploads --- config/packages/security.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 560c7a3..6ddcd34 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -32,6 +32,7 @@ security: token_provider: doctrine: true access_control: + - { path: '^/_uploader', roles: ROLE_USER, requires_channel: https } - { path: '^/', roles: PUBLIC_ACCESS, requires_channel: https } when@test: From bafc2c591f6fc633688975cce42852c5ade2101a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 18 Dec 2024 18:34:51 +0100 Subject: [PATCH 27/33] chore: refine session and cookie settings --- config/packages/framework.yaml | 3 ++- deploy.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 5a4cb0c..e56c29c 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -9,10 +9,11 @@ framework: # Remove or comment this section to explicitly disable session support. session: handler_id: session.handler.native_file - cookie_secure: auto + cookie_secure: true cookie_samesite: lax storage_factory_id: session.storage.factory.native save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' + name: epsession #esi: true #fragments: true diff --git a/deploy.php b/deploy.php index ba5509d..57a47a0 100644 --- a/deploy.php +++ b/deploy.php @@ -92,7 +92,7 @@ task('deploy', [ 'database:migrate', 'deploy:publish', 'cachetool:clear:opcache', - 'deploy:thumbnails', +// 'deploy:thumbnails', // 'deploy:stop-workers', ]); From e40da03e3add4c5a79a8d0a03567623ff9a4fad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 20 Dec 2024 17:32:42 +0100 Subject: [PATCH 28/33] fix: avoid null pointer exception --- src/Service/Teamer/PickupResolver.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Service/Teamer/PickupResolver.php b/src/Service/Teamer/PickupResolver.php index 2a3bf2f..9378d89 100644 --- a/src/Service/Teamer/PickupResolver.php +++ b/src/Service/Teamer/PickupResolver.php @@ -28,6 +28,9 @@ class PickupResolver }, $teamer->getPickups()); foreach ($teamerPickups as $teamerPickup) { + if (null === $teamerPickup) { + continue; + } $teamerPickupCity = trim($teamerPickup->getCity()); $pickupCity = trim($pickup->getCity()); if ($teamerPickupCity === $pickupCity) { From 89eb081bd6cef029ddc8235718fb7edb6315e317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 20 Dec 2024 17:33:05 +0100 Subject: [PATCH 29/33] fix: ensure url-sage filenames for downloads --- .../Teamer/Disposition/ContractPdfController.php | 13 ++++++++++--- .../Teamer/Disposition/InvoicePdfController.php | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Controller/Teamer/Disposition/ContractPdfController.php b/src/Controller/Teamer/Disposition/ContractPdfController.php index 3c3d8bb..2a42855 100644 --- a/src/Controller/Teamer/Disposition/ContractPdfController.php +++ b/src/Controller/Teamer/Disposition/ContractPdfController.php @@ -10,6 +10,7 @@ use Symfony\Component\HttpFoundation\HeaderUtils; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\String\Slugger\AsciiSlugger; class ContractPdfController extends AbstractController { @@ -26,12 +27,18 @@ class ContractPdfController extends AbstractController { $pdf = $this->renderer->render($disposition); - $teamer = $disposition->getTeamer(); + $slugger = new AsciiSlugger('de'); + + $teamer = $slugger->slug($disposition->getTeamer()); $assignment = $disposition->getAssignment(); - $destination = $assignment->getDestination(); + $destination = $slugger->slug($assignment->getDestination()); $filename = sprintf('Honorarvertrag_%s_%s.pdf', $teamer, $destination); - $disposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename, md5($filename)); + $disposition = HeaderUtils::makeDisposition( + HeaderUtils::DISPOSITION_ATTACHMENT, + $filename, + md5($filename) + ); $response = new Response($pdf->Output('S')); $response->setPrivate(); diff --git a/src/Controller/Teamer/Disposition/InvoicePdfController.php b/src/Controller/Teamer/Disposition/InvoicePdfController.php index ef6ff0f..d78d36f 100644 --- a/src/Controller/Teamer/Disposition/InvoicePdfController.php +++ b/src/Controller/Teamer/Disposition/InvoicePdfController.php @@ -10,6 +10,7 @@ use Symfony\Component\HttpFoundation\HeaderUtils; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Component\String\Slugger\AsciiSlugger; class InvoicePdfController extends AbstractController { @@ -26,12 +27,18 @@ class InvoicePdfController extends AbstractController { $pdf = $this->renderer->render($disposition); + $slugger = new AsciiSlugger('de'); + + $teamer = $slugger->slug($disposition->getTeamer()); $assignment = $disposition->getAssignment(); - $destination = $assignment->getDestination(); - $teamer = $disposition->getTeamer(); + $destination = $slugger->slug($assignment->getDestination()); $filename = sprintf('Honorarnote_%s_%s.pdf', $teamer, $disposition->getAssignment()->getDestination()); - $contentDisposition = HeaderUtils::makeDisposition(HeaderUtils::DISPOSITION_ATTACHMENT, $filename, md5($filename)); + $contentDisposition = HeaderUtils::makeDisposition( + HeaderUtils::DISPOSITION_ATTACHMENT, + $filename, + md5($filename) + ); $response = new Response($pdf->Output('S')); $response->setPrivate(); From f3e1de1ae24abcf2edcf9f2f06b2a8b8e02da94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Dec 2024 11:59:09 +0100 Subject: [PATCH 30/33] fix: improper use of variable --- .../Teamer/Disposition/ContractPdfController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Controller/Teamer/Disposition/ContractPdfController.php b/src/Controller/Teamer/Disposition/ContractPdfController.php index 2a42855..7fed60c 100644 --- a/src/Controller/Teamer/Disposition/ContractPdfController.php +++ b/src/Controller/Teamer/Disposition/ContractPdfController.php @@ -29,11 +29,12 @@ class ContractPdfController extends AbstractController $slugger = new AsciiSlugger('de'); - $teamer = $slugger->slug($disposition->getTeamer()); + $teamer = $disposition->getTeamer(); + $teamerPart = $slugger->slug($teamer); $assignment = $disposition->getAssignment(); $destination = $slugger->slug($assignment->getDestination()); - $filename = sprintf('Honorarvertrag_%s_%s.pdf', $teamer, $destination); + $filename = sprintf('Honorarvertrag_%s_%s.pdf', $teamerPart, $destination); $disposition = HeaderUtils::makeDisposition( HeaderUtils::DISPOSITION_ATTACHMENT, $filename, @@ -47,7 +48,7 @@ class ContractPdfController extends AbstractController $this->logger->info('Create teamer contract', [ 'teamer_id' => $teamer->getId(), - 'teamer_name' => (string) $teamer, + 'teamer_name' => (string) $teamerPart, 'assignment_id' => $assignment->getId(), 'destination' => (string) $destination, ]); From d2af503b77315f006b1f2d889f57e97859967dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Dec 2024 11:59:57 +0100 Subject: [PATCH 31/33] chore: update project dependencies --- composer.lock | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/composer.lock b/composer.lock index 8ee9a65..c396955 100644 --- a/composer.lock +++ b/composer.lock @@ -1287,16 +1287,16 @@ }, { "name": "doctrine/orm", - "version": "2.20.0", + "version": "2.20.1", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "8ed6c2234aba019f9737a6bcc9516438e62da27c" + "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/8ed6c2234aba019f9737a6bcc9516438e62da27c", - "reference": "8ed6c2234aba019f9737a6bcc9516438e62da27c", + "url": "https://api.github.com/repos/doctrine/orm/zipball/e3cabade99ebccc6ba078884c1c5f250866a494e", + "reference": "e3cabade99ebccc6ba078884c1c5f250866a494e", "shasum": "" }, "require": { @@ -1326,15 +1326,14 @@ "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", "phpstan/extension-installer": "~1.1.0 || ^1.4", - "phpstan/phpstan": "~1.4.10 || 1.12.6", - "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan": "~1.4.10 || 2.0.3", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0", - "vimeo/psalm": "4.30.0 || 5.24.0" + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "ext-dom": "Provides support for XSD validation for XML mapping files", @@ -1384,9 +1383,9 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.20.0" + "source": "https://github.com/doctrine/orm/tree/2.20.1" }, - "time": "2024-10-11T11:47:24+00:00" + "time": "2024-12-19T06:48:36+00:00" }, { "name": "doctrine/persistence", @@ -1758,16 +1757,16 @@ }, { "name": "knplabs/knp-menu", - "version": "v3.5.0", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/KnpLabs/KnpMenu.git", - "reference": "c39403f7c427d1b72cc56f38df0a075b4b9191fe" + "reference": "ac96b711cf7b4178747b0ecde79d7e5e05dbcd28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/c39403f7c427d1b72cc56f38df0a075b4b9191fe", - "reference": "c39403f7c427d1b72cc56f38df0a075b4b9191fe", + "url": "https://api.github.com/repos/KnpLabs/KnpMenu/zipball/ac96b711cf7b4178747b0ecde79d7e5e05dbcd28", + "reference": "ac96b711cf7b4178747b0ecde79d7e5e05dbcd28", "shasum": "" }, "require": { @@ -1825,9 +1824,9 @@ ], "support": { "issues": "https://github.com/KnpLabs/KnpMenu/issues", - "source": "https://github.com/KnpLabs/KnpMenu/tree/v3.5.0" + "source": "https://github.com/KnpLabs/KnpMenu/tree/v3.6.0" }, - "time": "2024-03-23T15:35:09+00:00" + "time": "2024-12-20T10:10:51+00:00" }, { "name": "knplabs/knp-menu-bundle", @@ -2295,10 +2294,6 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev" - }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -2308,6 +2303,10 @@ "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" } }, "autoload": { @@ -6060,8 +6059,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -9642,9 +9641,9 @@ "type": "library", "extra": { "hooks": { - "pre-commit": "composer fix-cs", "pre-push": "composer check-cs", - "post-merge": "composer install" + "post-merge": "composer install", + "pre-commit": "composer fix-cs" } }, "autoload": { From 0d377ae7cff122cf36b384ee9e1d65dd4ef8556a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Dec 2024 12:05:20 +0100 Subject: [PATCH 32/33] fix: maintain original log format --- src/Controller/Teamer/Disposition/ContractPdfController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/Teamer/Disposition/ContractPdfController.php b/src/Controller/Teamer/Disposition/ContractPdfController.php index 7fed60c..b4cbc83 100644 --- a/src/Controller/Teamer/Disposition/ContractPdfController.php +++ b/src/Controller/Teamer/Disposition/ContractPdfController.php @@ -48,7 +48,7 @@ class ContractPdfController extends AbstractController $this->logger->info('Create teamer contract', [ 'teamer_id' => $teamer->getId(), - 'teamer_name' => (string) $teamerPart, + 'teamer_name' => (string) $teamer, 'assignment_id' => $assignment->getId(), 'destination' => (string) $destination, ]); From c340ebd8b4e6a605e454da48196df7976130a89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 23 Dec 2024 16:36:42 +0100 Subject: [PATCH 33/33] fix: maintain original variable --- src/Controller/Teamer/Disposition/InvoicePdfController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Controller/Teamer/Disposition/InvoicePdfController.php b/src/Controller/Teamer/Disposition/InvoicePdfController.php index d78d36f..b66dbab 100644 --- a/src/Controller/Teamer/Disposition/InvoicePdfController.php +++ b/src/Controller/Teamer/Disposition/InvoicePdfController.php @@ -29,11 +29,12 @@ class InvoicePdfController extends AbstractController $slugger = new AsciiSlugger('de'); - $teamer = $slugger->slug($disposition->getTeamer()); + $teamer = $disposition->getTeamer(); + $teamerPart = $slugger->slug($teamer); $assignment = $disposition->getAssignment(); $destination = $slugger->slug($assignment->getDestination()); - $filename = sprintf('Honorarnote_%s_%s.pdf', $teamer, $disposition->getAssignment()->getDestination()); + $filename = sprintf('Honorarnote_%s_%s.pdf', $teamerPart, $disposition->getAssignment()->getDestination()); $contentDisposition = HeaderUtils::makeDisposition( HeaderUtils::DISPOSITION_ATTACHMENT, $filename,