From 9573f44001caf50ec977b60b48dbe55606204a06 Mon Sep 17 00:00:00 2001 From: Tchama Date: Thu, 23 Jul 2020 15:21:14 +0200 Subject: [PATCH 01/17] fix sf4 deprecated: remove sensio_framework messages --- Controller/SingleTaskController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/SingleTaskController.php b/Controller/SingleTaskController.php index fd5e26e33..556dc9ffe 100644 --- a/Controller/SingleTaskController.php +++ b/Controller/SingleTaskController.php @@ -4,7 +4,7 @@ namespace Chill\TaskBundle\Controller; use Chill\PersonBundle\Privacy\PrivacyEvent; use Symfony\Bundle\FrameworkBundle\Controller\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Symfony\Component\Routing\Annotation\Route; use Doctrine\ORM\EntityManager; use Chill\PersonBundle\Entity\Person; use Symfony\Component\HttpFoundation\Request; From 415ad5dd211f9e5bcef27618f0d9a800205ca405 Mon Sep 17 00:00:00 2001 From: Tchama Date: Mon, 27 Jul 2020 13:50:23 +0200 Subject: [PATCH 02/17] sf4 deprecated: timeline builder was private service --- Resources/config/services/timeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/config/services/timeline.yml b/Resources/config/services/timeline.yml index b00dd4ca7..d6ca33606 100644 --- a/Resources/config/services/timeline.yml +++ b/Resources/config/services/timeline.yml @@ -5,6 +5,7 @@ services: $registry: '@Symfony\Component\Workflow\Registry' $authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper' $tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface' + public: true tags: - { name: 'chill.timeline', context: 'person' } From 1c7dd27fca3890619b168c09ab8f0e9e30ac39df Mon Sep 17 00:00:00 2001 From: Tchama Date: Mon, 27 Jul 2020 16:16:17 +0200 Subject: [PATCH 03/17] fix sf4 minor corrections on Doctrine ORM mapping Entities --- Entity/SingleTask.php | 2 +- Entity/Task/SingleTaskPlaceEvent.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Entity/SingleTask.php b/Entity/SingleTask.php index 03c904497..23bdd61df 100644 --- a/Entity/SingleTask.php +++ b/Entity/SingleTask.php @@ -10,7 +10,7 @@ use Doctrine\Common\Collections\Collection; * SingleTask * * @ORM\Table( - * "chill_task.single_task", + * name="chill_task.single_task", * indexes={ * @ORM\Index( * name="by_type", diff --git a/Entity/Task/SingleTaskPlaceEvent.php b/Entity/Task/SingleTaskPlaceEvent.php index 75dfd82d6..fe8d2583e 100644 --- a/Entity/Task/SingleTaskPlaceEvent.php +++ b/Entity/Task/SingleTaskPlaceEvent.php @@ -24,7 +24,7 @@ use Chill\TaskBundle\Entity\SingleTask; * * * @ORM\Table( - * "chill_task.single_task_place_event", + * name="chill_task.single_task_place_event", * indexes={ * @ORM\Index( * name="transition_task_date", From ba7abaebf5d23960bacec0c1c6a9f0f68be09bc7 Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 28 Jul 2020 12:29:48 +0200 Subject: [PATCH 04/17] sf4, change deprecated workflow declaration --- Workflow/TaskWorkflowManager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Workflow/TaskWorkflowManager.php b/Workflow/TaskWorkflowManager.php index cf34f4c66..13be91bd3 100644 --- a/Workflow/TaskWorkflowManager.php +++ b/Workflow/TaskWorkflowManager.php @@ -18,8 +18,8 @@ namespace Chill\TaskBundle\Workflow; use Chill\TaskBundle\Entity\AbstractTask; -use Symfony\Component\Workflow\SupportStrategy\SupportStrategyInterface; -use Symfony\Component\Workflow\Workflow; +use Symfony\Component\Workflow\SupportStrategy\WorkflowSupportStrategyInterface; +use Symfony\Component\Workflow\WorkflowInterface; use Symfony\Component\Workflow\Event\Event; /** @@ -27,7 +27,7 @@ use Symfony\Component\Workflow\Event\Event; * * @author Julien Fastré */ -class TaskWorkflowManager implements SupportStrategyInterface +class TaskWorkflowManager implements WorkflowSupportStrategyInterface { /** * @@ -66,7 +66,7 @@ class TaskWorkflowManager implements SupportStrategyInterface return $definitions[0]; } - public function supports(Workflow $workflow, $subject): bool + public function supports(WorkflowInterface $workflow, $subject): bool { if (!$subject instanceof AbstractTask) { return false; From 1fa01474d8b9e9da1b9e1c822f0e6c39c3bcab34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 28 Jul 2020 13:11:23 +0200 Subject: [PATCH 05/17] make timeline & paginator service private --- Controller/SingleTaskController.php | 16 +++++++++++++--- Resources/config/services/controller.yml | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Controller/SingleTaskController.php b/Controller/SingleTaskController.php index 556dc9ffe..573517cc8 100644 --- a/Controller/SingleTaskController.php +++ b/Controller/SingleTaskController.php @@ -27,6 +27,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Translation\TranslatorInterface; use Chill\TaskBundle\Event\UI\UIEvent; use Chill\MainBundle\Repository\CenterRepository; +use Chill\MainBundle\Timeline\TimelineBuilder; class SingleTaskController extends Controller @@ -37,14 +38,23 @@ class SingleTaskController extends Controller */ protected $eventDispatcher; + /** + * + * @var TimelineBuilder + */ + protected $timelineBuilder; + /** * SingleTaskController constructor. * * @param EventDispatcherInterface $eventDispatcher */ - public function __construct(EventDispatcherInterface $eventDispatcher) - { + public function __construct( + EventDispatcherInterface $eventDispatcher, + TimelineBuilder $timelineBuilder + ) { $this->eventDispatcher = $eventDispatcher; + $this->timelineBuilder = $timelineBuilder; } @@ -151,7 +161,7 @@ class SingleTaskController extends Controller throw $this->createNotFoundException('Unable to find Task entity.'); } - $timeline = $this->get('chill.main.timeline_builder') + $timeline = $this->timelineBuilder ->getTimelineHTML('task', array('task' => $task)); $event = new PrivacyEvent($person, array( diff --git a/Resources/config/services/controller.yml b/Resources/config/services/controller.yml index bfeffa0d5..130db2175 100644 --- a/Resources/config/services/controller.yml +++ b/Resources/config/services/controller.yml @@ -6,4 +6,5 @@ services: Chill\TaskBundle\Controller\SingleTaskController: arguments: $eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface' + $timelineBuilder: '@chill_main.timeline_builder' tags: ['controller.service_arguments'] From 09bd534256cb211d1362d05403a059991ac2367c Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 28 Jul 2020 16:44:36 +0200 Subject: [PATCH 06/17] upgrade to symfony4, reset all requires into modules --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 41540a946..ecd4a91e9 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,9 @@ "classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ] }, "require": { - "chill-project/person": "~1.5" + }, "require-dev": { - "fzaninotto/faker": "^1.7", - "phpunit/phpunit": "^7.1" }, "license": "AGPL-3.0-or-later", "authors": [ From 2d92bc939b88578f74380c23d6a1c4e81ebc25fd Mon Sep 17 00:00:00 2001 From: Tchama Date: Thu, 30 Jul 2020 13:53:15 +0200 Subject: [PATCH 07/17] sf4 resolve errors and depreciations --- Templating/TaskTwigExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templating/TaskTwigExtension.php b/Templating/TaskTwigExtension.php index fd799dd34..e79cdcda2 100644 --- a/Templating/TaskTwigExtension.php +++ b/Templating/TaskTwigExtension.php @@ -27,7 +27,7 @@ use Chill\TaskBundle\Workflow\TaskWorkflowManager; * * @author Julien Fastré */ -class TaskTwigExtension extends \Twig_Extension +class TaskTwigExtension extends AbstractExtension { /** * From 14da65dcdbbfc89e79d60aee8a98966b0130df88 Mon Sep 17 00:00:00 2001 From: Tchama Date: Thu, 30 Jul 2020 14:25:28 +0200 Subject: [PATCH 08/17] rename syntax for ChillMain twig template calls --- Controller/SingleTaskController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/SingleTaskController.php b/Controller/SingleTaskController.php index 573517cc8..612acd638 100644 --- a/Controller/SingleTaskController.php +++ b/Controller/SingleTaskController.php @@ -537,7 +537,7 @@ class SingleTaskController extends Controller if ($viewParams['person'] !== null){ $viewParams['layout'] = 'ChillPersonBundle::layout.html.twig'; } else { - $viewParams['layout'] = 'ChillMainBundle::layout.html.twig'; + $viewParams['layout'] = '@ChillMain/layout.html.twig'; } // Form for filtering tasks From 70efafc0f5845fdf1e3a24de8de6078f4db43a14 Mon Sep 17 00:00:00 2001 From: Tchama Date: Thu, 30 Jul 2020 17:34:45 +0200 Subject: [PATCH 09/17] sf4, repair errors and make basic and admin chill pages works --- Resources/views/SingleTask/confirm_delete.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/views/SingleTask/confirm_delete.html.twig b/Resources/views/SingleTask/confirm_delete.html.twig index 5e4fa4a0f..a25f7b42d 100644 --- a/Resources/views/SingleTask/confirm_delete.html.twig +++ b/Resources/views/SingleTask/confirm_delete.html.twig @@ -7,7 +7,7 @@ {% block personcontent %} -{{ include('ChillMainBundle:Util:confirmation_template.html.twig', +{{ include('@ChillMain/Util/confirmation_template.html.twig', { 'title' : 'Remove task'|trans, 'confirm_question' : 'Are you sure you want to remove the task about "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ), From 98a3b38995d064b576645a2ae01dba8c2712c485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 31 Jul 2020 15:52:06 +0200 Subject: [PATCH 10/17] adapt migrations files to flex --- .../migrations => migrations}/Version20180413135614.php | 6 +++--- .../migrations => migrations}/Version20180413201023.php | 6 +++--- .../migrations => migrations}/Version20180426093011.php | 6 +++--- .../migrations => migrations}/Version20180502194119.php | 6 +++--- .../migrations => migrations}/Version20181113161925.php | 4 ++-- .../migrations => migrations}/Version20181113164108.php | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) rename {Resources/migrations => migrations}/Version20180413135614.php (94%) rename {Resources/migrations => migrations}/Version20180413201023.php (95%) rename {Resources/migrations => migrations}/Version20180426093011.php (87%) rename {Resources/migrations => migrations}/Version20180502194119.php (93%) rename {Resources/migrations => migrations}/Version20181113161925.php (91%) rename {Resources/migrations => migrations}/Version20181113164108.php (90%) diff --git a/Resources/migrations/Version20180413135614.php b/migrations/Version20180413135614.php similarity index 94% rename from Resources/migrations/Version20180413135614.php rename to migrations/Version20180413135614.php index 873f9b678..304ecab7e 100644 --- a/Resources/migrations/Version20180413135614.php +++ b/migrations/Version20180413135614.php @@ -2,7 +2,7 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** @@ -13,7 +13,7 @@ class Version20180413135614 extends AbstractMigration /** * @param Schema $schema */ - public function up(Schema $schema) + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -33,7 +33,7 @@ class Version20180413135614 extends AbstractMigration /** * @param Schema $schema */ - public function down(Schema $schema) + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/Resources/migrations/Version20180413201023.php b/migrations/Version20180413201023.php similarity index 95% rename from Resources/migrations/Version20180413201023.php rename to migrations/Version20180413201023.php index f068fe0e2..88890edaf 100644 --- a/Resources/migrations/Version20180413201023.php +++ b/migrations/Version20180413201023.php @@ -2,7 +2,7 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** @@ -13,7 +13,7 @@ class Version20180413201023 extends AbstractMigration /** * @param Schema $schema */ - public function up(Schema $schema) + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -36,7 +36,7 @@ class Version20180413201023 extends AbstractMigration /** * @param Schema $schema */ - public function down(Schema $schema) + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/Resources/migrations/Version20180426093011.php b/migrations/Version20180426093011.php similarity index 87% rename from Resources/migrations/Version20180426093011.php rename to migrations/Version20180426093011.php index 286d4e3d1..58065f182 100644 --- a/Resources/migrations/Version20180426093011.php +++ b/migrations/Version20180426093011.php @@ -2,7 +2,7 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** @@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema; */ class Version20180426093011 extends AbstractMigration { - public function up(Schema $schema) + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -18,7 +18,7 @@ class Version20180426093011 extends AbstractMigration $this->addSql('ALTER TABLE chill_task.recurring_task ADD closed BOOLEAN DEFAULT \'false\' NOT NULL'); } - public function down(Schema $schema) + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/Resources/migrations/Version20180502194119.php b/migrations/Version20180502194119.php similarity index 93% rename from Resources/migrations/Version20180502194119.php rename to migrations/Version20180502194119.php index a07ad1089..fbfe0f685 100644 --- a/Resources/migrations/Version20180502194119.php +++ b/migrations/Version20180502194119.php @@ -2,7 +2,7 @@ namespace Application\Migrations; -use Doctrine\DBAL\Migrations\AbstractMigration; +use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; /** @@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema; */ class Version20180502194119 extends AbstractMigration { - public function up(Schema $schema) + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -23,7 +23,7 @@ class Version20180502194119 extends AbstractMigration $this->addSql('ALTER TABLE chill_task.single_task_place_event ADD CONSTRAINT FK_D459EBEE8DB60186 FOREIGN KEY (task_id) REFERENCES chill_task.single_task (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } - public function down(Schema $schema) + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/Resources/migrations/Version20181113161925.php b/migrations/Version20181113161925.php similarity index 91% rename from Resources/migrations/Version20181113161925.php rename to migrations/Version20181113161925.php index 7b3ae95f4..c5cdb015b 100644 --- a/Resources/migrations/Version20181113161925.php +++ b/migrations/Version20181113161925.php @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181113161925 extends AbstractMigration { - public function up(Schema $schema) : void + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -18,7 +18,7 @@ final class Version20181113161925 extends AbstractMigration $this->addSql('CREATE INDEX transition_task ON chill_task.single_task_place_event (task_id, transition)'); } - public function down(Schema $schema) : void + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/Resources/migrations/Version20181113164108.php b/migrations/Version20181113164108.php similarity index 90% rename from Resources/migrations/Version20181113164108.php rename to migrations/Version20181113164108.php index 48e22c597..0945ca638 100644 --- a/Resources/migrations/Version20181113164108.php +++ b/migrations/Version20181113164108.php @@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181113164108 extends AbstractMigration { - public function up(Schema $schema) : void + public function up(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); @@ -18,7 +18,7 @@ final class Version20181113164108 extends AbstractMigration $this->addSql('CREATE INDEX by_current_state ON chill_task.single_task USING GIN (current_states)'); } - public function down(Schema $schema) : void + public function down(Schema $schema): void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); From f7b5e37079f9dc6056543884d97273bf2a4fadf5 Mon Sep 17 00:00:00 2001 From: Tchama Date: Mon, 3 Aug 2020 11:10:39 +0200 Subject: [PATCH 11/17] install twig intl-extra, replace localizeddate filter by format_date --- Resources/views/SingleTask/_list.html.twig | 6 +++--- Resources/views/SingleTask/show.html.twig | 6 +++--- .../single_task_transition_person_context.html.twig | 4 ++-- .../Timeline/single_task_transition_task_context.html.twig | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Resources/views/SingleTask/_list.html.twig b/Resources/views/SingleTask/_list.html.twig index 9f124d866..e45f2c26f 100644 --- a/Resources/views/SingleTask/_list.html.twig +++ b/Resources/views/SingleTask/_list.html.twig @@ -40,17 +40,17 @@
    {% if task.startDate is not null %}
  • - {{ task.startDate|localizeddate('medium', 'none') }} + {{ task.startDate|format_date('medium', 'none') }}
  • {% endif %} {% if task.warningDate is not null %}
  • - {{ task.warningDate|localizeddate('medium', 'none') }} + {{ task.warningDate|format_date('medium', 'none') }}
  • {% endif %} {% if task.endDate is not null %}
  • - {{ task.endDate|localizeddate('medium', 'none') }} + {{ task.endDate|format_date('medium', 'none') }}
  • {% endif %}
diff --git a/Resources/views/SingleTask/show.html.twig b/Resources/views/SingleTask/show.html.twig index f19825cdd..808179fc5 100644 --- a/Resources/views/SingleTask/show.html.twig +++ b/Resources/views/SingleTask/show.html.twig @@ -62,17 +62,17 @@ {% else %} {% if task.startDate is not null %}
{{ 'Start'|trans }}
-
{{ task.startDate|localizeddate('long', 'none') }}
+
{{ task.startDate|format_date('long', 'none') }}
{% endif %} {% if task.endDate is not null %}
{{ 'End'|trans }}
-
{{ task.endDate|localizeddate('long', 'none') }}
+
{{ task.endDate|format_date('long', 'none') }}
{% endif %} {% if task.warningDate is not null %}
{{ 'Warning'|trans }}
-
{{ task.warningDate|localizeddate('long', 'none') }}
+
{{ task.warningDate|format_date('long', 'none') }}
{% endif %} {% endif %} diff --git a/Resources/views/Timeline/single_task_transition_person_context.html.twig b/Resources/views/Timeline/single_task_transition_person_context.html.twig index 4bd7f6176..3b1b3cde1 100644 --- a/Resources/views/Timeline/single_task_transition_person_context.html.twig +++ b/Resources/views/Timeline/single_task_transition_person_context.html.twig @@ -1,6 +1,6 @@

- {{ event.datetime|localizeddate('long', 'none') }} + {{ event.datetime|format_date('long', 'none') }} / {{ 'Task'|trans }} / {% if transition is not null %} {{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }} @@ -25,7 +25,7 @@ {% if event.task.endDate is not empty %}
{{ 'Task end date'|trans }}
-
{{ event.task.endDate|localizeddate('medium', 'none') }}
+
{{ event.task.endDate|format_date('medium', 'none') }}
{% endif %}

diff --git a/Resources/views/Timeline/single_task_transition_task_context.html.twig b/Resources/views/Timeline/single_task_transition_task_context.html.twig index 010023a29..4f6b081bc 100644 --- a/Resources/views/Timeline/single_task_transition_task_context.html.twig +++ b/Resources/views/Timeline/single_task_transition_task_context.html.twig @@ -1,6 +1,6 @@

- {{ event.datetime|localizeddate('long', 'short') }} + {{ event.datetime|format_date('long', 'short') }} {% if transition is not null %} {{ task_workflow_metadata(event.task, 'transition.sentence', transition)|trans({ '%user%': event.author.username }) }} From 5292f319becb73231ea8bf7addf349462c738691 Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 4 Aug 2020 10:04:25 +0200 Subject: [PATCH 12/17] sf4, adding workflow and fix errors for task bundle --- Controller/SingleTaskController.php | 12 +++++++++--- DependencyInjection/Configuration.php | 4 ++-- Resources/translations/messages.fr.yml | 9 ++++----- Resources/views/SingleTask/index.html.twig | 4 +++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Controller/SingleTaskController.php b/Controller/SingleTaskController.php index 612acd638..59e414907 100644 --- a/Controller/SingleTaskController.php +++ b/Controller/SingleTaskController.php @@ -75,7 +75,9 @@ class SingleTaskController extends Controller ; if ($request->query->has('person_id')) { - $personId = $request->query->getInt('person_id', null); + + $personId = $request->query->getInt('person_id', 0); // sf4 check: + // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` if ($personId === null) { return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST); @@ -454,7 +456,9 @@ class SingleTaskController extends Controller if ($request->query->get('user_id') === '_unassigned') { $params['unassigned'] = true; } else { - $userId = $request->query->getInt('user_id', null); + $userId = $request->query->getInt('user_id', 0); // sf4 check: + // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` + $user = $this->getDoctrine()->getManager() ->getRepository('ChillMainBundle:User') ->find($userId); @@ -470,7 +474,9 @@ class SingleTaskController extends Controller if (!empty($request->query->get('scope_id'))) { - $scopeId = $request->query->getInt('scope_id', null); + $scopeId = $request->query->getInt('scope_id', 0); // sf4 check: + // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` + $scope = $this->getDoctrine()->getManager() ->getRepository('ChillMainBundle:Scope') ->find($scopeId); diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index e0989cd69..21d50c7f5 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -17,8 +17,8 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('chill_task'); + $treeBuilder = new TreeBuilder('chill_task'); + $rootNode = $treeBuilder->getRootNode('chill_task'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index 80d3065b1..49a4c2e09 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -15,7 +15,6 @@ Scope: Cercle Task: Tâche Details: Détails Person: Personne -Scope: Cercle Date: Date Dates: Dates User: Utilisateur @@ -74,10 +73,10 @@ cancel: annuler Start_verb: Démarrer Close_verb: Clotûrer Set this task to cancel state: Marquer cette tâche comme annulée -'%user% has closed the task': %user% a fermé la tâche -'%user% has canceled the task': %user% a annulé la tâche -'%user% has started the task': %user% a commencé la tâche -'%user% has created the task': %user% a introduit la tâche +'%user% has closed the task': '%user% a fermé la tâche' +'%user% has canceled the task': '%user% a annulé la tâche' +'%user% has started the task': '%user% a commencé la tâche' +'%user% has created the task': '%user% a introduit la tâche' Are you sure you want to close this task ?: Êtes-vous sûrs de vouloir clotûrer cette tâche ? Are you sure you want to cancel this task ?: Êtes-vous sûrs de vouloir annuler cette tâche ? Are you sure you want to start this task ?: Êtes-vous sûrs de vouloir démarrer cette tâche ? diff --git a/Resources/views/SingleTask/index.html.twig b/Resources/views/SingleTask/index.html.twig index f6509015f..f7bf4dfce 100644 --- a/Resources/views/SingleTask/index.html.twig +++ b/Resources/views/SingleTask/index.html.twig @@ -31,7 +31,8 @@ {# filter tasks #} - +{% block filtertasks %}{# + sf4 check: prevent error message: `A block definition cannot be nested under non-capturing nodes.` #} {% if person is not null %} {% block personcontent %} {% include 'ChillTaskBundle:SingleTask:_list.html.twig' %} @@ -43,3 +44,4 @@

{% endblock %} {% endif %} +{% endblock %} From 2a5ee00b863135e7f04789320c504c3ea94bddb1 Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 4 Aug 2020 10:19:50 +0200 Subject: [PATCH 13/17] setting new path for all config yaml files + adding expression-language component --- DependencyInjection/ChillTaskExtension.php | 24 +++++++++---------- .../config/routing.yml => config/routes.yaml | 0 .../services.yml => config/services.yaml | 0 .../services/controller.yaml | 2 +- .../event.yml => config/services/event.yaml | 0 .../services/fixtures.yaml | 2 +- .../form.yml => config/services/form.yaml | 0 .../menu.yml => config/services/menu.yaml | 0 .../services/repositories.yaml | 0 .../services/security.yaml | 0 .../services/templating.yaml | 0 .../services/timeline.yaml | 0 .../services/workflow.yaml | 0 13 files changed, 14 insertions(+), 14 deletions(-) rename Resources/config/routing.yml => config/routes.yaml (100%) rename Resources/config/services.yml => config/services.yaml (100%) rename Resources/config/services/controller.yml => config/services/controller.yaml (90%) rename Resources/config/services/event.yml => config/services/event.yaml (100%) rename Resources/config/services/fixtures.yml => config/services/fixtures.yaml (67%) rename Resources/config/services/form.yml => config/services/form.yaml (100%) rename Resources/config/services/menu.yml => config/services/menu.yaml (100%) rename Resources/config/services/repositories.yml => config/services/repositories.yaml (100%) rename Resources/config/services/security.yml => config/services/security.yaml (100%) rename Resources/config/services/templating.yml => config/services/templating.yaml (100%) rename Resources/config/services/timeline.yml => config/services/timeline.yaml (100%) rename Resources/config/services/workflow.yml => config/services/workflow.yaml (100%) diff --git a/DependencyInjection/ChillTaskExtension.php b/DependencyInjection/ChillTaskExtension.php index 3eda043a5..5ffbd38e7 100644 --- a/DependencyInjection/ChillTaskExtension.php +++ b/DependencyInjection/ChillTaskExtension.php @@ -25,17 +25,17 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services/controller.yml'); - $loader->load('services/security.yml'); - $loader->load('services/repositories.yml'); - $loader->load('services/workflow.yml'); - $loader->load('services/templating.yml'); - $loader->load('services/menu.yml'); - $loader->load('services/event.yml'); - $loader->load('services/timeline.yml'); - $loader->load('services/fixtures.yml'); - $loader->load('services/form.yml'); + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config')); + $loader->load('services/controller.yaml'); + $loader->load('services/security.yaml'); + $loader->load('services/repositories.yaml'); + $loader->load('services/workflow.yaml'); + $loader->load('services/templating.yaml'); + $loader->load('services/menu.yaml'); + $loader->load('services/event.yaml'); + $loader->load('services/timeline.yaml'); + $loader->load('services/fixtures.yaml'); + $loader->load('services/form.yaml'); } public function prepend(ContainerBuilder $container) @@ -51,7 +51,7 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface $container->prependExtensionConfig('chill_main', array( 'routing' => array( 'resources' => array( - '@ChillTaskBundle/Resources/config/routing.yml' + '@ChillTaskBundle/config/routes.yaml' ) ) )); diff --git a/Resources/config/routing.yml b/config/routes.yaml similarity index 100% rename from Resources/config/routing.yml rename to config/routes.yaml diff --git a/Resources/config/services.yml b/config/services.yaml similarity index 100% rename from Resources/config/services.yml rename to config/services.yaml diff --git a/Resources/config/services/controller.yml b/config/services/controller.yaml similarity index 90% rename from Resources/config/services/controller.yml rename to config/services/controller.yaml index 130db2175..461f65f01 100644 --- a/Resources/config/services/controller.yml +++ b/config/services/controller.yaml @@ -1,6 +1,6 @@ services: Chill\TaskBundle\Controller\: - resource: '../../../Controller' + resource: '../../Controller' tags: ['controller.service_arguments'] Chill\TaskBundle\Controller\SingleTaskController: diff --git a/Resources/config/services/event.yml b/config/services/event.yaml similarity index 100% rename from Resources/config/services/event.yml rename to config/services/event.yaml diff --git a/Resources/config/services/fixtures.yml b/config/services/fixtures.yaml similarity index 67% rename from Resources/config/services/fixtures.yml rename to config/services/fixtures.yaml index 38f9fa785..6523f4376 100644 --- a/Resources/config/services/fixtures.yml +++ b/config/services/fixtures.yaml @@ -1,4 +1,4 @@ services: Chill\TaskBundle\DataFixtures\ORM\: - resource: ../../../DataFixtures/ORM + resource: ../../DataFixtures/ORM tags: [ 'doctrine.fixture.orm' ] diff --git a/Resources/config/services/form.yml b/config/services/form.yaml similarity index 100% rename from Resources/config/services/form.yml rename to config/services/form.yaml diff --git a/Resources/config/services/menu.yml b/config/services/menu.yaml similarity index 100% rename from Resources/config/services/menu.yml rename to config/services/menu.yaml diff --git a/Resources/config/services/repositories.yml b/config/services/repositories.yaml similarity index 100% rename from Resources/config/services/repositories.yml rename to config/services/repositories.yaml diff --git a/Resources/config/services/security.yml b/config/services/security.yaml similarity index 100% rename from Resources/config/services/security.yml rename to config/services/security.yaml diff --git a/Resources/config/services/templating.yml b/config/services/templating.yaml similarity index 100% rename from Resources/config/services/templating.yml rename to config/services/templating.yaml diff --git a/Resources/config/services/timeline.yml b/config/services/timeline.yaml similarity index 100% rename from Resources/config/services/timeline.yml rename to config/services/timeline.yaml diff --git a/Resources/config/services/workflow.yml b/config/services/workflow.yaml similarity index 100% rename from Resources/config/services/workflow.yml rename to config/services/workflow.yaml From 4d2f84a9bd8a00274f6521bb40e710751c39c60e Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 4 Aug 2020 10:48:20 +0200 Subject: [PATCH 14/17] fix error in timeline with workflow in task --- Timeline/TaskLifeCycleEventTimelineProvider.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Timeline/TaskLifeCycleEventTimelineProvider.php b/Timeline/TaskLifeCycleEventTimelineProvider.php index ce2f99669..db099a3e1 100644 --- a/Timeline/TaskLifeCycleEventTimelineProvider.php +++ b/Timeline/TaskLifeCycleEventTimelineProvider.php @@ -136,7 +136,14 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface public function getEntityTemplate($entity, $context, array $args) { - $workflow = $this->registry->get($entity->getTask(), $entity->getData['workflow']); + $workflow = $this->registry->get($entity->getTask(), + (isset($entity->getData()['workflow'])) ? $entity->getData()['workflow'] : null + ); + // sf4 check: prevent error message: + // `Notice: Undefined property: Chill\TaskBundle\Entity\Task\SingleTaskPlaceEvent::$getData` + // * fix syntax error on $entity->getData['workflow'] + // * return null if not set + $transition = $this->getTransitionByName($entity->getTransition(), $workflow); return [ From c98c12051ad20c321dd6955b2f9f4196b9db14eb Mon Sep 17 00:00:00 2001 From: Tchama Date: Tue, 4 Aug 2020 16:28:07 +0200 Subject: [PATCH 15/17] move files from Resources/translations/ to translations/ --- {Resources/translations => translations}/messages.fr.yml | 0 {Resources/translations => translations}/validators.fr.yml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {Resources/translations => translations}/messages.fr.yml (100%) rename {Resources/translations => translations}/validators.fr.yml (100%) diff --git a/Resources/translations/messages.fr.yml b/translations/messages.fr.yml similarity index 100% rename from Resources/translations/messages.fr.yml rename to translations/messages.fr.yml diff --git a/Resources/translations/validators.fr.yml b/translations/validators.fr.yml similarity index 100% rename from Resources/translations/validators.fr.yml rename to translations/validators.fr.yml From f5f0e54261f3af2157c1796d244e75aa3176f6ac Mon Sep 17 00:00:00 2001 From: Tchama Date: Fri, 4 Sep 2020 20:35:32 +0200 Subject: [PATCH 16/17] fix deprecated ObjectManager path in data fixtures scripts --- DataFixtures/ORM/LoadTaskACL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DataFixtures/ORM/LoadTaskACL.php b/DataFixtures/ORM/LoadTaskACL.php index a365f82d9..5af11f6a2 100644 --- a/DataFixtures/ORM/LoadTaskACL.php +++ b/DataFixtures/ORM/LoadTaskACL.php @@ -21,7 +21,7 @@ namespace Chill\TaskBundle\DataFixtures\ORM; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\OrderedFixtureInterface; -use Doctrine\Common\Persistence\ObjectManager; +use Doctrine\Persistence\ObjectManager; use Chill\MainBundle\DataFixtures\ORM\LoadPermissionsGroup; use Chill\MainBundle\Entity\RoleScope; use Chill\MainBundle\DataFixtures\ORM\LoadScopes; From dc657cbf99655b8d27073cd288ae8bac6545ac97 Mon Sep 17 00:00:00 2001 From: Tchama Date: Sun, 6 Sep 2020 20:32:46 +0200 Subject: [PATCH 17/17] use '@foo/bar.html.twig' syntax in twig templates --- Resources/views/SingleTask/confirm_delete.html.twig | 2 +- Resources/views/SingleTask/edit.html.twig | 2 +- Resources/views/SingleTask/index.html.twig | 2 +- Resources/views/SingleTask/new.html.twig | 2 +- Resources/views/SingleTask/show.html.twig | 2 +- Resources/views/SingleTask/transition.html.twig | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Resources/views/SingleTask/confirm_delete.html.twig b/Resources/views/SingleTask/confirm_delete.html.twig index a25f7b42d..4ea637a60 100644 --- a/Resources/views/SingleTask/confirm_delete.html.twig +++ b/Resources/views/SingleTask/confirm_delete.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillPersonBundle::layout.html.twig" %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_task_list' %} {% set person = task.person %} diff --git a/Resources/views/SingleTask/edit.html.twig b/Resources/views/SingleTask/edit.html.twig index 7f683d0a7..c43aaf0a8 100644 --- a/Resources/views/SingleTask/edit.html.twig +++ b/Resources/views/SingleTask/edit.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillPersonBundle::layout.html.twig" %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_single_task_edit' %} {% set person = task.person %} diff --git a/Resources/views/SingleTask/index.html.twig b/Resources/views/SingleTask/index.html.twig index f7bf4dfce..2caaeceec 100644 --- a/Resources/views/SingleTask/index.html.twig +++ b/Resources/views/SingleTask/index.html.twig @@ -15,7 +15,7 @@ * along with this program. If not, see . #} -{% extends layout %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_single_task_new' %} diff --git a/Resources/views/SingleTask/new.html.twig b/Resources/views/SingleTask/new.html.twig index 1f054820c..e4c7e14a0 100644 --- a/Resources/views/SingleTask/new.html.twig +++ b/Resources/views/SingleTask/new.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillPersonBundle::layout.html.twig" %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_single_task_new' %} {% set person = task.person %} diff --git a/Resources/views/SingleTask/show.html.twig b/Resources/views/SingleTask/show.html.twig index 808179fc5..224e52b8c 100644 --- a/Resources/views/SingleTask/show.html.twig +++ b/Resources/views/SingleTask/show.html.twig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} -{% extends "ChillPersonBundle::layout.html.twig" %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_single_task_show' %} {% set person = task.person %} diff --git a/Resources/views/SingleTask/transition.html.twig b/Resources/views/SingleTask/transition.html.twig index 7ba341cd9..fc27ee8c4 100644 --- a/Resources/views/SingleTask/transition.html.twig +++ b/Resources/views/SingleTask/transition.html.twig @@ -1,4 +1,4 @@ -{% extends "ChillPersonBundle::layout.html.twig" %} +{% extends "@ChillPerson/layout.html.twig" %} {% set activeRouteKey = 'chill_task_task_list' %} {% set person = task.person %}