mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Add portal_url variable
This commit is contained in:
parent
a1494a25d0
commit
25fe52ab18
@ -153,6 +153,8 @@ class HtmlEngine
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')];
|
||||
}
|
||||
|
||||
$data['$portal_url'] = ['value' => $this->invitation->getPortalLink(), 'label' =>''];
|
||||
|
||||
$data['$entity_number'] = &$data['$number'];
|
||||
$data['$invoice.discount'] = ['value' => Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.discount')];
|
||||
$data['$discount'] = &$data['$invoice.discount'];
|
||||
|
@ -66,6 +66,30 @@ trait Inviteable
|
||||
}
|
||||
}
|
||||
|
||||
public function getPortalLink() :string
|
||||
{
|
||||
|
||||
$domain = isset($this->company->portal_domain) ?: $this->company->domain();
|
||||
|
||||
switch ($this->company->portal_mode) {
|
||||
case 'subdomain':
|
||||
return $domain.'/client/';
|
||||
break;
|
||||
case 'iframe':
|
||||
return $domain.'/client/';
|
||||
//return $domain . $entity_type .'/'. $this->contact->client->client_hash .'/'. $this->key;
|
||||
break;
|
||||
case 'domain':
|
||||
return $domain.'/client/';
|
||||
break;
|
||||
|
||||
default:
|
||||
return '';
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function getAdminLink() :string
|
||||
{
|
||||
return $this->getLink().'?silent=true';
|
||||
|
Loading…
Reference in New Issue
Block a user