Update FF configuration.

This commit is contained in:
James Cole
2016-09-18 19:57:21 +02:00
parent 221e4b7fc0
commit a95099fa46
7 changed files with 31 additions and 41 deletions

View File

@@ -156,7 +156,7 @@ class CurrencyController extends Controller
public function index(CurrencyRepositoryInterface $repository) public function index(CurrencyRepositoryInterface $repository)
{ {
$currencies = $repository->get(); $currencies = $repository->get();
$defaultCurrency = $repository->getCurrencyByPreference(Preferences::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'))); $defaultCurrency = $repository->getCurrencyByPreference(Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR')));
if (!auth()->user()->hasRole('owner')) { if (!auth()->user()->hasRole('owner')) {
@@ -246,13 +246,13 @@ class CurrencyController extends Controller
} }
// is the default currency for the user or the system // is the default currency for the user or the system
$defaultCode = Preferences::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR'))->data; $defaultCode = Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR'))->data;
if ($currency->code === $defaultCode) { if ($currency->code === $defaultCode) {
return false; return false;
} }
// is the default currency for the system // is the default currency for the system
$defaultSystemCode = env('DEFAULT_CURRENCY', 'EUR'); $defaultSystemCode = config('firefly.default_currency', 'EUR');
if ($currency->code === $defaultSystemCode) { if ($currency->code === $defaultSystemCode) {
return false; return false;
} }

View File

@@ -39,7 +39,7 @@ class HelpController extends Controller
*/ */
public function show(HelpInterface $help, string $route) public function show(HelpInterface $help, string $route)
{ {
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; $language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
$content = [ $content = [
'text' => '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>', 'text' => '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>',
'title' => 'Help', 'title' => 'Help',

View File

@@ -78,7 +78,7 @@ class PreferencesController extends Controller
$viewRangePref = Preferences::get('viewRange', '1M'); $viewRangePref = Preferences::get('viewRange', '1M');
$viewRange = $viewRangePref->data; $viewRange = $viewRangePref->data;
$frontPageAccounts = Preferences::get('frontPageAccounts', []); $frontPageAccounts = Preferences::get('frontPageAccounts', []);
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; $language = Preferences::get('language', config('firefly.default_language', 'en_US'))->data;
$transactionPageSize = Preferences::get('transactionPageSize', 50)->data; $transactionPageSize = Preferences::get('transactionPageSize', 50)->data;
$customFiscalYear = Preferences::get('customFiscalYear', 0)->data; $customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
$fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data; $fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data;

View File

@@ -81,7 +81,7 @@ class Range
private function configureView() private function configureView()
{ {
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US')); $pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
$lang = $pref->data; $lang = $pref->data;
App::setLocale($lang); App::setLocale($lang);

View File

@@ -360,7 +360,7 @@ class ImportValidator
/** @var CurrencyRepositoryInterface $repository */ /** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class, [$this->user]); $repository = app(CurrencyRepositoryInterface::class, [$this->user]);
// is the default currency for the user or the system // is the default currency for the user or the system
$defaultCode = Preferences::getForUser($this->user, 'currencyPreference', env('DEFAULT_CURRENCY', 'EUR'))->data; $defaultCode = Preferences::getForUser($this->user, 'currencyPreference', config('firefly.default_currency', 'EUR'))->data;
$entry->fields['currency'] = $repository->findByCode($defaultCode); $entry->fields['currency'] = $repository->findByCode($defaultCode);
Log::debug(sprintf('Set currency to %s', $defaultCode)); Log::debug(sprintf('Set currency to %s', $defaultCode));

View File

@@ -136,7 +136,7 @@ class Amount
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} else { } else {
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first(); $currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
if ($currency) { if ($currency) {
@@ -145,9 +145,9 @@ class Amount
return $currency->code; return $currency->code;
} }
$cache->store(env('DEFAULT_CURRENCY', 'EUR')); $cache->store(config('firefly.default_currency', 'EUR'));
return env('DEFAULT_CURRENCY', 'EUR'); return config('firefly.default_currency', 'EUR');
} }
} }
@@ -161,7 +161,7 @@ class Amount
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} else { } else {
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first(); $currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
$cache->store($currency->symbol); $cache->store($currency->symbol);
@@ -180,7 +180,7 @@ class Amount
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); return $cache->get();
} }
$currencyPreference = Prefs::get('currencyPreference', env('DEFAULT_CURRENCY', 'EUR')); $currencyPreference = Prefs::get('currencyPreference', config('firefly.default_currency', 'EUR'));
$currency = TransactionCurrency::whereCode($currencyPreference->data)->first(); $currency = TransactionCurrency::whereCode($currencyPreference->data)->first();
$cache->store($currency); $cache->store($currency);

View File

@@ -1,14 +1,16 @@
<?php <?php
declare(strict_types = 1); declare(strict_types = 1);
/*
* DO NOT EDIT THIS FILE. IT IS AUTO GENERATED.
*
* ANY OPTIONS IN THIS FILE YOU CAN SAFELY EDIT CAN BE FOUND IN THE USER INTERFACE OF FIRFELY III.
*/
return [ return [
// default values for editable configuration:
'configuration' => [ 'configuration' => [
'single_user_mode' => true, 'single_user_mode' => true,
], ],
'chart' => 'chartjs', 'chart' => 'chartjs',
'version' => '3.10.4', 'version' => '3.10.4',
'csv_import_enabled' => true, 'csv_import_enabled' => true,
@@ -19,23 +21,19 @@ return [
'export_formats' => [ 'export_formats' => [
'csv' => 'FireflyIII\Export\Exporter\CsvExporter', 'csv' => 'FireflyIII\Export\Exporter\CsvExporter',
// mt940 FireflyIII Export Exporter MtExporter
], ],
'import_formats' => [ 'import_formats' => [
'csv' => 'FireflyIII\Import\Importer\CsvImporter', 'csv' => 'FireflyIII\Import\Importer\CsvImporter',
// mt940 FireflyIII Import Importer MtImporter
], ],
'default_export_format' => 'csv', 'default_export_format' => 'csv',
'default_import_format' => 'csv', 'default_import_format' => 'csv',
'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'accountRoles' => [ 'accountRoles' => [
'defaultAsset' => 'Default asset account', 'defaultAsset' => 'Default asset account',
'sharedAsset' => 'Shared asset account', 'sharedAsset' => 'Shared asset account',
'savingAsset' => 'Savings account', 'savingAsset' => 'Savings account',
'ccAsset' => 'Credit card', 'ccAsset' => 'Credit card',
], ],
'ccTypes' => [ 'ccTypes' => [
'monthlyFull' => 'Full payment every month', 'monthlyFull' => 'Full payment every month',
], ],
@@ -121,9 +119,7 @@ return [
'transfers' => 'fa-exchange', 'transfers' => 'fa-exchange',
], ],
'bindables' => [ 'bindables' => [
// models
'account' => 'FireflyIII\Models\Account', 'account' => 'FireflyIII\Models\Account',
'attachment' => 'FireflyIII\Models\Attachment', 'attachment' => 'FireflyIII\Models\Attachment',
'bill' => 'FireflyIII\Models\Bill', 'bill' => 'FireflyIII\Models\Bill',
@@ -139,17 +135,13 @@ return [
'ruleGroup' => 'FireflyIII\Models\RuleGroup', 'ruleGroup' => 'FireflyIII\Models\RuleGroup',
'jobKey' => 'FireflyIII\Models\ExportJob', 'jobKey' => 'FireflyIII\Models\ExportJob',
'importJob' => 'FireflyIII\Models\ImportJob', 'importJob' => 'FireflyIII\Models\ImportJob',
// lists
'accountList' => 'FireflyIII\Support\Binder\AccountList', 'accountList' => 'FireflyIII\Support\Binder\AccountList',
'budgetList' => 'FireflyIII\Support\Binder\BudgetList', 'budgetList' => 'FireflyIII\Support\Binder\BudgetList',
'journalList' => 'FireflyIII\Support\Binder\JournalList', 'journalList' => 'FireflyIII\Support\Binder\JournalList',
'categoryList' => 'FireflyIII\Support\Binder\CategoryList', 'categoryList' => 'FireflyIII\Support\Binder\CategoryList',
// others
'start_date' => 'FireflyIII\Support\Binder\Date', 'start_date' => 'FireflyIII\Support\Binder\Date',
'end_date' => 'FireflyIII\Support\Binder\Date', 'end_date' => 'FireflyIII\Support\Binder\Date',
], ],
'rule-triggers' => [ 'rule-triggers' => [
'user_action' => 'FireflyIII\Rules\Triggers\UserAction', 'user_action' => 'FireflyIII\Rules\Triggers\UserAction',
'from_account_starts' => 'FireflyIII\Rules\Triggers\FromAccountStarts', 'from_account_starts' => 'FireflyIII\Rules\Triggers\FromAccountStarts',
@@ -181,7 +173,6 @@ return [
'append_description' => 'FireflyIII\Rules\Actions\AppendDescription', 'append_description' => 'FireflyIII\Rules\Actions\AppendDescription',
'prepend_description' => 'FireflyIII\Rules\Actions\PrependDescription', 'prepend_description' => 'FireflyIII\Rules\Actions\PrependDescription',
], ],
// all rule actions that require text input:
'rule-actions-text' => [ 'rule-actions-text' => [
'set_category', 'set_category',
'set_budget', 'set_budget',
@@ -192,10 +183,9 @@ return [
'prepend_description', 'prepend_description',
], ],
'test-triggers' => [ 'test-triggers' => [
// The maximum number of transactions shown when testing a list of triggers
'limit' => 10, 'limit' => 10,
// The maximum number of transactions to analyse, when testing a list of triggers
'range' => 200, 'range' => 200,
], ],
'default_currency' => 'EUR',
'default_language' => 'en_US',
]; ];