From 7c92ed85308c715ec83fb10008f6b5ad9b27ab60 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 3 Apr 2014 23:01:03 +0300 Subject: [PATCH] Bug fixes --- app/controllers/AccountController.php | 10 ++++++ .../2014_04_03_191105_add_pro_plan.php | 34 +++++++++++++++++++ app/routes.php | 1 + app/views/invoices/edit.blade.php | 3 ++ 4 files changed, 48 insertions(+) create mode 100644 app/database/migrations/2014_04_03_191105_add_pro_plan.php diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 2397a18b114d..f6495396253f 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -61,6 +61,16 @@ class AccountController extends \BaseController { return Redirect::to('invoices/create'); } + public function enableProPlan() + { + $account = Auth::user()->account; + dd(Request::all()); + if ($account->pro_plan) + { + return Redirect::to('/dashboard'); + } + } + public function setTrashVisible($entityType, $visible) { Session::put('show_trash', $visible == 'true'); diff --git a/app/database/migrations/2014_04_03_191105_add_pro_plan.php b/app/database/migrations/2014_04_03_191105_add_pro_plan.php new file mode 100644 index 000000000000..afde3759bc35 --- /dev/null +++ b/app/database/migrations/2014_04_03_191105_add_pro_plan.php @@ -0,0 +1,34 @@ +boolean('pro_plan'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('accounts', function($table) + { + $table->dropColumn('pro_plan'); + }); + } + +} diff --git a/app/routes.php b/app/routes.php index bb7fc82e22ae..b29b32147730 100755 --- a/app/routes.php +++ b/app/routes.php @@ -61,6 +61,7 @@ Route::group(array('before' => 'auth'), function() Route::get('force_inline_pdf', 'UserController@forcePDFJS'); Route::get('account/getSearchData', array('as' => 'getSearchData', 'uses' => 'AccountController@getSearchData')); + Route::get('account/enable_pro_plan', 'AccountController@enableProPlan'); Route::get('company/{section?}', 'AccountController@showSection'); Route::post('company/{section?}', 'AccountController@doSection'); Route::post('user/setTheme', 'UserController@setTheme'); diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index d395a04949f9..9bb9c13a6f61 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -274,6 +274,9 @@ + @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 + @endif