From fa983df1c731fe4229c117edc0f33e286c0a0295 Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 17:23:26 +0100 Subject: [PATCH 1/7] Docker compose server added. --- docker-compose.server.yml | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docker-compose.server.yml diff --git a/docker-compose.server.yml b/docker-compose.server.yml new file mode 100644 index 00000000..83a0f82c --- /dev/null +++ b/docker-compose.server.yml @@ -0,0 +1,47 @@ +# itk-version: 2.0.1 +version: "3" + +networks: + frontend: + external: true + app: + driver: bridge + internal: false + +services: + phpfpm: + image: itkdev/php8.2-fpm:alpine + restart: unless-stopped + networks: + - app + extra_hosts: + - "host.docker.internal:host-gateway" + environment: + - PHP_MAX_EXECUTION_TIME=30 + - PHP_MEMORY_LIMIT=128M + - COMPOSER_VERSION=2 + volumes: + - .:/app:delegated + + nginx: + image: nginxinc/nginx-unprivileged:alpine + restart: unless-stopped + networks: + - app + - frontend + depends_on: + - phpfpm + ports: + - '8080' + volumes: + - ${PWD}/.docker/vhost.conf:/etc/nginx/conf.d/default.conf:ro + - ./:/app:rw + labels: + - "traefik.enable=true" + - "traefik.docker.network=frontend" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.entrypoints=web" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https" + - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${COMPOSE_SERVER_DOMAIN}`)" + - "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure" From 2c9e17e61af040e2ae4b803658656ff238bbfb8f Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 17:32:18 +0100 Subject: [PATCH 2/7] Genoptag sag --- core/Controller/ProcessController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/Controller/ProcessController.php b/core/Controller/ProcessController.php index 1452359a..94903961 100644 --- a/core/Controller/ProcessController.php +++ b/core/Controller/ProcessController.php @@ -589,13 +589,14 @@ public function complete(Request $request, Process $process, ServiceRepository $ * @param Request $request * @param Process $process * @param ProcessStatusRepository $processStatusRepository + * @param DatafordelerService $datafordelerService * * @return Response * * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function resume(Request $request, Process $process, ProcessStatusRepository $processStatusRepository): Response + public function resume(Request $request, Process $process, ProcessStatusRepository $processStatusRepository, DatafordelerService $datafordelerService): Response { $this->denyAccessUnlessGranted('edit', $process); @@ -604,6 +605,16 @@ public function resume(Request $request, Process $process, ProcessStatusReposito ]); $form->handleRequest($request); + $processClientIdentifier = $process->getProcessClient()->getIdentifier(); + // Get client type + $clientType = $process->getProcessClient()->getType(); + + if (ProcessClientPerson::PERSON === $clientType) { + $processClientIdentifier = preg_replace('/\D+/', '', $processClientIdentifier); + $data = $datafordelerService->getPersonData($processClientIdentifier); + } elseif (ProcessClientCompany::COMPANY === $clientType) { + $data = $datafordelerService->getVirksomhedData($processClientIdentifier); + } if ($form->isSubmitted() && $form->isValid()) { $process->setCompletedAt(null); @@ -624,6 +635,7 @@ public function resume(Request $request, Process $process, ProcessStatusReposito $process ), 'process' => $process, + 'data' => $data, 'form' => $form->createView(), ] ); From 3f4d16109c6d1fd17347cba78434431f372ae6aa Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 18:38:23 +0100 Subject: [PATCH 3/7] Antal dage rettede --- core/Resources/translations/messages.da.yaml | 8 +------- core/Resources/views/process/_form_complete.html.twig | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/core/Resources/translations/messages.da.yaml b/core/Resources/translations/messages.da.yaml index 4e182567..2d23e45d 100644 --- a/core/Resources/translations/messages.da.yaml +++ b/core/Resources/translations/messages.da.yaml @@ -514,14 +514,8 @@ process: performed_company_check: Har der været udført virksomhedskontrol? police_report: Sagen er politianmeldt processing_time: Sagens behandlingstid - processing_time_value: 'En dag|%days% dage' + processing_time_value: '%days% dage' # # @see https://symfony.com/doc/current/translation/message_format.html#pluralization - # processing_time_value: > - # {days, plural, - # =0 {Nul dage} - # one {én dag} - # other {%days% dage} - # } status: Status ved sagens afslutning submit: Godkend afslutning af sag title: Afslut sag %case_number% diff --git a/core/Resources/views/process/_form_complete.html.twig b/core/Resources/views/process/_form_complete.html.twig index da530ad4..89c35f94 100644 --- a/core/Resources/views/process/_form_complete.html.twig +++ b/core/Resources/views/process/_form_complete.html.twig @@ -15,11 +15,10 @@ {{ process.createdAt|date('d-m-Y') }} – {{ 'now'|date('d-m-Y') }} - {# @see https://stackoverflow.com/questions/15657687/twig-date-difference #} {% set start_date = process.createdAt %} {% set end_date = 'now' %} {% set days = date(end_date).diff(date(start_date)).days + 1 %} - ({{ 'process.complete.processing_time_value'|trans({'days': days}) }}) + ({{ 'process.complete.processing_time_value'|trans({'%days%': days}) }}) From 40c91ed8d835bc299ffd32886f7e9f842376b489 Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 19:34:21 +0100 Subject: [PATCH 4/7] BI --- core/Command/ReportExportCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Command/ReportExportCommand.php b/core/Command/ReportExportCommand.php index c1f21595..3862c197 100644 --- a/core/Command/ReportExportCommand.php +++ b/core/Command/ReportExportCommand.php @@ -98,7 +98,7 @@ public function getHelp(): string $help[] = ''; foreach ($exports as $export) { $help[] = sprintf(' Title: %s', $export->getTitle()); - $help[] = sprintf(' Class name: %s', $export::class); + $help[] = sprintf(' Class name: %s', \get_class($export)); $help[] = ' Parameters:'; foreach ($export->getParameters() as $name => $info) { $type = $info['type'] ?? TextType::class; From facbfd4d7dde95d389251f0c17a2b375173a0368 Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 19:39:28 +0100 Subject: [PATCH 5/7] BI rettelse --- core/Command/ReportExportCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/Command/ReportExportCommand.php b/core/Command/ReportExportCommand.php index 3862c197..060515ce 100644 --- a/core/Command/ReportExportCommand.php +++ b/core/Command/ReportExportCommand.php @@ -98,7 +98,7 @@ public function getHelp(): string $help[] = ''; foreach ($exports as $export) { $help[] = sprintf(' Title: %s', $export->getTitle()); - $help[] = sprintf(' Class name: %s', \get_class($export)); + $help[] = sprintf(' Class name: %s', $export::class); $help[] = ' Parameters:'; foreach ($export->getParameters() as $name => $info) { $type = $info['type'] ?? TextType::class; @@ -148,5 +148,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(sprintf('Result written to file: %s', $result->getFilename())); } } + + return 0; } } From f06ddde6564d2697ec91dfb310a804b741639bcc Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 19:39:43 +0100 Subject: [PATCH 6/7] UPGRADE.md change --- UPGRADE.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UPGRADE.md b/UPGRADE.md index fe6534d4..fe67b06c 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -6,6 +6,10 @@ All upgrade notes for this project will be documented in this file. ## [Unreleased] +## [3.2.1] - 2023-12-04 + +Nothing has been changed + ## [3.2.0] - 2023-12-03 Nothing has been changed @@ -41,7 +45,8 @@ Nothing has been changed DEFAULT_URI='' ``` -[Unreleased]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.0...HEAD +[Unreleased]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.1...HEAD +[3.2.1]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.0...3.2.1 [3.2.0]: https://github.com/itk-dev/kontrolgruppen/compare/3.1.1...3.2.0 [3.1.1]: https://github.com/itk-dev/kontrolgruppen/compare/3.1.0...3.1.1 [3.1.0]: https://github.com/itk-dev/kontrolgruppen/compare/3.0.0...3.1.0 From 0928e58143473300a14d6e61057f7c7b300003ad Mon Sep 17 00:00:00 2001 From: samilesma Date: Mon, 4 Dec 2023 19:39:53 +0100 Subject: [PATCH 7/7] Changelog.md --- CHANGELOG.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea62841a..59ef098f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,16 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [3.2.1] - 2023-12-04 + +### Changed + +#### Bugfixes + +- Docker compose server file added +- Being able to reopen a case +- Show correct day when concluding a case. + ## [3.2.0] - 2023-12-03 ### Changed @@ -264,7 +274,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). - [KON-361](https://github.com/aakb/kontrolgruppen/pull/81): Changed datepicker -[Unreleased]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.0...HEAD +[Unreleased]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.1...HEAD +[3.2.1]: https://github.com/itk-dev/kontrolgruppen/compare/3.2.0...3.2.1 [3.2.0]: https://github.com/itk-dev/kontrolgruppen/compare/3.1.1...3.2.0 [3.1.1]: https://github.com/itk-dev/kontrolgruppen/compare/3.1.0...3.1.1 [3.1.0]: https://github.com/itk-dev/kontrolgruppen/compare/3.0.0...3.1.0