Führe PDF-Vorlagen für Dokumente ein: Titelseite, grafischer Kopf und Fuß, Angaben je Fassung (ADR-51, Nachtrag)
Eine Vorlage ist reines Layout (Titelseite mit allein stehendem Titel, Kopf- und Fußgrafik aus dem Medienbestand, Herausgeber und Standardvermerk) und wird dem Dokument zugeordnet. Untertitel, Ausgabe, Veröffentlichungsdatum und Copyright-Vermerk gehören zur Dokumentfassung (document_meta). Ohne Vorlage bleibt das PDF unverändert. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
81037b9868
commit
765b8e779e
31 files changed
+1272
-33
No files matched your search
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\EmbeddedImages;
|
||||
use App\Domain\Catalog\PdfTemplate;
|
||||
use App\Filament\Resources\ContentElements\ContentElementResource;
|
||||
use App\Filament\Support\ChoosesMedia;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
/**
|
||||
* PDF-Vorlagen für Dokumente (ADR-51, Nachtrag): Titelseite, grafische Kopf- und Fußzeile und Standardvermerke. Die Bilder
|
||||
* wählt der gemeinsame Picker aus dem Medienbestand (freigegebene Bildfassungen); eine Vorlage ist reines Layout und ändert
|
||||
* keinen Inhalt. Gespeichert wird erst mit „Vorlage speichern“; offene Eingaben bleiben beim Wechsel der Vorlage nicht stehen,
|
||||
* der Wechsel fragt bei offenen Änderungen nach.
|
||||
*/
|
||||
class PdfVorlagen extends Page
|
||||
{
|
||||
use ChoosesMedia;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Inhalte';
|
||||
|
||||
protected static ?string $navigationLabel = 'PDF-Vorlagen';
|
||||
|
||||
protected static ?int $navigationSort = 60;
|
||||
|
||||
protected static ?string $slug = 'pdf-vorlagen';
|
||||
|
||||
protected static ?string $title = 'PDF-Vorlagen';
|
||||
|
||||
protected string $view = 'filament.pdf.vorlagen';
|
||||
|
||||
/** Gewählte Vorlage; 0 = neue, noch nicht gespeicherte. */
|
||||
public int $templateId = 0;
|
||||
|
||||
public string $name = '';
|
||||
|
||||
public string $publisher = '';
|
||||
|
||||
public string $copyright = '';
|
||||
|
||||
public bool $showCover = true;
|
||||
|
||||
public ?int $headerId = null;
|
||||
|
||||
public ?int $footerId = null;
|
||||
|
||||
public ?int $coverId = null;
|
||||
|
||||
/** Das Bildfeld, in das die Auswahl übernommen wird: header, footer oder cover. */
|
||||
public ?string $bildFeld = null;
|
||||
|
||||
/** @var array{aktion: string, argument: int|string|null, titel: string, text: string, label: string, gefahr: bool}|null */
|
||||
public ?array $bestaetigung = null;
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return ContentElementResource::editor();
|
||||
}
|
||||
|
||||
public function mount(): void
|
||||
{
|
||||
$first = PdfTemplate::query()->where('kind', PdfTemplate::KIND_DOCUMENT)->orderBy('name')->first();
|
||||
$first instanceof PdfTemplate ? $this->loadTemplate($first) : $this->clearForm();
|
||||
}
|
||||
|
||||
public function getHeading(): string|Htmlable|null
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getMaxContentWidth(): Width|string|null
|
||||
{
|
||||
return Width::Full;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array{id: int, name: string, documents: int}>
|
||||
*/
|
||||
public function templates(): array
|
||||
{
|
||||
return PdfTemplate::query()->where('kind', PdfTemplate::KIND_DOCUMENT)->withCount('compositions')->orderBy('name')->get()
|
||||
->map(fn (PdfTemplate $template): array => ['id' => $template->id, 'name' => $template->name, 'documents' => (int) $template->compositions_count])->all();
|
||||
}
|
||||
|
||||
public function select(int $id): void
|
||||
{
|
||||
$template = PdfTemplate::query()->where('kind', PdfTemplate::KIND_DOCUMENT)->find($id);
|
||||
|
||||
if ($template instanceof PdfTemplate) {
|
||||
$this->loadTemplate($template);
|
||||
}
|
||||
}
|
||||
|
||||
public function newTemplate(): void
|
||||
{
|
||||
$this->clearForm();
|
||||
}
|
||||
|
||||
/** Ob die Eingaben vom gespeicherten Stand abweichen. */
|
||||
public function changed(): bool
|
||||
{
|
||||
$template = $this->templateId > 0 ? PdfTemplate::query()->find($this->templateId) : null;
|
||||
|
||||
if (! $template instanceof PdfTemplate) {
|
||||
return $this->name !== '' || $this->publisher !== '' || $this->copyright !== '' || $this->headerId !== null || $this->footerId !== null || $this->coverId !== null;
|
||||
}
|
||||
|
||||
return $this->name !== $template->name
|
||||
|| $this->publisher !== (string) $template->publisher
|
||||
|| $this->copyright !== (string) $template->copyright
|
||||
|| $this->showCover !== (bool) $template->show_cover
|
||||
|| $this->headerId !== $template->header_version_id
|
||||
|| $this->footerId !== $template->footer_version_id
|
||||
|| $this->coverId !== $template->cover_version_id;
|
||||
}
|
||||
|
||||
public function save(): void
|
||||
{
|
||||
abort_unless(ContentElementResource::editor(), 403);
|
||||
|
||||
if (trim($this->name) === '') {
|
||||
Notification::make()->danger()->title('Der Name fehlt.')->body('Er bezeichnet die Vorlage bei der Auswahl am Dokument.')->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (['header' => $this->headerId, 'footer' => $this->footerId, 'cover' => $this->coverId] as $slot => $id) {
|
||||
if ($id !== null && $this->imageProblem($id) !== null) {
|
||||
Notification::make()->danger()->title('Das Bild für '.$this->slotLabel($slot).' lässt sich nicht verwenden.')->body((string) $this->imageProblem($id))->send();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$values = [
|
||||
'name' => trim($this->name),
|
||||
'kind' => PdfTemplate::KIND_DOCUMENT,
|
||||
'show_cover' => $this->showCover,
|
||||
'header_version_id' => $this->headerId,
|
||||
'footer_version_id' => $this->footerId,
|
||||
'cover_version_id' => $this->coverId,
|
||||
'publisher' => trim($this->publisher) === '' ? null : trim($this->publisher),
|
||||
'copyright' => trim($this->copyright) === '' ? null : trim($this->copyright),
|
||||
];
|
||||
$template = $this->templateId > 0 ? PdfTemplate::query()->find($this->templateId) : null;
|
||||
$template instanceof PdfTemplate ? $template->update($values) : $template = PdfTemplate::query()->create($values);
|
||||
$this->loadTemplate($template);
|
||||
Notification::make()->success()->title('Vorlage gespeichert')->body('Sie gilt sofort für jedes Dokument, das sie verwendet, auch für ältere Fassungen.')->send();
|
||||
}
|
||||
|
||||
public function askConfirmation(string $aktion): void
|
||||
{
|
||||
if ($aktion === 'delete' && $this->templateId > 0) {
|
||||
$uses = PdfTemplate::query()->withCount('compositions')->find($this->templateId)?->compositions_count ?? 0;
|
||||
$this->bestaetigung = [
|
||||
'aktion' => 'delete',
|
||||
'argument' => null,
|
||||
'titel' => '„'.$this->name.'“ löschen?',
|
||||
'text' => $uses > 0
|
||||
? $uses.' '.($uses === 1 ? 'Dokument verwendet' : 'Dokumente verwenden').' diese Vorlage und '.($uses === 1 ? 'erzeugt' : 'erzeugen').' danach wieder das einfache PDF ohne Titelseite. Die Bilder bleiben im Medienbestand.'
|
||||
: 'Die Vorlage wird entfernt. Die Bilder bleiben im Medienbestand.',
|
||||
'label' => 'Vorlage löschen',
|
||||
'gefahr' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmConfirmation(): void
|
||||
{
|
||||
$frage = $this->bestaetigung;
|
||||
$this->bestaetigung = null;
|
||||
|
||||
if (($frage['aktion'] ?? null) === 'delete' && $this->templateId > 0) {
|
||||
abort_unless(ContentElementResource::editor(), 403);
|
||||
PdfTemplate::query()->whereKey($this->templateId)->delete();
|
||||
$this->mount();
|
||||
Notification::make()->success()->title('Vorlage gelöscht')->send();
|
||||
}
|
||||
}
|
||||
|
||||
public function cancelConfirmation(): void
|
||||
{
|
||||
$this->bestaetigung = null;
|
||||
}
|
||||
|
||||
public function openImagePicker(string $slot): void
|
||||
{
|
||||
if (! in_array($slot, ['header', 'footer', 'cover'], true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->bildFeld = $slot;
|
||||
$this->resetPicker('vorlagenbild');
|
||||
$this->pickerKind = 'bild';
|
||||
}
|
||||
|
||||
public function clearImage(string $slot): void
|
||||
{
|
||||
match ($slot) {
|
||||
'header' => $this->headerId = null,
|
||||
'footer' => $this->footerId = null,
|
||||
'cover' => $this->coverId = null,
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
public function pickerAllowsMany(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function closePicker(): void
|
||||
{
|
||||
$this->pickerOpen = false;
|
||||
$this->pickerSelected = '';
|
||||
$this->pickerInspected = '';
|
||||
$this->pickerMarked = [];
|
||||
$this->bildFeld = null;
|
||||
}
|
||||
|
||||
public function confirmPicker(): void
|
||||
{
|
||||
$target = array_key_first($this->pickerMarked);
|
||||
$slot = $this->bildFeld;
|
||||
|
||||
if ($target === null || $slot === null || preg_match('/^element:(\d+)$/', (string) $target, $match) !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$problem = $this->imageProblem((int) $match[1]);
|
||||
|
||||
if ($problem !== null) {
|
||||
Notification::make()->danger()->title('Dieses Bild lässt sich nicht verwenden.')->body($problem)->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
match ($slot) {
|
||||
'header' => $this->headerId = (int) $match[1],
|
||||
'footer' => $this->footerId = (int) $match[1],
|
||||
'cover' => $this->coverId = (int) $match[1],
|
||||
default => null,
|
||||
};
|
||||
$this->closePicker();
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
public function pickerKinds(): array
|
||||
{
|
||||
return ['bild' => 'Bilder'];
|
||||
}
|
||||
|
||||
public function pickerTitle(): string
|
||||
{
|
||||
return 'Bild für '.$this->slotLabel((string) $this->bildFeld);
|
||||
}
|
||||
|
||||
public function pickerConfirmLabel(): string
|
||||
{
|
||||
return 'Bild übernehmen';
|
||||
}
|
||||
|
||||
/** @return array{art: string, titel: string} */
|
||||
public function pickerKontext(): array
|
||||
{
|
||||
return ['art' => 'die PDF-Vorlage', 'titel' => trim($this->name) !== '' ? $this->name : 'neue Vorlage'];
|
||||
}
|
||||
|
||||
/** @return array<string, string> */
|
||||
public function presentationRoleOptions(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/** @return array<string, mixed>|null */
|
||||
public function pickerReplacing(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function imageUrl(?int $versionId): ?string
|
||||
{
|
||||
return $versionId === null ? null : EmbeddedImages::staffSource($versionId);
|
||||
}
|
||||
|
||||
public function imageTitle(?int $versionId): string
|
||||
{
|
||||
$version = $versionId === null ? null : ContentElementVersion::query()->with('element')->find($versionId);
|
||||
|
||||
return $version?->element === null ? '' : (string) ($version->element->display_title ?: $version->element->working_title);
|
||||
}
|
||||
|
||||
public function slotLabel(string $slot): string
|
||||
{
|
||||
return match ($slot) {
|
||||
'header' => 'den Kopf der Seiten',
|
||||
'footer' => 'den Fuß der Seiten',
|
||||
'cover' => 'die Titelseite',
|
||||
default => 'die Vorlage',
|
||||
};
|
||||
}
|
||||
|
||||
private function imageProblem(int $versionId): ?string
|
||||
{
|
||||
$version = ContentElementVersion::query()->with('element')->find($versionId);
|
||||
|
||||
if (! $version instanceof ContentElementVersion || $version->element === null || $version->element->output_class !== 'bild') {
|
||||
return 'Das ist kein Bild des Medienbestands.';
|
||||
}
|
||||
|
||||
if ($version->status !== ContentVersionStatus::Bereit) {
|
||||
return 'Die Bildfassung ist noch nicht freigegeben.';
|
||||
}
|
||||
|
||||
return EmbeddedImages::file($version) === null ? 'Die Bilddatei liegt nicht vor.' : null;
|
||||
}
|
||||
|
||||
private function loadTemplate(PdfTemplate $template): void
|
||||
{
|
||||
$this->templateId = $template->id;
|
||||
$this->name = $template->name;
|
||||
$this->publisher = (string) $template->publisher;
|
||||
$this->copyright = (string) $template->copyright;
|
||||
$this->showCover = (bool) $template->show_cover;
|
||||
$this->headerId = $template->header_version_id;
|
||||
$this->footerId = $template->footer_version_id;
|
||||
$this->coverId = $template->cover_version_id;
|
||||
}
|
||||
|
||||
private function clearForm(): void
|
||||
{
|
||||
$this->templateId = 0;
|
||||
$this->name = '';
|
||||
$this->publisher = '';
|
||||
$this->copyright = '';
|
||||
$this->showCover = true;
|
||||
$this->headerId = null;
|
||||
$this->footerId = null;
|
||||
$this->coverId = null;
|
||||
}
|
||||
|
||||
protected function pickerExceptId(): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
use App\Domain\Catalog\ContentElementVersion;
|
||||
use App\Domain\Catalog\ContentService;
|
||||
use App\Domain\Catalog\ContentVersionStatus;
|
||||
use App\Domain\Catalog\DocumentMeta;
|
||||
use App\Domain\Catalog\DomainRuleException;
|
||||
use App\Domain\Catalog\EditorialVocabulary;
|
||||
use App\Domain\Catalog\EditorialWorkingDraft;
|
||||
@@ -21,6 +22,7 @@
|
||||
use App\Domain\Catalog\IdentityDimension;
|
||||
use App\Domain\Catalog\IdentityDimensionValue;
|
||||
use App\Domain\Catalog\IdentityProfile;
|
||||
use App\Domain\Catalog\PdfTemplate;
|
||||
use App\Domain\Catalog\StructureNode;
|
||||
use App\Domain\Cms\Catalog\PublicCatalogReader;
|
||||
use App\Domain\Cms\Widgets\RenderContext;
|
||||
@@ -81,6 +83,18 @@ abstract class EditComposition extends EditRecord
|
||||
|
||||
public string $durationMax = '';
|
||||
|
||||
/** Dokumentfassung (ADR-51): Angaben für Titelseite und Impressum des PDF. Sie gehören zur Fassung. */
|
||||
public string $docSubtitle = '';
|
||||
|
||||
public string $docEdition = '';
|
||||
|
||||
public string $docPublished = '';
|
||||
|
||||
public string $docCopyright = '';
|
||||
|
||||
/** Die PDF-Vorlage des Dokuments („“ = bisheriges Layout). Wirkt sofort, ohne Fassung. */
|
||||
public string $pdfTemplateId = '';
|
||||
|
||||
public string $prerequisites = '';
|
||||
|
||||
public string $newVariantName = '';
|
||||
@@ -1856,6 +1870,7 @@ public function publishRevision(): bool
|
||||
'duration_max' => $this->blank($this->durationMax),
|
||||
'material_note' => $this->richBlank('materialNote'),
|
||||
'prerequisites' => $this->blank($this->prerequisites),
|
||||
'document_meta' => $this->documentMetaNow(),
|
||||
],
|
||||
$this->releaseConsent,
|
||||
$this->normalizeVariants($this->variants),
|
||||
@@ -1975,6 +1990,7 @@ protected function loadAufbau(): void
|
||||
$this->thumbnailError = $composition->thumbnail_error;
|
||||
$this->thumbnailSource = $composition->thumbnail_source;
|
||||
$this->imageCaptionText = $this->captionFor($composition->thumbnail_source);
|
||||
$this->pdfTemplateId = $composition->pdf_template_id === null ? '' : (string) $composition->pdf_template_id;
|
||||
$this->catalogScope = match ($this->hostKind()) {
|
||||
CompositionKind::Kurs => 'module',
|
||||
CompositionKind::Uebung => 'uebungen',
|
||||
@@ -1998,6 +2014,7 @@ protected function loadAufbau(): void
|
||||
$this->learningGoal = '';
|
||||
$this->durationMinutes = '';
|
||||
$this->materialNote = '';
|
||||
$this->fillDocumentMeta(null);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2040,6 +2057,7 @@ protected function applyDraft(array $draft): void
|
||||
$this->learningGoal = (string) ($draft['learning_goal'] ?? '');
|
||||
$this->durationMinutes = ($draft['duration_minutes'] ?? null) === null ? '' : (string) $draft['duration_minutes'];
|
||||
$this->materialNote = (string) ($draft['material_note'] ?? '');
|
||||
$this->fillDocumentMeta($draft['document_meta'] ?? null);
|
||||
$this->revisionNote = (string) ($draft['revision_note'] ?? '');
|
||||
$this->selected = null;
|
||||
$this->roleDraft = '';
|
||||
@@ -2063,6 +2081,7 @@ protected function applyVersion(CompositionVersion $version): void
|
||||
$this->learningGoal = (string) ($version->learning_goal ?? '');
|
||||
$this->durationMinutes = $version->duration_minutes === null ? '' : (string) $version->duration_minutes;
|
||||
$this->materialNote = (string) ($version->material_note ?? '');
|
||||
$this->fillDocumentMeta($version->document_meta);
|
||||
$this->selected = null;
|
||||
$this->roleDraft = '';
|
||||
$this->noteDraft = '';
|
||||
@@ -2179,6 +2198,66 @@ protected function sameMembers(CompositionVersion $version): bool
|
||||
return $current === $next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Die Angaben der Dokumentfassung im Arbeitsstand; nur bei einem Dokument, sonst null.
|
||||
*
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
protected function documentMetaNow(): ?array
|
||||
{
|
||||
if (! $this->isDocument()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DocumentMeta::normalize([
|
||||
'subtitle' => $this->docSubtitle,
|
||||
'edition' => $this->docEdition,
|
||||
'published_on' => $this->docPublished,
|
||||
'copyright' => $this->docCopyright,
|
||||
]);
|
||||
}
|
||||
|
||||
protected function fillDocumentMeta(mixed $meta): void
|
||||
{
|
||||
$meta = DocumentMeta::normalize($meta) ?? [];
|
||||
$this->docSubtitle = $meta['subtitle'] ?? '';
|
||||
$this->docEdition = $meta['edition'] ?? '';
|
||||
$this->docPublished = $meta['published_on'] ?? '';
|
||||
$this->docCopyright = $meta['copyright'] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Die wählbaren PDF-Vorlagen für Dokumente.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function pdfTemplateOptions(): array
|
||||
{
|
||||
return PdfTemplate::query()->where('kind', PdfTemplate::KIND_DOCUMENT)->orderBy('name')->pluck('name', 'id')
|
||||
->mapWithKeys(fn (string $name, int|string $id): array => [(string) $id => $name])->all();
|
||||
}
|
||||
|
||||
/** Ordnet dem Dokument eine PDF-Vorlage zu. Das gilt sofort für jedes PDF dieses Dokuments, auch für ältere Fassungen. */
|
||||
public function savePdfTemplate(): void
|
||||
{
|
||||
$this->guardEditorial();
|
||||
$id = ctype_digit($this->pdfTemplateId) ? (int) $this->pdfTemplateId : null;
|
||||
|
||||
if ($id !== null && ! PdfTemplate::query()->where('kind', PdfTemplate::KIND_DOCUMENT)->whereKey($id)->exists()) {
|
||||
$this->feedback = 'Diese PDF-Vorlage gibt es nicht mehr.';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var Composition $composition */
|
||||
$composition = $this->getRecord();
|
||||
$composition->pdf_template_id = $id;
|
||||
$composition->save();
|
||||
$this->feedback = $id === null
|
||||
? 'Das Dokument verwendet wieder das einfache PDF-Layout ohne Titelseite.'
|
||||
: 'Die PDF-Vorlage ist zugeordnet. Sie gilt sofort für jedes PDF dieses Dokuments, auch für ältere Fassungen; Ausgabe, Datum und Vermerk bleiben je Fassung.';
|
||||
}
|
||||
|
||||
protected function didacticChanged(CompositionVersion $version): bool
|
||||
{
|
||||
$minutes = $this->minutes($this->durationMinutes);
|
||||
@@ -2198,6 +2277,7 @@ protected function didacticChanged(CompositionVersion $version): bool
|
||||
|| $version->prerequisites !== $this->blank($this->prerequisites)
|
||||
|| ($version->duration_max === null ? null : (string) $version->duration_max) !== $this->blank($this->durationMax)
|
||||
|| $storedVariants !== $this->normalizeVariants($this->variants)
|
||||
|| DocumentMeta::normalize($version->document_meta) !== $this->documentMetaNow()
|
||||
|| $storedMinutes !== $minutes;
|
||||
}
|
||||
|
||||
@@ -2420,6 +2500,7 @@ protected function payload(): array
|
||||
'prerequisites' => $this->blank($this->prerequisites),
|
||||
'variants' => $this->normalizeVariants($this->variants),
|
||||
'revision_note' => $this->blank($this->revisionNote),
|
||||
'document_meta' => $this->documentMetaNow(),
|
||||
// Ungespeicherte Texte der Kapitel gelten als Änderung des Entwurfs; nach dem Speichern sind sie leer.
|
||||
'chapters' => $this->chapterEditsNow(),
|
||||
'members' => array_values(array_map(
|
||||
@@ -2466,6 +2547,7 @@ protected function readyPayload(): array
|
||||
'prerequisites' => null,
|
||||
'variants' => [],
|
||||
'revision_note' => null,
|
||||
'document_meta' => null,
|
||||
'members' => [],
|
||||
];
|
||||
}
|
||||
@@ -2482,6 +2564,7 @@ protected function readyPayload(): array
|
||||
'key' => $variant->key, 'name' => $variant->name, 'description' => (string) $variant->description, 'origin' => $variant->origin,
|
||||
])->all()),
|
||||
'revision_note' => null,
|
||||
'document_meta' => DocumentMeta::normalize($version->document_meta),
|
||||
'members' => array_values(array_map(
|
||||
fn (array $row): array => [
|
||||
'role' => trim((string) ($row['role'] ?? '')),
|
||||
@@ -2524,6 +2607,7 @@ protected function normalizePayload(array $payload): array
|
||||
'prerequisites' => $payload['prerequisites'] ?? null,
|
||||
'variants' => $this->normalizeVariants($payload['variants'] ?? []),
|
||||
'revision_note' => $payload['revision_note'] ?? null,
|
||||
'document_meta' => DocumentMeta::normalize($payload['document_meta'] ?? null),
|
||||
'chapters' => is_array($payload['chapters'] ?? null) ? $payload['chapters'] : [],
|
||||
'members' => $members,
|
||||
];
|
||||
|
||||
@@ -106,8 +106,8 @@ public function pickerResult(): array
|
||||
return ['items' => [], 'more' => false];
|
||||
}
|
||||
|
||||
if (in_array($this->pickerPurpose, ['aufbau', 'textbild'], true)) {
|
||||
$image = $this->pickerPurpose === 'textbild';
|
||||
if (in_array($this->pickerPurpose, ['aufbau', 'textbild', 'vorlagenbild'], true)) {
|
||||
$image = in_array($this->pickerPurpose, ['textbild', 'vorlagenbild'], true);
|
||||
|
||||
return $this->filterByMaterialart(app(EditorialCatalog::class)->browse(
|
||||
$this->pickerQuery,
|
||||
|
||||
Reference in new issue
Block a user