Zeige die Herkunft der Übungen, gestalte die Übernahmeseite mit gemeinsamen Bausteinen und belege sie im Browser
Herkunft lokal, Shinkan oder Shinkan lokal ergänzt im Übungsbestand; Übernahmeseite mit Knöpfen, Kapseln, Karten und Meldungen der Verwaltung; Prüfung im Browser (leer, Abruffehler, Suche, Tastatur, Vorschau, Bestätigung, wiederholt, schmal) mit Bildern im Abnahmeordner. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79998f6347
commit
b901b02cce
15 files changed
+155
-64
No files matched your search
@@ -4,8 +4,10 @@
|
||||
|
||||
use App\Domain\Catalog\Composition;
|
||||
use App\Domain\Catalog\CompositionKind;
|
||||
use App\Domain\Catalog\CompositionMember;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\EditorialVocabulary;
|
||||
use App\Domain\Catalog\ExerciseSource;
|
||||
use App\Domain\Catalog\IdentityDimensionValue;
|
||||
use App\Domain\Catalog\Pillar;
|
||||
use App\Domain\Catalog\PillarFilterCompat;
|
||||
@@ -151,6 +153,10 @@ public function entries(): array
|
||||
$canEdit = ContentElementResource::editor();
|
||||
$rows = [];
|
||||
|
||||
$shinkan = $kinds === [CompositionKind::Exercise] || in_array(CompositionKind::Exercise, $kinds, true)
|
||||
? ExerciseSource::query()->whereNotNull('composition_id')->pluck('composition_id')->all()
|
||||
: [];
|
||||
|
||||
$compositions = Composition::query()
|
||||
->whereIn('kind', $kinds)
|
||||
->with(['editorialContentKind', 'versions.members.contentElementVersion.element'])
|
||||
@@ -189,7 +195,7 @@ public function entries(): array
|
||||
$rows[] = [
|
||||
'schluessel' => 'c'.$composition->id,
|
||||
'titel' => $title,
|
||||
'meta' => $kind->deskLabel().($title !== $composition->designation ? ' · '.$composition->designation : '').($kind === CompositionKind::Exercise ? ' · Herkunft: lokal' : ''),
|
||||
'meta' => $kind->deskLabel().($title !== $composition->designation ? ' · '.$composition->designation : '').($kind === CompositionKind::Exercise ? ' · Herkunft: '.$this->exerciseOrigin($composition, $shinkan) : ''),
|
||||
'text' => $summary,
|
||||
'bild' => $cover['url'],
|
||||
'bildFehlt' => 'Kein Titelbild',
|
||||
@@ -215,6 +221,23 @@ public function entries(): array
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Herkunft einer Übung: lokal angelegt, aus Shinkan übernommen oder aus Shinkan übernommen und lokal ergänzt.
|
||||
*
|
||||
* @param list<int> $shinkan Übungen mit Quellbindung
|
||||
*/
|
||||
private function exerciseOrigin(Composition $composition, array $shinkan): string
|
||||
{
|
||||
if (! in_array($composition->id, $shinkan, true)) {
|
||||
return 'lokal';
|
||||
}
|
||||
|
||||
$latest = $composition->versions->sortByDesc('number')->first();
|
||||
$local = $latest !== null && CompositionMember::query()->where('composition_version_id', $latest->id)->where('origin', 'lokal')->exists();
|
||||
|
||||
return $local ? 'Shinkan, lokal ergänzt' : 'Shinkan';
|
||||
}
|
||||
|
||||
/**
|
||||
* Anlegedialog für Module und Programme; derselbe auf dem Arbeitsplatz und in den Listen.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user