mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Fixes for client portal PDF display
This commit is contained in:
parent
372471b267
commit
ae74f5a9d8
@ -251,7 +251,7 @@ class Credit extends BaseModel
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function pdf_file_path($invitation = null, string $type = 'url')
|
||||
public function pdf_file_path($invitation = null, string $type = 'path')
|
||||
{
|
||||
if (! $invitation) {
|
||||
|
||||
@ -267,13 +267,11 @@ class Credit extends BaseModel
|
||||
if(!$invitation)
|
||||
throw new \Exception('Hard fail, could not create an invitation - is there a valid contact?');
|
||||
|
||||
|
||||
$file_path = CreateEntityPdf::dispatchNow($invitation);
|
||||
|
||||
return Storage::disk('public')->path($file_path);
|
||||
return Storage::disk('public')->{$type}($file_path);
|
||||
}
|
||||
|
||||
|
||||
public function markInvitationsSent()
|
||||
{
|
||||
$this->invitations->each(function ($invitation) {
|
||||
|
@ -392,7 +392,7 @@ class Invoice extends BaseModel
|
||||
return $invoice_calc->build();
|
||||
}
|
||||
|
||||
public function pdf_file_path($invitation = null, string $type = 'url')
|
||||
public function pdf_file_path($invitation = null, string $type = 'path')
|
||||
{
|
||||
if (! $invitation) {
|
||||
|
||||
@ -408,10 +408,9 @@ class Invoice extends BaseModel
|
||||
if(!$invitation)
|
||||
throw new \Exception('Hard fail, could not create an invitation - is there a valid contact?');
|
||||
|
||||
|
||||
$file_path = CreateEntityPdf::dispatchNow($invitation);
|
||||
|
||||
return Storage::disk('public')->path($file_path);
|
||||
return Storage::disk('public')->{$type}($file_path);
|
||||
}
|
||||
|
||||
public function markInvitationsSent()
|
||||
|
@ -207,7 +207,7 @@ class Quote extends BaseModel
|
||||
}
|
||||
|
||||
|
||||
public function pdf_file_path($invitation = null, string $type = 'url')
|
||||
public function pdf_file_path($invitation = null, string $type = 'path')
|
||||
{
|
||||
if (! $invitation) {
|
||||
|
||||
@ -223,13 +223,13 @@ class Quote extends BaseModel
|
||||
if(!$invitation)
|
||||
throw new \Exception('Hard fail, could not create an invitation - is there a valid contact?');
|
||||
|
||||
|
||||
$file_path = CreateEntityPdf::dispatchNow($invitation);
|
||||
|
||||
return Storage::disk('public')->path($file_path);
|
||||
return Storage::disk('public')->{$type}($file_path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param int $status
|
||||
* @return string
|
||||
|
@ -2,7 +2,7 @@
|
||||
@section('meta_title', ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.credit'), 'entity_number' => $credit->number]))
|
||||
|
||||
@push('head')
|
||||
<meta name="pdf-url" content="{{ $credit->pdf_file_path() }}">
|
||||
<meta name="pdf-url" content="{{ $credit->pdf_file_path(null, 'url') }}">
|
||||
<script src="{{ asset('js/vendor/pdf.js/pdf.min.js') }}"></script>
|
||||
@endpush
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
<iframe src="{{ $invoice->pdf_file_path() }}"
|
||||
<iframe src="{{ $invoice->pdf_file_path(null, 'url') }}"
|
||||
style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"></iframe>
|
||||
|
@ -2,7 +2,7 @@
|
||||
@section('meta_title', ctrans('texts.view_invoice'))
|
||||
|
||||
@push('head')
|
||||
<meta name="pdf-url" content="{{ $invoice->pdf_file_path() }}">
|
||||
<meta name="pdf-url" content="{{ $invoice->pdf_file_path(null, 'url') }}">
|
||||
<meta name="show-invoice-terms" content="{{ $settings->show_accept_invoice_terms ? true : false }}">
|
||||
<meta name="require-invoice-signature" content="{{ $client->user->account->hasFeature(\App\Models\Account::FEATURE_INVOICE_SETTINGS) && $settings->require_invoice_signature }}">
|
||||
<script src="{{ asset('js/vendor/pdf.js/pdf.min.js') }}"></script>
|
||||
@ -174,7 +174,7 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<iframe src="{{ $invoice->pdf_file_path() }}" class="h-screen w-full border-0 hidden lg:block mt-4"></iframe>
|
||||
<iframe src="{{ $invoice->pdf_file_path(null, 'url') }}" class="h-screen w-full border-0 hidden lg:block mt-4"></iframe>
|
||||
|
||||
<div class="flex justify-center">
|
||||
<canvas id="pdf-placeholder" class="shadow rounded-lg bg-white lg:hidden mt-4 p-4"></canvas>
|
||||
|
@ -1,2 +1,2 @@
|
||||
<iframe src="{{ $quote->pdf_file_path() }}"
|
||||
<iframe src="{{ $quote->pdf_file_path(null,'url') }}"
|
||||
style="position:fixed; top:0; left:0; bottom:0; right:0; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;"></iframe>
|
||||
|
@ -2,7 +2,7 @@
|
||||
@section('meta_title', ctrans('texts.entity_number_placeholder', ['entity' => ctrans('texts.quote'), 'entity_number' => $quote->number]))
|
||||
|
||||
@push('head')
|
||||
<meta name="pdf-url" content="{{ asset($quote->pdf_file_path()) }}">
|
||||
<meta name="pdf-url" content="{{ asset($quote->pdf_file_path(null, 'url')) }}">
|
||||
<script src="{{ asset('js/vendor/pdf.js/pdf.min.js') }}"></script>
|
||||
|
||||
<meta name="show-quote-terms" content="{{ $settings->show_accept_quote_terms ? true : false }}">
|
||||
@ -78,7 +78,7 @@
|
||||
<canvas id="pdf-placeholder" class="shadow rounded-lg bg-white lg:hidden mt-4 p-4"></canvas>
|
||||
</div>
|
||||
|
||||
<iframe src="{{ $quote->pdf_file_path() }}" class="h-screen w-full border-0 hidden lg:block mt-4"></iframe>
|
||||
<iframe src="{{ $quote->pdf_file_path(null, 'url') }}" class="h-screen w-full border-0 hidden lg:block mt-4"></iframe>
|
||||
|
||||
@include('portal.ninja2020.invoices.includes.terms', ['entities' => [$quote], 'entity_type' => ctrans('texts.quote')])
|
||||
@include('portal.ninja2020.invoices.includes.signature')
|
||||
|
@ -1,7 +1,7 @@
|
||||
@extends('portal.ninja2020.layout.clean')
|
||||
|
||||
@push('head')
|
||||
<meta name="pdf-url" content="{{ asset($entity->pdf_file_path()) }}">
|
||||
<meta name="pdf-url" content="{{ asset($entity->pdf_file_path(null, 'url')) }}">
|
||||
<script src="{{ asset('js/vendor/pdf.js/pdf.min.js') }}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.x/dist/alpine.min.js" defer></script>
|
||||
@endpush
|
||||
@ -39,7 +39,7 @@
|
||||
<div x-show="open" x-transition:enter="transition ease-out duration-100" x-transition:enter-start="transform opacity-0 scale-95" x-transition:enter-end="transform opacity-100 scale-100" x-transition:leave="transition ease-in duration-75" x-transition:leave-start="transform opacity-100 scale-100" x-transition:leave-end="transform opacity-0 scale-95" class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg">
|
||||
<div class="rounded-md bg-white shadow-xs">
|
||||
<div class="py-1">
|
||||
<a target="_blank" href="{{ asset($entity->pdf_file_path()) }}" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
<a target="_blank" href="{{ asset($entity->pdf_file_path(null, 'url')) }}" class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ ctrans('texts.open_in_new_tab') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user