diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php
index 03ab458ab..2d77d0f51 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkDuplicateController.php
@@ -11,19 +11,18 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Controller;
+use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
use Chill\PersonBundle\Form\FindAccompanyingPeriodWorkType;
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
-use Symfony\Component\Serializer\Serializer;
-use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
class AccompanyingPeriodWorkDuplicateController extends AbstractController
{
- public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, private readonly TranslatorInterface $translator, private readonly SerializerInterface $serializer) {}
+ public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelperInterface $stringHelper) {}
/**
* @ParamConverter("accompanyingPeriodWork", options={"id": "acpw_id"})
@@ -35,10 +34,14 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
$acpwList = $this->accompanyingPeriodWorkRepository->findByAccompanyingPeriod($accompanyingPeriod);
- $acpwListArray = $this->serializer->normalize($acpwList, 'json', ['groups' => ['read']]);
- $acpwListJson = json_encode($acpwListArray);
-
- dump($acpwListJson);
+ $acpwArray = array_map(function ($acpw) {
+ return [
+ 'id' => $acpw->getId(),
+ 'socialAction' => $this->stringHelper->localize($acpw->getSocialAction()->getTitle()),
+ 'start_date' => $acpw->getStartDate(),
+ 'end_date' => $acpw->getEndDate(),
+ ];
+ }, $acpwList);
$this->denyAccessUnlessGranted(
'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE',
@@ -62,7 +65,7 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
$direction = $form->get('direction')->getData();
- if ('starting' === $direction) {
+/* if ('starting' === $direction) {
$params = [
'acpw1_id' => $acpw->getId(),
'acpw2_id' => $acpw2->getId(),
@@ -72,14 +75,14 @@ class AccompanyingPeriodWorkDuplicateController extends AbstractController
'acpw1_id' => $acpw2->getId(),
'acpw2_id' => $acpw->getId(),
];
- }
+ }*/
// return $this->redirectToRoute('chill_person_acpw_duplicate_confirm', $params);
}
return $this->render('@ChillPerson/AccompanyingPeriodWorkDuplicate/assign_acpw_duplicate.html.twig', [
'accompanyingCourse' => $acpw->getAccompanyingPeriod(),
- 'acpwListJson' => $acpwListJson,
+ 'acpwList' => $acpwArray,
'acpw' => $acpw,
'form' => $form->createView(),
]);
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js
index 3ec34b7a4..05cd5a9b3 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/mod/DuplicateSelector/AccompanyingPeriodWorkSelector.js
@@ -1,12 +1,10 @@
import { createApp } from 'vue';
-import AccompanyingPeriodWorkSelector from "../../vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelector.vue";
-
+import AccompanyingPeriodWorkSelectorModal from "../../vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelectorModal.vue";
document.addEventListener("DOMContentLoaded", () => {
- const el = document.getElementById('linked-acpw-selector');
- if (el) {
- createApp(AccompanyingPeriodWorkSelector, {
- acpwList: JSON.parse(el.dataset.acpwList)
- }).mount(el);
+ const el = document.getElementById('linked-acpw-selector');
+ if (el) {
+ const acpwList = JSON.parse(el.dataset.acpwList);
+ createApp(AccompanyingPeriodWorkSelectorModal, { acpwList }).mount(el);
}
});
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/types.ts b/src/Bundle/ChillPersonBundle/Resources/public/types.ts
index c93440d75..0b7867370 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/types.ts
+++ b/src/Bundle/ChillPersonBundle/Resources/public/types.ts
@@ -59,7 +59,7 @@ export interface AccompanyingPeriodWork {
privateComment: PrivateCommentEmbeddable;
referrersHistory: AccompanyingPeriodWorkReferrerHistory[];
results: Result[];
- socialAction?: SocialAction;
+ socialAction: SocialAction;
startDate?: string;
thirdParties: Thirdparty[];
updatedAt?: string;
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelector.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelector.vue
index 579b9f638..4ee4d58c9 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelector.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/DuplicateSelector/AccompanyingPeriodWorkSelector.vue
@@ -1,33 +1,25 @@
Select an Accompanying Period Work
-
+
-
-
acpw_duplicate.Select accompanying period work
+
+
+
+
-
-
-
-
-