diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.php index 634153bf0b..d0be292c29 100644 --- a/app/controllers/GoogleChartController.php +++ b/app/controllers/GoogleChartController.php @@ -86,7 +86,7 @@ class GoogleChartController extends BaseController /** @var \FireflyIII\Shared\Preferences\Preferences $preferences */ $preferences = App::make('FireflyIII\Shared\Preferences\Preferences'); - $pref = $preferences->get('frontpageAccounts', []); + $pref = $preferences->get('frontPageAccounts', []); /** @var \FireflyIII\Database\Account\Account $acct */ $acct = App::make('FireflyIII\Database\Account\Account'); diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index faea3a7f68..4470615afb 100644 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -39,7 +39,7 @@ class HomeController extends BaseController // get the preference for the home accounts to show: - $frontpage = $preferences->get('frontpageAccounts', []); + $frontpage = $preferences->get('frontPageAccounts', []); if ($frontpage->data == []) { $accounts = $acct->getAssetAccounts(); } else { diff --git a/app/controllers/PiggybankController.php b/app/controllers/PiggybankController.php index 0ba6f9c8ce..3e662323ae 100644 --- a/app/controllers/PiggybankController.php +++ b/app/controllers/PiggybankController.php @@ -155,7 +155,7 @@ class PiggyBankController extends BaseController $accounts[$account->id] = [ 'name' => $account->name, 'balance' => Steam::balance($account), - 'leftForPiggybanks' => $this->_repository->leftOnAccount($account), + 'leftForPiggyBanks' => $this->_repository->leftOnAccount($account), 'sumOfSaved' => $piggyBank->savedSoFar, 'sumOfTargets' => floatval($piggyBank->targetamount), 'leftToSave' => $piggyBank->leftToSave diff --git a/app/controllers/PreferencesController.php b/app/controllers/PreferencesController.php index 1330af52ef..6b2b9a08ff 100644 --- a/app/controllers/PreferencesController.php +++ b/app/controllers/PreferencesController.php @@ -32,11 +32,11 @@ class PreferencesController extends BaseController $accounts = $acct->getAssetAccounts(); $viewRange = $preferences->get('viewRange', '1M'); $viewRangeValue = $viewRange->data; - $frontPage = $preferences->get('frontpageAccounts', []); + $frontPage = $preferences->get('frontPageAccounts', []); $budgetMax = $preferences->get('budgetMaximum', 1000); $budgetMaximum = $budgetMax->data; - return View::make('preferences.index', compact('budgetMaximum'))->with('accounts', $accounts)->with('frontpageAccounts', $frontPage)->with( + return View::make('preferences.index', compact('budgetMaximum'))->with('accounts', $accounts)->with('frontPageAccounts', $frontPage)->with( 'viewRange', $viewRangeValue ); } @@ -49,12 +49,12 @@ class PreferencesController extends BaseController /** @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); + // front page accounts + $frontPageAccounts = []; + foreach (Input::get('frontPageAccounts') as $id) { + $frontPageAccounts[] = intval($id); } - $preferences->set('frontpageAccounts', $frontpageAccounts); + $preferences->set('frontPageAccounts', $frontPageAccounts); // view range: $preferences->set('viewRange', Input::get('viewRange')); diff --git a/app/controllers/ReminderController.php b/app/controllers/ReminderController.php index 2ef658ec04..873ac2b7eb 100644 --- a/app/controllers/ReminderController.php +++ b/app/controllers/ReminderController.php @@ -31,7 +31,7 @@ class ReminderController extends BaseController throw new FireflyException('Cannot act on reminder for ' . get_class($reminder->remindersable)); break; break; - case 'Piggybank': + case 'PiggyBank': $amount = Reminders::amountForReminder($reminder); $preFilled = [ 'amount' => round($amount, 2), @@ -85,7 +85,7 @@ class ReminderController extends BaseController { $amount = null; - if (get_class($reminder->remindersable) == 'Piggybank') { + if (get_class($reminder->remindersable) == 'PiggyBank') { $amount = Reminders::amountForReminder($reminder); } diff --git a/app/database/migrations/2014_12_13_190730_changes_for_v321.php b/app/database/migrations/2014_12_13_190730_changes_for_v321.php index 40c878e971..10dc2f221d 100644 --- a/app/database/migrations/2014_12_13_190730_changes_for_v321.php +++ b/app/database/migrations/2014_12_13_190730_changes_for_v321.php @@ -503,133 +503,5 @@ class ChangesForV321 extends Migration \DB::update('UPDATE `transaction_currencies` SET `symbol` = "€", `name` = "Euro" WHERE `code` = "EUR";'); } - // - // public function doRenameInLimitRepetitions() - // { - // Schema::table( - // 'limit_repetitions', function (Blueprint $table) { - // $table->renameColumn('limit_id', 'budget_limit_id'); - // } - // ); - // } - // - // public function doBudgetLimits() - // { - // Schema::rename('limits', 'budget_limits'); - // Schema::table( - // 'budget_limits', function (Blueprint $table) { - // $table->integer('budget_id')->unsigned()->after('updated_at'); - // $table->foreign('budget_id', 'bid_foreign')->references('id')->on('budgets')->onDelete('cascade'); - // } - // ); - // } - // - // public function doPiggyBankEvents() - // { - // Schema::rename('piggybank_events', 'piggy_bank_events'); - // - // } - // - // public function doCreateCategoryTables() - // { - // Schema::create( - // 'categories', function (Blueprint $table) { - // $table->increments('id'); - // $table->timestamps(); - // $table->softDeletes(); - // $table->string('name', 50); - // $table->integer('user_id')->unsigned(); - // $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - // $table->unique(['user_id', 'name']); - // } - // ); - // Schema::create( - // 'category_transaction_journal', function (Blueprint $table) { - // $table->increments('id'); - // $table->integer('category_id')->unsigned(); - // $table->integer('transaction_journal_id')->unsigned(); - // $table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); - // $table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade'); - // $table->unique(['category_id', 'transaction_journal_id'], 'catid_tjid_unique'); - // } - // ); - // - // } - // - // public function doUpdateTransactionTable() - // { - // Schema::table( - // 'transactions', function (Blueprint $table) { - // $table->dropForeign('transactions_piggybank_id_foreign'); - // #$table->dropIndex('transactions_piggybank_id_foreign'); - // $table->dropColumn('piggybank_id'); - // } - // ); - // } - // - // public function doDropCompRecurTable() - // { - // Schema::drop('component_recurring_transaction'); - // } - // - // public function doDropCompTransTable() - // { - // Schema::drop('component_transaction'); - // } - // - // public function doMoveBudgets() - // { - // Component::where('class', 'Budget')->get()->each( - // function (Component $c) { - // $entry = [ - // 'user_id' => $c->user_id, - // 'name' => $c->name - // - // ]; - // $budget = Budget::firstOrCreate($entry); - // Log::debug('Migrated budget #' . $budget->id . ': ' . $budget->name); - // // create entry in budget_transaction_journal - // $connections = DB::table('component_transaction_journal')->where('component_id', $c->id)->get(); - // foreach ($connections as $connection) { - // DB::table('budget_transaction_journal')->insert( - // [ - // 'budget_id' => $budget->id, - // 'transaction_journal_id' => $connection->transaction_journal_id - // ] - // ); - // } - // } - // ); - // } - // - // public function doMoveCategories() - // { - // Component::where('class', 'Category')->get()->each( - // function (Component $c) { - // $entry = [ - // 'user_id' => $c->user_id, - // 'name' => $c->name - // - // ]; - // $category = Category::firstOrCreate($entry); - // Log::debug('Migrated category #' . $category->id . ': ' . $category->name); - // // create entry in category_transaction_journal - // $connections = DB::table('component_transaction_journal')->where('component_id', $c->id)->get(); - // foreach ($connections as $connection) { - // DB::table('category_transaction_journal')->insert( - // [ - // 'category_id' => $category->id, - // 'transaction_journal_id' => $connection->transaction_journal_id - // ] - // ); - // } - // } - // ); - // } - // - // public function doMoveLimitReferences() - // { - // throw new \FireflyIII\Exception\FireflyException('TODO'); - // } } diff --git a/app/lib/FireflyIII/Shared/Toolkit/Reminders.php b/app/lib/FireflyIII/Shared/Toolkit/Reminders.php index f506f81a98..f545d4fb73 100644 --- a/app/lib/FireflyIII/Shared/Toolkit/Reminders.php +++ b/app/lib/FireflyIII/Shared/Toolkit/Reminders.php @@ -25,7 +25,7 @@ class Reminders switch (get_class($reminder->remindersable)) { - case 'Piggybank': + case 'PiggyBank': $start = new Carbon; $end = !is_null($reminder->remindersable->targetdate) ? clone $reminder->remindersable->targetdate : new Carbon; $reminders = 0; @@ -93,7 +93,7 @@ class Reminders $reminder->active = 1; $reminder->user()->associate(\Auth::getUser()); $reminder->remindersable_id = $piggyBank->id; - $reminder->remindersable_type = 'Piggybank'; + $reminder->remindersable_type = 'PiggyBank'; $reminder->save(); } } diff --git a/app/models/Transaction.php b/app/models/Transaction.php index 136941f0b0..554d130ed3 100644 --- a/app/models/Transaction.php +++ b/app/models/Transaction.php @@ -32,7 +32,7 @@ class Transaction extends Eloquent */ public function piggyBank() { - return $this->belongsTo('Piggybank'); + return $this->belongsTo('PiggyBank'); } /** diff --git a/app/models/User.php b/app/models/User.php index e86aa0da0b..938f353bde 100644 --- a/app/models/User.php +++ b/app/models/User.php @@ -55,7 +55,7 @@ class User extends Eloquent implements UserInterface, RemindableInterface */ public function piggyBanks() { - return $this->hasManyThrough('Piggybank', 'Account'); + return $this->hasManyThrough('PiggyBank', 'Account'); } /** diff --git a/app/views/piggy_banks/index.blade.php b/app/views/piggy_banks/index.blade.php index 327f87ddb5..6279dcd1d6 100644 --- a/app/views/piggy_banks/index.blade.php +++ b/app/views/piggy_banks/index.blade.php @@ -91,7 +91,7 @@ {{{$info['name']}}} {{mf($info['balance'])}} - {{mf($info['leftForPiggybanks'])}} + {{mf($info['leftForPiggyBanks'])}} {{mf($info['sumOfTargets'])}} {{mf($info['sumOfSaved'])}} {{mf($info['leftToSave'])}} diff --git a/app/views/preferences/index.blade.php b/app/views/preferences/index.blade.php index 9dad68c853..0a3816f684 100644 --- a/app/views/preferences/index.blade.php +++ b/app/views/preferences/index.blade.php @@ -17,10 +17,10 @@