diff --git a/Internal/db/schema.sql b/Internal/db/schema.sql index 606b033..008cce9 100755 --- a/Internal/db/schema.sql +++ b/Internal/db/schema.sql @@ -82,6 +82,8 @@ CREATE TABLE events ( category_slug VARCHAR(120) NULL, image_path VARCHAR(255) NULL, location_label VARCHAR(180) NULL, + location_source_type ENUM('custom','place','editorial_event') NOT NULL DEFAULT 'custom', + location_source_listing_id BIGINT UNSIGNED NULL, street VARCHAR(180) NULL, zip CHAR(5) NULL, city VARCHAR(120) NULL, diff --git a/Internal/de/PROJECT_CONTEXT.md b/Internal/de/PROJECT_CONTEXT.md index 31c64c8..7df7250 100644 --- a/Internal/de/PROJECT_CONTEXT.md +++ b/Internal/de/PROJECT_CONTEXT.md @@ -24,7 +24,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter. Kernbereiche sind l - Der Bereich `Events` ist wieder auf echte eigene Events und Event-Teilnahmen begrenzt. - Der Bereich `Events` bietet zusätzlich einen manuellen ICS-Export und einen persönlichen abonnierbaren Kalender-Feed für alle eigenen Events und Event-Teilnahmen. - Der Bereich `Events` ist im UI in `Meine Events`, `Kalendersynchronisation` und `Abgelaufene Events` getrennt, damit aktive Events, Kalender-Themen und Vergangenes sauber getrennt bleiben. -- In `Meine Events` sitzt der Button `Neues Event anlegen` direkt in der Box `Eigene Events`; die bisherige Teilnahme-Box heißt jetzt `Angemeldete Events` und enthält zusätzlich einen direkten Link zur `Event Suche`. +- In `Meine Events` sitzt der Button `Neues Event anlegen` jetzt direkt in der oberen Tab-Zeile; die bisherige Teilnahme-Box heißt `Angemeldete Events` und enthält zusätzlich einen direkten Link zur `Event Suche`. - Orte und Veranstaltungen sind vorerst in einen separaten Mitgliederbereichspunkt `Orte & Veranstaltungen` verschoben. - In `Orte & Veranstaltungen` können Nutzer dauerhafte Orte und zeitlich begrenzte Veranstaltungen neu anlegen. - Neue Orte und Veranstaltungen bleiben bis zur Freigabe im Status `wartet auf Freigabe` und werden erst danach systemweit veröffentlicht. @@ -32,8 +32,12 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter. Kernbereiche sind l - Vorschläge für neue Orte und Veranstaltungen dürfen schon vor der Freigabe als Ortsvorschlag für Events genutzt werden, solange sie noch offen geprüft werden. - Dubletten bei Orten und Veranstaltungen sollen serverseitig mindestens über Namen und Adresse abgefangen werden. - Die Eingabe im Bereich `Events` soll so einfach wie möglich bleiben und zeigt deshalb nur die für echte Termine relevanten Felder. +- Eigene Events nutzen jetzt als Pflichtfelder nur noch Titel, Datum und `Mit Kindern`; die Beschreibung ist optional. +- Für die Event-Location gibt es jetzt die Auswahl `Ort aus Datenbank`, `Veranstaltung aus Datenbank` oder `Benutzerdefiniert`. +- Bei `Ort` oder `Veranstaltung` werden Adresse und Kategorie direkt aus dem gewählten Datenbank-Eintrag übernommen. +- 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 Kategorie, optionales Bild, Ja/Nein-Angabe `Mit Kindern`, optionale Platzzahl und direkte Karten-/Adress-Synchronisierung. +- Eigene Events unterstützen optionalen Beschreibungstext, Ja/Nein-Angabe `Mit Kindern`, optionale Platzzahl, optionales Bild sowie eine Location aus Datenbank oder benutzerdefinierte Adresse. ## Technischer Rahmen - eigener Front-Controller in `public/index.php` diff --git a/Internal/de/PROJECT_STRUCTURE.md b/Internal/de/PROJECT_STRUCTURE.md index eeb0db3..7902057 100644 --- a/Internal/de/PROJECT_STRUCTURE.md +++ b/Internal/de/PROJECT_STRUCTURE.md @@ -17,6 +17,7 @@ Stand: 2026-08-10 - Avatar-Verwaltung: `src/App/Avatar/AvatarManager.php` - aktive Styles: `src/App/Avatar/Lorelei.php`, `src/App/Avatar/Croodles.php` - Profil-/Kinder-/Event-/Ausflugsziel-Logik im Mitgliederbereich: `partials/landing/account/dashboard.php` +- Event-Quellen aus Datenbank plus Speicherung der Event-Location-Herkunft: `partials/landing/account/dashboard.php`, `src/App/AccountPages.php`, `Internal/db/schema.sql` - Consent- und rechtliche Texte: `public/page/datenschutz.php` - System-Einstellungen: `src/App/SystemSettings.php` - neue Listing-/Ort-Basis: `src/App/ListingCatalog.php` diff --git a/Internal/de/README.md b/Internal/de/README.md index 4dfeed4..08d1fac 100644 --- a/Internal/de/README.md +++ b/Internal/de/README.md @@ -23,7 +23,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter mit Fokus auf lokale - System-Sektion für Seiten-Admins mit Wartungs- und Diensteschaltern - neue Datenbasis für ein späteres Termin-, Ort- und Veranstaltungssystem angelegt - Mitgliederbereich `Events` ist wieder auf echte eigene Events und Event-Teilnahmen fokussiert -- Eigene Events haben jetzt Kategorie, optionales Bild, klare Kinderangabe, optionale Platzzahl und eine direktere Karten-/Adress-Synchronisierung +- Eigene Events haben jetzt optionalen Beschreibungstext, klare Kinderangabe, optionale Platzzahl, optionales Bild sowie eine Location aus Datenbank oder benutzerdefinierte Adresse - 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 44d61b3..36ce8d2 100644 --- a/Internal/en/PROJECT_CONTEXT.md +++ b/Internal/en/PROJECT_CONTEXT.md @@ -24,7 +24,7 @@ Papa-Kind-Treff is a PHP-based platform for fathers. Core areas are local events - The `Events` area is limited again to real own events and event participations. - The `Events` area now also provides a manual ICS export and a personal subscribable calendar feed for all own events and event participations. - The `Events` area is now separated in the UI into `My Events`, `Calendar Sync`, and `Expired Events` so that active events, calendar tasks, and past items stay clearly separated. -- Inside `My Events`, the `Create New Event` button now lives directly in the `Own Events` box; the previous participation box is now labeled `Registered Events` and also includes a direct link to `Event Search`. +- Inside `My Events`, the `Create New Event` button now lives directly in the upper tab row; the previous participation box is now labeled `Registered Events` and also includes a direct link to `Event Search`. - Places and event-like entries were moved for now into a separate member-area section `Places & Events`. - Inside `Places & Events`, users can create permanent places and time-limited event-style entries. - New places and event-style entries stay in a pending state until an admin approves them for publication. @@ -32,8 +32,12 @@ Papa-Kind-Treff is a PHP-based platform for fathers. Core areas are local events - Pending new places and event-style entries can already be used as location suggestions for events while they are still under review. - Duplicate submissions for places and event-style entries should be blocked server-side at least by name and address. - The `Events` input flow should stay as simple as possible and therefore only shows fields relevant for real scheduled events. +- Own events now only require title, date, and the `with children` choice; the description is optional. +- Event locations now support the modes `place from database`, `event from database`, or `custom`. +- When a database-backed place or event is selected, the address and category are taken directly from that source entry. +- 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 category, optional image, a clear `with children` yes/no field, optional capacity, and direct map/address synchronization. +- 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. ## Technical Frame - custom front controller in `public/index.php` diff --git a/Internal/en/PROJECT_STRUCTURE.md b/Internal/en/PROJECT_STRUCTURE.md index 97fae36..8b78bf0 100644 --- a/Internal/en/PROJECT_STRUCTURE.md +++ b/Internal/en/PROJECT_STRUCTURE.md @@ -17,6 +17,7 @@ Updated: 2026-08-10 - avatar management: `src/App/Avatar/AvatarManager.php` - active avatar styles: `src/App/Avatar/Lorelei.php`, `src/App/Avatar/Croodles.php` - profile/children/event/outing logic inside member area: `partials/landing/account/dashboard.php` +- database-backed event location sources plus persisted event location origin: `partials/landing/account/dashboard.php`, `src/App/AccountPages.php`, `Internal/db/schema.sql` - consent and legal texts: `public/page/datenschutz.php` - system settings: `src/App/SystemSettings.php` - new listing/place base: `src/App/ListingCatalog.php` diff --git a/Internal/en/README.md b/Internal/en/README.md index 1cbcb81..b70e5cc 100644 --- a/Internal/en/README.md +++ b/Internal/en/README.md @@ -23,7 +23,7 @@ Papa-Kind-Treff is a PHP-based platform for fathers focused on local events, app - system section for site admins with maintenance and service toggles - new data foundation prepared for a broader event, place, and listing system - member area `Events` is now limited again to real own events and event participations -- own events now include category, optional image, explicit child suitability, optional capacity, and more direct map/address synchronization +- 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 - 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 6e1d469..0f05486 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter mit Fokus auf: - Im Mitgliederbereich ist `Events` jetzt wieder auf echte eigene Events und Event-Teilnahmen beschränkt - Orte und sonstige Veranstaltungen laufen jetzt separat unter `Orte & Veranstaltungen` - Neue Orte und Veranstaltungen müssen vor Veröffentlichung erst durch einen Admin freigegeben werden; Änderungs- und Löschwünsche laufen ebenfalls als begründete Anfrage -- Eigene Events unterstützen aktuell Kategorie, Bild-Upload, klare Kinderangabe, optionale Platzzahl und direkte Karten-/Adress-Synchronisierung +- Eigene Events unterstützen aktuell optionalen Beschreibungstext, klare Kinderangabe, optionale Platzzahl, Bild-Upload sowie eine Location aus Datenbank oder benutzerdefinierte Adresse - 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 166539f..af9bf4f 100755 --- a/partials/landing/account/dashboard.php +++ b/partials/landing/account/dashboard.php @@ -54,6 +54,31 @@ 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; +$eventLocationSourceInputValue = ''; +foreach (($eventLocationOptions ?? []) as $locationOption) { + if ((int)($locationOption['id'] ?? 0) !== $eventLocationSourceIdValue) { + continue; + } + $optionTypeLabel = (string)($locationOption['listing_type'] ?? '') === 'place' ? 'Ort' : 'Veranstaltung'; + $optionAddressLabel = trim(implode(', ', array_filter([ + (string)($locationOption['street'] ?? ''), + trim((string)($locationOption['zip'] ?? '') . ' ' . (string)($locationOption['city'] ?? '')), + ]))); + $optionDateLabel = !empty($locationOption['starts_at']) ? date('d.m.Y', strtotime((string)$locationOption['starts_at'])) : ''; + $eventLocationSourceInputValue = trim(implode(' · ', array_filter([ + $optionTypeLabel, + (string)($locationOption['title'] ?? ''), + $optionDateLabel, + $optionAddressLabel, + ]))); + if ($eventLocationModeValue !== 'custom' && !empty($locationOption['category_title'])) { + $categoryInputValue = (string)$locationOption['category_title']; + $categorySlugValue = (string)($locationOption['category_slug'] ?? $categorySlugValue); + } + break; +} $priceRows = []; if ($editingListing && !empty($editListing['prices']) && is_array($editListing['prices'])) { foreach ($editListing['prices'] as $priceRow) { @@ -1100,6 +1125,7 @@ if (!empty($canManageSystemSettings)) { + +
Die Kurzbeschreibung wird automatisch aus dem Text erzeugt.
+ +Neue Orte und Veranstaltungen werden erst nach Prüfung durch einen Admin freigegeben.
-Wird zur Karten-/Umkreissuche genutzt.