1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Add promotion message in footer

This commit is contained in:
Hillel Coren 2017-12-01 11:50:16 +02:00
parent 7d03a4f38f
commit 60ec74b88d
4 changed files with 23 additions and 1 deletions

View File

@ -1110,6 +1110,14 @@ class Account extends Eloquent
return ! empty($plan_details);
}
/**
* @return mixed
*/
public function hasActivePromo()
{
return $this->company->hasActivePromo();
}
/**
* @param null $plan_details
*

View File

@ -199,6 +199,10 @@ class Company extends Eloquent
public function applyFreeYear()
{
if ($this->plan_started && $this->plan_started != '0000-00-00') {
return;
}
$this->plan = PLAN_PRO;
$this->plan_term = PLAN_TERM_YEARLY;
$this->plan_price = PLAN_PRICE_PRO_MONTHLY;

View File

@ -132,6 +132,14 @@ class User extends Authenticatable
return $this->account->isPro();
}
/**
* @return mixed
*/
public function hasActivePromo()
{
return $this->account->hasActivePromo();
}
/**
* @param $feature
*

View File

@ -470,7 +470,9 @@
<div class="col-md-12">
@if (Utils::isNinjaProd())
@if (Auth::check() && Auth::user()->isTrial())
@if (Auth::check() && Auth::user()->hasActivePromo())
Your promotion will expire soon, <a href="javascript:showUpgradeModal()">click here</a> to upgrade now.
@elseif (Auth::check() && Auth::user()->isTrial())
{!! trans(Auth::user()->account->getCountTrialDaysLeft() == 0 ? 'texts.trial_footer_last_day' : 'texts.trial_footer', [
'count' => Auth::user()->account->getCountTrialDaysLeft(),
'link' => '<a href="javascript:showUpgradeModal()">' . trans('texts.click_here') . '</a>'