This commit is contained in:
salam committed 2025-10-13 17:17:30 +02:00
1 parent 8971b8b948
commit f676ec5a51
51 files changed
+1663 -601

No files matched your search

@@ -1,54 +0,0 @@
<?php
namespace App\Actions\Download;
use App\Actions\Generate\GenerateStandardTexte;
use App\Models\Projekt;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
class DownloadStandardTexte
{
public function download($projekts_id, $mode)
{
if ($mode == 'new') {
Projekt::where('id', $projekts_id)->update(['pdf_standardtexte' => '', 'pdf_standardtexte_ok' => '0']);
}
$headers = [
'Content-Type: application/pdf',
'Cache-Control: max-age=0',
'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT',
'Cache-Control: cache, must-revalidate',
];
$projekt = Projekt::where('id', $projekts_id)->first()->toArray();
$filepath = Storage::disk('public')->path("/download/$projekts_id/standards/");
if ($projekt['pdf_standardtexte_ok'] == 0) {
$filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['intname']).'.pdf';
if (! File::isDirectory($filepath)) {
File::makeDirectory($filepath, 0777, true, true);
}
$file = $filepath.$filename;
GenerateStandardTexte::generate($file, $projekts_id);
Projekt::where('id', $projekts_id)->update(['pdf_standardtexte' => $filename, 'pdf_standardtexte_ok' => 1]);
return Response::download($file, $projekt['name'], $headers);
} else {
$filename = $projekt['pdf_standardtexte'];
$file = $filepath.$filename;
return Response::download($file, $projekt['name'], $headers);
}
}
}
@@ -8,7 +8,7 @@ use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
class DownloadExcel
class Excel
{
public function download($projekts_id, $mode)
{
+64
View File
@@ -0,0 +1,64 @@
<?php
namespace App\Actions\Download;
use App\Actions\Generate\MakeGutachten;
use App\Models\Projekte;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
class Gutachten
{
public function download($projekts_id, $mode)
{
if ($mode == 'new') {
Projekte::where('id', $projekts_id)->update(['pdf_gutachten_name' => '', 'pdf_gutachten_status' => '0']);
}
$headers = [
'Content-Type: application/pdf',
'Cache-Control: max-age=0',
'Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT',
'Cache-Control: cache, must-revalidate',
];
$projekt = Projekte::where('id', $projekts_id)->first()->toArray();
$filepath = Storage::disk('public')->path("/download/$projekts_id/");
$filename = 'Gutachten '.preg_replace("'[^0-9a-zA-Z]'", '', $projekt['interner_name']).'.pdf';
if (! File::isDirectory($filepath)) {
File::makeDirectory($filepath, 0777, true, true);
}
$file = $filepath.$filename;
MakeGutachten::generate($file, $projekts_id);
return Response::download($file, $projekt['offizieller_name'], $headers);
// if ($projekt['pdf_standardtexte_ok'] == 0) {
// $filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['interner_name']).'.pdf';
// if (! File::isDirectory($filepath)) {
// File::makeDirectory($filepath, 0777, true, true);
// }
// $file = $filepath.$filename;
// MakeGutachten::generate($file, $projekts_id);
// Projekt::where('id', $projekts_id)->update(['pdf_standardtexte' => $filename, 'pdf_standardtexte_ok' => 1]);
// return Response::download($file, $projekt['name'], $headers);
// } else {
// $filename = $projekt['pdf_standardtexte'];
// $file = $filepath.$filename;
// return Response::download($file, $projekt['name'], $headers);
// }
}
}
@@ -8,13 +8,13 @@ use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Storage;
class DownloadNutzwerte
class Nutzwerte
{
public function download($projekts_id, $mode)
{
if ($mode == 'new') {
Projekt::where('id', $projekts_id)->update(['pdf_nutzwerte' => '', 'pdf_nutzwerte_ok' => '0']);
Projekt::where('id', $projekts_id)->update(['pdf_nutzwerte_name' => '', 'pdf_nutzwerte_status' => '0']);
}
$headers = [
@@ -24,11 +24,11 @@ class DownloadNutzwerte
'Cache-Control: cache, must-revalidate',
];
$projekt = Projekt::where('id', $projekts_id)->first()->toArray();
$projekt = Projekte::where('id', $projekts_id)->first()->toArray();
$filepath = Storage::disk('public')->path("/download/$projekts_id/nutzwerte/");
if ($projekt['pdf_nutzwerte_ok'] == 0) {
if ($projekt['pdf_nutzwerte_status'] == 0) {
$filename = preg_replace("'[^0-9a-zA-Z]'", '', $projekt['intname']).'.pdf';
@@ -45,7 +45,7 @@ class DownloadNutzwerte
} else {
$filename = $projekt['pdf_nutzwerte'];
$filename = $projekt['pdf_nutzwerte_name'];
$file = $filepath.$filename;
@@ -1,250 +0,0 @@
<?php
namespace App\Actions\Generate;
use App\Actions\Generate\StandardTexte\AllgemeinTabelle;
use App\Actions\Generate\StandardTexte\Deckblatt;
use App\Actions\Generate\StandardTexte\Inhalt;
use App\Actions\Generate\StandardTexte\Paragraph6Tabelle;
use App\Actions\Generate\StandardTexte\Standardtext;
use App\Actions\Generate\StandardTexte\Tabelle;
use App\Models\Auftraggeber;
use App\Models\Gutachter;
use App\Models\Inhaltsverzeichnis;
use App\Models\Platzhalter;
use App\Models\Projekt;
use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
class GenerateStandardTexte
{
public static $projekt;
public static $gutachter;
public static $auftraggeber;
public static $platzhalter = [];
public static function generate($filepath, $projekts_id)
{
self::$projekt = Projekt::where('id', $projekts_id)->get()->first();
self::$gutachter = Gutachter::where('id', self::$projekt->gutachters_id)->get()->first();
self::$auftraggeber = Auftraggeber::where('id', self::$projekt->auftraggebers_id)->get()->first();
self::$platzhalter = Platzhalter::where('projekts_id', $projekts_id)->pluck('platzhaltertext', 'platzhalter')->toArray();
$mpdf = new Mpdf(
[
'debug' => true,
'mode' => 'utf-8',
'format' => 'A4-P',
'margin_left' => 10,
'margin_right' => 10,
'margin_top' => 12,
'margin_bottom' => 20,
'margin_header' => 0,
'margin_footer' => 0,
]
);
$stylesheet = file_get_contents(__DIR__.'/../../../resources/css/pdf-download.css');
$mpdf->WriteHTML($stylesheet, HTMLParserMode::HEADER_CSS);
$mpdf->SetTitle('Nutzwertgutachen '.self::$projekt->name);
$mpdf->SetTitle('Standardtexte '.self::$projekt->name);
$mpdf->SetCreator('www.nutzwertgutachten.at');
$mpdf->SetAuthor(self::$gutachter->adressenblock);
$inhalte = Inhaltsverzeichnis::where('projekts_id', $projekts_id)->where('is_active', 1)->orderBy('pos')->get();
if (count($inhalte) == 0) {
exit;
}
foreach ($inhalte as $inhalt) {
$standardtext = Standardtext::replace($inhalt['standardtext']);
switch ($inhalt['kennung']) {
case 'deckblatt':
$html = Deckblatt::load($standardtext);
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'inhalt':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
}
$html = Inhalt::load($standardtext);
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
break;
case 'allgemeineangaben':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'auftraggeber':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= trim(self::$auftraggeber->adressenblock);
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'zweck':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'ortsbesichtigung':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'unterlagen':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'befund':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'grundbuchstand':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= Tabelle::load($standardtext);
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'beschreibung':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'paragraph_6_teil_1':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'paragraph_6_tabelle':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
}
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html = Paragraph6Tabelle::load($projekts_id);
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'paragraph_6_teil_2':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'allgemeinflaechen_nach_p6':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">ALLGEMEINFLÄCHEN</div>';
$html .= AllgemeinTabelle::load($projekts_id);
$html .= '<br><br><br><br><br><br><br>';
$html .= '<table class="inhalt"><tr>';
$html .= '<td>'.self::$projekt->erstellung.'</td>';
$html .= '<td class="right">'.self::$gutachter->kennung.'</td>';
$html .= '</tr></table>';
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'gutachten':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
}
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'allgemeine-grundsaetze':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'allgemeine-bewertungen':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
case 'zubehoer':
if ($inhalt['neue_seite']) {
$mpdf->AddPage();
$mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
}
$html = '<div class="header">'.$inhalt['titel'].'</div>';
$html .= $standardtext;
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
break;
}
}
ob_clean();
$mpdf->Output($filepath, 'F');
}
}
@@ -1,6 +1,6 @@
<?php
namespace App\Actions\Generate\StandardTexte;
namespace App\Actions\Generate\Gutachten;
use App\Models\Allgemeinflaechen;
use App\Utilities\Html;
@@ -0,0 +1,41 @@
<?php
namespace App\Actions\Generate\Gutachten;
use App\Actions\Generate\MakeGutachten;
class Deckblatt
{
public static function create()
{
// GUTACHTER
$html = '<div class="right">';
$html .= '<p class="big">'.MakeGutachten::$gutachter->company.'</p>';
$html .= '<p class="gray small">'.nl2br(MakeGutachten::$gutachter->address).'</p>';
$html .= '</div>';
// if (MakeGutachten::$gutachter->kopf == 'adressenblock') {
// $html .= '<div class="right">'.MakeGutachten::$gutachter->adressenblock.'</div>';
// } elseif (MakeGutachten::$gutachter->kopf == 'logo') {
// $html .= '<div class="right">';
// $html .= '<img src="'.public_path().'/storage/'.MakeGutachten::$gutachter->clientlogo.'" style="width:'.MakeGutachten::$gutachter->breite.'mm; height: auto;">';
// $html .= '</div>';
// }
// $html .= '</div>';
$html .= '<div class="title">Gutachten';
$html .= '<div class="base ml-1 mt-2">'.trim(MakeGutachten::$projekt->interner_name).'</div>';
$html .= '</div>';
$html .= '<div class="festsetzung">Zur Festsetzung der Nutzwerte';
$html .= '<div class="base">'.trim(MakeGutachten::$projekt->offizieller_name).'</div>';
$html .= '</div>';
// // AUFTRAGGEBER
// $html .= '<div class="auftraggeber">';
// $html .= MakeGutachten::$auftraggeber->adressenblock;
return $html;
}
}
@@ -1,6 +1,6 @@
<?php
namespace App\Actions\Generate\StandardTexte;
namespace App\Actions\Generate\Gutachten;
use App\Utilities\Html;
@@ -1,6 +1,6 @@
<?php
namespace App\Actions\Generate\StandardTexte;
namespace App\Actions\Generate\Gutachten;
use App\Utilities\Html;
use Illuminate\Support\Facades\DB;
@@ -1,6 +1,6 @@
<?php
namespace App\Actions\Generate\StandardTexte;
namespace App\Actions\Generate\Gutachten;
use App\Actions\Generate\GenerateStandardTexte;
@@ -1,6 +1,6 @@
<?php
namespace App\Actions\Generate\StandardTexte;
namespace App\Actions\Generate\Gutachten;
use App\Utilities\Html;
@@ -10,7 +10,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Fill;
class GenerateExcel
class MakeExcel
{
public static function generate($filepath, $projekts_id)
{
+260
View File
@@ -0,0 +1,260 @@
<?php
namespace App\Actions\Generate;
use App\Actions\Generate\Gutachten\AllgemeinTabelle;
use App\Actions\Generate\Gutachten\Deckblatt;
use App\Actions\Generate\Gutachten\Inhalt;
use App\Actions\Generate\Gutachten\Paragraph6Tabelle;
use App\Actions\Generate\Gutachten\Standardtext;
use App\Actions\Generate\Gutachten\Tabelle;
use App\Models\Auftraggeber;
use App\Models\Gutachter;
use App\Models\Inhaltsverzeichnis;
use App\Models\Platzhalter;
use App\Models\Projekte;
use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
class MakeGutachten
{
public static $projekt;
public static $gutachter;
public static $auftraggeber;
public static $platzhalter = [];
public static function generate($filepath, $projekts_id)
{
self::$projekt = Projekte::where('id', $projekts_id)->get()->first();
self::$gutachter = Gutachter::where('id', self::$projekt->gutachter_id)->get()->first();
self::$auftraggeber = Auftraggeber::where('id', self::$projekt->auftraggeber_id)->get()->first();
// self::$platzhalter = Platzhalter::where('projekts_id', $projekts_id)->pluck('platzhaltertext', 'platzhalter')->toArray();
$mpdf = new Mpdf(
[
'debug' => true,
'mode' => 'utf-8',
'format' => 'A4-P',
'margin_left' => 15,
'margin_right' => 10,
'margin_top' => 10,
'margin_bottom' => 10,
'margin_header' => 0,
'margin_footer' => 0,
]
);
$stylesheet = file_get_contents(__DIR__.'/../../../resources/css/pdf-download.css');
$mpdf->WriteHTML($stylesheet, HTMLParserMode::HEADER_CSS);
$mpdf->SetTitle('Nutzwertgutachen '.self::$projekt->offizieller_name);
$mpdf->SetTitle('Gutachten '.self::$projekt->offizieller_name);
$mpdf->SetCreator('nutzwerte.at');
$mpdf->SetAuthor(self::$gutachter->title.' '.self::$gutachter->gender.' '.self::$gutachter->name);
/**
* DECKBLATT
*/
$html = Deckblatt::create();
$mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// $inhalte = Inhaltsverzeichnis::where('projekts_id', $projekts_id)->where('is_active', 1)->orderBy('pos')->get();
// if (count($inhalte) == 0) {
// exit;
// }
// foreach ($inhalte as $inhalt) {
// $standardtext = Standardtext::replace($inhalt['standardtext']);
// switch ($inhalt['kennung']) {
// case 'deckblatt':
// $html = Deckblatt::load($standardtext);
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'inhalt':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// }
// $html = Inhalt::load($standardtext);
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// break;
// case 'allgemeineangaben':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'auftraggeber':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= trim(self::self::$auftraggeber->adressenblock);
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'zweck':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'ortsbesichtigung':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'unterlagen':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'befund':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'grundbuchstand':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= Tabelle::load($standardtext);
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'beschreibung':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'paragraph_6_teil_1':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'paragraph_6_tabelle':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// }
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html = Paragraph6Tabelle::load($projekts_id);
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'paragraph_6_teil_2':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'allgemeinflaechen_nach_p6':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">ALLGEMEINFLÄCHEN</div>';
// $html .= AllgemeinTabelle::load($projekts_id);
// $html .= '<br><br><br><br><br><br><br>';
// $html .= '<table class="inhalt"><tr>';
// $html .= '<td>'.self::$projekt->erstellung.'</td>';
// $html .= '<td class="right">'.self::$gutachter->kennung.'</td>';
// $html .= '</tr></table>';
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'gutachten':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// }
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'allgemeine-grundsaetze':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'allgemeine-bewertungen':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['index'].' - '.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// case 'zubehoer':
// if ($inhalt['neue_seite']) {
// $mpdf->AddPage();
// $mpdf->SetHTMLFooter('<div class="size09 center">Seite {PAGENO}<br><br></div>');
// }
// $html = '<div class="header">'.$inhalt['titel'].'</div>';
// $html .= $standardtext;
// $mpdf->WriteHTML($html, HTMLParserMode::HTML_BODY);
// break;
// }
// }
ob_clean();
$mpdf->Output($filepath, 'F');
}
}
@@ -16,7 +16,7 @@ use App\Models\Projekt;
use Mpdf\HTMLParserMode;
use Mpdf\Mpdf;
class GenerateNutzwerte
class MakeNutzwerte
{
public static $projekt;
@@ -1,39 +0,0 @@
<?php
namespace App\Actions\Generate\StandardTexte;
use App\Actions\Generate\GenerateStandardTexte;
class Deckblatt
{
public static function load($standardtext)
{
// GUTACHTER
$html = '<div class="deckblatt">';
if (GenerateStandardTexte::$gutachter->kopf == 'adressenblock') {
$html .= '<div class="right">'.GenerateStandardTexte::$gutachter->adressenblock.'</div>';
} elseif (GenerateStandardTexte::$gutachter->kopf == 'logo') {
$html .= '<div class="right">';
$html .= '<img src="'.public_path().'/storage/'.GenerateStandardTexte::$gutachter->clientlogo.'" style="width:'.GenerateStandardTexte::$gutachter->breite.'mm; height: auto;">';
$html .= '</div>';
}
$html .= '</div>';
// TITEL
$html .= '<div class="title">Gutachten';
$html .= '<div class="basetext">'.trim(GenerateStandardTexte::$projekt->name).'</div>';
$html .= '</div>';
// PROJEKT
$html .= '<div class="festsetzung">Zur Festsetzung der Nutzwerte';
$html .= '<div class="basetext">'.trim($standardtext).'</div>';
$html .= '</div>';
// AUFTRAGGEBER
$html .= '<div class="auftraggeber">';
$html .= GenerateStandardTexte::$auftraggeber->adressenblock;
$html .= '</div>';
return $html;
}
}
-4
View File
@@ -115,10 +115,6 @@ class Register extends BaseRegister
Textarea::make('kontos.address')
->label('Adresse')
->required(),
TextInput::make('kontos.country')
->label('Land')
->default('Österreich')
->required(),
])->columnSpan(4),
Fieldset::make('Kontaktperson')
->visible(fn (Get $get): bool => $get('register-modus') == 'new')
@@ -31,10 +31,6 @@ class AuftraggeberForm
Textarea::make('address')
->label('Adresse')
->required(),
TextInput::make('country')
->label('Land')
->default('Österreich')
->required(),
]),
Tab::make('Kontaktperson')
->icon('lucide-contact')
@@ -31,12 +31,8 @@ class GutachterForm
Textarea::make('address')
->label('Adresse')
->required(),
TextInput::make('country')
->label('Land')
->default('Österreich')
->required(),
]),
Tab::make('Kontaktperson')
Tab::make('Gutachter')
->icon('lucide-contact')
->inlineLabel()
->schema([
@@ -76,7 +72,7 @@ class GutachterForm
'1:1',
])
->directory('gutachter-logo')
->label('Gutachter Logo'),
->label('Logo'),
]),
Tab::make('Anzeige Im Gutachten')
->icon('phosphor-eye')
@@ -85,9 +81,9 @@ class GutachterForm
CheckboxList::make('kopf')
->Label('Bitte auswählen')
->options([
'logo' => '<div class="flex gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" fill="currentColor" viewBox="0 0 256 256"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"></path></svg>Logo des Gutachters</div>',
'logo' => '<div class="flex gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" fill="currentColor" viewBox="0 0 256 256"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"></path></svg>Logo</div>',
'firma' => '<div class="flex gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-stamp-icon lucide-stamp"><path d="M14 13V8.5C14 7 15 7 15 5a3 3 0 0 0-6 0c0 2 1 2 1 3.5V13"/><path d="M20 15.5a2.5 2.5 0 0 0-2.5-2.5h-11A2.5 2.5 0 0 0 4 15.5V17a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1z"/><path d="M5 22h14"/></svg> Firma mit Adresse</div>',
'name' => '<div class="flex gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-contact-icon lucide-contact"><path d="M16 2v2"/><path d="M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2"/><path d="M8 2v2"/><circle cx="12" cy="11" r="3"/><rect x="3" y="4" width="18" height="18" rx="2"/></svg> Name des Gutachters</div>',
'name' => '<div class="flex gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-contact-icon lucide-contact"><path d="M16 2v2"/><path d="M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2"/><path d="M8 2v2"/><circle cx="12" cy="11" r="3"/><rect x="3" y="4" width="18" height="18" rx="2"/></svg>Gutachter</div>',
])
->allowHtml()
->columnSpanFull(),
@@ -41,10 +41,6 @@ class KontoForm
Textarea::make('address')
->label('Adresse')
->required(),
TextInput::make('country')
->label('Land')
->default('Österreich')
->required(),
])->columnSpanFull(),
Tab::make('Kontaktperson')
->icon('lucide-contact')
@@ -15,40 +15,48 @@ class EditProjekte extends EditRecord
protected function getHeaderActions(): array
{
return [
Action::make('standardtexte')
->label('Standard Texte')
Action::make('gutachten')
->disabled(fn ($record): bool => ! $record->pdf_gutachten_status)
->color(fn ($record): string => match ($record->pdf_gutachten_status) {
1 => 'info',
default => 'gray',
})
->label('Gutachten')
->icon('icon-pdf')
->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'file']))
->openUrlInNewTab(),
Action::make('nutzwerte')
->color('gray')
->label('Nutzwerte')
->icon('icon-pdf')
->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'file']))
->openUrlInNewTab(),
Action::make('nutzwerte_excel')
Action::make('excel')
->color('gray')
->label('Nutzdaten')
->color('success')
->icon('icon-excel')
->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'file']))
->openUrlInNewTab(),
ActionGroup::make([
Action::make('generator_standardtexte')
->label('Standards Generieren')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
Action::make('generator_nutzwerte')
->label('Nutzwerte Generieren')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
Action::make('nutzwerte_excel')
->label('Excel Generieren')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
Action::make('make_gutachten')
->label('Gutachten Erstellen')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('standard.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
Action::make('make_nutzwerte')
->label('Nutzwerte Erstellen')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('nutzwerte.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
Action::make('make_excel')
->label('Datenblatt Erstellen')
->icon('heroicon-o-cog-8-tooth')
->url(fn ($record) => route('excel.download', ['record' => $record, 'mode' => 'new']))
->openUrlInNewTab(),
DeleteAction::make()->label('Projekt löschen'),
]),
])->label('Berechnen')
->icon('heroicon-m-ellipsis-vertical')
->color('primary'),
];
}
@@ -56,12 +64,4 @@ class EditProjekte extends EditRecord
{
return 'Projekt Änderungen gespeichert';
}
// protected function getFormActions(): array
// {
// return [
// $this->getSaveFormAction()->label('Sichern'),
// $this->getCancelFormAction()->label('Zurück zu Liste'),
// ];
// }
}
@@ -53,7 +53,10 @@ class RaeumeallesRelationManager extends RelationManager
->striped()
->recordTitleAttribute('top_nummer')
->columns([
TextColumn::make('top_nummer')->searchable()->label('Top'),
TextColumn::make('top_nummer')
->extraAttributes(['pointer-events' => 'none'])
->searchable()
->label('Top'),
TextColumn::make('geschoss')->searchable(),
TextColumn::make('raumart')->searchable(),
TextInputColumn::make('faktor')
-1
View File
@@ -20,7 +20,6 @@ class Auftraggeber extends Model
'company',
'logo',
'address',
'country',
'email',
'phone',
'use_logo',
-1
View File
@@ -20,7 +20,6 @@ class Gutachter extends Model
'company',
'logo',
'address',
'country',
'email',
'phone',
'use_logo',
-1
View File
@@ -24,7 +24,6 @@ class Konto extends Model
'company',
'email',
'address',
'country',
'phone',
'uid_number',
'plan_id',
+70
View File
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\KontoTextblock;
use Illuminate\Auth\Access\HandlesAuthorization;
class KontoTextblockPolicy
{
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return $authUser->can('ViewAny:KontoTextblock');
}
public function view(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('View:KontoTextblock');
}
public function create(AuthUser $authUser): bool
{
return $authUser->can('Create:KontoTextblock');
}
public function update(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('Update:KontoTextblock');
}
public function delete(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('Delete:KontoTextblock');
}
public function restore(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('Restore:KontoTextblock');
}
public function forceDelete(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('ForceDelete:KontoTextblock');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:KontoTextblock');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:KontoTextblock');
}
public function replicate(AuthUser $authUser, KontoTextblock $kontoTextblock): bool
{
return $authUser->can('Replicate:KontoTextblock');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:KontoTextblock');
}
}