From 1c782b6f2cf29db2b8e0a066dcb84a1ba2ae07ff Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Jan 2014 14:01:24 +0000 Subject: [PATCH] bug fixes --- app/controllers/AccountController.php | 21 ++-- app/controllers/CreditController.php | 9 +- app/controllers/InvoiceController.php | 3 + app/controllers/PaymentController.php | 12 ++- ...11_05_180133_confide_setup_users_table.php | 13 +-- app/database/seeds/ConstantsSeeder.php | 15 ++- app/models/Activity.php | 8 +- app/models/Invoice.php | 6 +- app/models/User.php | 10 +- app/ninja/repositories/CreditRepository.php | 5 +- app/ninja/repositories/InvoiceRepository.php | 6 +- app/ninja/repositories/PaymentRepository.php | 5 +- app/views/accounts/details.blade.php | 4 +- app/views/accounts/export.blade.php | 2 +- app/views/accounts/import.blade.php | 2 +- app/views/accounts/settings.blade.php | 6 +- app/views/clients/edit.blade.php | 2 +- app/views/clients/show.blade.php | 8 +- app/views/credits/edit.blade.php | 5 +- app/views/header.blade.php | 9 +- app/views/invoices/edit.blade.php | 97 +++++++++++++------ app/views/payments/edit.blade.php | 4 +- bootstrap/start.php | 19 ++-- public/js/script.js | 5 +- 24 files changed, 167 insertions(+), 109 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 73d905c957..74bebaf71b 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -44,10 +44,11 @@ class AccountController extends \BaseController { $random = str_random(RANDOM_KEY_LENGTH); $user = new User; + $user->username = $random; $user->password = $random; - $user->password_confirmation = $random; - $account->users()->save($user); - + $user->password_confirmation = $random; + $account->users()->save($user); + Session::forget(RECENTLY_VIEWED); } @@ -479,17 +480,13 @@ class AccountController extends \BaseController { $account->industry_id = Input::get('industry_id') ? Input::get('industry_id') : null; $account->save(); - $user = $account->users()->first(); + $user = Auth::user(); $user->first_name = trim(Input::get('first_name')); $user->last_name = trim(Input::get('last_name')); - $user->username = $user->email = trim(Input::get('email')); - $user->phone = trim(Input::get('phone')); - $user->save(); - - if (Input::get('timezone_id')) { - $timezone = Timezone::findOrFail(Input::get('timezone_id')); - Session::put('tz', $timezone->name); - } + $user->username = trim(Input::get('email')); + $user->email = trim(Input::get('email')); + $user->phone = trim(Input::get('phone')); + $user->amend(); // need to 'amend' to avoid password validation rules /* Logo image file */ if ($file = Input::file('logo')) diff --git a/app/controllers/CreditController.php b/app/controllers/CreditController.php index cf77da9da3..b51293c3f0 100755 --- a/app/controllers/CreditController.php +++ b/app/controllers/CreditController.php @@ -23,7 +23,7 @@ class CreditController extends \BaseController { return View::make('list', array( 'entityType'=>ENTITY_CREDIT, 'title' => '- Credits', - 'columns'=>['checkbox', 'Client', 'Credit Amount', 'Credit Date', 'Action'] + 'columns'=>['checkbox', 'Client', 'Credit Amount', 'Credit Date', 'Private Notes', 'Action'] )); } @@ -41,6 +41,7 @@ class CreditController extends \BaseController { return $table->addColumn('amount', function($model){ return Utils::formatMoney($model->amount, $model->currency_id); }) ->addColumn('credit_date', function($model) { return Utils::fromSqlDate($model->credit_date); }) + ->addColumn('private_notes', function($model) { return $model->private_notes; }) ->addColumn('dropdown', function($model) { return '