Mache Medien, Übungen und Kurse in der Verwaltung bearbeitbar.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4f2e5a5f3b
commit
3ee9f529ca
33 files changed
+1105
-284
No files matched your search
@@ -7,6 +7,7 @@
|
||||
use App\Domain\Catalog\BundleStatus;
|
||||
use App\Domain\Catalog\BundleVersion;
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\CompositionMember;
|
||||
use App\Domain\Catalog\ContentElement;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
@@ -263,7 +264,7 @@ public function elementUsage(ContentElement $element): array
|
||||
->get();
|
||||
|
||||
foreach ($members as $member) {
|
||||
$lines[] = 'Komposition '.$member->compositionVersion->composition->designation
|
||||
$lines[] = self::compositionLabel($member->compositionVersion->composition)
|
||||
.' · Fassung '.$member->compositionVersion->number
|
||||
.' · Rolle '.$member->role;
|
||||
}
|
||||
@@ -310,7 +311,7 @@ public function compositionMembers(Composition $composition): array
|
||||
}
|
||||
|
||||
$nested = $member->nestedCompositionVersion;
|
||||
$lines[] = $member->role.' — Komposition '.($nested->composition->designation ?? 'fehlt');
|
||||
$lines[] = $member->role.' — '.($nested === null ? 'fehlt' : self::compositionLabel($nested->composition));
|
||||
}
|
||||
|
||||
return $lines;
|
||||
@@ -331,7 +332,7 @@ public function compositionUsage(Composition $composition): array
|
||||
->get();
|
||||
|
||||
foreach ($parents as $member) {
|
||||
$lines[] = 'Komposition '.$member->compositionVersion->composition->designation
|
||||
$lines[] = self::compositionLabel($member->compositionVersion->composition)
|
||||
.' · Fassung '.$member->compositionVersion->number
|
||||
.' · Rolle '.$member->role;
|
||||
}
|
||||
@@ -414,6 +415,14 @@ private function purpose(string $purpose): string
|
||||
};
|
||||
}
|
||||
|
||||
private static function compositionLabel(Composition $composition): string
|
||||
{
|
||||
$kind = $composition->kind;
|
||||
$label = $kind instanceof CompositionKind ? $kind->label() : 'Zusammenstellung';
|
||||
|
||||
return $label.': '.$composition->designation;
|
||||
}
|
||||
|
||||
private function status(mixed $status): string
|
||||
{
|
||||
return match (StatusValue::of($status)) {
|
||||
|
||||
Reference in new issue
Block a user