Vereinheitliche die fachlichen Säulen auf die zentrale Säulenverwaltung
CI Feature / test (push) Successful in 1m34s
Deploy Test / test (push) Successful in 1m29s
Deploy Test / deploy (push) Successful in 29s

Module, Programme und Lizenzartikel verwenden wie Medien und Seiten die Tabelle
pillars; die Kopie „Fachliche Säule“ in den redaktionellen Dimensionen wird nirgends
mehr angeboten, geändert oder gefiltert und bleibt nur als Verlauf erhalten.

- Migration (nur Ergänzungen): composition_pillar und license_article_pillar mit
  restrictOnDelete, pillar_id an den alten Dimensionswerten als dokumentierte
  Abbildung, einmalige wiederholbare Übernahme (LegacyPillarAdoption).
- Übernahme nur über die gespeicherte Kennung pfeiler-<Nummer> und nur direkte
  Zuordnungen; mehrdeutige, abgeleitete und verwaiste Fälle werden gemeldet, nicht
  geraten. Medien bleiben bei ihrer Zuordnung. Alte Zeilen bleiben unverändert.
  Befehl: php artisan luf:saeulen-uebernehmen [--dry-run].
- Editoren von Modul, Programm und Lizenzartikel wählen Säulen aus der Säulenverwaltung;
  PillarService::assign gilt für alle Objektarten, Löschschutz zählt alle Objektarten.
- Filter: Module und Programme, Aufbau-Picker und Mitgliederbibliothek nach der
  Säulenzuordnung; alte Adressen mit einem Säulenwert der Einordnung folgen der Säule.
- Abgeleitete Säulen (aus enthaltenen Medien) bleiben getrennt von direkten.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-21 10:11:42 +01:00
1 parent d5c2b34b9d
commit 7c48a6480c
25 files changed
+1250 -44

No files matched your search

@@ -22,6 +22,7 @@
use App\Domain\Cms\Catalog\PublicCatalogReader;
use App\Domain\Cms\Widgets\RenderContext;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\AssignsPillars;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\ManagesEditorialSurface;
use App\Filament\Support\MediumForm;
@@ -43,6 +44,7 @@
abstract class EditComposition extends EditRecord
{
use AssignsPillars;
use ManagesEditorialSurface;
use WithFileUploads;
@@ -398,11 +400,15 @@ public function redaktionTexteHinweis(): string
*/
public function einordnungGruppen(): array
{
return array_map(fn (array $group): array => [
$groups = array_map(fn (array $group): array => [
'legend' => $group['label'],
'model' => 'dimensionIds',
'values' => $group['values'],
], $this->dimensionGroups());
$pillars = $this->pillarGroup();
return $pillars === null ? $groups : [$pillars, ...$groups];
}
/**
@@ -466,7 +472,7 @@ public function einordnungUnsaved(): bool
sort($stored);
sort($current);
return $stored !== $current;
return $stored !== $current || $this->pillarsUnsaved($record);
}
public function openText(): void
@@ -1654,6 +1660,7 @@ protected function fillRedaktion(): void
->pluck('editorial_dimension_value_id')
->map(fn (mixed $id): string => (string) (int) $id)
->all();
$this->loadPillarIds($composition);
}
/**
@@ -1913,6 +1920,7 @@ protected function persistRedaktion(): bool
'description' => $this->description,
], $this->actor());
$this->syncDimensions($record, array_map(intval(...), $this->dimensionIds));
$this->persistPillarIds($record);
$record->refresh();
$this->getRecord()->setRawAttributes($record->getAttributes());
@@ -3,6 +3,7 @@
namespace App\Filament\Resources\ContentElements\Pages;
use App\Domain\Catalog\EditorialVocabulary;
use App\Domain\Catalog\PillarFilterCompat;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Support\Bestand;
use App\Filament\Support\MediaLibrary;
@@ -170,6 +171,11 @@ public function resetFilters(): void
*/
public function bestand(): array
{
// Alte Adressen mit einem Säulenwert der Einordnung gelten für die zentrale Säule.
if (ctype_digit($this->einordnung) && $this->saeule === '' && is_int($pillar = PillarFilterCompat::pillarOfLegacyValue((int) $this->einordnung))) {
[$this->saeule, $this->einordnung] = [(string) $pillar, ''];
}
$optionen = fn (array $liste, string $wert, string $label): array => collect($liste)
->mapWithKeys(fn (array $eintrag): array => [(string) $eintrag[$wert] => $eintrag[$label]])
->all();
@@ -16,6 +16,7 @@
use App\Domain\Catalog\LicenseArticle;
use App\Filament\Resources\ContentElements\ContentElementResource;
use App\Filament\Resources\LicenseArticles\LicenseArticleResource;
use App\Filament\Support\AssignsPillars;
use App\Filament\Support\CatalogOptions;
use App\Filament\Support\EditorialCatalog;
use App\Filament\Support\ManagesEditorialSurface;
@@ -30,6 +31,7 @@
class ViewLicenseArticle extends ViewRecord
{
use AssignsPillars;
use ManagesEditorialSurface;
use ReportsDomainRules;
@@ -115,6 +117,7 @@ protected function saveRedaktionTexte(): bool
], auth()->user());
app(IdentityDimension::class)->replaceOffered($article, array_map(intval(...), $this->dimensionIds));
$this->persistPillarIds($article);
$article->refresh();
$this->fillLicenseEditorial();
@@ -159,7 +162,7 @@ public function einordnungUnsaved(): bool
sort($stored);
sort($current);
return $stored !== $current;
return $stored !== $current || $this->pillarsUnsaved($article);
}
/**
@@ -270,11 +273,15 @@ public function einordnungArt(): array
*/
public function einordnungGruppen(): array
{
return array_map(fn (array $group): array => [
$groups = array_map(fn (array $group): array => [
'legend' => $group['label'],
'model' => 'dimensionIds',
'values' => $group['values'],
], $this->licenseDimensionGroups());
$pillars = $this->pillarGroup();
return $pillars === null ? $groups : [$pillars, ...$groups];
}
private function sourceTitle(Model $source): string
@@ -312,6 +319,7 @@ private function fillLicenseEditorial(): void
->where('origin', 'direkt')
->pluck('editorial_dimension_value_id')
->all();
$this->loadPillarIds($article);
}
protected function getHeaderActions(): array
@@ -22,7 +22,7 @@ class ListPillars extends ListRecords
public function getSubheading(): string|Htmlable|null
{
return 'Die fachlichen Säulen des Materials. Eine veröffentlichte Säule ist ein Themenbereich der Website. Ein Medium und eine Seite können mehreren Säulen zugeordnet sein.';
return 'Die fachlichen Säulen des Materials. Eine veröffentlichte Säule ist ein Themenbereich der Website. Medien, Module, Programme, Lizenzartikel und Seiten können mehreren Säulen zugeordnet sein. Hier ist die einzige Pflegestelle der Säulen.';
}
protected function getHeaderActions(): array
@@ -50,11 +50,28 @@ protected function getHeaderActions(): array
];
}
/**
* Zuordnungen aller Objektarten; ohne Zuordnung wie bisher „0 Medien“.
*/
private function usageLabel(PillarService $service, Pillar $pillar): string
{
$usage = [
'medien' => (int) $pillar->elements_count,
'zusammenstellungen' => (int) $pillar->compositions_count,
'lizenzartikel' => (int) $pillar->license_articles_count,
'seiten' => (int) $pillar->pages_count,
];
return array_sum($usage) === 0 ? '0 Medien' : $service->usageText($usage);
}
protected function catalogRows(): array
{
$rows = [];
foreach (Pillar::query()->withCount('elements')->orderBy('sort_order')->orderBy('name')->get() as $pillar) {
$service = app(PillarService::class);
foreach (Pillar::query()->withCount(['elements', 'compositions', 'licenseArticles', 'pages'])->orderBy('sort_order')->orderBy('name')->get() as $pillar) {
$public = $pillar->published_at !== null;
$url = PillarResource::getUrl('edit', ['record' => $pillar]);
$rows[] = [
@@ -66,7 +83,7 @@ protected function catalogRows(): array
'url' => $url,
'chips' => [
$public ? ['label' => 'Auf der Website veröffentlicht', 'ton' => 'gut'] : ['label' => 'Intern', 'ton' => 'leise'],
['label' => $pillar->elements_count === 1 ? '1 Medium' : $pillar->elements_count.' Medien', 'ton' => 'neutral'],
['label' => $this->usageLabel($service, $pillar), 'ton' => 'neutral'],
],
'zustand' => [$public ? 'oeffentlich' : 'intern'],
'aktionen' => [['label' => 'Bearbeiten', 'href' => $url, 'icon' => 'stift']],