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

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

View File

@ -14,7 +14,7 @@ class AddProPlan extends Migration {
{ {
Schema::table('accounts', function($table) 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) Schema::table('accounts', function($table)
{ {
$table->dropColumn('pro_plan'); $table->dropColumn('pro_plan_paid');
}); });
} }

View File

@ -287,5 +287,11 @@ return array(
'password_reset' => 'Dein Passwort wurde erfolgreich geändert.', 'password_reset' => 'Dein Passwort wurde erfolgreich geändert.',
'wrong_password_reset' => 'Ungültiges Passwort. Versuche es erneut', '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', 'cvv' => 'CVV',
// Security alerts // Security alerts
'confide' => array( 'confide' => [
'too_many_attempts' => 'Too many attempts. Try again in few minutes.', 'too_many_attempts' => 'Too many attempts. Try again in few minutes.',
'wrong_credentials' => 'Incorrect email or password.', 'wrong_credentials' => 'Incorrect email or password.',
'confirmation' => 'Your account has been confirmed!', '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_forgot' => 'The information regarding password reset was sent to your email.',
'password_reset' => 'Your password has been changed successfully.', 'password_reset' => 'Your password has been changed successfully.',
'wrong_password_reset' => 'Invalid password. Try again', '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

@ -286,6 +286,12 @@ return array(
'password_reset' => 'Your password has been changed successfully.', 'password_reset' => 'Your password has been changed successfully.',
'wrong_password_reset' => 'Invalid password. Try again', '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,6 +287,12 @@ return array(
'password_reset' => 'Your password has been changed successfully.', 'password_reset' => 'Your password has been changed successfully.',
'wrong_password_reset' => 'Invalid password. Try again', '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', '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', 'expiration_year' => 'Ano de expiração',
'cvv' => 'CVV', '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

@ -5,6 +5,11 @@ class Utils
public static function isProd() public static function isProd()
{ {
return App::environment() == ENV_PRODUCTION; return App::environment() == ENV_PRODUCTION;
}
public static function isNinjaProd()
{
return $_SERVER['SERVER_NAME'] == 'www.invoiceninja.com';
} }
public static function basePath() public static function basePath()

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() public function showGreyBackground()
{ {
return !$this->theme_id || in_array($this->theme_id, [2, 3, 5, 6, 7, 8, 10, 11, 12]); 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> </div>
@endif @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> <div class="container">{{ trans('texts.powered_by') }} <a href="https://www.invoiceninja.com/" target="_blank">InvoiceNinja.com</a></div>
@endif @endif

View File

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