diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index 5b2fd7c056..f1c9cb2db4 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -44,7 +44,10 @@ class BillController extends Controller */ public function create() { - $periods = config('firefly.periods_to_text'); + $periods = []; + foreach (config('firefly.bill_periods') as $current) { + $periods[$current] = trans('firefly.' . $current); + } $subTitle = trans('firefly.create_new_bill'); @@ -99,7 +102,10 @@ class BillController extends Controller */ public function edit(Bill $bill) { - $periods = config('firefly.periods_to_text'); + $periods = []; + foreach (config('firefly.bill_periods') as $current) { + $periods[$current] = trans('firefly.' . $current); + } $subTitle = trans('firefly.edit_bill', ['name' => $bill->name]); // put previous url in session if not redirect from store (not "return_to_edit"). diff --git a/app/Http/Controllers/PiggyBankController.php b/app/Http/Controllers/PiggyBankController.php index f0e2eff21f..898adc8fb7 100644 --- a/app/Http/Controllers/PiggyBankController.php +++ b/app/Http/Controllers/PiggyBankController.php @@ -75,8 +75,6 @@ class PiggyBankController extends Controller */ public function create(AccountCrudInterface $crud) { - - $periods = config('firefly.piggy_bank_periods'); $accounts = ExpandedForm::makeSelectList($crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); $subTitle = trans('firefly.new_piggy_bank'); $subTitleIcon = 'fa-plus'; @@ -89,7 +87,7 @@ class PiggyBankController extends Controller Session::flash('gaEventCategory', 'piggy-banks'); Session::flash('gaEventAction', 'create'); - return view('piggy-banks.create', compact('accounts', 'periods', 'subTitle', 'subTitleIcon')); + return view('piggy-banks.create', compact('accounts', 'subTitle', 'subTitleIcon')); } /** @@ -135,7 +133,6 @@ class PiggyBankController extends Controller public function edit(AccountCrudInterface $crud, PiggyBank $piggyBank) { - $periods = config('firefly.piggy_bank_periods'); $accounts = ExpandedForm::makeSelectList($crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])); $subTitle = trans('firefly.update_piggy_title', ['name' => $piggyBank->name]); $subTitleIcon = 'fa-pencil'; @@ -162,7 +159,7 @@ class PiggyBankController extends Controller } Session::forget('piggy-banks.edit.fromUpdate'); - return view('piggy-banks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'accounts', 'periods', 'preFilled')); + return view('piggy-banks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'accounts', 'preFilled')); } /** diff --git a/config/firefly.php b/config/firefly.php index c6a2c05c5b..4a045e1f6a 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -2,12 +2,9 @@ declare(strict_types = 1); - return [ 'chart' => 'chartjs', 'version' => '3.9.0', - 'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'], - 'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'csv_import_enabled' => true, 'maxUploadSize' => 5242880, 'allowedMimes' => ['image/png', 'image/jpeg', 'application/pdf'], @@ -19,20 +16,7 @@ return [ // mt940 FireflyIII Export Exporter MtExporter ], 'default_export_format' => 'csv', - - 'piggy_bank_periods' => [ - 'week' => 'Week', - 'month' => 'Month', - 'quarter' => 'Quarter', - 'year' => 'Year', - ], - 'periods_to_text' => [ - 'weekly' => 'A week', - 'monthly' => 'A month', - 'quarterly' => 'A quarter', - 'half-year' => 'Six months', - 'yearly' => 'A year', - ], + 'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'accountRoles' => [ 'defaultAsset' => 'Default asset account', @@ -41,25 +25,9 @@ return [ 'ccAsset' => 'Credit card', ], - 'range_to_text' => [ - '1D' => 'day', - '1W' => 'week', - '1M' => 'month', - '3M' => 'three months', - '6M' => 'half year', - 'custom' => '(custom)', - ], 'ccTypes' => [ 'monthlyFull' => 'Full payment every month', ], - 'range_to_name' => [ - '1D' => 'one day', - '1W' => 'one week', - '1M' => 'one month', - '3M' => 'three months', - '6M' => 'six months', - '1Y' => 'one year', - ], 'range_to_repeat_freq' => [ '1D' => 'weekly', '1W' => 'weekly', @@ -117,18 +85,6 @@ return [ 'pt_BR' => ['name_locale' => 'Português do Brasil', 'name_english' => 'Portuguese (Brazil)', 'complete' => true], 'fr_FR' => ['name_locale' => 'Français', 'name_english' => 'French', 'complete' => false], ], - 'lang' => [ - 'en_US' => 'English', - 'nl_NL' => 'Nederlands', - 'fr_FR' => 'Français', - 'pt_BR' => 'Português do Brasil', - ], - 'locales' => [ - 'en_US' => ['en', 'English', 'en_US', 'en_US.utf8'], - 'nl_NL' => ['nl', 'Dutch', 'nl_NL', 'nl_NL.utf8'], - 'pt_BR' => ['pt_BR', 'pt_BR.utf8'], - 'fr_FR' => ['fr_FR', 'fr_FR.utf8'], - ], 'transactionTypesByWhat' => [ 'expenses' => ['Withdrawal'], 'withdrawal' => ['Withdrawal'], @@ -147,18 +103,6 @@ return [ ], - 'month' => [ - 'en_US' => '%B %Y', - 'nl_NL' => '%B %Y', - 'fr_FR' => '%B %Y', - 'pt_BR' => '%B %Y', - ], - 'monthAndDay' => [ - 'en_US' => '%B %e, %Y', - 'nl_NL' => '%e %B %Y', - 'fr_FR' => '%B %e, %Y', - 'pt_BR' => '%B %e, %Y', - ], 'bindables' => [ // models 'account' => 'FireflyIII\Models\Account',