Skip to content

Firefly III: a personal finances manager

Excluded more files from the "old" libraries and included new ones instead. This should greatly clean up the code base.

James Cole638fa9005f7e
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 @@
<?php
-use Firefly\Exception\FireflyException;
+use FireflyIII\Exception\FireflyException;
use Illuminate\Support\MessageBag;
/**
diff --git a/app/controllers/BudgetController.php b/app/controllers/BudgetController.php
index faacb44535..ae8d0b123e 100644
--- a/app/controllers/BudgetController.php
+++ b/app/controllers/BudgetController.php
@@ -1,6 +1,6 @@
<?php
-use Firefly\Exception\FireflyException;
+use FireflyIII\Exception\FireflyException;
use Illuminate\Support\MessageBag;
diff --git a/app/controllers/CategoryController.php b/app/controllers/CategoryController.php
index 2a8fe2f472..d655245a3e 100644
--- a/app/controllers/CategoryController.php
+++ b/app/controllers/CategoryController.php
@@ -1,5 +1,5 @@
<?php
-use Firefly\Exception\FireflyException;
+use FireflyIII\Exception\FireflyException;
use Illuminate\Support\MessageBag;
/**
diff --git a/app/controllers/GoogleTableController.php b/app/controllers/GoogleTableController.php
index 2d1b091f49..05ec289c46 100644
--- a/app/controllers/GoogleTableController.php
+++ b/app/controllers/GoogleTableController.php
@@ -1,6 +1,6 @@
<?php
use Carbon\Carbon;
-use Firefly\Exception\FireflyException;
+use FireflyIII\Exception\FireflyException;
/**
* Class GoogleTableController
diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php
index fb582a6652..c497a8c6d3 100644
--- a/app/controllers/PiggybankController.php
+++ b/app/controllers/PiggybankController.php
@@ -1,6 +1,6 @@
<?php
-use Firefly\Exception\FireflyException;
+use FireflyIII\Exception\FireflyException;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\Collection;
use Illuminate\Support\MessageBag;
diff --git a/app/controllers/PreferencesController.php b/app/controllers/PreferencesController.php
index 2e1d82bcda..e8e6b4b3e9 100644
--- a/app/controllers/PreferencesController.php
+++ b/app/controllers/PreferencesController.php
@@ -1,8 +1,5 @@
<?php
-use Firefly\Helper\Preferences\PreferencesHelperInterface as PHI;
-use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
-
/**
* Class PreferencesController
*
@@ -10,20 +7,14 @@ use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
*/
class PreferencesController extends BaseController
{
- protected $_accounts;
- protected $_preferences;
-
/**
- * @param ARI $accounts
- * @param PHI $preferences
+ *
*/
- public function __construct(ARI $accounts, PHI $preferences)
+ public function __construct()
{
- $this->_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');
- $viewRangeValue = $viewRange->data;
+ /** @var \FireflyIII\Shared\Preferences\Preferences $preferences */
+ $preferences = App::make('FireflyIII\Shared\Preferences\Preferences');
- // pref:
- $frontpage = $this->_preferences->get('frontpageAccounts', []);
+ $accounts = $acct->getAssetAccounts();
+ $viewRange = $preferences->get('viewRange', '1M');
+ $viewRangeValue = $viewRange->data;
+ $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 @@
+<?php
+
+namespace FireflyIII\Exception;
+
+
+/**
+ * Class FireflyException
+ *
+ * @package Firefly\Exception
+ */
+class FireflyException extends \Exception
+{
+
+}
\ No newline at end of file
diff --git a/app/lib/FireflyIII/Exception/ValidationException.php b/app/lib/FireflyIII/Exception/ValidationException.php
new file mode 100644
index 0000000000..4cb09c9f5d
--- /dev/null
+++ b/app/lib/FireflyIII/Exception/ValidationException.php
@@ -0,0 +1,11 @@
+<?php
+namespace FireflyIII\Exception;
+
+/**
+ * Class ValidationException
+ *
+ * @package Firefly\Exception
+ */
+class ValidationException extends \Exception {
+
+}
\ No newline at end of file