From 604f074dfa888a4da054037459143ea6ce6900f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 10 May 2021 13:26:13 +0200 Subject: [PATCH 1/3] Show invoices full screen --- app/Http/Controllers/ClientPortal/InvoiceController.php | 2 +- .../views/portal/ninja2020/invoices/show-fullscreen.blade.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 9746863da046..ff5a0d493650 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -57,7 +57,7 @@ class InvoiceController extends Controller ]; if ($request->query('mode') === 'fullscreen') { - return response()->file($invoice->pdf_file_path(null, 'path')); + return render('invoices.show-fullscreen', $data); } return $this->render('invoices.show', $data); diff --git a/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php b/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php new file mode 100644 index 000000000000..8b1bb3b8da23 --- /dev/null +++ b/resources/views/portal/ninja2020/invoices/show-fullscreen.blade.php @@ -0,0 +1,2 @@ + From 580628b7f97cb2cc1a9823540439546223f968e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 10 May 2021 13:28:31 +0200 Subject: [PATCH 2/3] Show quotes --- app/Http/Controllers/ClientPortal/QuoteController.php | 2 +- .../views/portal/ninja2020/quotes/show-fullscreen.blade.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 resources/views/portal/ninja2020/quotes/show-fullscreen.blade.php diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index e634cdb258e8..cf73519e12e6 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -44,7 +44,7 @@ class QuoteController extends Controller ]; if ($request->query('mode') === 'fullscreen') { - return response()->file($quote->pdf_file_path(null, 'path')); + return render('quotes.show-fullscreen', $data); } return $this->render('quotes.show', $data); diff --git a/resources/views/portal/ninja2020/quotes/show-fullscreen.blade.php b/resources/views/portal/ninja2020/quotes/show-fullscreen.blade.php new file mode 100644 index 000000000000..0c1d9597545e --- /dev/null +++ b/resources/views/portal/ninja2020/quotes/show-fullscreen.blade.php @@ -0,0 +1,2 @@ + From 50ad75b5167285f0859c02e86c81eda94efb4937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 10 May 2021 13:35:38 +0200 Subject: [PATCH 3/3] Fix the wrong variable reference --- app/Http/Controllers/ClientPortal/QuoteController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index cf73519e12e6..a7d6354eeecc 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -76,9 +76,9 @@ class QuoteController extends Controller } if ($quotes->count() == 1) { - return response()->streamDownload(function () use ($invoices) { - echo file_get_contents($invoices->first()->pdf_file_path()); - }, basename($invoices->first()->pdf_file_path()), ['Cache-Control:' => 'no-cache']); + return response()->streamDownload(function () use ($quotes) { + echo file_get_contents($quotes->first()->pdf_file_path()); + }, basename($quotes->first()->pdf_file_path()), ['Cache-Control:' => 'no-cache']); //return response()->download(TempFile::path($invoices->first()->pdf_file_path()), basename($quotes->first()->pdf_file_path())); }