Catch edge case when displaying document not available

This commit is contained in:
David Bomba 2024-03-27 20:08:55 +11:00
parent 34aaf9aec7
commit 7ae477faf3
3 changed files with 7 additions and 8 deletions

View File

@ -87,7 +87,7 @@ class InvitationController extends Controller
->firstOrFail();
if ($invitation->trashed() || $invitation->{$entity}->is_deleted) {
return $this->render('generic.not_available', ['account' => $invitation->company->account, 'company' => $invitation->company]);
return $this->render('generic.not_available', ['passed_account' => $invitation->company->account, 'passed_company' => $invitation->company]);
}
if ($invitation->contact->trashed()) {
@ -138,11 +138,10 @@ class InvitationController extends Controller
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key}), 'silent' => $is_silent]);
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key}), 'silent' => $is_silent])->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
}
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})]);
return redirect()->route('client.'.$entity.'.show', [$entity => $this->encodePrimaryKey($invitation->{$key})])->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
}
private function fireEntityViewedEvent($invitation, $entity_string)

View File

@ -26,7 +26,7 @@ class SubscriptionPurchaseController extends Controller
App::setLocale($subscription->company->locale());
if ($subscription->trashed()) {
return $this->render('generic.not_available', ['account' => $subscription->company->account, 'company' => $subscription->company]);
return $this->render('generic.not_available', ['passed_account' => $subscription->company->account, 'passed_company' => $subscription->company]);
}
/* Make sure the contact is logged into the correct company for this subscription */

View File

@ -7,15 +7,15 @@
<div class="m-auto md:w-1/2 lg:w-1/2">
<div class="flex flex-col items-center">
@if($account && !$account->isPaid())
@if($passed_account && !$passed_account->isPaid())
<div>
<img src="{{ asset('images/invoiceninja-black-logo-2.png') }}"
class="border-b border-gray-100 h-18 pb-4" alt="Invoice Ninja logo">
</div>
@elseif(isset($company) && !is_null($company))
@elseif(isset($passed_company) && !is_null($passed_company))
<div>
<img src="{{ $company->present()->logo() }}"
class="mx-auto border-b border-gray-100 h-18 pb-4" alt="{{ $company->present()->name() }} logo">
<img src="{{ $passed_company->present()->logo() }}"
class="mx-auto border-b border-gray-100 h-18 pb-4" alt="{{ $passed_company->present()->name() }} logo">
</div>
@endif
<h1 class="text-center text-3xl mt-10">{{ ctrans("texts.entity_removed_title") }}</h1>