From 47a4b63172c6009c3f9923b972a349c56bf9ef2a Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 7 Aug 2024 09:53:37 +0200 Subject: [PATCH] changes the zustellungs warning for the Profil Adressen/Kontakte --- .../components/Cis/Profil/ProfilModal/EditProfil.js | 3 --- .../ProfilModal/EditProfilComponents/EditAdresse.js | 11 ++++++----- .../ProfilModal/EditProfilComponents/EditKontakt.js | 10 +++++++--- system/phrasesupdate.php | 13 +++++++------ 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js index 1b54fe7f6..ec14a9486 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js @@ -56,9 +56,6 @@ export default { async submitProfilChange() { - //todo delete this debugging line - console.log("this is a test") - //? check if data is valid before making a request if (this.topic && this.profilUpdate) { //? if profil update contains any attachment diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditAdresse.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditAdresse.js index c3f194958..c38f6fd31 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditAdresse.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditAdresse.js @@ -34,10 +34,6 @@ export default { }, methods: { - test: function () { - console.log(this.gemeinden, "this are the gemeinden"); - console.log(this.ortschaftnamen, "this are the ortschaftsnamen"); - }, autocompleteSearchGemeinden: function (event) { this.gemeinden = this.gemeinden.map((gemeinde) => gemeinde); @@ -97,6 +93,11 @@ export default { computed: { showZustellAdressenWarning: function () { + + // if the address was already a zustellungsadresse when editing the address, then the warning will not be shown and the zustellungsadresse will just be overwritten + if (JSON.parse(this.originalValue).zustelladresse){ + return false; + } // if zustellAdressenCount is not 0 and the own kontakt has the flag zustellung set to true if (!this.zustellAdressenCount.includes(this.data.adresse_id)) { return this.data.zustelladresse && this.zustellAdressenCount.length; @@ -135,7 +136,7 @@ export default {
- {{$p.t('profilUpdate','zustelladresseWarning')}} + {{$p.t('profilUpdate','zustell_adressen_warning')}}
diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditKontakt.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditKontakt.js index 03bd8dcd7..ee1cc938c 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditKontakt.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/EditKontakt.js @@ -27,6 +27,10 @@ export default { computed: { showZustellKontakteWarning: function () { + // if the kontakt is already a zustellungskontakt when the user is editing the kontakt, then no warning is shown and the zustellung will be overwritten + if (JSON.parse(this.originalValue).zustellung) { + return false; + } // if zustellKontakteCount is not 0 and the own kontakt has the flag zustellung set to true if (!this.zustellKontakteCount.includes(this.data.kontakt_id)) { return this.data.zustellung && this.zustellKontakteCount.length; @@ -50,14 +54,14 @@ export default { template: /*html*/ ` - -
+ +
- {{$p.t('profilUpdate','zustellkontakteWarning')}} + {{$p.t('profilUpdate','zustell_kontakte_warning')}}
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 49a3a0bdc..23281cb96 100755 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -25868,18 +25868,18 @@ array( array( 'app' => 'core', 'category' => 'profilUpdate', - 'phrase' => 'zustelladresseWarning', + 'phrase' => 'zustell_adressen_warning', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => '!Achtung: Eine Ihrer Adressen ist bereits als Zustelladresse gespeichert, sind sie sicher, dass sie die aktuelle Adresse stattdessen als Zustelladresse speichern wollen?', + 'text' => 'Einer ihrer Adressen wird bereits zur Zustellung verwendet, möchten sie diese Adressen als Zustellungsadresse übernehmen?', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => '!Attention: One of your addresses is already saved as a delivery address, are you sure you want to save the current address as a delivery address instead?', + 'text' => 'One of your addresses is already used as a contact address, would you like to use this address as your new contact address?', 'description' => '', 'insertvon' => 'system' ) @@ -25888,23 +25888,24 @@ array( array( 'app' => 'core', 'category' => 'profilUpdate', - 'phrase' => 'zustellkontakteWarning', + 'phrase' => 'zustell_kontakte_warning', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => '!Achtung: Eine deiner Kontakte ist bereits als Zustellungskontakt gespeichert, sind sie sicher, dass sie den aktuellen Kontakt stattdessen als Zustellkontakt speichern wollen?', + 'text' => 'Einer ihrer Kontakte wird bereits zur Zustellung verwendet, möchten sie diesen Kontakt als Zustellungskontakt übernehmen?', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => '!Attention: One of your contacts is already saved as a delivery contact, are you sure you want to save the current contact as a delivery contact instead?', + 'text' => 'One of your contacts is already used as a communication mean, would you like to use this contact as your new communication mean?', 'description' => '', 'insertvon' => 'system' ) ) ), + array( 'app' => 'core', 'category' => 'profilUpdate',