diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index fea09ebf9f21..42737940bbe8 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -639,6 +639,7 @@ class AccountController extends BaseController { $rules = array( 'name' => 'required', + 'logo' => 'sometimes|max:1024|mimes:jpeg,gif,png', ); $user = Auth::user()->account->users()->orderBy('id')->first(); diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index d93e67300bc9..248b1be6bef3 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -60,8 +60,7 @@ class InvoiceController extends BaseController 'columns' => Utils::trans(['checkbox', 'invoice_number', 'client', 'invoice_date', 'invoice_total', 'balance_due', 'due_date', 'status', 'action']), ]; - $recurringInvoices = Invoice::scope() - ->where('is_recurring', '=', true); + $recurringInvoices = Invoice::scope()->where('is_recurring', '=', true); if (Session::get('show_trash:invoice')) { $recurringInvoices->withTrashed(); diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 4b63aabc695c..6632ce843b3b 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -543,18 +543,19 @@ class PaymentController extends BaseController ->withErrors($validator) ->withInput(); } + + + if ($accountGateway->update_address) { + $client->address1 = trim(Input::get('address1')); + $client->address2 = trim(Input::get('address2')); + $client->city = trim(Input::get('city')); + $client->state = trim(Input::get('state')); + $client->postal_code = trim(Input::get('postal_code')); + $client->country_id = Input::get('country_id'); + $client->save(); + } } - - if ($onSite && $accountGateway->update_address) { - $client->address1 = trim(Input::get('address1')); - $client->address2 = trim(Input::get('address2')); - $client->city = trim(Input::get('city')); - $client->state = trim(Input::get('state')); - $client->postal_code = trim(Input::get('postal_code')); - $client->country_id = Input::get('country_id'); - $client->save(); - } - + try { $gateway = self::createGateway($accountGateway); $details = self::getPaymentDetails($invitation, ($useToken || !$onSite) ? false : Input::all()); diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index d90c821414e1..50b66b69f720 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -377,6 +377,15 @@ class UserController extends BaseController Session::put(SESSION_USER_ACCOUNTS, $users); Session::flash('message', trans('texts.unlinked_account')); - return Redirect::to($referer); + return Redirect::to('/dashboard'); + } + + public function manageCompanies() + { + $data = [ + + ]; + + return View::make('users.account_management', $data); } } diff --git a/app/Http/routes.php b/app/Http/routes.php index 156e66ea6573..e016e3841c09 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -1,5 +1,7 @@ 'auth'], function() { Route::post('users/change_password', 'UserController@changePassword'); Route::get('/switch_account/{user_id}', 'UserController@switchAccount'); Route::get('/unlink_account/{user_account_id}/{user_id}', 'UserController@unlinkAccount'); + Route::get('/manage_companies', 'UserController@manageCompanies'); Route::get('api/tokens', array('as'=>'api.tokens', 'uses'=>'TokenController@getDatatable')); Route::resource('tokens', 'TokenController'); @@ -363,7 +366,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_STRIPE); define('NINJA_GATEWAY_CONFIG', ''); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); -define('NINJA_VERSION', '2.2.2'); +define('NINJA_VERSION', '2.3.0'); define('NINJA_DATE', '2000-01-01'); define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com'); diff --git a/app/Models/Account.php b/app/Models/Account.php index 5def5c6a999c..be307f6ca775 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -315,7 +315,7 @@ class Account extends Eloquent public function isWhiteLabel() { if (Utils::isNinja()) { - return self::isPro(); + return self::isPro() && $this->pro_plan_paid != NINJA_DATE; } else { return $this->pro_plan_paid == NINJA_DATE; } diff --git a/resources/lang/da/texts.php b/resources/lang/da/texts.php index 5a5b73b03582..580e366e7298 100644 --- a/resources/lang/da/texts.php +++ b/resources/lang/da/texts.php @@ -738,6 +738,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/de/texts.php b/resources/lang/de/texts.php index 280580e8e50c..7519119b40d6 100644 --- a/resources/lang/de/texts.php +++ b/resources/lang/de/texts.php @@ -732,7 +732,8 @@ return array( 'invoice_to' => 'Rechnunge an', 'invoice_no' => 'Rechnung Nr.', 'recent_payments' => 'Kürzliche Zahlungen', - 'outstanding' => 'Ausstehend', + 'manage_companies' => 'Manage Companies', + ); \ No newline at end of file diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 11092c957a16..b9807c4c93b4 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -740,7 +740,8 @@ return array( 'invoice_no' => 'Invoice No.', 'recent_payments' => 'Recent Payments', 'outstanding' => 'Outstanding', - + 'manage_companies' => 'Manage Companies', + ); diff --git a/resources/lang/es/texts.php b/resources/lang/es/texts.php index aa0273a47042..92ca314723b6 100644 --- a/resources/lang/es/texts.php +++ b/resources/lang/es/texts.php @@ -708,6 +708,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + ); \ No newline at end of file diff --git a/resources/lang/es_ES/texts.php b/resources/lang/es_ES/texts.php index df7ec3c92535..97b333fbb2c2 100644 --- a/resources/lang/es_ES/texts.php +++ b/resources/lang/es_ES/texts.php @@ -737,6 +737,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/fr/texts.php b/resources/lang/fr/texts.php index b401ea0d3076..6fd60e17c4ba 100644 --- a/resources/lang/fr/texts.php +++ b/resources/lang/fr/texts.php @@ -729,6 +729,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/fr_CA/texts.php b/resources/lang/fr_CA/texts.php index 2300badc12b2..0c0bf2e3a4a2 100644 --- a/resources/lang/fr_CA/texts.php +++ b/resources/lang/fr_CA/texts.php @@ -730,6 +730,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + ); diff --git a/resources/lang/it/texts.php b/resources/lang/it/texts.php index d12f6f2bcb94..9672b9ea533d 100644 --- a/resources/lang/it/texts.php +++ b/resources/lang/it/texts.php @@ -732,6 +732,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/lt/texts.php b/resources/lang/lt/texts.php index b57bdc7cfc25..15ca60fcba36 100644 --- a/resources/lang/lt/texts.php +++ b/resources/lang/lt/texts.php @@ -739,6 +739,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/nb_NO/texts.php b/resources/lang/nb_NO/texts.php index 18b88e16886e..c014c917637c 100644 --- a/resources/lang/nb_NO/texts.php +++ b/resources/lang/nb_NO/texts.php @@ -737,6 +737,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/nl/texts.php b/resources/lang/nl/texts.php index 27778af2b948..f82175f36ad9 100644 --- a/resources/lang/nl/texts.php +++ b/resources/lang/nl/texts.php @@ -732,6 +732,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/lang/pt_BR/texts.php b/resources/lang/pt_BR/texts.php index ea074e12d853..875691412797 100644 --- a/resources/lang/pt_BR/texts.php +++ b/resources/lang/pt_BR/texts.php @@ -732,6 +732,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + ); diff --git a/resources/lang/sv/texts.php b/resources/lang/sv/texts.php index 295f596832d4..13e443f81bdc 100644 --- a/resources/lang/sv/texts.php +++ b/resources/lang/sv/texts.php @@ -735,6 +735,12 @@ return array( 'header' => 'Header', 'footer' => 'Footer', 'custom' => 'Custom', + 'invoice_to' => 'Invoice to', + 'invoice_no' => 'Invoice No.', + 'recent_payments' => 'Recent Payments', + 'outstanding' => 'Outstanding', + 'manage_companies' => 'Manage Companies', + diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index cc8a1f0eb6d5..e42e71f27574 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -203,19 +203,6 @@ }); } - function showUnlink(userAccountId, userId) { - NINJA.unlink = { - 'userAccountId': userAccountId, - 'userId': userId - }; - $('#unlinkModal').modal('show'); - return false; - } - - function unlinkAccount() { - window.location = '{{ URL::to('/unlink_account') }}' + '/' + NINJA.unlink.userAccountId + '/' + NINJA.unlink.userId; - } - function wordWrapText(value, width) { @if (Auth::user()->account->auto_wrap) @@ -389,7 +376,7 @@ -