diff --git a/frontend/components/EntityShowSubPhases.vue b/frontend/components/EntityShowSubPhases.vue index 9ef46d6..aac7ce9 100644 --- a/frontend/components/EntityShowSubPhases.vue +++ b/frontend/components/EntityShowSubPhases.vue @@ -96,6 +96,26 @@ const togglePhasePanel = (phase) => { openPhaseKey.value = openPhaseKey.value === phase.key ? null : phase.key } +const getQuickActionTarget = (link) => { + const [configuredPath, configuredQuery = ""] = String(link || "").split("?") + const query = Object.fromEntries(new URLSearchParams(configuredQuery)) + let path = configuredPath + + // Bereits gespeicherte Phasenvorlagen können noch die alten Routen enthalten. + if (configuredPath === "/tasks/create") { + path = "/tasks" + query.mode = "create" + } else if (configuredPath === "/events/edit") { + path = "/standardEntity/events/create" + } + + new URLSearchParams(props.queryStringData || "").forEach((value, key) => { + query[key] = value + }) + + return { path, query } +} + const changeActivePhase = async (key) => { console.log(props.item) let item = await useEntities("projects").selectSingle(props.item.id,'*') @@ -175,7 +195,7 @@ const changeActivePhase = async (key) => { {{button.label}} diff --git a/frontend/pages/projecttypes/[mode]/[[id]].vue b/frontend/pages/projecttypes/[mode]/[[id]].vue index c7af80a..b7c895f 100644 --- a/frontend/pages/projecttypes/[mode]/[[id]].vue +++ b/frontend/pages/projecttypes/[mode]/[[id]].vue @@ -279,10 +279,10 @@ const addPhase = () => { @click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Rechnung',link:'/createDocument/edit/?type=invoices'})">Rechnung Erstellen Aufgabe Erstellen + @click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Aufgabe',link:'/tasks?mode=create'})">Aufgabe Erstellen Termin Erstellen + @click="itemInfo.initialPhases[itemInfo.initialPhases.findIndex(i=> i.key === selectedKeyForQuickAction)].quickactions.push({label:'+ Termin',link:'/standardEntity/events/create'})">Termin Erstellen