mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 03:39:00 +00:00
Add preferences option to enable or disable the custom fiscal year handling.
Stored in DB as 0 or 1 and converted:- - twig expression in view (expandedform needs true boolean) - checkbox true/false converted to integer in set function in controller Oh and I worked out how to localize the label ... took me a while but ended up so simple. This is stage 1 of the overall custom fiscal year extension for Firefly.
This commit is contained in:
@@ -39,10 +39,11 @@ class PreferencesController extends Controller
|
||||
$budgetMax = Preferences::get('budgetMaximum', 1000);
|
||||
$language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data;
|
||||
$budgetMaximum = $budgetMax->data;
|
||||
$customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
|
||||
|
||||
$showIncomplete = env('SHOW_INCOMPLETE_TRANSLATIONS', 'false') == 'true';
|
||||
|
||||
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'showIncomplete'));
|
||||
return view('preferences.index', compact('budgetMaximum', 'language', 'accounts', 'frontPageAccounts', 'viewRange', 'customFiscalYear', 'showIncomplete'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,6 +71,10 @@ class PreferencesController extends Controller
|
||||
$budgetMaximum = intval(Input::get('budgetMaximum'));
|
||||
Preferences::set('budgetMaximum', $budgetMaximum);
|
||||
|
||||
// custom fiscal year
|
||||
$customFiscalYear = (int) Input::get('customFiscalYear');
|
||||
Preferences::set('customFiscalYear', $customFiscalYear);
|
||||
|
||||
// language:
|
||||
$lang = Input::get('language');
|
||||
if (in_array($lang, array_keys(Config::get('firefly.languages')))) {
|
||||
|
Reference in New Issue
Block a user