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)
{
$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')) {
@ -246,13 +246,13 @@ class CurrencyController extends Controller
}
// 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) {
return false;
}
// is the default currency for the system
$defaultSystemCode = env('DEFAULT_CURRENCY', 'EUR');
$defaultSystemCode = config('firefly.default_currency', 'EUR');
if ($currency->code === $defaultSystemCode) {
return false;
}

View File

@ -39,7 +39,7 @@ class HelpController extends Controller
*/
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 = [
'text' => '<p>' . strval(trans('firefly.route_has_no_help')) . '</p>',
'title' => 'Help',

View File

@ -78,7 +78,7 @@ class PreferencesController extends Controller
$viewRangePref = Preferences::get('viewRange', '1M');
$viewRange = $viewRangePref->data;
$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;
$customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
$fiscalYearStartStr = Preferences::get('fiscalYearStart', '01-01')->data;

View File

@ -81,7 +81,7 @@ class Range
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;
App::setLocale($lang);

View File

@ -360,7 +360,7 @@ class ImportValidator
/** @var CurrencyRepositoryInterface $repository */
$repository = app(CurrencyRepositoryInterface::class, [$this->user]);
// 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);
Log::debug(sprintf('Set currency to %s', $defaultCode));

View File

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

View File

@ -1,14 +1,16 @@
<?php
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 [
// default values for editable configuration:
'configuration' => [
'configuration' => [
'single_user_mode' => true,
],
'chart' => 'chartjs',
'version' => '3.10.4',
'csv_import_enabled' => true,
@ -17,25 +19,21 @@ return [
'resend_confirmation' => 3600,
'confirmation_age' => 14400, // four hours
'export_formats' => [
'export_formats' => [
'csv' => 'FireflyIII\Export\Exporter\CsvExporter',
// mt940 FireflyIII Export Exporter MtExporter
],
'import_formats' => [
'import_formats' => [
'csv' => 'FireflyIII\Import\Importer\CsvImporter',
// mt940 FireflyIII Import Importer MtImporter
],
'default_export_format' => 'csv',
'default_import_format' => 'csv',
'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'accountRoles' => [
'default_export_format' => 'csv',
'default_import_format' => 'csv',
'bill_periods' => ['weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'accountRoles' => [
'defaultAsset' => 'Default asset account',
'sharedAsset' => 'Shared asset account',
'savingAsset' => 'Savings account',
'ccAsset' => 'Credit card',
],
'ccTypes' => [
'monthlyFull' => 'Full payment every month',
],
@ -121,9 +119,7 @@ return [
'transfers' => 'fa-exchange',
],
'bindables' => [
// models
'bindables' => [
'account' => 'FireflyIII\Models\Account',
'attachment' => 'FireflyIII\Models\Attachment',
'bill' => 'FireflyIII\Models\Bill',
@ -139,18 +135,14 @@ return [
'ruleGroup' => 'FireflyIII\Models\RuleGroup',
'jobKey' => 'FireflyIII\Models\ExportJob',
'importJob' => 'FireflyIII\Models\ImportJob',
// lists
'accountList' => 'FireflyIII\Support\Binder\AccountList',
'budgetList' => 'FireflyIII\Support\Binder\BudgetList',
'journalList' => 'FireflyIII\Support\Binder\JournalList',
'categoryList' => 'FireflyIII\Support\Binder\CategoryList',
// others
'start_date' => 'FireflyIII\Support\Binder\Date',
'end_date' => 'FireflyIII\Support\Binder\Date',
],
'rule-triggers' => [
'rule-triggers' => [
'user_action' => 'FireflyIII\Rules\Triggers\UserAction',
'from_account_starts' => 'FireflyIII\Rules\Triggers\FromAccountStarts',
'from_account_ends' => 'FireflyIII\Rules\Triggers\FromAccountEnds',
@ -169,7 +161,7 @@ return [
'description_contains' => 'FireflyIII\Rules\Triggers\DescriptionContains',
'description_is' => 'FireflyIII\Rules\Triggers\DescriptionIs',
],
'rule-actions' => [
'rule-actions' => [
'set_category' => 'FireflyIII\Rules\Actions\SetCategory',
'clear_category' => 'FireflyIII\Rules\Actions\ClearCategory',
'set_budget' => 'FireflyIII\Rules\Actions\SetBudget',
@ -181,8 +173,7 @@ return [
'append_description' => 'FireflyIII\Rules\Actions\AppendDescription',
'prepend_description' => 'FireflyIII\Rules\Actions\PrependDescription',
],
// all rule actions that require text input:
'rule-actions-text' => [
'rule-actions-text' => [
'set_category',
'set_budget',
'add_tag',
@ -191,11 +182,10 @@ return [
'append_description',
'prepend_description',
],
'test-triggers' => [
// The maximum number of transactions shown when testing a list of triggers
'test-triggers' => [
'limit' => 10,
// The maximum number of transactions to analyse, when testing a list of triggers
'range' => 200,
],
'default_currency' => 'EUR',
'default_language' => 'en_US',
];