mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Fix for invoice.services
This commit is contained in:
parent
c0dc7f4e22
commit
b957b4397b
@ -46,6 +46,11 @@ class ClientPortalController extends BaseController
|
||||
|
||||
public function view($invitationKey)
|
||||
{
|
||||
if (request()->silent) {
|
||||
session(['silent' => true]);
|
||||
return redirect(request()->url());
|
||||
}
|
||||
|
||||
if (!$invitation = $this->invoiceRepo->findInvoiceByInvitation($invitationKey)) {
|
||||
return $this->returnError();
|
||||
}
|
||||
@ -65,7 +70,7 @@ class ClientPortalController extends BaseController
|
||||
|
||||
$account->loadLocalizationSettings($client);
|
||||
|
||||
if (!Input::has('phantomjs') && !Input::has('silent') && !Session::has($invitationKey)
|
||||
if (! Input::has('phantomjs') && ! session('silent') && ! Session::has($invitationKey)
|
||||
&& (!Auth::check() || Auth::user()->account_id != $invoice->account_id)) {
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
|
||||
event(new QuoteInvitationWasViewed($invoice, $invitation));
|
||||
|
@ -167,11 +167,6 @@ class InvoiceController extends BaseController
|
||||
$contact->invitation_openend = $invitation->opened_date && $invitation->opened_date != '0000-00-00 00:00:00' ? $invitation->opened_date : false;
|
||||
$contact->invitation_status = $contact->email_error ? false : $invitation->getStatus();
|
||||
$contact->invitation_signature_svg = $invitation->signatureDiv();
|
||||
|
||||
// when using invoice.services prevent markng as viewed
|
||||
if (Utils::isNinja() && $account->domain_id != \Domain::INVOICENINJA_COM) {
|
||||
$contact->invitation_link .= '?silent=true';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -717,10 +717,6 @@ class Account extends Eloquent
|
||||
*/
|
||||
public function hasLogo()
|
||||
{
|
||||
if($this->logo == ''){
|
||||
$this->calculateLogoDetails();
|
||||
}
|
||||
|
||||
return !empty($this->logo);
|
||||
}
|
||||
|
||||
|
@ -666,7 +666,9 @@ function ContactModel(data) {
|
||||
var str = '';
|
||||
@if (Utils::isConfirmed())
|
||||
if (self.invitation_link()) {
|
||||
str += '<a href="' + self.invitation_link() + '" target="_blank">{{ trans('texts.view_as_recipient') }}</a>';
|
||||
// clicking add 'silent=true' however it's removed when copying the link
|
||||
str += '<a href="' + self.invitation_link() + '" onclick="window.open(\'' + self.invitation_link()
|
||||
+ '?silent=true\', \'_blank\');return false;">{{ trans('texts.view_as_recipient') }}</a>';
|
||||
}
|
||||
@endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user