mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Replace variable names.
This commit is contained in:
@@ -145,13 +145,13 @@ class CreateController extends Controller
|
||||
Log::channel('audit')->info('Stored new account.', $data);
|
||||
|
||||
// update preferences if necessary:
|
||||
$frontPage = app('preferences')->get('frontPageAccounts', [])->data;
|
||||
if (!is_array($frontPage)) {
|
||||
$frontPage = [];
|
||||
$frontpage = app('preferences')->get('frontpageAccounts', [])->data;
|
||||
if (!is_array($frontpage)) {
|
||||
$frontpage = [];
|
||||
}
|
||||
if (AccountType::ASSET === $account->accountType->type) {
|
||||
$frontPage[] = $account->id;
|
||||
app('preferences')->set('frontPageAccounts', $frontPage);
|
||||
$frontpage[] = $account->id;
|
||||
app('preferences')->set('frontpageAccounts', $frontpage);
|
||||
}
|
||||
|
||||
// store attachment(s):
|
||||
|
@@ -301,14 +301,14 @@ class AccountController extends Controller
|
||||
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
|
||||
$defaultSet = $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray();
|
||||
app('log')->debug('Default set is ', $defaultSet);
|
||||
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
|
||||
$frontPageArray = !is_array($frontPage->data) ? [] : $frontPage->data;
|
||||
app('log')->debug('Frontpage preference set is ', $frontPageArray);
|
||||
if (0 === count($frontPageArray)) {
|
||||
app('preferences')->set('frontPageAccounts', $defaultSet);
|
||||
$frontpage = app('preferences')->get('frontpageAccounts', $defaultSet);
|
||||
$frontpageArray = !is_array($frontpage->data) ? [] : $frontpage->data;
|
||||
app('log')->debug('Frontpage preference set is ', $frontpageArray);
|
||||
if (0 === count($frontpageArray)) {
|
||||
app('preferences')->set('frontpageAccounts', $defaultSet);
|
||||
app('log')->debug('frontpage set is empty!');
|
||||
}
|
||||
$accounts = $repository->getAccountsById($frontPageArray);
|
||||
$accounts = $repository->getAccountsById($frontpageArray);
|
||||
|
||||
return response()->json($this->accountBalanceChart($accounts, $start, $end));
|
||||
}
|
||||
|
@@ -116,8 +116,8 @@ class CategoryController extends Controller
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
|
||||
$frontPageGenerator = new FrontpageChartGenerator($start, $end);
|
||||
$chartData = $frontPageGenerator->generate();
|
||||
$frontpageGenerator = new FrontpageChartGenerator($start, $end);
|
||||
$chartData = $frontpageGenerator->generate();
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
$cache->store($data);
|
||||
|
||||
|
@@ -129,10 +129,10 @@ class HomeController extends Controller
|
||||
}
|
||||
$subTitle = (string)trans('firefly.welcome_back');
|
||||
$transactions = [];
|
||||
$frontPage = app('preferences')->getFresh('frontPageAccounts', $repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray());
|
||||
$frontPageArray = $frontPage->data;
|
||||
if (!is_array($frontPageArray)) {
|
||||
$frontPageArray = [];
|
||||
$frontpage = app('preferences')->getFresh('frontpageAccounts', $repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray());
|
||||
$frontpageArray = $frontpage->data;
|
||||
if (!is_array($frontpageArray)) {
|
||||
$frontpageArray = [];
|
||||
}
|
||||
|
||||
/** @var Carbon $start */
|
||||
@@ -140,13 +140,13 @@ class HomeController extends Controller
|
||||
|
||||
/** @var Carbon $end */
|
||||
$end = session('end', today(config('app.timezone'))->endOfMonth());
|
||||
$accounts = $repository->getAccountsById($frontPageArray);
|
||||
$accounts = $repository->getAccountsById($frontpageArray);
|
||||
$today = today(config('app.timezone'));
|
||||
|
||||
// sort frontpage accounts by order
|
||||
$accounts = $accounts->sortBy('order');
|
||||
|
||||
app('log')->debug('Frontpage accounts are ', $frontPageArray);
|
||||
app('log')->debug('Frontpage accounts are ', $frontpageArray);
|
||||
|
||||
/** @var BillRepositoryInterface $billRepository */
|
||||
$billRepository = app(BillRepositoryInterface::class);
|
||||
|
@@ -115,7 +115,7 @@ class NewUserController extends Controller
|
||||
|
||||
// store frontpage preferences:
|
||||
$accounts = $this->repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray();
|
||||
app('preferences')->set('frontPageAccounts', $accounts);
|
||||
app('preferences')->set('frontpageAccounts', $accounts);
|
||||
|
||||
// mark.
|
||||
app('preferences')->mark();
|
||||
|
@@ -89,10 +89,10 @@ class PreferencesController extends Controller
|
||||
/** @var array<int, int> $accountIds */
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
$viewRange = app('navigation')->getViewRange(false);
|
||||
$frontPageAccountsPref = app('preferences')->get('frontPageAccounts', $accountIds);
|
||||
$frontPageAccounts = $frontPageAccountsPref->data;
|
||||
if (!is_array($frontPageAccounts)) {
|
||||
$frontPageAccounts = $accountIds;
|
||||
$frontpageAccountsPref = app('preferences')->get('frontpageAccounts', $accountIds);
|
||||
$frontpageAccounts = $frontpageAccountsPref->data;
|
||||
if (!is_array($frontpageAccounts)) {
|
||||
$frontpageAccounts = $accountIds;
|
||||
}
|
||||
$language = app('steam')->getLanguage();
|
||||
$languages = config('firefly.languages');
|
||||
@@ -128,8 +128,8 @@ class PreferencesController extends Controller
|
||||
$locales = ['equal' => (string)trans('firefly.equal_to_language')] + $locales;
|
||||
// an important fallback is that the frontPageAccount array gets refilled automatically
|
||||
// when it turns up empty.
|
||||
if (0 === count($frontPageAccounts)) {
|
||||
$frontPageAccounts = $accountIds;
|
||||
if (0 === count($frontpageAccounts)) {
|
||||
$frontpageAccounts = $accountIds;
|
||||
}
|
||||
|
||||
// for the demo user, the slackUrl is automatically emptied.
|
||||
@@ -139,7 +139,7 @@ class PreferencesController extends Controller
|
||||
$slackUrl = '';
|
||||
}
|
||||
|
||||
return view('preferences.index', compact('language', 'groupedAccounts', 'isDocker', 'frontPageAccounts', 'languages', 'darkMode', 'availableDarkModes', 'notifications', 'slackUrl', 'locales', 'locale', 'tjOptionalFields', 'viewRange', 'customFiscalYear', 'listPageSize', 'fiscalYearStart'));
|
||||
return view('preferences.index', compact('language', 'groupedAccounts', 'isDocker', 'frontpageAccounts', 'languages', 'darkMode', 'availableDarkModes', 'notifications', 'slackUrl', 'locales', 'locale', 'tjOptionalFields', 'viewRange', 'customFiscalYear', 'listPageSize', 'fiscalYearStart'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,12 +155,12 @@ class PreferencesController extends Controller
|
||||
public function postIndex(Request $request)
|
||||
{
|
||||
// front page accounts
|
||||
$frontPageAccounts = [];
|
||||
if (is_array($request->get('frontPageAccounts')) && count($request->get('frontPageAccounts')) > 0) {
|
||||
foreach ($request->get('frontPageAccounts') as $id) {
|
||||
$frontPageAccounts[] = (int)$id;
|
||||
$frontpageAccounts = [];
|
||||
if (is_array($request->get('frontpageAccounts')) && count($request->get('frontpageAccounts')) > 0) {
|
||||
foreach ($request->get('frontpageAccounts') as $id) {
|
||||
$frontpageAccounts[] = (int)$id;
|
||||
}
|
||||
app('preferences')->set('frontPageAccounts', $frontPageAccounts);
|
||||
app('preferences')->set('frontpageAccounts', $frontpageAccounts);
|
||||
}
|
||||
|
||||
// extract notifications:
|
||||
|
Reference in New Issue
Block a user