diff --git a/.changes/unreleased/Feature-20250325-164301.yaml b/.changes/unreleased/Feature-20250325-164301.yaml new file mode 100644 index 000000000..181466d14 --- /dev/null +++ b/.changes/unreleased/Feature-20250325-164301.yaml @@ -0,0 +1,7 @@ +kind: Feature +body: Added a second phone number "telephone2" to the thirdParty entity. Adapted twig + templates and vuejs apps to handle this phone number +time: 2025-03-25T16:43:01.003712495+01:00 +custom: + Issue: "364" + SchemaChange: Add columns or tables diff --git a/.changes/unreleased/Fixed-20250325-164327.yaml b/.changes/unreleased/Fixed-20250325-164327.yaml new file mode 100644 index 000000000..7bf8b3d6c --- /dev/null +++ b/.changes/unreleased/Fixed-20250325-164327.yaml @@ -0,0 +1,9 @@ +kind: Fixed +body: |- + FIXED wrong translations in the on-the-fly for creation of thirdParty + FIXED update of phone number in on-the-fly edition of thirdParty + FIXED closing of modal when editing thirdParty in accompanying course works +time: 2025-03-25T16:43:27.437038378+01:00 +custom: + Issue: "" + SchemaChange: No schema change diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue index 3357d6463..1c5d2b6da 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/BadgeEntity.vue @@ -26,9 +26,9 @@ trans(THIRDPARTY_CONTACT_OF) }} {{ - trans(THIRDPARTY_A_CONTACT) + trans(THIRDPARTY_A_COMPANY) }} - {{ $t("thirdparty.contact") }} + {{ trans(THIRDPARTY_A_CONTACT) }} @@ -54,6 +54,7 @@ import { ACCEPTED_USERS, THIRDPARTY_A_CONTACT, THIRDPARTY_CONTACT_OF, + THIRDPARTY_A_COMPANY, PERSON, THIRDPARTY, } from "translator"; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue index 3c5562d08..c2dbd6e0c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue @@ -204,7 +204,8 @@ export default { } else if (payload.type === "thirdparty") { body.name = payload.data.text; body.email = payload.data.email; - body.telephone = payload.data.phonenumber; + body.telephone = payload.data.telephone; + body.telephone2 = payload.data.telephone2; body.address = { id: payload.data.address.address_id }; makeFetch( diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue index 23a191817..5858cdb00 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue @@ -385,7 +385,8 @@ export default { } else if (payload.type === "thirdparty") { body.name = payload.data.text; body.email = payload.data.email; - body.telephone = payload.data.phonenumber; + body.telephone = payload.data.telephone; + body.telephone2 = payload.data.telephone2; if (payload.data.address) { body.address = { id: payload.data.address.address_id }; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue index 70f09e4e6..87daacf47 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue @@ -194,6 +194,7 @@ export default { body.name = payload.data.name; body.email = payload.data.email; body.telephone = payload.data.telephone; + body.telephone2 = payload.data.telephone2; body.address = payload.data.address ? { id: payload.data.address.address_id } : null; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index 1f8a99d43..952bbc2d3 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -745,7 +745,8 @@ export default { let body = { type: payload.type }; body.name = payload.data.text; body.email = payload.data.email; - body.telephone = payload.data.phonenumber; + body.telephone = payload.data.telephone; + body.telephone2 = payload.data.telephone2; body.address = { id: payload.data.address.address_id }; makeFetch( @@ -755,7 +756,9 @@ export default { ) .then((response) => { this.$store.dispatch("updateThirdParty", response); - this.$refs.onTheFly.closeModal(); + for (let otf of this.$refs.onTheFly) { + otf.closeModal(); + } }) .catch((error) => { if (error.name === "ValidationException") { diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php index 98d0ffafd..708d08076 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdpartyCSVExportController.php @@ -65,6 +65,7 @@ class ThirdpartyCSVExportController extends AbstractController 'Name', 'Profession', 'Telephone', + 'Telephone2', 'Email', 'Address', 'Comment', @@ -76,6 +77,7 @@ class ThirdpartyCSVExportController extends AbstractController 'Contact name', 'Contact firstname', 'Contact phone', + 'Contact phone2', 'Contact email', 'Contact address', 'Contact profession', diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index eb35aea4d..e65a06515 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -209,6 +209,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin #[PhonenumberConstraint(type: 'any')] private ?PhoneNumber $telephone = null; + #[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])] + #[ORM\Column(name: 'telephone2', type: 'phone_number', nullable: true)] + #[PhonenumberConstraint(type: 'any')] + private ?PhoneNumber $telephone2 = null; + #[ORM\Column(name: 'types', type: \Doctrine\DBAL\Types\Types::JSON, nullable: true)] private ?array $thirdPartyTypes = []; @@ -429,6 +434,11 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin return $this->telephone; } + public function getTelephone2(): ?PhoneNumber + { + return $this->telephone2; + } + /** * Get type. */ @@ -712,6 +722,13 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin return $this; } + public function setTelephone2(?PhoneNumber $telephone2 = null): self + { + $this->telephone2 = $telephone2; + + return $this; + } + /** * Set type. * diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 26ed31d32..9cd671872 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -59,6 +59,10 @@ class ThirdPartyType extends AbstractType 'label' => 'Phonenumber', 'required' => false, ]) + ->add('telephone2', ChillPhoneNumberType::class, [ + 'label' => 'telephone2', + 'required' => false, + ]) ->add('email', EmailType::class, [ 'required' => false, ]) diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php index d4e0e55ee..111be4089 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php @@ -42,6 +42,7 @@ class ThirdPartyRepository implements ObjectRepository parent.name AS name, parent.profession AS profession, parent.telephone AS telephone, + parent.telephone2 AS telephone2, parent.email AS email, CONCAT_WS(' ', parent_address.street, parent_address.streetnumber, parent_postal.code, parent_postal.label) AS address, parent.comment AS comment, @@ -55,6 +56,7 @@ class ThirdPartyRepository implements ObjectRepository contact.name AS contact_name, contact.firstname AS contact_firstname, contact.telephone AS contact_phone, + contact.telephone2 AS contact_phone2, contact.email AS contact_email, contact.profession AS contact_profession, CONCAT_WS(' ', contact_address.street, contact_address.streetnumber, contact_postal.code, contact_postal.label) AS contact_address diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue index aaa80bd08..0fee3dcdb 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue @@ -91,6 +91,18 @@ }} +