diff --git a/.gitignore b/.gitignore index e3149e9c2..c0de00354 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ /ninja.sublime-workspace /tests/_log .env.development.php +.env.php .idea .project /nbproject/private/ \ No newline at end of file diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index a2d95c896..2cd63747f 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -64,7 +64,7 @@ class AccountController extends \BaseController Auth::login($user, true); Event::fire('user.login'); - return Redirect::to('invoices/create'); + return Redirect::to('invoices/create')->with('sign_up', Input::get('sign_up')); } public function enableProPlan() diff --git a/app/controllers/DashboardController.php b/app/controllers/DashboardController.php index 7e8fa5a58..403b24f8b 100644 --- a/app/controllers/DashboardController.php +++ b/app/controllers/DashboardController.php @@ -16,6 +16,9 @@ class DashboardController extends \BaseController ->leftJoin('invoices', 'clients.id', '=', 'invoices.client_id') ->where('accounts.id', '=', Auth::user()->account_id) ->where('clients.is_deleted', '=', false) + ->where('invoices.is_deleted', '=', false) + ->where('invoices.is_recurring', '=', false) + ->where('invoices.is_quote', '=', false) ->groupBy('accounts.id') ->first(); diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index 6431283b5..419aeb41d 100755 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -113,7 +113,7 @@ class HomeController extends BaseController public function invoiceNow() { if (Auth::check()) { - return Redirect::to('invoices/create'); + return Redirect::to('invoices/create')->with('sign_up', Input::get('sign_up')); } else { return View::make('public.header', ['invoiceNow' => true]); } diff --git a/app/views/header.blade.php b/app/views/header.blade.php index f1a0c638a..b107c4bf0 100755 --- a/app/views/header.blade.php +++ b/app/views/header.blade.php @@ -587,6 +587,8 @@ Want something changed? We're {{ link_to('https://github.com/hillelcoren/invoice @if (Auth::check() && !Utils::isNinja() && !Auth::user()->registered) $('#closeSignUpButton').hide(); showSignUp(); + @elseif(Session::get('sign_up') || Input::get('sign_up')) + showSignUp(); @endif @yield('onReady') diff --git a/app/views/public/header.blade.php b/app/views/public/header.blade.php index 012f793af..225f420bc 100644 --- a/app/views/public/header.blade.php +++ b/app/views/public/header.blade.php @@ -51,6 +51,7 @@ {{ Form::open(array('url' => 'get_started', 'id' => 'startForm')) }} {{ Form::hidden('guest_key') }} +{{ Form::hidden('sign_up', Input::get('sign_up')) }} {{ Form::close() }}