wip zuabschlaege pdf

This commit is contained in:
salam committed 2025-10-28 13:40:01 +01:00
1 parent 88d561675d
commit 7917777b93
23 files changed
+510 -604

No files matched your search

@@ -30,6 +30,7 @@ use Filament\Support\Icons\Heroicon;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Support\HtmlString;
class ProjektInhaltsverzeichnisRelationManager extends RelationManager
{
@@ -50,7 +51,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
Tabs::make('Tabs')
->tabs([
Tab::make('Überschrift')
->hidden(fn ($record) => $record->name == 'DECKBLATT' ? true : false)
->hidden(fn ($record) => $record?->name == 'DECKBLATT' ? true : false)
->schema([
Checkbox::make('neue_seite')
->label('Start neuer Seite'),
@@ -86,13 +87,15 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->columnSpan(1),
]),
Tab::make('Textblock')
->hidden(fn ($record) => in_array($record?->name, ['INHALTSVERZEICHNIS']) ? true : false)
->schema([
Grid::make()
->columns(6)
->schema([
TextInput::make('konto_textblock_id')->hidden(),
RichEditor::make('textblock')
->aboveLabel('Ausgabe Textblock vor Tabelle')
->hiddenLabel()
->aboveLabel(fn ($record): string => $record?->tabellen_id != 0 ? 'Ausgabe Textblock vor Tabelle' : '')
->columnSpan(5)
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
->toolbarButtons([
@@ -124,11 +127,11 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
TextInput::make('name')->required()
->label('Ändern sie gegebeben Falls den Namen')
->default(function ($record) {
return KontoTextblock::where('id', $record['konto_textblock_id'])->pluck('name')->first();
return KontoTextblock::where('id', $record?->konto_textblock_id)->pluck('name')->first();
}),
])
->hidden(function ($record) {
return (bool) ! $record['konto_textblock_id'];
return (bool) ! $record?->konto_textblock_id;
})
->action(function (array $mountedActions, array $data) {
$record = $mountedActions[0]->getRawData();
@@ -144,7 +147,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
TextInput::make('name')->required()
->label('Geben sie der Vorlage einen eindeutigen Namen')
->default(function ($record) {
return $record['name'];
return $record?->name;
}),
])
->modalSubmitActionLabel('Sichern')
@@ -185,12 +188,12 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
]),
]),
Tab::make('Tabellen')
->hidden(fn ($record) => in_array($record?->name, ['DECKBLATT']) ? true : false)
->schema([
Select::make('tabellen_id')->label('Tabelle')
->aboveLabel('Ausgabe Textblock vor Tabelle')
->prefixIcon('phosphor-table')
->prefixIconColor(
fn ($record): string => $record->tabellen_id == 0 ? 'gray' : 'primary'
fn ($record): string => $record?->tabellen_id == 0 ? 'gray' : 'primary'
)
->default(0)
->options(function () {
@@ -250,6 +253,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
IconColumn::make('textblock')
->alignCenter()
->icon('phosphor-article')
->tooltip(fn ($record): HtmlString => new HtmlString($record->textblock))
->color(fn (string $state): string => match ($state) {
'0' => 'gray',
default => 'info',