This commit is contained in:
salam committed 2025-10-22 07:05:52 +02:00
1 parent 6bf10b25bd
commit fe03a71735
18 files changed
+149 -103

No files matched your search

@@ -13,6 +13,7 @@ class CreateProjektInhaltsverzeichnis
ProjektInhaltsverzeichnis::where('projekte_id', $record->id)->delete();
$inhaltsverzeichnis = Inhaltsverzeichnis::get();
$part = 1;
foreach ($inhaltsverzeichnis as $inhalt) {
$textblock = '';
@@ -20,6 +21,10 @@ class CreateProjektInhaltsverzeichnis
$textblock = Textblock::where('id', $inhalt->textblock_id)->pluck('textblock')->first();
}
if ($inhalt->tabellen_id == 5) {
$part = 2;
}
ProjektInhaltsverzeichnis::updateOrCreate(
[
'projekte_id' => $record->id,
@@ -32,9 +37,11 @@ class CreateProjektInhaltsverzeichnis
'ueberschrift_anzeigen' => $inhalt->ueberschrift_anzeigen,
'tabellen_id' => $inhalt->tabellen_id,
'textblock_id' => $inhalt->textblock_id,
'part' => $part,
'seite' => $inhalt->seite,
'neue_seite' => $inhalt->neue_seite,
'seitenzahl_anzeige' => $inhalt->seitenzahl_anzeige,
'no_edit' => $inhalt->no_edit,
'textblock' => $textblock,
]);
}
+1 -1
View File
@@ -36,7 +36,7 @@ class MakeGutachten
public static function generate($filepath, $projekte_id)
{
self::$inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->orderBy('sort')->get();
self::$inhaltesverzeichnis = ProjektInhaltsverzeichnis::where('projekte_id', $projekte_id)->where('part', 1)->orderBy('sort')->get();
self::$projekt = Projekte::where('id', $projekte_id)->first();
@@ -20,14 +20,18 @@ class InhaltsverzeichnisForm
Section::make('Überschrift')
->schema([
Checkbox::make('neue_seite')
->label('Start neuer Seite')
->columnSpan(2),
->label('Start neuer Seite'),
Checkbox::make('ueberschrift_anzeigen')
->label('Überschrift angezeigen'),
Textarea::make('name')
->required()
->label('Kapitel / Absatz')
->label('Überschrift in der Inhaltsangabe')
->columnSpan(2),
Checkbox::make('ueberschrift_anzeigen')
->label('Überschrift angezeigen')
Textarea::make('name2')
->label('Überschrift im Dokument')
->belowContent([
'Bei abweichender Überschrift im Dokument',
])
->columnSpan(2),
TextInput::make('ordnungszahl')
->label('Kapitel Index')
@@ -4,10 +4,9 @@ namespace App\Filament\Resources\Inhaltsverzeichnis\Tables;
use Filament\Actions\DeleteAction;
use Filament\Actions\EditAction;
use Filament\Support\Enums\FontWeight;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Columns\ToggleColumn;
use Filament\Tables\Table;
class InhaltsverzeichnisTable
@@ -28,14 +27,16 @@ class InhaltsverzeichnisTable
'1' => 'phosphor-file-plus',
default => ''
}),
IconColumn::make('ueberschrift_anzeigen')
->label('')
->tooltip('Überschrift anzeigen')
->icon(fn (string $state): Heroicon => match ($state) {
'1' => Heroicon::OutlinedEye,
'0' => Heroicon::OutlinedEyeSlash,
}),
TextColumn::make('name')
->label('Überschrift')
->wrap()
->weight(fn ($record): FontWeight => match ($record->ueberschrift_anzeigen) {
1 => FontWeight::Thin,
default => FontWeight::SemiBold,
}),
// ToggleColumn::make('ueberschrift_anzeigen')->label('')->tooltip('Überschrift im PDF anzeigen'),
->wrap(),
TextColumn::make('tabellen.name')->wrap()->label('Tabelle'),
TextColumn::make('textblock.name')->wrap(),
TextColumn::make('seite')
@@ -47,7 +48,7 @@ class InhaltsverzeichnisTable
->defaultSort('sort', direction: 'asc')
->reorderable('sort')
->recordActions([
EditAction::make()->iconButton(),
EditAction::make()->iconButton()->hidden(fn ($record) => (bool) $record->no_edit),
DeleteAction::make()->iconButton(),
]);
}
@@ -52,15 +52,20 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->hidden(fn ($record) => $record->name == 'DECKBLATT' ? true : false)
->schema([
Checkbox::make('neue_seite')
->label('Start neuer Seite')
->columnSpan(2),
->label('Start neuer Seite'),
Checkbox::make('ueberschrift_anzeigen')
->label('Überschrift angezeigen'),
Textarea::make('name')
->required()
->label('Kapitel / Absatz')
->label('Überschrift in der Inhaltsangabe')
->columnSpan(2),
Checkbox::make('ueberschrift_anzeigen')
->label('Überschrift angezeigen')
Textarea::make('name2')
->label('Überschrift im Dokument')
->belowContent([
'Bei abweichender Überschrift im Dokument',
])
->columnSpan(2),
TextInput::make('ordnungszahl')
->label('Kapitel Index')
->placeholder('3.21')
@@ -86,6 +91,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->schema([
TextInput::make('konto_textblock_id')->hidden(),
RichEditor::make('textblock')
->aboveLabel('Ausgabe Textblock vor Tabelle')
->columnSpan(5)
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
->toolbarButtons([
@@ -180,6 +186,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
Tab::make('Tabellen')
->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'
@@ -261,7 +268,7 @@ class ProjektInhaltsverzeichnisRelationManager extends RelationManager
->createAnother(false),
])
->recordActions([
EditAction::make()->iconButton()->hidden(fn ($record) => $record->name == 'INHALTSVERZEICHNIS' ? true : false),
EditAction::make()->iconButton()->hidden(fn ($record) => (bool) $record->no_edit),
DeleteAction::make()->iconButton(),
])
->toolbarActions([
+1
View File
@@ -14,6 +14,7 @@ class ProjektInhaltsverzeichnis extends Model
'textblock_id',
'sort',
'ordnungszahl',
'part',
'seite',
'neue_seite',
'seitenzahl_anzeige',