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 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 diff --git a/core/Command/ReportExportCommand.php b/core/Command/ReportExportCommand.php index c1f21595..060515ce 100644 --- a/core/Command/ReportExportCommand.php +++ b/core/Command/ReportExportCommand.php @@ -148,5 +148,7 @@ public function execute(InputInterface $input, OutputInterface $output) $output->writeln(sprintf('Result written to file: %s', $result->getFilename())); } } + + return 0; } } 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(), ] ); 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}) }}) 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"