From 9874e77ddf56fcf7915ed55cc1eb1035fd6d65da Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Sun, 9 Nov 2014 11:30:00 +0100 Subject: [PATCH 1/3] Remove ignore instructions. --- app/models/Limit.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/Limit.php b/app/models/Limit.php index 49571e2d25..2bfb674e1b 100644 --- a/app/models/Limit.php +++ b/app/models/Limit.php @@ -104,14 +104,12 @@ class Limit extends Ardent try { $repetition->save(); \Log::debug('Created new repetition with id #' . $repetition->id); - // @codeCoverageIgnoreStart } catch (QueryException $e) { // do nothing \Log::error('Trying to save new Limitrepetition failed!'); \Log::error($e->getMessage()); } - // @codeCoverageIgnoreEnd if (isset($repetition->id)) { \Event::fire('limits.repetition', [$repetition]); } From e666e5e9e35168b8541c28753a289f969227f6c3 Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Sun, 9 Nov 2014 11:32:18 +0100 Subject: [PATCH 2/3] Clean up composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index df668992fe..d697788744 100644 --- a/composer.json +++ b/composer.json @@ -24,14 +24,13 @@ "laravel/framework": "4.2.*", "laravelbook/ardent": "~2.4", "davejamesmiller/laravel-breadcrumbs": "2.*", - "rcrowe/twigbridge": "0.6.*", "grumpydictator/gchart": "dev-master" }, "require-dev": { "barryvdh/laravel-debugbar": "@stable", "barryvdh/laravel-ide-helper": "@stable", "doctrine/dbal": "~2.3", - "pda/pheanstalk": "2.*" + "codeception/codeception": "*" }, "autoload": { "classmap": [ From 1ff135d1722618883bf7c98d5e7fd2b4482fc0f1 Mon Sep 17 00:00:00 2001 From: Stewart Malik Date: Mon, 10 Nov 2014 02:27:19 +1030 Subject: [PATCH 3/3] [Fixes #21] Change the majority of View::share to View::make()->with() --- app/controllers/AccountController.php | 53 +++++++++++++++---------- app/controllers/PiggybankController.php | 10 ++--- app/controllers/ProfileController.php | 16 ++++---- app/controllers/RecurringController.php | 25 ++++++------ 4 files changed, 57 insertions(+), 47 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index ba394611ae..da88631243 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -31,19 +31,22 @@ class AccountController extends BaseController throw new FireflyException('Cannot handle account type "' . e($what) . '".'); break; case 'asset': - View::share('subTitleIcon', 'fa-money'); - View::share('subTitle', 'Asset accounts'); + $subTitleIcon = 'fa-money'; + $subTitle = 'Asset accounts'; break; case 'expense': - View::share('subTitleIcon', 'fa-shopping-cart'); - View::share('subTitle', 'Expense accounts'); + $subTitleIcon = 'fa-shopping-cart'; + $subTitle = 'Expense accounts'; break; case 'revenue': - View::share('subTitleIcon', 'fa-download'); - View::share('subTitle', 'Revenue accounts'); + $subTitleIcon = 'fa-download'; + $subTitle = 'Revenue accounts'; break; } - return View::make('accounts.index')->with('what', $what); + return View::make('accounts.index') + ->with('what', $what) + ->with(compact('subTitleIcon')) + ->with(compact('subTitle')); } @@ -118,17 +121,20 @@ class AccountController extends BaseController { switch ($what) { case 'asset': - View::share('subTitleIcon', 'fa-money'); + $subTitleIcon = 'fa-money'; break; case 'expense': - View::share('subTitleIcon', 'fa-shopping-cart'); + $subTitleIcon = 'fa-shopping-cart'; break; case 'revenue': - View::share('subTitleIcon', 'fa-download'); + $subTitleIcon = 'fa-download'; break; } - return View::make('accounts.create')->with('subTitle', 'Create a new ' . $what . ' account')->with('what', $what); + return View::make('accounts.create') + ->with('subTitle', 'Create a new ' . $what . ' account') + ->with('what', $what) + ->with(compact('subTitleIcon')); } /** @@ -229,14 +235,14 @@ class AccountController extends BaseController switch ($account->accountType->type) { case 'Asset account': case 'Default account': - View::share('subTitleIcon', 'fa-money'); + $subTitleIcon = 'fa-money'; break; case 'Expense account': case 'Beneficiary account': - View::share('subTitleIcon', 'fa-shopping-cart'); + $subTitleIcon = 'fa-shopping-cart'; break; case 'Revenue account': - View::share('subTitleIcon', 'fa-download'); + $subTitleIcon = 'fa-download'; break; } @@ -251,9 +257,11 @@ class AccountController extends BaseController Session::flash('prefilled', $prefilled); } - - return View::make('accounts.edit')->with('account', $account)->with('openingBalance', $openingBalance)->with( - 'subTitle', 'Edit ' . strtolower( + return View::make('accounts.edit') + ->with('account', $account) + ->with('openingBalance', $openingBalance) + ->with(compact('subTitleIcon')) + ->with('subTitle', 'Edit ' . strtolower( $account->accountType->type ) . ' "' . $account->name . '"' ); @@ -269,22 +277,23 @@ class AccountController extends BaseController switch ($account->accountType->type) { case 'Asset account': case 'Default account': - View::share('subTitleIcon', 'fa-money'); + $subTitleIcon = 'fa-money'; break; case 'Expense account': case 'Beneficiary account': - View::share('subTitleIcon', 'fa-shopping-cart'); + $subTitleIcon = 'fa-shopping-cart'; break; case 'Revenue account': - View::share('subTitleIcon', 'fa-download'); + $subTitleIcon = 'fa-download'; break; } //$data = $this->_accounts->show($account, 40); return View::make('accounts.show') - ->with('account', $account) - ->with('subTitle', 'Details for ' . strtolower($account->accountType->type) . ' "' . $account->name . '"'); + ->with('account', $account) + ->with('subTitle', 'Details for ' . strtolower($account->accountType->type) . ' "' . $account->name . '"') + ->with(compact('subTitleIcon')); } /** diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php index 78b6c49ec0..fb582a6652 100644 --- a/app/controllers/PiggybankController.php +++ b/app/controllers/PiggybankController.php @@ -46,11 +46,11 @@ class PiggybankController extends BaseController */ public function delete(Piggybank $piggybank) { - View::share('subTitle', 'Delete "' . $piggybank->name . '"'); - View::share('title', 'Piggy banks'); - View::share('mainTitleIcon', 'fa-sort-amount-asc'); - - return View::make('piggybanks.delete')->with('piggybank', $piggybank); + return View::make('piggybanks.delete') + ->with('piggybank', $piggybank) + ->with('subTitle', 'Delete "' . $piggybank->name . '"') + ->with('title', 'Piggy banks') + ->with('mainTitleIcon', 'fa-sort-amount-asc'); } /** diff --git a/app/controllers/ProfileController.php b/app/controllers/ProfileController.php index 37641af434..beda24d3cf 100644 --- a/app/controllers/ProfileController.php +++ b/app/controllers/ProfileController.php @@ -22,10 +22,10 @@ class ProfileController extends BaseController */ public function index() { - View::share('title', 'Profile'); - View::share('subTitle', Auth::user()->email); - View::share('mainTitleIcon', 'fa-user'); - return View::make('profile.index'); + return View::make('profile.index') + ->with('title', 'Profile') + ->with('subTitle', Auth::user()->email) + ->with('mainTitleIcon', 'fa-user'); } /** @@ -33,10 +33,10 @@ class ProfileController extends BaseController */ public function changePassword() { - View::share('title', Auth::user()->email); - View::share('subTitle', 'Change your password'); - View::share('mainTitleIcon', 'fa-user'); - return View::make('profile.change-password'); + return View::make('profile.change-password') + ->with('title', Auth::user()->email) + ->with('subTitle', 'Change your password') + ->with('mainTitleIcon', 'fa-user'); } /** diff --git a/app/controllers/RecurringController.php b/app/controllers/RecurringController.php index 1fe8e051af..db60b34004 100644 --- a/app/controllers/RecurringController.php +++ b/app/controllers/RecurringController.php @@ -32,10 +32,11 @@ class RecurringController extends BaseController */ public function create() { - View::share('subTitle', 'Create new'); $periods = \Config::get('firefly.periods_to_text'); - return View::make('recurring.create')->with('periods', $periods); + return View::make('recurring.create') + ->with('periods', $periods) + ->with('subTitle', 'Create new'); } /** @@ -45,8 +46,9 @@ class RecurringController extends BaseController */ public function delete(RecurringTransaction $recurringTransaction) { - View::share('subTitle', 'Delete "' . $recurringTransaction->name . '"'); - return View::make('recurring.delete')->with('recurringTransaction', $recurringTransaction); + return View::make('recurring.delete') + ->with('recurringTransaction', $recurringTransaction) + ->with('subTitle', 'Delete "' . $recurringTransaction->name . '"'); } /** @@ -77,11 +79,10 @@ class RecurringController extends BaseController { $periods = \Config::get('firefly.periods_to_text'); - View::share('subTitle', 'Edit "' . $recurringTransaction->name . '"'); - - return View::make('recurring.edit')->with('periods', $periods)->with( - 'recurringTransaction', $recurringTransaction - ); + return View::make('recurring.edit') + ->with('periods', $periods) + ->with('recurringTransaction', $recurringTransaction) + ->with('subTitle', 'Edit "' . $recurringTransaction->name . '"'); } /** @@ -97,9 +98,9 @@ class RecurringController extends BaseController */ public function show(RecurringTransaction $recurringTransaction) { - View::share('subTitle', $recurringTransaction->name); - return View::make('recurring.show')->with('recurring', $recurringTransaction); - + return View::make('recurring.show') + ->with('recurring', $recurringTransaction) + ->with('subTitle', $recurringTransaction->name); } /**