1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Working on pro plan

This commit is contained in:
Hillel Coren 2014-04-04 00:12:38 +03:00
parent c49da09f8a
commit 8e3f602e3a
12 changed files with 66 additions and 11 deletions

View File

@ -63,12 +63,16 @@ class AccountController extends \BaseController {
public function enableProPlan()
{
$account = Auth::user()->account;
dd(Request::all());
if ($account->pro_plan)
if (Auth::user()->isPro())
{
return Redirect::to('/dashboard');
}
$account = Auth::user()->account;
$client = new Client;
}
public function setTrashVisible($entityType, $visible)

View File

@ -14,7 +14,7 @@ class AddProPlan extends Migration {
{
Schema::table('accounts', function($table)
{
$table->boolean('pro_plan');
$table->timestamp('pro_plan_paid');
});
}
@ -27,7 +27,7 @@ class AddProPlan extends Migration {
{
Schema::table('accounts', function($table)
{
$table->dropColumn('pro_plan');
$table->dropColumn('pro_plan_paid');
});
}

View File

@ -288,4 +288,10 @@ return array(
'wrong_password_reset' => 'Ungültiges Passwort. Versuche es erneut',
),
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -278,7 +278,7 @@ return array(
'cvv' => 'CVV',
// Security alerts
'confide' => array(
'confide' => [
'too_many_attempts' => 'Too many attempts. Try again in few minutes.',
'wrong_credentials' => 'Incorrect email or password.',
'confirmation' => 'Your account has been confirmed!',
@ -286,7 +286,12 @@ return array(
'password_forgot' => 'The information regarding password reset was sent to your email.',
'password_reset' => 'Your password has been changed successfully.',
'wrong_password_reset' => 'Invalid password. Try again',
),
],
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -287,5 +287,11 @@ return array(
'wrong_password_reset' => 'Invalid password. Try again',
),
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -288,5 +288,11 @@ return array(
'wrong_password_reset' => 'Invalid password. Try again',
),
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -288,6 +288,12 @@ return array(
'wrong_password_reset' => 'Invalid password. Try again',
),
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -276,4 +276,11 @@ return array(
'expiration_year' => 'Ano de expiração',
'cvv' => 'CVV',
// Pro Plan
'pro_plan' => [
'remove_logo' => ':link to remove the Invoice Ninja logo by joining the pro plan',
'remove_logo_link' => 'Click here',
],
);

View File

@ -7,6 +7,11 @@ class Utils
return App::environment() == ENV_PRODUCTION;
}
public static function isNinjaProd()
{
return $_SERVER['SERVER_NAME'] == 'www.invoiceninja.com';
}
public static function basePath()
{
return substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1);

View File

@ -104,6 +104,16 @@ class User extends ConfideUser implements UserInterface, RemindableInterface
}
}
public function isPro()
{
if (!Auth::check())
{
return false;
}
return $this->account->pro_plan;
}
public function showGreyBackground()
{
return !$this->theme_id || in_array($this->theme_id, [2, 3, 5, 6, 7, 8, 10, 11, 12]);

View File

@ -318,7 +318,7 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice
</div>
@endif
@if ($_SERVER['SERVER_NAME'] != 'www.invoiceninja.com')
@if (!Utils::isNinjaProd())
<div class="container">{{ trans('texts.powered_by') }} <a href="https://www.invoiceninja.com/" target="_blank">InvoiceNinja.com</a></div>
@endif

View File

@ -274,8 +274,8 @@
<iframe id="theFrame" style="display:none" frameborder="1" width="100%" height="1180"></iframe>
<canvas id="theCanvas" style="display:none;width:100%;border:solid 1px #CCCCCC;"></canvas>
@if (!Auth::user()->account->pro_plan)
Enable the pro plan by {{ link_to('account/enable_pro_plan', 'clicking here') }} to remove the Invoice Ninja logo
@if (!Auth::user()->isPro())
{{ trans('texts.pro_plan.remove_logo', ['link'=>link_to('account/enable_pro_plan', trans('texts.pro_plan.remove_logo_link'))]) }}
@endif
<div class="modal fade" id="clientModal" tabindex="-1" role="dialog" aria-labelledby="clientModalLabel" aria-hidden="true">