Führe die zentrale Pflege redaktioneller Stammdaten ein
CI Feature / test (push) Successful in 1m12s
Deploy Test / test (push) Successful in 1m7s
Deploy Test / deploy (push) Successful in 23s

FACH-56 bis FACH-58: Arbeitsplatz „Redaktionelle Stammdaten“ für fachliche
Materialarten, Altersbereich und Zielgruppe, Einsatzbereiche und
Verwendungszwecke (bestehende Tabellen; Säulen bleiben in ihrer Verwaltung).

- Migration (nur Ergänzungen): aktiv/inaktiv für Materialarten und Werte,
  Reihenfolge der Werte, zulässige Objektkontexte der Materialarten, einmalig
  aus dem Bestand abgeleitet; jede vorhandene Zuordnung bleibt zulässig.
- EditorialVocabulary als eine Regelquelle für Redaktion (Medium, Modul,
  Programm, Lizenzartikel), Medien- und Kompositionsfilter, Picker und
  Mitgliederbibliothek: neu wählbar nur aktive, kontextgerechte Werte;
  vorhandene inaktive Zuordnungen sichtbar und beim Speichern erhalten;
  serverseitige Prüfung der Materialart.
- Kennung fest, Bezeichnung pflegbar; verwendete Werte nur deaktivierbar;
  Systemkennungen (programm, modul, traineranleitung) geschützt.
- „Inhaltsart“ heißt durchgängig „Fachliche Materialart“; der Picker trennt
  Medienart und fachliche Materialart und filtert danach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-20 21:18:03 +01:00
1 parent c84ae10809
commit f774d43647
24 files changed
+1543 -91

No files matched your search

+36 -2
View File
@@ -4,6 +4,7 @@
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\EditorialVocabulary;
use App\Domain\Cms\Catalog\PublicMaterialReader;
use App\Domain\Cms\Widgets\Support\WebsiteImage;
use App\Http\Controllers\ContentPreviewController;
@@ -26,6 +27,9 @@ trait ChoosesMedia
public string $pickerDimension = '';
/** Filter „Fachliche Materialart“ (Kennung), gleiche Regel wie Medieneditor und Medienfilter. */
public string $pickerMaterialart = '';
public string $pickerInspected = '';
public string $pickerSelected = '';
@@ -99,15 +103,16 @@ public function pickerResult(): array
}
if ($this->pickerPurpose === 'aufbau') {
return app(EditorialCatalog::class)->browse(
return $this->filterByMaterialart(app(EditorialCatalog::class)->browse(
$this->pickerQuery,
$this->pickerKind,
$this->pickerDimension,
$this->pickerExceptId(),
);
));
}
$result = app(EditorialCatalog::class)->presentationBrowse($this->pickerQuery, $this->pickerKind);
$result = $this->filterByMaterialart($result);
// CMS: nur Bilder, die als Website-Bild wählbar sind (keine vertraulichen Arten, nicht archiviert).
if ($this->pickerPurpose === 'website-bild') {
@@ -159,6 +164,7 @@ public function pickerDetail(): ?array
$row['released'] = $element->website_released_at !== null;
$row['output_label'] = PublicMaterialReader::outputLabel((string) $element->output_class);
$row['pillars'] = $element->pillars->pluck('name')->all();
$row['material'] = $element->editorialContentKind?->label;
$row['usage'] = app(CatalogReading::class)->elementUsage($element);
}
@@ -198,10 +204,38 @@ protected function resetPicker(string $purpose): void
$this->pickerOpen = true;
$this->pickerQuery = '';
$this->pickerDimension = '';
$this->pickerMaterialart = '';
$this->pickerInspected = '';
$this->pickerSelected = '';
$this->pickerMarked = [];
$this->replacingKey = null;
$this->bindToVersion = false;
}
/**
* Fachliche Materialarten, nach denen der Picker Medien eingrenzen kann (Kontext Medium).
*
* @return array<string, string>
*/
public function pickerMaterialarten(): array
{
return app(EditorialVocabulary::class)->kindFilterOptions('medium', $this->pickerMaterialart);
}
/**
* @param array{items: list<array<string, mixed>>, more: bool} $result
* @return array{items: list<array<string, mixed>>, more: bool}
*/
private function filterByMaterialart(array $result): array
{
if (! ctype_digit($this->pickerMaterialart)) {
return $result;
}
$ids = array_values(array_filter(array_map(fn (array $item): int => (int) ($item['element_id'] ?? 0), $result['items'])));
$passend = ContentElement::query()->whereKey($ids)->where('editorial_content_kind_id', (int) $this->pickerMaterialart)->pluck('id')->map(fn ($id): int => (int) $id)->all();
$result['items'] = array_values(array_filter($result['items'], fn (array $item): bool => in_array((int) ($item['element_id'] ?? 0), $passend, true)));
return $result;
}
}