diff --git a/Internal/de/PROJECT_CONTEXT.md b/Internal/de/PROJECT_CONTEXT.md index 12cd89b..7c6a3b0 100644 --- a/Internal/de/PROJECT_CONTEXT.md +++ b/Internal/de/PROJECT_CONTEXT.md @@ -39,6 +39,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter. Kernbereiche sind l - Im Formular für eigene Events sind `Gültig bis` und `Wiederholung` ausgeblendet. - Bei eigener Event-Location aus der Datenbank werden Adresse und Kategorie nur als Info angezeigt und nicht direkt bearbeitet. - Aus dem Formular für eigene Events kann direkt in das Anlegen eines neuen Orts oder einer neuen Veranstaltung gewechselt werden. +- Nach diesem Zwischenschritt kehrt der Nutzer wieder in sein Event zurück; die bisherige Event-Eingabe bleibt erhalten und der neu angelegte Ort bzw. die neue Veranstaltung wird direkt ausgewählt. - Bei `Veranstaltung aus Datenbank` muss das Event-Datum innerhalb des hinterlegten Gültigkeitszeitraums dieser Veranstaltungs-Quelle liegen. - Kategorien werden im Mitgliederbereich per Sucheingabe mit bestehenden Vorschlägen und automatischer Neuanlage gepflegt. - Eigene Events unterstützen optionalen Beschreibungstext, Ja/Nein-Angabe `Mit Kindern`, optionale Platzzahl, optionales Bild sowie eine Location aus Datenbank oder benutzerdefinierte Adresse. diff --git a/Internal/de/README.md b/Internal/de/README.md index e131829..3e75644 100644 --- a/Internal/de/README.md +++ b/Internal/de/README.md @@ -25,6 +25,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter mit Fokus auf lokale - Mitgliederbereich `Events` ist wieder auf echte eigene Events und Event-Teilnahmen fokussiert - Eigene Events haben jetzt optionalen Beschreibungstext, klare Kinderangabe, optionale Platzzahl, optionales Bild sowie eine Location aus Datenbank oder benutzerdefinierte Adresse - Bei eigener Event-Location aus der Datenbank werden Adresse und Kategorie nur informativ übernommen und nicht direkt im Event geändert +- Der Zwischenschritt vom eigenen Event zum Anlegen eines neuen Orts oder einer neuen Veranstaltung springt danach wieder in das Event zurück und wählt den neuen Eintrag direkt aus - Orte und sonstige Veranstaltungen wurden vorerst in einen separaten Bereich `Orte & Veranstaltungen` verschoben - Neue Orte und Veranstaltungen müssen vor Veröffentlichung erst durch einen Admin freigegeben werden; Änderungs- und Löschwünsche laufen ebenfalls nur als begründete Anfrage - Die Eingabemasken sind jetzt progressiv aufgebaut: erst Pflichtangaben, optionale Daten in einklappbaren Bereichen diff --git a/Internal/en/PROJECT_CONTEXT.md b/Internal/en/PROJECT_CONTEXT.md index 400d6d4..2f3713f 100644 --- a/Internal/en/PROJECT_CONTEXT.md +++ b/Internal/en/PROJECT_CONTEXT.md @@ -39,6 +39,7 @@ Papa-Kind-Treff is a PHP-based platform for fathers. Core areas are local events - Inside the own-event form, `valid until` and `recurrence` are hidden. - When an own event uses a database-backed location, address and category are shown as informational values and are not edited directly. - The own-event form now offers direct links into creating a new place or a new event-style listing. +- After that intermediate step, the user returns to the own-event form with the previous event input restored and the newly created place or event-style listing already selected. - When `event from database` is selected, the event date must fall inside that source event's valid date window. - Categories in the member area are handled via a search input with existing suggestions and automatic creation when needed. - Own events support an optional description, a clear `with children` yes/no field, optional capacity, an optional image, and either a database-backed location or a custom address. diff --git a/Internal/en/README.md b/Internal/en/README.md index c61d1b8..1b52071 100644 --- a/Internal/en/README.md +++ b/Internal/en/README.md @@ -25,6 +25,7 @@ Papa-Kind-Treff is a PHP-based platform for fathers focused on local events, app - member area `Events` is now limited again to real own events and event participations - own events now support an optional description, explicit child suitability, optional capacity, an optional image, and either a database-backed location or a custom address - when an own event uses a database-backed location, address and category are shown as informational values and are not edited directly inside the event +- when a user creates a new place or event-style listing from inside an own event, the flow returns to that event afterwards and preselects the newly created entry - places and other event-style entries were moved for now into a separate member-area section `Places & Events` - new places and event-style entries must be approved by an admin before publication; change and deletion wishes also run as reasoned requests - the member-area entry forms now follow a progressive approach: required fields first, optional data inside collapsible sections diff --git a/README.md b/README.md index d40df42..0b07e14 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter mit Fokus auf: - Eigene Events unterstützen aktuell optionalen Beschreibungstext, klare Kinderangabe, optionale Platzzahl, Bild-Upload sowie eine Location aus Datenbank oder benutzerdefinierte Adresse - Bei eigener Event-Location aus der Datenbank werden Adresse und Kategorie nur informativ aus dem gewählten Ort bzw. der gewählten Veranstaltung übernommen und nicht manuell geändert - Aus dem Formular für eigene Events kann direkt in das Anlegen eines neuen Orts oder einer neuen Veranstaltung verzweigt werden +- Wenn aus einem eigenen Event heraus ein neuer Ort oder eine neue Veranstaltung angelegt wird, kehrt der Ablauf danach wieder in das Event zurück und wählt den neuen Eintrag direkt vor - Die Eingabe im Mitgliederbereich ist jetzt bewusst vereinfacht: zuerst nur Pflichtangaben, optionale Angaben in einklappbaren Bereichen - Kategorien werden jetzt über eine Sucheingabe mit bestehenden Vorschlägen gepflegt; neue Kategorien werden automatisch angelegt und sind für Seiten-Admins im Systembereich zusammenführbar - Im Mitgliederbereich `Events` gibt es jetzt zusätzlich einen ICS-Download und einen persönlichen abonnierbaren Kalender-Feed für alle eigenen Events und Event-Teilnahmen diff --git a/partials/landing/account/dashboard.php b/partials/landing/account/dashboard.php index cb2c431..a4fcccf 100755 --- a/partials/landing/account/dashboard.php +++ b/partials/landing/account/dashboard.php @@ -9,9 +9,13 @@ $dashboardUserId = (int)($_SESSION['user_id'] ?? 0); $requestedCreateListingKind = isset($_GET['create_listing']) && in_array((string)$_GET['create_listing'], ['place', 'editorial_event'], true) ? (string)$_GET['create_listing'] : null; +$restoreEventDraftActive = !empty($restoreEventDraftActive); $editingEvent = isset($editEvent) && $editEvent !== null; $editingListing = isset($editListing) && $editListing !== null; $editing = $editingEvent || $editingListing; +$eventDraftValues = (!$editing && (($section ?? '') === 'events') && $restoreEventDraftActive && is_array($restoredEventDraft ?? null)) + ? $restoredEventDraft + : []; $currentEntryKind = $editingListing ? (string)($editListing['listing_type'] ?? 'editorial_event') : ((($section ?? 'events') === 'places') ? ($requestedCreateListingKind ?? 'place') : 'event'); @@ -21,23 +25,27 @@ if ($editingEvent && !empty($editEvent['starts_at'])) { $startVal = date('Y-m-d', strtotime((string)$editEvent['starts_at'])); } elseif ($editingListing && !empty($editListing['starts_at'])) { $startVal = date('Y-m-d', strtotime((string)$editListing['starts_at'])); +} elseif (!empty($eventDraftValues['starts_at'])) { + $startVal = (string)$eventDraftValues['starts_at']; } -$withChildrenValue = $editingEvent ? (((int)($editEvent['allow_kids'] ?? 1)) === 1 ? 'yes' : 'no') : (($editingListing && $currentEntryKind === 'editorial_event' && !empty($editListing['supports_registration'])) ? 'yes' : 'yes'); +$withChildrenValue = $editingEvent + ? (((int)($editEvent['allow_kids'] ?? 1)) === 1 ? 'yes' : 'no') + : (!empty($eventDraftValues['with_children']) ? (string)$eventDraftValues['with_children'] : (($editingListing && $currentEntryKind === 'editorial_event' && !empty($editListing['supports_registration'])) ? 'yes' : 'yes')); $eventTitle = $editingEvent ? 'Event bearbeiten' : ($editingListing ? ($currentEntryKind === 'place' ? 'Änderung für Ort anfragen' : 'Änderung für Veranstaltung anfragen') : ((($section ?? 'events') === 'places') ? 'Ort oder Veranstaltung anlegen' : 'Neues Event anlegen')); $submitLabel = $editingEvent ? 'Event speichern' : ($editingListing ? 'Änderungsanfrage senden' : ((($section ?? 'events') === 'places') ? 'Eintrag zur Freigabe einreichen' : 'Event anlegen')); -$titleValue = $editingEvent ? (string)($editEvent['title'] ?? '') : (string)($editListing['title'] ?? ''); +$titleValue = $editingEvent ? (string)($editEvent['title'] ?? '') : (!empty($eventDraftValues['title']) ? (string)$eventDraftValues['title'] : (string)($editListing['title'] ?? '')); $teaserValue = $editingEvent ? (string)($editEvent['teaser_public'] ?? '') : (string)($editListing['teaser_public'] ?? ''); -$descriptionValue = $editingEvent ? (string)($editEvent['description'] ?? '') : (string)($editListing['description'] ?? ''); -$streetValue = $editingEvent ? (string)($editEvent['street'] ?? '') : (string)($editListing['street'] ?? ''); -$zipValue = $editingEvent ? (string)($editEvent['zip'] ?? '') : (string)($editListing['zip'] ?? ''); -$cityValue = $editingEvent ? (string)($editEvent['city'] ?? '') : (string)($editListing['city'] ?? ''); -$regionValue = $editingEvent ? (string)($editEvent['region'] ?? '') : (string)($editListing['region'] ?? ''); -$latValue = $editingEvent ? (string)($editEvent['lat'] ?? '') : (string)($editListing['lat'] ?? ''); -$lngValue = $editingEvent ? (string)($editEvent['lng'] ?? '') : (string)($editListing['lng'] ?? ''); -$visibilityValue = $editingEvent ? (string)($editEvent['visibility'] ?? 'public') : (string)($editListing['visibility'] ?? 'public'); -$categorySlugValue = $editingEvent ? (string)($editEvent['category_slug'] ?? '') : (string)($editListing['category_slug'] ?? ''); +$descriptionValue = $editingEvent ? (string)($editEvent['description'] ?? '') : (!empty($eventDraftValues['description']) ? (string)$eventDraftValues['description'] : (string)($editListing['description'] ?? '')); +$streetValue = $editingEvent ? (string)($editEvent['street'] ?? '') : (isset($eventDraftValues['street']) ? (string)$eventDraftValues['street'] : (string)($editListing['street'] ?? '')); +$zipValue = $editingEvent ? (string)($editEvent['zip'] ?? '') : (isset($eventDraftValues['zip']) ? (string)$eventDraftValues['zip'] : (string)($editListing['zip'] ?? '')); +$cityValue = $editingEvent ? (string)($editEvent['city'] ?? '') : (isset($eventDraftValues['city']) ? (string)$eventDraftValues['city'] : (string)($editListing['city'] ?? '')); +$regionValue = $editingEvent ? (string)($editEvent['region'] ?? '') : (isset($eventDraftValues['region']) ? (string)$eventDraftValues['region'] : (string)($editListing['region'] ?? '')); +$latValue = $editingEvent ? (string)($editEvent['lat'] ?? '') : (isset($eventDraftValues['lat']) ? (string)$eventDraftValues['lat'] : (string)($editListing['lat'] ?? '')); +$lngValue = $editingEvent ? (string)($editEvent['lng'] ?? '') : (isset($eventDraftValues['lng']) ? (string)$eventDraftValues['lng'] : (string)($editListing['lng'] ?? '')); +$visibilityValue = $editingEvent ? (string)($editEvent['visibility'] ?? 'public') : (!empty($eventDraftValues['visibility']) ? (string)$eventDraftValues['visibility'] : (string)($editListing['visibility'] ?? 'public')); +$categorySlugValue = $editingEvent ? (string)($editEvent['category_slug'] ?? '') : (!empty($eventDraftValues['category_slug']) ? (string)$eventDraftValues['category_slug'] : (string)($editListing['category_slug'] ?? '')); $imagePathValue = $editingEvent ? (string)($editEvent['image_path'] ?? '') : (string)($editListing['image_path'] ?? ''); -$capacityValue = $editingEvent ? (string)($editEvent['max_participants'] ?? '') : (string)($editListing['capacity_total'] ?? ''); +$capacityValue = $editingEvent ? (string)($editEvent['max_participants'] ?? '') : (isset($eventDraftValues['max_participants']) ? (string)$eventDraftValues['max_participants'] : (string)($editListing['capacity_total'] ?? '')); $phoneValue = $editingListing ? (string)($editListing['phone'] ?? '') : ''; $websiteValue = $editingListing ? (string)($editListing['website_url'] ?? '') : ''; $specialConditionsValue = $editingListing ? (string)($editListing['special_conditions_note'] ?? '') : ''; @@ -58,15 +66,11 @@ $categoryTitleMap = []; foreach (($listingCategories ?? []) as $categoryRow) { $categoryTitleMap[(string)($categoryRow['slug'] ?? '')] = (string)($categoryRow['title'] ?? ''); } -$categoryInputValue = $categoryTitleMap[$categorySlugValue] ?? $categorySlugValue; -$eventLocationModeValue = $editingEvent ? (string)($editEvent['location_source_type'] ?? 'custom') : 'custom'; -$eventLocationSourceIdValue = $editingEvent && !empty($editEvent['location_source_listing_id']) ? (int)$editEvent['location_source_listing_id'] : 0; -$usesDatabaseEventLocation = $currentEntryKind === 'event' && $eventLocationModeValue !== 'custom'; -$eventAddressInfoValue = trim(implode(', ', array_filter([ - $streetValue, - trim($zipValue . ' ' . $cityValue), - $regionValue, -]))); +$categoryInputValue = !empty($eventDraftValues['category_input']) + ? (string)$eventDraftValues['category_input'] + : ($categoryTitleMap[$categorySlugValue] ?? $categorySlugValue); +$eventLocationModeValue = $editingEvent ? (string)($editEvent['location_source_type'] ?? 'custom') : (!empty($eventDraftValues['event_location_mode']) ? (string)$eventDraftValues['event_location_mode'] : 'custom'); +$eventLocationSourceIdValue = $editingEvent && !empty($editEvent['location_source_listing_id']) ? (int)$editEvent['location_source_listing_id'] : (!empty($eventDraftValues['event_location_source_id']) ? (int)$eventDraftValues['event_location_source_id'] : 0); $eventLocationPlaceOptions = []; $eventLocationEditorialOptions = []; foreach (($eventLocationOptions ?? []) as $locationOption) { @@ -83,13 +87,24 @@ foreach (($eventLocationOptions ?? []) as $locationOption) { (string)($locationOption['street'] ?? ''), trim((string)($locationOption['zip'] ?? '') . ' ' . (string)($locationOption['city'] ?? '')), ]))); - $optionDateLabel = !empty($locationOption['starts_at']) ? date('d.m.Y', strtotime((string)$locationOption['starts_at'])) : ''; if ($eventLocationModeValue !== 'custom' && !empty($locationOption['category_title'])) { $categoryInputValue = (string)$locationOption['category_title']; $categorySlugValue = (string)($locationOption['category_slug'] ?? $categorySlugValue); + $streetValue = (string)($locationOption['street'] ?? $streetValue); + $zipValue = (string)($locationOption['zip'] ?? $zipValue); + $cityValue = (string)($locationOption['city'] ?? $cityValue); + $regionValue = (string)($locationOption['region'] ?? $regionValue); + $latValue = (string)($locationOption['lat'] ?? $latValue); + $lngValue = (string)($locationOption['lng'] ?? $lngValue); } break; } +$usesDatabaseEventLocation = $currentEntryKind === 'event' && $eventLocationModeValue !== 'custom'; +$eventAddressInfoValue = trim(implode(', ', array_filter([ + $streetValue, + trim($zipValue . ' ' . $cityValue), + $regionValue, +]))); $priceRows = []; if ($editingListing && !empty($editListing['prices']) && is_array($editListing['prices'])) { foreach ($editListing['prices'] as $priceRow) { @@ -1127,7 +1142,7 @@ if (!empty($canManageSystemSettings)) {

-
+ @@ -1204,8 +1219,8 @@ if (!empty($canManageSystemSettings)) {
- Neuen Ort anlegen - Neue Veranstaltung anlegen + +
> @@ -1405,6 +1420,11 @@ if (!empty($canManageSystemSettings)) {
+ + + +
+