diff --git a/.gitignore b/.gitignore index d224f3651e0f..3a650b3e97aa 100644 --- a/.gitignore +++ b/.gitignore @@ -12,12 +12,10 @@ /bootstrap/environment.php /vendor /.env.development.php -/composer.phar -/composer.lock /.DS_Store /Thumbs.db /ninja.sublime-project /ninja.sublime-workspace /tests/_log .idea -.project +.project \ No newline at end of file diff --git a/app/database/migrations/2014_04_17_100523_add_remember_token.php b/app/database/migrations/2014_04_17_100523_add_remember_token.php new file mode 100644 index 000000000000..6a436001075a --- /dev/null +++ b/app/database/migrations/2014_04_17_100523_add_remember_token.php @@ -0,0 +1,34 @@ +string('remember_token', 100)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function($table) + { + $table->dropColumn('remember_token'); + }); + } + +} diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php index f87a0d310abf..204d2439dfae 100644 --- a/app/lang/de/texts.php +++ b/app/lang/de/texts.php @@ -310,5 +310,7 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index 459ffe7bb9b5..dc707bbf39c4 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -310,4 +310,6 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php index f1252896d15e..18628e65cfb6 100644 --- a/app/lang/es/texts.php +++ b/app/lang/es/texts.php @@ -309,5 +309,7 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php index c13031ff3e61..60b06e3de8f7 100644 --- a/app/lang/fr/texts.php +++ b/app/lang/fr/texts.php @@ -309,6 +309,8 @@ return array( 'pro_plan_product' => 'Plan Pro', 'pro_plan_description' => 'Inscription d\'une durée d\'un an au Plan Pro d\'Invoice ninja', 'pro_plan_success' => 'Merci pour votre inscription ! Une fois la facture réglée, votre adhésion au Plan Pro commencera.', + + 'unsaved_changes' => 'You have unsaved changes', ); diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php index 80084dd0fc04..aaaf32bb3d7a 100644 --- a/app/lang/it/texts.php +++ b/app/lang/it/texts.php @@ -310,5 +310,7 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/lang/nl/texts.php b/app/lang/nl/texts.php index a042310ab74a..06bec940f064 100644 --- a/app/lang/nl/texts.php +++ b/app/lang/nl/texts.php @@ -310,5 +310,7 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php index 0280fa85c2ec..d4f9aa17cf47 100644 --- a/app/lang/pt_BR/texts.php +++ b/app/lang/pt_BR/texts.php @@ -298,5 +298,7 @@ return array( 'pro_plan_description' => 'One year enrollment in the Invoice Ninja Pro Plan.', 'pro_plan_success' => 'Thanks for joining! Once the invoice is paid your Pro Plan membership will begin.', + 'unsaved_changes' => 'You have unsaved changes', + ); diff --git a/app/libraries/utils.php b/app/libraries/utils.php index 88c3cccf9566..0ca3bcbd3b8a 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -17,6 +17,11 @@ class Utils return $_SERVER['SERVER_NAME'] == 'www.invoiceninja.com'; } + public static function isNinjaDev() + { + return isset($_ENV['NINJA_DEV']) && $_ENV['NINJA_DEV']; + } + public static function basePath() { return substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/') + 1); diff --git a/app/models/User.php b/app/models/User.php index cbdfb040d975..441a78b968eb 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -138,4 +138,19 @@ class User extends ConfideUser implements UserInterface, RemindableInterface { return $this->isPro() ? MAX_NUM_CLIENTS_PRO : MAX_NUM_CLIENTS; } + + public function getRememberToken() + { + return $this->remember_token; + } + + public function setRememberToken($value) + { + $this->remember_token = $value; + } + + public function getRememberTokenName() + { + return 'remember_token'; + } } \ No newline at end of file diff --git a/app/routes.php b/app/routes.php index e2d0b2399d7b..9d4e13bc886c 100755 --- a/app/routes.php +++ b/app/routes.php @@ -312,6 +312,4 @@ if (Auth::check() && Auth::user()->id === 1) { Auth::loginUsingId(1); } -*/ - -//dd(Session::has(REQUESTED_PRO_PLAN)); \ No newline at end of file +*/ \ No newline at end of file diff --git a/app/views/accounts/details.blade.php b/app/views/accounts/details.blade.php index 823f5743e1a1..612e7aaeae3e 100755 --- a/app/views/accounts/details.blade.php +++ b/app/views/accounts/details.blade.php @@ -11,7 +11,7 @@ - {{ Former::open_for_files()->addClass('col-md-10 col-md-offset-1')->rules(array( + {{ Former::open_for_files()->addClass('col-md-10 col-md-offset-1 warn-on-exit')->rules(array( 'name' => 'required', 'email' => 'email|required' )); }} diff --git a/app/views/accounts/import_map.blade.php b/app/views/accounts/import_map.blade.php index e667cacbcc47..b1e4de004cbe 100755 --- a/app/views/accounts/import_map.blade.php +++ b/app/views/accounts/import_map.blade.php @@ -3,7 +3,7 @@ @section('content') @parent - {{ Former::open('company/import_export') }} + {{ Former::open('company/import_export')->addClass('warn-on-exit') }} {{ Former::legend('import_clients') }} @if ($headers) diff --git a/app/views/accounts/notifications.blade.php b/app/views/accounts/notifications.blade.php index 46a226bd2e12..7cebf0efbd39 100755 --- a/app/views/accounts/notifications.blade.php +++ b/app/views/accounts/notifications.blade.php @@ -3,7 +3,7 @@ @section('content') @parent - {{ Former::open()->addClass('col-md-8 col-md-offset-2') }} + {{ Former::open()->addClass('col-md-8 col-md-offset-2 warn-on-exit') }} {{ Former::populate($account) }} {{ Former::populateField('notify_sent', intval(Auth::user()->notify_sent)) }} {{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }} diff --git a/app/views/accounts/payments.blade.php b/app/views/accounts/payments.blade.php index 378f03c02b9a..47c92811f32c 100755 --- a/app/views/accounts/payments.blade.php +++ b/app/views/accounts/payments.blade.php @@ -3,7 +3,7 @@ @section('content') @parent - {{ Former::open()->addClass('col-md-8 col-md-offset-2') }} + {{ Former::open()->addClass('col-md-8 col-md-offset-2 warn-on-exit') }} {{ Former::populate($account) }} {{ Former::legend('Payment Gateway') }} diff --git a/app/views/clients/edit.blade.php b/app/views/clients/edit.blade.php index f957e1802659..584a6d60b4f2 100755 --- a/app/views/clients/edit.blade.php +++ b/app/views/clients/edit.blade.php @@ -9,7 +9,7 @@