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

@@ -7,8 +7,7 @@
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\EditorialContentKind;
use App\Domain\Catalog\EditorialDimension;
use App\Domain\Catalog\EditorialVocabulary;
use App\Domain\Catalog\IdentityDimension;
use App\Domain\Catalog\IdentityDimensionValue;
use App\Domain\Catalog\IdentityProfile;
@@ -74,8 +73,8 @@ public function form(Schema $schema): Schema
->helperText('Erscheint in der Bibliothek. Leer lässt den Arbeitstitel stehen. Speichern legt keine Fassung an.'),
Textarea::make('summary')->label('Kurzbeschreibung')->rows(3),
Select::make('editorial_content_kind_id')
->label('Inhaltsart')
->options(fn (): array => EditorialContentKind::selectOptions())
->label('Fachliche Materialart')
->options(fn (): array => app(EditorialVocabulary::class)->kindOptions('medium', $this->getRecord()->editorial_content_kind_id !== null ? (int) $this->getRecord()->editorial_content_kind_id : null))
->nullable()
->helperText('Optional für Bibliothek und Website. Ändert weder die Ausgabeart noch eine Fassung.'),
Placeholder::make('usage')->label('Verwendung')->content(function (): HtmlString {
@@ -103,9 +102,12 @@ public function form(Schema $schema): Schema
CheckboxList::make('dimension_ids')->label('Fachliche Einordnung')
->options(function (): array {
$options = [];
foreach (EditorialDimension::forSubject($this->getRecord()) as $dimension) {
foreach ($dimension->values as $value) {
$options[$value->id] = $dimension->label.': '.$value->label;
foreach (app(EditorialVocabulary::class)->dimensionGroups($this->getRecord(), IdentityDimensionValue::query()
->where('subject_type', $this->getRecord()->getMorphClass())
->where('subject_id', $this->getRecord()->getKey())
->pluck('editorial_dimension_value_id')->map(fn ($id): int => (int) $id)->all()) as $dimension) {
foreach ($dimension['values'] as $value) {
$options[$value['id']] = $dimension['label'].': '.$value['label'];
}
}
@@ -2,7 +2,7 @@
namespace App\Filament\Resources\ContentElements\Pages;
use App\Domain\Catalog\EditorialContentKind;
use App\Domain\Catalog\EditorialVocabulary;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\Bestand;
use App\Filament\Support\MediaLibrary;
@@ -121,7 +121,7 @@ public function pillarOptions(): array
*/
public function classificationOptions(): array
{
return app(MediaLibrary::class)->classifications();
return app(MediaLibrary::class)->classifications(ctype_digit($this->einordnung) ? [(int) $this->einordnung] : []);
}
/**
@@ -129,7 +129,7 @@ public function classificationOptions(): array
*/
public function contentKindOptions(): array
{
return EditorialContentKind::selectOptions();
return app(EditorialVocabulary::class)->kindFilterOptions('medium', $this->inhaltsart);
}
public function filtersActive(): bool
@@ -7,8 +7,7 @@
use App\Domain\Catalog\ContentService;
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\DomainRuleException;
use App\Domain\Catalog\EditorialContentKind;
use App\Domain\Catalog\EditorialDimension;
use App\Domain\Catalog\EditorialVocabulary;
use App\Domain\Catalog\IdentityChange;
use App\Domain\Catalog\IdentityDimension;
use App\Domain\Catalog\IdentityDimensionValue;
@@ -648,6 +647,19 @@ protected function saveRedaktionTexte(): bool
return false;
}
$kindError = app(EditorialVocabulary::class)->kindError(
'medium',
filled($this->kindId) ? (int) $this->kindId : null,
$element->editorial_content_kind_id !== null ? (int) $element->editorial_content_kind_id : null,
);
if ($kindError !== null) {
$this->deskFeedback = $kindError;
$this->redaktionFehlerFeld = 'kindId';
return false;
}
$this->versionsBeforeSave = $element->versions()->count();
app(IdentityProfile::class)->fill($element, [
'working_title' => $title,
@@ -776,8 +788,8 @@ public function einordnungArt(): array
{
return [
'model' => 'kindId',
'options' => EditorialContentKind::selectOptions(),
'hilfe' => 'Fachliche Materialart, unabhängig von der Dateiart.',
'options' => app(EditorialVocabulary::class)->kindOptions('medium', $this->getRecord()->editorial_content_kind_id !== null ? (int) $this->getRecord()->editorial_content_kind_id : null),
'hilfe' => 'Fachliche Materialart, unabhängig von der technischen Medienart.',
];
}
@@ -793,11 +805,14 @@ public function einordnungGruppen(): array
->map(fn (Pillar $pillar): array => ['id' => (int) $pillar->id, 'label' => (string) $pillar->name])->all(),
]];
foreach (EditorialDimension::forSubject($this->getRecord()) as $dimension) {
foreach (app(EditorialVocabulary::class)->dimensionGroups($this->getRecord(), IdentityDimensionValue::query()
->where('subject_type', $this->getRecord()->getMorphClass())
->where('subject_id', $this->getRecord()->getKey())
->pluck('editorial_dimension_value_id')->map(fn ($id): int => (int) $id)->all()) as $dimension) {
$groups[] = [
'legend' => (string) $dimension->label,
'legend' => $dimension['label'],
'model' => 'dimensionIds',
'values' => collect($dimension->values)->map(fn ($value): array => ['id' => (int) $value->id, 'label' => (string) $value->label])->all(),
'values' => $dimension['values'],
];
}
@@ -1014,7 +1029,7 @@ public function editorialHistory(): array
'thumbnail_alt' => 'Alternativtext',
'thumbnail_path' => 'Vorschaubild',
'thumbnail_source' => 'Herkunft des Vorschaubilds',
'editorial_content_kind_id' => 'Inhaltsart',
'editorial_content_kind_id' => 'Fachliche Materialart',
];
return IdentityChange::query()