diff --git a/.gitignore b/.gitignore index e3149e9c2c9a..c0de003549c8 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 a2d95c89681a..2cd63747f874 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 7e8fa5a58be7..403b24f8b847 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 6431283b52a9..419aeb41d8b7 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 f1a0c638a0cc..b107c4bf007e 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 012f793af333..225f420bc2fa 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() }}