mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-31 09:46:20 +00:00
🤖 Auto commit for release 'develop' on 2026-01-23
This commit is contained in:
@@ -46,7 +46,7 @@ trait GetConfigurationData
|
||||
E_ALL => 'E_ALL',
|
||||
E_ALL & ~E_DEPRECATED => 'E_ALL & ~E_DEPRECATED ',
|
||||
E_ALL & ~E_NOTICE => 'E_ALL & ~E_NOTICE',
|
||||
E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR => 'E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR'
|
||||
E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR => 'E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR',
|
||||
];
|
||||
|
||||
return $array[$value] ?? (string) $value;
|
||||
@@ -62,13 +62,13 @@ trait GetConfigurationData
|
||||
$steps = [];
|
||||
if (is_array($elements) && count($elements) > 0) {
|
||||
foreach ($elements as $key => $options) {
|
||||
$currentStep = $options;
|
||||
$currentStep = $options;
|
||||
|
||||
// get the text:
|
||||
$currentStep['intro'] = (string) trans('intro.' . $route . '_' . $key);
|
||||
$currentStep['intro'] = (string) trans('intro.'.$route.'_'.$key);
|
||||
|
||||
// save in array:
|
||||
$steps[] = $currentStep;
|
||||
$steps[] = $currentStep;
|
||||
}
|
||||
}
|
||||
Log::debug(sprintf('Total basic steps for %s is %d', $routeKey, count($steps)));
|
||||
@@ -83,23 +83,23 @@ trait GetConfigurationData
|
||||
*/
|
||||
protected function getDateRangeConfig(): array // get configuration + get preferences.
|
||||
{
|
||||
$viewRange = Navigation::getViewRange(false);
|
||||
$viewRange = Navigation::getViewRange(false);
|
||||
|
||||
Log::debug(sprintf('dateRange: the view range is "%s"', $viewRange));
|
||||
|
||||
/** @var Carbon $start */
|
||||
$start = session('start');
|
||||
$start = session('start');
|
||||
|
||||
/** @var Carbon $end */
|
||||
$end = session('end');
|
||||
$end = session('end');
|
||||
|
||||
/** @var Carbon $first */
|
||||
$first = session('first');
|
||||
$title = sprintf('%s - %s', $start->isoFormat($this->monthAndDayFormat), $end->isoFormat($this->monthAndDayFormat));
|
||||
$isCustom = true === session('is_custom_range', false);
|
||||
$today = today(config('app.timezone'));
|
||||
$ranges = [// first range is the current range:
|
||||
$title => [$start, $end]];
|
||||
$first = session('first');
|
||||
$title = sprintf('%s - %s', $start->isoFormat($this->monthAndDayFormat), $end->isoFormat($this->monthAndDayFormat));
|
||||
$isCustom = true === session('is_custom_range', false);
|
||||
$today = today(config('app.timezone'));
|
||||
$ranges = [// first range is the current range:
|
||||
$title => [$start, $end]];
|
||||
Log::debug(sprintf('dateRange: the date range in the session is"%s" - "%s"', $start->format('Y-m-d'), $end->format('Y-m-d')));
|
||||
|
||||
// when current range is a custom range, add the current period as the next range.
|
||||
@@ -107,61 +107,61 @@ trait GetConfigurationData
|
||||
$index = Navigation::periodShow($start, $viewRange);
|
||||
$customPeriodStart = Navigation::startOfPeriod($start, $viewRange);
|
||||
$customPeriodEnd = Navigation::endOfPeriod($customPeriodStart, $viewRange);
|
||||
$ranges[$index] = [$customPeriodStart, $customPeriodEnd];
|
||||
$ranges[$index] = [$customPeriodStart, $customPeriodEnd];
|
||||
}
|
||||
// then add previous range and next range, but skip this for the lastX and YTD stuff.
|
||||
if (!in_array($viewRange, config('firefly.dynamic_date_ranges', []), true)) {
|
||||
$previousDate = Navigation::subtractPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($previousDate, $viewRange);
|
||||
$previousStart = Navigation::startOfPeriod($previousDate, $viewRange);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $viewRange);
|
||||
$previousDate = Navigation::subtractPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($previousDate, $viewRange);
|
||||
$previousStart = Navigation::startOfPeriod($previousDate, $viewRange);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $viewRange);
|
||||
$ranges[$index] = [$previousStart, $previousEnd];
|
||||
|
||||
$nextDate = Navigation::addPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($nextDate, $viewRange);
|
||||
$nextStart = Navigation::startOfPeriod($nextDate, $viewRange);
|
||||
$nextEnd = Navigation::endOfPeriod($nextStart, $viewRange);
|
||||
$nextDate = Navigation::addPeriod($start, $viewRange);
|
||||
$index = Navigation::periodShow($nextDate, $viewRange);
|
||||
$nextStart = Navigation::startOfPeriod($nextDate, $viewRange);
|
||||
$nextEnd = Navigation::endOfPeriod($nextStart, $viewRange);
|
||||
$ranges[$index] = [$nextStart, $nextEnd];
|
||||
}
|
||||
|
||||
// today:
|
||||
/** @var Carbon $todayStart */
|
||||
$todayStart = Navigation::startOfPeriod($today, $viewRange);
|
||||
$todayStart = Navigation::startOfPeriod($today, $viewRange);
|
||||
|
||||
/** @var Carbon $todayEnd */
|
||||
$todayEnd = Navigation::endOfPeriod($todayStart, $viewRange);
|
||||
$todayEnd = Navigation::endOfPeriod($todayStart, $viewRange);
|
||||
|
||||
if ($todayStart->ne($start) || $todayEnd->ne($end)) {
|
||||
$ranges[ucfirst((string) trans('firefly.today'))] = [$todayStart, $todayEnd];
|
||||
}
|
||||
|
||||
// last seven days:
|
||||
$seven = today(config('app.timezone'))->subDays(7);
|
||||
$index = (string) trans('firefly.last_seven_days');
|
||||
$seven = today(config('app.timezone'))->subDays(7);
|
||||
$index = (string) trans('firefly.last_seven_days');
|
||||
$ranges[$index] = [$seven, new Carbon()];
|
||||
|
||||
// last 30 days:
|
||||
$thirty = today(config('app.timezone'))->subDays(30);
|
||||
$index = (string) trans('firefly.last_thirty_days');
|
||||
$thirty = today(config('app.timezone'))->subDays(30);
|
||||
$index = (string) trans('firefly.last_thirty_days');
|
||||
$ranges[$index] = [$thirty, new Carbon()];
|
||||
|
||||
// month to date:
|
||||
$monthBegin = today(config('app.timezone'))->startOfMonth();
|
||||
$index = (string) trans('firefly.month_to_date');
|
||||
$monthBegin = today(config('app.timezone'))->startOfMonth();
|
||||
$index = (string) trans('firefly.month_to_date');
|
||||
$ranges[$index] = [$monthBegin, new Carbon()];
|
||||
|
||||
// year to date:
|
||||
$yearBegin = today(config('app.timezone'))->startOfYear();
|
||||
$index = (string) trans('firefly.year_to_date');
|
||||
$yearBegin = today(config('app.timezone'))->startOfYear();
|
||||
$index = (string) trans('firefly.year_to_date');
|
||||
$ranges[$index] = [$yearBegin, new Carbon()];
|
||||
|
||||
// previous year:
|
||||
$yearBegin = today(config('app.timezone'))->subYear()->startOfYear();
|
||||
$index = (string) trans('firefly.previous_year', ['year' => $yearBegin->year]);
|
||||
$yearBegin = today(config('app.timezone'))->subYear()->startOfYear();
|
||||
$index = (string) trans('firefly.previous_year', ['year' => $yearBegin->year]);
|
||||
$ranges[$index] = [$yearBegin, $yearBegin->clone()->endOfYear()];
|
||||
|
||||
// everything
|
||||
$index = (string) trans('firefly.everything');
|
||||
$index = (string) trans('firefly.everything');
|
||||
$ranges[$index] = [$first, new Carbon()];
|
||||
|
||||
return [
|
||||
@@ -174,8 +174,8 @@ trait GetConfigurationData
|
||||
'customRange' => (string) trans('firefly.customRange'),
|
||||
'start' => $start->format('Y-m-d'),
|
||||
'end' => $end->format('Y-m-d'),
|
||||
'ranges' => $ranges
|
||||
]
|
||||
'ranges' => $ranges,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -190,16 +190,16 @@ trait GetConfigurationData
|
||||
// user is on page with specific instructions:
|
||||
if ('' !== $specificPage) {
|
||||
$routeKey = str_replace('.', '_', $route);
|
||||
$elements = config(sprintf('intro.%s', $routeKey . '_' . $specificPage));
|
||||
$elements = config(sprintf('intro.%s', $routeKey.'_'.$specificPage));
|
||||
if (is_array($elements) && count($elements) > 0) {
|
||||
foreach ($elements as $key => $options) {
|
||||
$currentStep = $options;
|
||||
$currentStep = $options;
|
||||
|
||||
// get the text:
|
||||
$currentStep['intro'] = (string) trans('intro.' . $route . '_' . $specificPage . '_' . $key);
|
||||
$currentStep['intro'] = (string) trans('intro.'.$route.'_'.$specificPage.'_'.$key);
|
||||
|
||||
// save in array:
|
||||
$steps[] = $currentStep;
|
||||
$steps[] = $currentStep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user