This commit is contained in:
@@ -54,6 +54,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter. Kernbereiche sind l
|
||||
- Kategorien liegen nicht mehr unter `System`, sondern in einem eigenen Mitgliederbereichspunkt `Kategorien`; dort werden nur neue Kategorien angezeigt und per Vorschlagsfeld mit bestehenden Kategorien aus der Datenbank zusammengeführt.
|
||||
- Neue Kategorien bleiben dort sichtbar, bis sie von einem Berechtigten bestätigt oder mit einer bestehenden Kategorie zusammengeführt werden.
|
||||
- Im Bereich `Kategorien` gibt es zusätzlich eine Suche über bestehende Kategorien, damit sie gezielt gefunden und zusammengeführt werden können.
|
||||
- Beim Zusammenführen wird die nicht zu behaltende Kategorie anschließend vollständig entfernt und die Ansicht danach frisch neu geladen.
|
||||
- Beim Zusammenführen kann explizit festgelegt werden, welche der beiden Kategorien erhalten bleibt.
|
||||
- Community-Level können zusätzlich die Rechte für Kategorien sowie für die Freigabe von Orten und Veranstaltungen tragen.
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ Papa-Kind-Treff is a PHP-based platform for fathers. Core areas are local events
|
||||
- Categories no longer live under `System`, but in their own member-area section `Categories`; that area only shows newly created categories and merges them into existing database categories through a suggestion field.
|
||||
- New categories remain visible there until an authorized user confirms them or merges them into an existing category.
|
||||
- The `Categories` area also includes a search across existing categories so they can be found and merged directly.
|
||||
- During merging, the category that should not be kept is removed completely and the view is reloaded fresh afterwards.
|
||||
- During merging, it is now possible to explicitly choose which of the two categories should be kept.
|
||||
- Community levels can now additionally carry the rights for category handling as well as place and event approvals.
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ Papa-Kind-Treff ist eine PHP-basierte Plattform für Väter mit Fokus auf:
|
||||
- Kategorien wurden aus `System` in den eigenen Mitgliederbereichspunkt `Kategorien` verschoben; dort werden nur neue Kategorien angezeigt und per Vorschlagsfeld mit bestehenden Kategorien aus der Datenbank zusammengeführt
|
||||
- Neue Kategorien bleiben im Bereich `Kategorien` sichtbar, bis sie von einem Berechtigten bestätigt oder zusammengeführt werden
|
||||
- Im Bereich `Kategorien` gibt es zusätzlich eine Suche über bestehende Kategorien, damit sie gezielt gefunden und zusammengeführt werden können
|
||||
- Beim Zusammenführen wird die nicht zu behaltende Kategorie anschließend vollständig entfernt und die Ansicht danach frisch neu geladen
|
||||
- Beim Zusammenführen von Kategorien kann jetzt explizit festgelegt werden, welche der beiden Kategorien erhalten bleibt
|
||||
- Community-Level können jetzt zusätzlich die Rechte für Kategorien sowie für die Freigabe von Orten und Veranstaltungen tragen
|
||||
- neue interne Grundstruktur: `listing_places`, `listings`, `listing_occurrences`, `listing_prices`, `listing_benefits`
|
||||
|
||||
@@ -351,13 +351,15 @@ final class AccountPages
|
||||
$sourceCategorySlug,
|
||||
$targetCategorySlug
|
||||
);
|
||||
$info = 'Kategorie zusammengeführt.';
|
||||
$app->flash()->set('success', 'Kategorie zusammengeführt.');
|
||||
redirect('/dashboard?section=categories');
|
||||
} elseif ($action === 'category_confirm') {
|
||||
if (!$canManageCategories || !$listingCatalog) {
|
||||
throw new \RuntimeException('Keine Berechtigung für die Kategorien-Verwaltung.');
|
||||
}
|
||||
$listingCatalog->confirmCategory((string)($_POST['source_category_slug'] ?? ''));
|
||||
$info = 'Kategorie bestätigt.';
|
||||
$app->flash()->set('success', 'Kategorie bestätigt.');
|
||||
redirect('/dashboard?section=categories');
|
||||
} elseif ($action === 'child_add' || $action === 'child_update') {
|
||||
$crypto = self::requireCrypto($crypto, 'Kinder');
|
||||
$childId = (int)($_POST['child_id'] ?? 0);
|
||||
|
||||
@@ -385,7 +385,7 @@ final class ListingCatalog
|
||||
throw new \RuntimeException('Bitte zwei unterschiedliche Kategorien auswählen.');
|
||||
}
|
||||
|
||||
$lookup = $this->pdo->prepare('SELECT id, slug FROM listing_categories WHERE slug = :slug LIMIT 1');
|
||||
$lookup = $this->pdo->prepare('SELECT id, slug, title FROM listing_categories WHERE slug = :slug LIMIT 1');
|
||||
$lookup->execute(['slug' => $sourceSlug]);
|
||||
$source = $lookup->fetch(\PDO::FETCH_ASSOC);
|
||||
$lookup->execute(['slug' => $targetSlug]);
|
||||
@@ -396,6 +396,7 @@ final class ListingCatalog
|
||||
|
||||
$sourceId = (int)$source['id'];
|
||||
$targetId = (int)$target['id'];
|
||||
$sourceTitle = (string)($source['title'] ?? '');
|
||||
|
||||
$this->pdo->beginTransaction();
|
||||
try {
|
||||
@@ -420,7 +421,23 @@ final class ListingCatalog
|
||||
'target' => $targetSlug,
|
||||
'source' => $sourceSlug,
|
||||
]);
|
||||
$this->pdo->prepare('DELETE FROM listing_categories WHERE id = :id')->execute(['id' => $sourceId]);
|
||||
$deleteCategory = $this->pdo->prepare('DELETE FROM listing_categories WHERE id = :id');
|
||||
$deleteCategory->execute(['id' => $sourceId]);
|
||||
|
||||
$verifyStmt = $this->pdo->prepare(
|
||||
'SELECT COUNT(*)
|
||||
FROM listing_categories
|
||||
WHERE id = :id OR slug = :slug OR (LOWER(title) = LOWER(:title) AND id <> :targetId)'
|
||||
);
|
||||
$verifyStmt->execute([
|
||||
'id' => $sourceId,
|
||||
'slug' => $sourceSlug,
|
||||
'title' => $sourceTitle,
|
||||
'targetId' => $targetId,
|
||||
]);
|
||||
if ((int)$verifyStmt->fetchColumn() > 0) {
|
||||
throw new \RuntimeException('Die alte Kategorie konnte nicht vollständig entfernt werden.');
|
||||
}
|
||||
$this->pdo->commit();
|
||||
} catch (\Throwable $e) {
|
||||
if ($this->pdo->inTransaction()) {
|
||||
|
||||
Reference in New Issue
Block a user