From aeaf747445e85208a276de5d2e0d9ec07d509301 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Wed, 29 Apr 2026 19:49:45 +0200 Subject: [PATCH] Enhance worship import functionality: Add neighbor invitation and self-information fields in worshipController.js and WorshipManagement.vue. Implement logic to automatically set self-information based on neighbor invitation status, improving user experience and data handling during worship imports. --- controllers/worshipController.js | 5 +++++ src/content/admin/WorshipManagement.vue | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/controllers/worshipController.js b/controllers/worshipController.js index 80b2c2d..ce4ab2d 100644 --- a/controllers/worshipController.js +++ b/controllers/worshipController.js @@ -1829,6 +1829,9 @@ exports.saveImportedWorships = async (req, res) => { // Freigabe-Status aus Import-Dialog übernehmen (Checkbox in der UI). // Fallback: wenn kein Wert gesetzt ist, bleibt es false. worshipData.approved = !!worshipData.approved; + worshipData.neighborInvitation = !!worshipData.neighborInvitation; + // Regel: Nachbarschaftsraum => automatisch Selbstinformation. + worshipData.selfInformation = !!worshipData.selfInformation || worshipData.neighborInvitation; worshipData.title = normalizeText(worshipData.title) || 'Gottesdienst'; const replaceExistingIds = Array.isArray(worshipData._replaceExistingIds) @@ -1844,6 +1847,8 @@ exports.saveImportedWorships = async (req, res) => { sacristanService: worshipData.sacristanService || '', organPlaying: worshipData.organPlaying || '', approved: worshipData.approved, + neighborInvitation: worshipData.neighborInvitation, + selfInformation: worshipData.selfInformation, eventPlaceId: worshipData.eventPlaceId, }; diff --git a/src/content/admin/WorshipManagement.vue b/src/content/admin/WorshipManagement.vue index f439844..0d0fff8 100644 --- a/src/content/admin/WorshipManagement.vue +++ b/src/content/admin/WorshipManagement.vue @@ -174,6 +174,18 @@ Freigegeben +
+ +
+
+ +
@@ -831,7 +843,9 @@ export default { _hasDayPlaceConflict: w._hasDayPlaceConflict || false, _conflictingWorships: w._conflictingWorships || [], _replaceExistingIds: w._replaceExistingIds || [], - _importChoice: w._importChoice || (w._hasDayPlaceConflict ? 'keepExisting' : 'import') + _importChoice: w._importChoice || (w._hasDayPlaceConflict ? 'keepExisting' : 'import'), + neighborInvitation: !!w.neighborInvitation, + selfInformation: !!w.selfInformation }; }); this.importErrors = response.data.errors || []; @@ -859,6 +873,11 @@ export default { removeWorship(index) { this.importedWorships.splice(index, 1); }, + handleImportNeighborInvitationChange(worship) { + if (worship?.neighborInvitation) { + worship.selfInformation = true; + } + }, async saveImportedWorships() { if (this.importedWorships.length === 0) { alert('Keine Gottesdienste zum Speichern vorhanden.'); @@ -912,6 +931,8 @@ export default { sacristanService: w.sacristanService, organPlaying: w.organPlaying, approved: w.approved || false, + neighborInvitation: !!w.neighborInvitation, + selfInformation: !!w.selfInformation || !!w.neighborInvitation, eventPlaceId: w.eventPlace ? w.eventPlace.id : (w.eventPlaceId || null), _importChoice: w._importChoice || 'import', _replaceExistingIds: w._replaceExistingIds || [],