diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index c875e0be64..2397451853 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -1,6 +1,6 @@ _accounts = $accounts; - $this->_preferences = $preferences; - View::share('title','Preferences'); - View::share('mainTitleIcon','fa-gear'); + View::share('title', 'Preferences'); + View::share('mainTitleIcon', 'fa-gear'); } /** @@ -31,13 +22,16 @@ class PreferencesController extends BaseController */ public function index() { - $accounts = $this->_accounts->getDefault(); + /** @var \FireflyIII\Database\Account $acct */ + $acct = App::make('FireflyIII\Database\Account'); - $viewRange = $this->_preferences->get('viewRange', '1M'); + /** @var \FireflyIII\Shared\Preferences\Preferences $preferences */ + $preferences = App::make('FireflyIII\Shared\Preferences\Preferences'); + + $accounts = $acct->getAssetAccounts(); + $viewRange = $preferences->get('viewRange', '1M'); $viewRangeValue = $viewRange->data; - - // pref: - $frontpage = $this->_preferences->get('frontpageAccounts', []); + $frontpage = $preferences->get('frontpageAccounts', []); return View::make('preferences.index')->with('accounts', $accounts)->with('frontpageAccounts', $frontpage) ->with('viewRange', $viewRangeValue); @@ -49,15 +43,18 @@ class PreferencesController extends BaseController public function postIndex() { + /** @var \FireflyIII\Shared\Preferences\Preferences $preferences */ + $preferences = App::make('FireflyIII\Shared\Preferences\Preferences'); + // frontpage accounts $frontpageAccounts = []; foreach (Input::get('frontpageAccounts') as $id) { $frontpageAccounts[] = intval($id); } - $this->_preferences->set('frontpageAccounts', $frontpageAccounts); + $preferences->set('frontpageAccounts', $frontpageAccounts); // view range: - $this->_preferences->set('viewRange', Input::get('viewRange')); + $preferences->set('viewRange', Input::get('viewRange')); // forget session values: Session::forget('start'); Session::forget('end'); diff --git a/app/controllers/ProfileController.php b/app/controllers/ProfileController.php index beda24d3cf..6692e02872 100644 --- a/app/controllers/ProfileController.php +++ b/app/controllers/ProfileController.php @@ -23,9 +23,9 @@ class ProfileController extends BaseController public function index() { return View::make('profile.index') - ->with('title', 'Profile') - ->with('subTitle', Auth::user()->email) - ->with('mainTitleIcon', 'fa-user'); + ->with('title', 'Profile') + ->with('subTitle', Auth::user()->email) + ->with('mainTitleIcon', 'fa-user'); } /** @@ -34,9 +34,9 @@ class ProfileController extends BaseController public function changePassword() { return View::make('profile.change-password') - ->with('title', Auth::user()->email) - ->with('subTitle', 'Change your password') - ->with('mainTitleIcon', 'fa-user'); + ->with('title', Auth::user()->email) + ->with('subTitle', 'Change your password') + ->with('mainTitleIcon', 'fa-user'); } /** diff --git a/app/lib/FireflyIII/Exception/FireflyException.php b/app/lib/FireflyIII/Exception/FireflyException.php new file mode 100644 index 0000000000..566a0cb437 --- /dev/null +++ b/app/lib/FireflyIII/Exception/FireflyException.php @@ -0,0 +1,14 @@ +