This commit is contained in:
salam committed 2025-10-21 18:00:44 +02:00
1 parent 9881d8c37b
commit 6bf10b25bd
21 files changed
+245 -178

No files matched your search

+21 -3
View File
@@ -10,12 +10,14 @@ use App\Actions\Generate\Gutachten\Platzhalter;
use App\Actions\Generate\Gutachten\Standardtext;
use App\Actions\Generate\Gutachten\Tabelle;
use App\Actions\Generate\Gutachten\Ueberschrift;
use App\Actions\Generate\Utilities\Format;
use App\Models\Auftraggeber;
use App\Models\Gutachter;
use App\Models\Inhaltsverzeichnis;
use App\Models\Projekte;
use App\Models\ProjektInhaltsverzeichnis;
use App\Models\ProjektPlatzhalter;
use Filament\Forms\Components\RichEditor\RichContentRenderer;
use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
@@ -72,22 +74,38 @@ class MakeGutachten
$mpdf->AddPage();
}
$textblock = $inhalt->textblock ? Platzhalter::replace($inhalt->textblock) : '';
if ($inhalt->textblock) {
$textblock = Platzhalter::replace($inhalt->textblock);
$textblock = Format::fix_str($textblock);
}
if ($inhalt->name == 'DECKBLATT') {
$html = Deckblatt::create($textblock);
} elseif ($inhalt->name == 'INHALTSVERZEICHNIS') {
$html = Inhalt::create();
} else {
$html = Ueberschrift::create($inhalt);
$html .= $textblock;
switch ($inhalt->tabellen_id) {
case '8':
$str = RichContentRenderer::make(MakeGutachten::$auftraggeber->referenz_formatting)->toHtml();
$html .= Format::fix_str($str);
break;
}
if ($inhalt->textblock) {
$html .= $textblock;
}
}
if ($inhalt->seitenzahl_anzeige == 1) {
$mpdf->SetHTMLFooter('<div class="center">Seite {PAGENO}<br><br></div>');
}
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
if ($html) {
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
}
}
// $inhalte = Inhaltsverzeichnis::where('projekte_id', $projekte_id)->where('is_active', 1)->orderBy('pos')->get();