Pflege Übungen im Aufbauarbeitsplatz und weise Verwendung und Sperrfolgen nach
CI Feature / test (push) Successful in 2m34s

Eigener Eintrag Übungen unter Inhalte (Bestand, Anlegen, gemeinsamer Aufbau mit Varianten, Verwendung und
Variantenauswahl im Modul und Programm), Verwendungsnachweis über verschachtelte und ältere Stände,
Auswirkungsbericht einer Mediensperre, gesperrte Bestandteile verhindern die Angebotsaktivierung, Vorschaubilder
gesperrter Medien werden nicht mehr ausgeliefert, Rückfalltest gegen die Daten des neuen Stands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-23 17:03:32 +01:00
1 parent d1f97a351a
commit bbee288e69
22 files changed
+1104 -26

No files matched your search

@@ -6,6 +6,7 @@
use App\Domain\Catalog\Composition;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\ContentVersionStatus;
use App\Domain\Catalog\EditorialVocabulary;
use App\Domain\Catalog\IdentityDimension;
use App\Domain\Catalog\LicenseArticle;
@@ -501,8 +502,10 @@ private function maySeeThumbnail(Request $request, string $kind, int $subject):
return true;
}
// Ein gesperrtes Medium zeigt auch kein Vorschaubild mehr (Sperre gilt für Ausgaben und Ableitungen).
if ($kind === 'element' && $release->contents->contains(
fn ($content): bool => $content->elementVersion?->content_element_id === $subject,
fn ($content): bool => $content->elementVersion?->content_element_id === $subject
&& $content->elementVersion->status !== ContentVersionStatus::Gesperrt,
)) {
return true;
}
+43 -1
View File
@@ -5,11 +5,13 @@
use App\Domain\Catalog\ArticleRelease;
use App\Domain\Catalog\Composition;
use App\Domain\Catalog\CompositionDisplayRelease;
use App\Domain\Catalog\CompositionKind;
use App\Domain\Catalog\CompositionStructureReader;
use App\Domain\Catalog\CompositionVersion;
use App\Domain\Catalog\ContentElement;
use App\Domain\Catalog\ContentElementVersion;
use App\Domain\Catalog\EditorialProfileReader;
use App\Domain\Catalog\ExerciseGuide;
use App\Domain\Catalog\ReleaseStatus;
use App\Domain\Catalog\StructureNode;
use App\Domain\Entitlement\DecideAccess;
@@ -389,7 +391,7 @@ private function present(User $user, StructureNode $node, bool $full, int $rootI
'view_url' => $view,
'poster_url' => $poster,
'download_url' => $download,
'program_url' => $this->programUrl($node),
'program_url' => $this->exerciseUrl($user, $rootId, $node) ?? $this->programUrl($node),
'composition_id' => $node->compositionId,
'element_id' => $node->contentElementId,
'version_id' => $node->contentElementVersionId,
@@ -491,6 +493,46 @@ private function element(int $id): ?ContentElement
return $this->elements[$id];
}
/**
* Eine Übung im Zusammenhang des erworbenen Moduls oder Programms: die im Stand gebundene Fassung und ihre Varianten,
* nicht die jeweils neueste Fassung der Übung. Gefunden wird der jüngste auslieferbare Stand des Kontos, dessen
* festgeschriebene Wurzel diese Fassung an einer Stelle einbindet.
*/
private function exerciseUrl(User $user, int $rootId, StructureNode $node): ?string
{
if ($node->compositionVersionId === null) {
return null;
}
$nested = CompositionVersion::query()->with('composition')->find($node->compositionVersionId);
if ($nested?->composition?->kind !== CompositionKind::Exercise) {
return null;
}
$guide = app(ExerciseGuide::class);
foreach ($this->grants($user) as $grant) {
$releases = ArticleRelease::query()
->where('license_article_id', $grant->license_article_id)
->whereIn('status', [ReleaseStatus::Veroeffentlicht, ReleaseStatus::AbgeloestVerfuegbar])
->whereHas('rootCompositionVersion', fn ($query) => $query->where('composition_id', $rootId))
->with('rootCompositionVersion')
->orderByDesc('number')
->get();
foreach ($releases as $release) {
$path = $guide->pathTo($release->rootCompositionVersion, $nested->id);
if ($path !== null) {
return route('member.exercise', ['article' => $grant->license_article_id, 'release' => $release->id, 'path' => $path]);
}
}
}
return null;
}
private function programUrl(StructureNode $node): ?string
{
if ($node->compositionId === null || $node->compositionVersionId === null) {