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;