Various updates.

This commit is contained in:
James Cole
2021-04-04 08:31:15 +02:00
parent f8c725e5b2
commit 85b22341a4
41 changed files with 161 additions and 54 deletions

View File

@@ -21,8 +21,8 @@
declare(strict_types=1);
use Carbon\Carbon;
use Diglactic\Breadcrumbs\Generator;
use Diglactic\Breadcrumbs\Exceptions\DuplicateBreadcrumbException;
use Diglactic\Breadcrumbs\Generator;
use FireflyIII\Models\Account;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\Bill;
@@ -114,8 +114,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' =>$start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('accounts.show', $account));
}
@@ -420,8 +420,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('budgets.no-budget'));
}
@@ -454,8 +454,8 @@ try {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $budgetLimit->start_date->formatLocalized((string) trans('config.month_and_day')),
'end' => $budgetLimit->end_date->formatLocalized((string) trans('config.month_and_day')),]
['start' => $budgetLimit->start_date->formatLocalized((string)trans('config.month_and_day')),
'end' => $budgetLimit->end_date->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push(
@@ -504,8 +504,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('categories.show', [$category->id]));
}
@@ -529,8 +529,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('categories.no-category'));
}
@@ -724,10 +724,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -737,10 +737,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -751,10 +751,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -765,10 +765,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -779,10 +779,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, string $doubleIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.double', [$accountIds, $doubleIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -793,10 +793,10 @@ try {
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
$breadcrumbs->parent('reports.index');
$monthFormat = (string) trans('config.month_and_day');
$monthFormat = (string)trans('config.month_and_day');
$startString = $start->formatLocalized($monthFormat);
$endString = $end->formatLocalized($monthFormat);
$title = (string) trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$title = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
$breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
}
@@ -1006,8 +1006,8 @@ try {
if (null !== $start && null !== $end) {
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('tags.show', [$tag->id, $start, $end]));
}
@@ -1019,7 +1019,7 @@ try {
static function (Generator $breadcrumbs, Tag $tag) {
$breadcrumbs->parent('tags.index');
$breadcrumbs->push($tag->tag, route('tags.show', [$tag->id]));
$title = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$title = (string)trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$breadcrumbs->push($title, route('tags.show.all', $tag->id));
}
);
@@ -1036,8 +1036,8 @@ try {
// add date range:
$title = trans(
'firefly.between_dates_breadcrumb',
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
['start' => $start->formatLocalized((string)trans('config.month_and_day')),
'end' => $end->formatLocalized((string)trans('config.month_and_day')),]
);
$breadcrumbs->push($title, route('transactions.index', [$what, $start, $end]));
}
@@ -1069,7 +1069,7 @@ try {
$first = $group->transactionJournals()->first();
$breadcrumbs->push(
trans('breadcrumbs.edit_journal', ['description' => limitStringLength($first->description)]),
trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string)$first->description)]),
route('transactions.edit', [$group->id])
);
}
@@ -1108,7 +1108,7 @@ try {
$type = strtolower($first->transactionType->type);
$title = limitStringLength($first->description);
if ($group->transactionJournals()->count() > 1) {
$title = limitStringLength($group->title);
$title = limitStringLength((string)$group->title);
}
if ('opening balance' === $type) {
// TODO link to account.
@@ -1168,7 +1168,7 @@ try {
'transactions.bulk.edit',
static function (Generator $breadcrumbs, array $journals): void {
if (!empty($journals)) {
$ids = Arr::pluck($journals, 'transaction_journal_id');
$ids = Arr::pluck($journals, 'transaction_journal_id');
$first = reset($journals);
$breadcrumbs->parent('transactions.index', strtolower($first['transaction_type_type']));
$breadcrumbs->push(trans('firefly.mass_bulk_journals'), route('transactions.bulk.edit', $ids));