Am Lizenzartikel gibt es den Abschnitt "Im Shop verkaufen": Er listet die Optionen mit Preis, Rechten, Nutzerkreis und Zustand. "Option hinzufuegen" fragt nur Rechteprofil, Preis, Eignung, Nutzerkreis und eine Bezeichnung ab; Artikel, Inhalt und Vergabe stehen fest. Aendern und Aus dem Verkauf nehmen laufen am selben Ort. OfferService::offerArticle legt Angebot und erste Fassung in einer Transaktion an, damit eine fehlgeschlagene Pruefung kein leeres Angebot hinterlaesst. reviseArticleOption aktiviert die naechste Fassung und lehnt Optionen anderer Artikel ab. Aus der Angebotsmaske entfaellt die Auswahl "Programmfassung, die abgedeckt sein muss"; die Pruefung bleibt im Dienst. Pakete und der Altbestand behalten die Angebotsmaske.
133 lines
8.1 KiB
PHP
133 lines
8.1 KiB
PHP
@if ($this->redaktionOpen)
|
|
@include('filament.verwaltung.redaktion')
|
|
@else
|
|
@php
|
|
/** @var \App\Domain\Catalog\LicenseArticle $artikel */
|
|
$artikel = $this->getRecord();
|
|
$profil = $this->editorialProfile('artikel');
|
|
$quelle = $this->redaktionQuelle();
|
|
$titel = $this->redaktionTitel();
|
|
$offen = $this->redaktionOffen();
|
|
$aktionen = [];
|
|
$ohneStand = ! $artikel->current_release_id;
|
|
if ($ohneStand) {
|
|
$aktionen[] = ['label' => 'Inhalt festlegen', 'wire' => "mountAction('release')", 'art' => 'primary'];
|
|
}
|
|
if ($this->canEditEditorial()) {
|
|
$aktionen[] = ['label' => 'Redaktion bearbeiten', 'wire' => "openRedaktion('texte')", 'art' => $ohneStand ? 'line' : 'line', 'icon' => 'stift'];
|
|
}
|
|
$mehr = [
|
|
['label' => $ohneStand ? 'Inhalt festlegen' : 'Neuen Stand veröffentlichen', 'wire' => "mountAction('release')", 'hinweis' => $ohneStand ? 'Freigegebenen Inhalt wählen, den der Artikel lizenziert.' : 'Neuer Artikelstand aus einer freigegebenen Fassung.'],
|
|
['label' => 'Stand zurückziehen', 'wire' => "mountAction('withdraw')", 'hinweis' => 'Rechtlich notwendiger Rückzug mit Begründung.', 'gefahr' => true],
|
|
];
|
|
@endphp
|
|
<div class="vw">
|
|
@include('filament.verwaltung.kopf', [
|
|
'brot' => [['label' => 'Lizenzartikel', 'href' => \App\Filament\Resources\LicenseArticles\LicenseArticleResource::getUrl('index')], $titel],
|
|
'titel' => $titel,
|
|
'typ' => 'Lizenzartikel · Kennung '.$artikel->code.($artikel->product_line ? ' · '.$artikel->product_line : ''),
|
|
'status' => [
|
|
['text' => \Illuminate\Support\Str::before($stand[0] ?? '', ' · Dasselbe'), 'ton' => $artikel->current_release_id ? 'gut' : 'neutral'],
|
|
$offen ? ['text' => 'Redaktion mit ungespeicherten Änderungen', 'ton' => 'offen', 'aktion' => ['label' => 'Zur Redaktion', 'wire' => "openRedaktion('".$this->redaktionTab."')"]] : null,
|
|
],
|
|
'aktionen' => $aktionen,
|
|
'mehr' => $mehr,
|
|
])
|
|
|
|
@if ($this->deskFeedback !== '')
|
|
<p class="vw-meldung" role="status" style="margin-bottom: 1rem;"><span>{{ $this->deskFeedback }}</span></p>
|
|
@endif
|
|
@include('filament.verwaltung.abgang', ['offen' => $offen])
|
|
|
|
<div class="vw-medien-raster">
|
|
<div class="vw-spalte">
|
|
<section class="vw-karte-box" aria-labelledby="artikel-redaktion">
|
|
<div class="vw-spalte-kopf">
|
|
<h2 id="artikel-redaktion">Präsentation des Artikels</h2>
|
|
@if ($quelle)
|
|
<span class="vw-feld-hilfe">Quelle: {{ $quelle['titel'] }} ({{ $quelle['art'] }})</span>
|
|
@endif
|
|
</div>
|
|
<dl class="vw-angaben">
|
|
@foreach (['display_title' => 'Name', 'teaser' => 'Teaser', 'summary' => 'Kurzbeschreibung'] as $feld => $label)
|
|
<dt>{{ $label }}</dt>
|
|
<dd>
|
|
{{ $profil->value($feld) ?? 'Keine Angabe' }}
|
|
@if ($profil->origin($feld) === 'quelle')
|
|
<span class="vw-kapsel">Übernommen</span>
|
|
@elseif ($profil->origin($feld) === 'eigen')
|
|
<span class="vw-kapsel is-eigen">Eigene Angabe</span>
|
|
@endif
|
|
</dd>
|
|
@endforeach
|
|
<dt>Präsentationsmedien</dt>
|
|
<dd>{{ count(app(\App\Domain\Catalog\PresentationMedia::class)->staged($artikel)) }} Zuordnungen</dd>
|
|
</dl>
|
|
@if ($this->canEditEditorial())
|
|
<div><button type="button" class="vw-btn is-line" wire:click="openRedaktion('texte')">@include('filament.verwaltung.icon', ['name' => 'stift'])Redaktion bearbeiten</button></div>
|
|
@endif
|
|
</section>
|
|
|
|
<section class="vw-karte-box" aria-labelledby="artikel-optionen" id="optionen">
|
|
<div class="vw-spalte-kopf">
|
|
<h2 id="artikel-optionen">Im Shop verkaufen</h2>
|
|
<span class="vw-feld-hilfe">Jede Option ist eine Lizenz mit Rechteprofil und Preis. Alle Optionen erscheinen auf der Produktseite dieses Artikels.</span>
|
|
</div>
|
|
@if (! $this->canOffer())
|
|
<p class="vw-feld-hilfe">Zuerst den Inhalt festlegen: Ohne veröffentlichten Stand lizenziert der Artikel nichts und lässt sich nicht verkaufen.</p>
|
|
@else
|
|
@php($optionen = $this->optionRows())
|
|
@if ($optionen === [])
|
|
<div class="vw-leer">
|
|
<strong>Noch keine Option</strong>
|
|
<p>Lege fest, mit welchem Rechteprofil und zu welchem Preis der Artikel verkauft wird. Mehrere Optionen, etwa für Privatpersonen und für Vereine, sind möglich.</p>
|
|
</div>
|
|
@else
|
|
<ul class="vw-verwendungsliste">
|
|
@foreach ($optionen as $option)
|
|
<li>
|
|
<strong>{{ $option['name'] }}</strong>
|
|
<span @class(['vw-zustand', 'is-'.$option['zustand']['ton']])>{{ $option['zustand']['label'] }}</span>
|
|
<span class="vw-feld-hilfe">{{ $option['price'] }} · {{ $option['licence'] }} · {{ $option['for'] }} · Rechte: {{ $option['rights'] }} · Fassung {{ $option['number'] }}</span>
|
|
<span class="vw-zeilenaktionen">
|
|
<button type="button" class="vw-link" wire:click="mountAction('option', { offer: {{ $option['offer'] }} })">{{ $option['active'] ? 'Ändern' : 'Wieder anbieten' }}</button>
|
|
@if ($option['active'])
|
|
<button type="button" class="vw-link is-quiet" wire:click="mountAction('optionEnd', { offer: {{ $option['offer'] }} })">Aus dem Verkauf nehmen</button>
|
|
@endif
|
|
@if ($option['page'])
|
|
<a class="vw-link is-quiet" href="{{ $option['page'] }}" target="_blank" rel="noopener">Produktseite ansehen</a>
|
|
@endif
|
|
<a class="vw-link is-quiet" href="{{ $option['url'] }}">Angebot öffnen</a>
|
|
</span>
|
|
</li>
|
|
@endforeach
|
|
</ul>
|
|
@endif
|
|
<div><button type="button" class="vw-btn is-line" wire:click="mountAction('option')">@include('filament.verwaltung.icon', ['name' => 'plus'])Option hinzufügen</button></div>
|
|
@endif
|
|
</section>
|
|
</div>
|
|
<aside class="vw-spalte">
|
|
@include('filament.verwaltung.voraussetzungen', ['voraussetzungen' => $voraussetzungen])
|
|
<section class="vw-karte-box" aria-labelledby="artikel-stand">
|
|
<h2 id="artikel-stand">Aktueller Stand</h2>
|
|
<ul style="margin: 0; padding-left: 1.1rem; display: grid; gap: 0.25rem;">
|
|
@foreach ($stand as $zeile)
|
|
<li>{{ $zeile }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</section>
|
|
<section class="vw-karte-box" aria-labelledby="artikel-angebote">
|
|
<h2 id="artikel-angebote">Pakete und Angebote</h2>
|
|
<p class="vw-feld-hilfe">Wo dieser Artikel lizenziert wird.</p>
|
|
@forelse ($kontext as $zeile)
|
|
<p>{{ $zeile }}</p>
|
|
@empty
|
|
<p class="vw-feld-hilfe">In keinem Paket und keinem Angebot.</p>
|
|
@endforelse
|
|
</section>
|
|
</aside>
|
|
</div>
|
|
</div>
|
|
@endif
|