2015-02-22 02:46:21 -06:00
|
|
|
<?php
|
2016-05-20 05:27:31 -05:00
|
|
|
/**
|
|
|
|
* breadcrumbs.php
|
2020-03-17 11:06:30 -05:00
|
|
|
* Copyright (c) 2019 james@firefly-iii.org.
|
2016-05-20 05:27:31 -05:00
|
|
|
*
|
2019-10-01 23:45:03 -05:00
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
2016-10-04 23:52:15 -05:00
|
|
|
*
|
2019-10-01 23:45:03 -05:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
* License, or (at your option) any later version.
|
2017-10-21 01:40:00 -05:00
|
|
|
*
|
2019-10-01 23:45:03 -05:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2017-10-21 01:40:00 -05:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2019-10-01 23:45:03 -05:00
|
|
|
* GNU Affero General Public License for more details.
|
2017-10-21 01:40:00 -05:00
|
|
|
*
|
2019-10-01 23:45:03 -05:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2016-05-20 05:27:31 -05:00
|
|
|
*/
|
2017-03-24 09:15:12 -05:00
|
|
|
declare(strict_types=1);
|
2017-07-23 01:32:51 -05:00
|
|
|
|
2015-02-22 02:46:21 -06:00
|
|
|
use Carbon\Carbon;
|
2020-11-07 13:13:06 -06:00
|
|
|
use Diglactic\Breadcrumbs\Generator;
|
|
|
|
use Diglactic\Breadcrumbs\Exceptions\DuplicateBreadcrumbException;
|
2015-02-22 08:40:13 -06:00
|
|
|
use FireflyIII\Models\Account;
|
2016-02-10 07:36:21 -06:00
|
|
|
use FireflyIII\Models\Attachment;
|
2015-02-25 08:19:14 -06:00
|
|
|
use FireflyIII\Models\Bill;
|
2015-03-29 14:27:51 -05:00
|
|
|
use FireflyIII\Models\Budget;
|
2016-12-30 00:39:42 -06:00
|
|
|
use FireflyIII\Models\BudgetLimit;
|
2015-02-23 14:19:16 -06:00
|
|
|
use FireflyIII\Models\Category;
|
2017-08-21 00:13:03 -05:00
|
|
|
use FireflyIII\Models\LinkType;
|
2020-06-20 03:10:55 -05:00
|
|
|
use FireflyIII\Models\ObjectGroup;
|
2015-02-24 14:10:25 -06:00
|
|
|
use FireflyIII\Models\PiggyBank;
|
2018-06-10 09:59:03 -05:00
|
|
|
use FireflyIII\Models\Recurrence;
|
2016-02-10 07:36:21 -06:00
|
|
|
use FireflyIII\Models\Rule;
|
|
|
|
use FireflyIII\Models\RuleGroup;
|
2015-05-03 05:58:55 -05:00
|
|
|
use FireflyIII\Models\Tag;
|
2015-05-02 03:40:20 -05:00
|
|
|
use FireflyIII\Models\TransactionCurrency;
|
2019-04-08 13:31:31 -05:00
|
|
|
use FireflyIII\Models\TransactionGroup;
|
2015-03-29 14:27:51 -05:00
|
|
|
use FireflyIII\Models\TransactionJournal;
|
2017-08-23 14:21:42 -05:00
|
|
|
use FireflyIII\Models\TransactionJournalLink;
|
2016-10-15 00:11:53 -05:00
|
|
|
use FireflyIII\User;
|
2019-07-04 10:31:47 -05:00
|
|
|
use Illuminate\Support\Arr;
|
2015-05-03 05:58:55 -05:00
|
|
|
|
2018-08-05 11:59:15 -05:00
|
|
|
if (!function_exists('limitStringLength')) {
|
|
|
|
/**
|
|
|
|
* Cuts away the middle of a string when it's very long.
|
|
|
|
*
|
|
|
|
* @param string $string
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function limitStringLength(string $string): string
|
|
|
|
{
|
|
|
|
$maxChars = 75;
|
|
|
|
$length = \strlen($string);
|
|
|
|
$result = $string;
|
|
|
|
if ($length > $maxChars) {
|
2021-01-07 13:31:48 -06:00
|
|
|
$result = substr_replace($string, ' ... ', (int)($maxChars / 2), $length - $maxChars);
|
2018-08-05 11:59:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return $result;
|
2018-08-05 00:36:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
try {
|
|
|
|
// HOME
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'home',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.home'), route('index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.home'), route('index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// ACCOUNTS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $what) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what]));
|
|
|
|
}
|
2019-10-19 12:17:14 -05:00
|
|
|
);
|
|
|
|
Breadcrumbs::register( // inactive
|
|
|
|
'accounts.inactive.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $what) {
|
2019-10-19 12:17:14 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts_inactive'), route('accounts.inactive.index', [$what]));
|
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $what) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('accounts.index', $what);
|
|
|
|
$breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$what = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
|
|
|
|
|
|
|
$breadcrumbs->parent('accounts.index', $what);
|
2018-08-27 22:21:23 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($account->name), route('accounts.show.all', [$account->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
if (null !== $start && null !== $end) {
|
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-10-18 23:41:31 -05:00
|
|
|
['start' =>$start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('accounts.show', $account));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.show.all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$what = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
|
|
|
|
|
|
|
$breadcrumbs->parent('accounts.index', $what);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($account->name), route('accounts.show', [$account->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.reconcile',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('accounts.show', $account);
|
|
|
|
$breadcrumbs->push(trans('firefly.reconcile_account', ['account' => $account->name]), route('accounts.reconcile', [$account->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.reconcile.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account, TransactionJournal $journal) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('accounts.show', $account);
|
|
|
|
$title = trans('firefly.reconciliation') . ' "' . $journal->description . '"';
|
|
|
|
$breadcrumbs->push($title, route('accounts.reconcile.show', [$journal->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('accounts.show', $account);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.delete_account', ['name' => limitStringLength($account->name)]), route('accounts.delete', [$account->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Account $account) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('accounts.show', $account);
|
|
|
|
$what = config('firefly.shortNamesByFullName.' . $account->accountType->type);
|
|
|
|
|
2018-08-05 08:34:20 -05:00
|
|
|
$breadcrumbs->push(
|
2020-03-20 11:31:54 -05:00
|
|
|
trans('firefly.edit_' . $what . '_account', ['name' => limitStringLength($account->name)]),
|
|
|
|
route('accounts.edit', [$account->id])
|
2018-08-05 08:34:20 -05:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// ADMIN
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.administration'), route('admin.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.users',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.list_all_users'), route('admin.users'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.users.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, User $user) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.users');
|
|
|
|
$breadcrumbs->push(trans('firefly.single_user_administration', ['email' => $user->email]), route('admin.users.show', [$user->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.users.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, User $user) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.users');
|
|
|
|
$breadcrumbs->push(trans('firefly.edit_user', ['email' => $user->email]), route('admin.users.edit', [$user->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.users.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, User $user) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.users');
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_user', ['email' => $user->email]), route('admin.users.delete', [$user->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.users.domains',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.blocked_domains'), route('admin.users.domains'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.configuration.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.instance_configuration'), route('admin.configuration.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.update-check',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.update_check_title'), route('admin.update-check'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.links.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.journal_link_configuration'), route('admin.links.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.links.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.links.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.create_new_link_type'), route('admin.links.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.links.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, LinkType $linkType) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.links.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.overview_for_link', ['name' => limitStringLength($linkType->name)]), route('admin.links.show', [$linkType->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.links.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, LinkType $linkType) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.links.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.edit_link_type', ['name' => limitStringLength($linkType->name)]), route('admin.links.edit', [$linkType->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.links.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, LinkType $linkType) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('admin.links.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.delete_link_type', ['name' => limitStringLength($linkType->name)]), route('admin.links.delete', [$linkType->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-03-11 02:13:23 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.telemetry.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2020-03-11 02:13:23 -05:00
|
|
|
$breadcrumbs->parent('admin.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.telemetry_index'), route('admin.telemetry.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'admin.telemetry.view',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2020-03-11 02:13:23 -05:00
|
|
|
$breadcrumbs->parent('admin.telemetry.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.telemetry_view'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.link.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionJournalLink $link) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.delete_journal_link'), route('transactions.link.delete', $link->id));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// ATTACHMENTS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'attachments.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.attachments'), route('attachments.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'attachments.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Attachment $attachment) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$object = $attachment->attachable;
|
|
|
|
if ($object instanceof TransactionJournal) {
|
2019-07-26 10:48:24 -05:00
|
|
|
$group = $object->transactionGroup;
|
2019-07-27 06:54:06 -05:00
|
|
|
if (null !== $group && $group instanceof TransactionGroup) {
|
|
|
|
$breadcrumbs->parent('transactions.show', $object->transactionGroup);
|
2019-07-26 10:48:24 -05:00
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
2019-08-03 01:33:05 -05:00
|
|
|
|
|
|
|
if ($object instanceof Bill) {
|
|
|
|
$breadcrumbs->parent('bills.show', $object);
|
|
|
|
}
|
2020-03-20 11:31:54 -05:00
|
|
|
$breadcrumbs->push(
|
|
|
|
limitStringLength(trans('firefly.edit_attachment', ['name' => $attachment->filename])),
|
|
|
|
route('attachments.edit', [$attachment])
|
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'attachments.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Attachment $attachment) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$object = $attachment->attachable;
|
|
|
|
if ($object instanceof TransactionJournal) {
|
2019-07-21 10:15:06 -05:00
|
|
|
$breadcrumbs->parent('transactions.show', $object->transactionGroup);
|
2019-07-04 10:31:47 -05:00
|
|
|
}
|
2019-08-03 07:45:37 -05:00
|
|
|
if ($object instanceof Bill) {
|
|
|
|
$breadcrumbs->parent('bills.show', $object);
|
|
|
|
}
|
|
|
|
$breadcrumbs->push(
|
2020-03-20 11:31:54 -05:00
|
|
|
trans('firefly.delete_attachment', ['name' => limitStringLength($attachment->filename)]),
|
|
|
|
route('attachments.edit', [$attachment])
|
2019-08-03 07:45:37 -05:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// BILLS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'bills.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.bills'), route('bills.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'bills.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('bills.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.newBill'), route('bills.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'bills.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Bill $bill) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('bills.show', $bill);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.edit_bill', ['name' => limitStringLength($bill->name)]), route('bills.edit', [$bill->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'bills.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Bill $bill) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('bills.show', $bill);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.delete_bill', ['name' => limitStringLength($bill->name)]), route('bills.delete', [$bill->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'bills.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Bill $bill) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('bills.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($bill->name), route('bills.show', [$bill->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// BUDGETS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.budgets'), route('budgets.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.create_new_budget'), route('budgets.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Budget $budget) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.show', $budget);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.edit_budget', ['name' => limitStringLength($budget->name)]), route('budgets.edit', [$budget->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Budget $budget) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.show', $budget);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.delete_budget', ['name' => limitStringLength($budget->name)]), route('budgets.delete', [$budget->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.no-budget',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.journals_without_budget'), route('budgets.no-budget'));
|
2018-08-08 10:53:40 -05:00
|
|
|
if (null !== $start && null !== $end) {
|
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-08-08 10:53:40 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('budgets.no-budget'));
|
|
|
|
}
|
2018-07-14 10:23:44 -05:00
|
|
|
}
|
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
2018-07-14 10:23:44 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.no-budget-all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-07-14 10:23:44 -05:00
|
|
|
$breadcrumbs->parent('budgets.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.journals_without_budget'), route('budgets.no-budget'));
|
|
|
|
$breadcrumbs->push(trans('firefly.everything'), route('budgets.no-budget-all'));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Budget $budget) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($budget->name), route('budgets.show', [$budget->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.everything'), route('budgets.show', [$budget->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'budgets.show.limit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Budget $budget, BudgetLimit $budgetLimit) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('budgets.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($budget->name), route('budgets.show', [$budget->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
|
2018-02-11 13:45:48 -06:00
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $budgetLimit->start_date->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $budgetLimit->end_date->formatLocalized((string) trans('config.month_and_day')),]
|
2018-02-11 13:45:48 -06:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push(
|
|
|
|
$title,
|
|
|
|
route('budgets.show.limit', [$budget->id, $budgetLimit->id])
|
2017-11-15 04:33:07 -06:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// CATEGORIES
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.categories'), route('categories.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('categories.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.new_category'), route('categories.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Category $category) {
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->parent('categories.show.all', $category);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.edit_category', ['name' => limitStringLength($category->name)]), route('categories.edit', [$category->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Category $category) {
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->parent('categories.show', $category);
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.delete_category', ['name' => limitStringLength($category->name)]), route('categories.delete', [$category->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Category $category, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('categories.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($category->name), route('categories.show', [$category->id]));
|
2018-08-08 10:53:40 -05:00
|
|
|
if (null !== $start && null !== $end) {
|
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-08-08 10:53:40 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('categories.show', [$category->id]));
|
|
|
|
}
|
2018-07-14 15:48:22 -05:00
|
|
|
}
|
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
2018-07-14 15:48:22 -05:00
|
|
|
Breadcrumbs::register(
|
2018-08-07 14:00:25 -05:00
|
|
|
'categories.show.all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Category $category) {
|
2018-07-14 15:48:22 -05:00
|
|
|
$breadcrumbs->parent('categories.index');
|
2018-08-05 00:36:33 -05:00
|
|
|
$breadcrumbs->push(limitStringLength($category->name), route('categories.show', [$category->id]));
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.everything'), route('categories.show.all', [$category->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'categories.no-category',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('categories.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category'));
|
2018-08-08 10:53:40 -05:00
|
|
|
if (null !== $start && null !== $end) {
|
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-08-08 10:53:40 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('categories.no-category'));
|
|
|
|
}
|
2018-07-14 15:48:22 -05:00
|
|
|
}
|
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
2018-07-14 15:48:22 -05:00
|
|
|
Breadcrumbs::register(
|
2018-08-08 10:53:40 -05:00
|
|
|
'categories.no-category.all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-07-14 15:48:22 -05:00
|
|
|
$breadcrumbs->parent('categories.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.journals_without_category'), route('categories.no-category'));
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->push(trans('firefly.everything'), route('categories.no-category.all'));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// CURRENCIES
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'currencies.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.currencies'), route('currencies.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'currencies.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('currencies.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.create_currency'), route('currencies.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'currencies.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionCurrency $currency) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('currencies.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.edit_currency', ['name' => $currency->name]), route('currencies.edit', [$currency->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'currencies.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionCurrency $currency) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('currencies.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.delete_currency', ['name' => $currency->name]), route('currencies.delete', [$currency->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// EXPORT
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'export.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
2019-12-27 03:59:31 -06:00
|
|
|
$breadcrumbs->push(trans('firefly.export_data_bc'), route('export.index'));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// PIGGY BANKS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.piggyBanks'), route('piggy-banks.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.newPiggyBank'), route('piggy-banks.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, PiggyBank $piggyBank) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.edit_piggyBank', ['name' => $piggyBank->name]), route('piggy-banks.edit', [$piggyBank->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, PiggyBank $piggyBank) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_piggy_bank', ['name' => $piggyBank->name]), route('piggy-banks.delete', [$piggyBank->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, PiggyBank $piggyBank) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.index');
|
|
|
|
$breadcrumbs->push($piggyBank->name, route('piggy-banks.show', [$piggyBank->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.add-money-mobile',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, PiggyBank $piggyBank) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
|
|
|
|
$breadcrumbs->push(trans('firefly.add_money_to_piggy', ['name' => $piggyBank->name]), route('piggy-banks.add-money-mobile', [$piggyBank->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'piggy-banks.remove-money-mobile',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, PiggyBank $piggyBank) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
|
|
|
|
$breadcrumbs->push(
|
|
|
|
trans('firefly.remove_money_from_piggy_title', ['name' => $piggyBank->name]),
|
|
|
|
route('piggy-banks.remove-money-mobile', [$piggyBank->id])
|
2017-11-15 04:33:07 -06:00
|
|
|
);
|
2017-11-15 03:52:29 -06:00
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
// PREFERENCES
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'preferences.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.code',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.profile'), route('profile.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2019-08-04 00:21:11 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.new-backup-codes',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2019-08-04 00:21:11 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.profile'), route('profile.index'));
|
|
|
|
}
|
2020-06-27 08:42:18 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.logout-others',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2020-06-27 08:42:18 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.logout_others'), route('profile.logout-others'));
|
|
|
|
}
|
2019-08-04 00:21:11 -05:00
|
|
|
);
|
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
// PROFILE
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.profile'), route('profile.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.change-password',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('profile.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.changePassword'), route('profile.change-password'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.change-email',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('profile.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.change_email'), route('profile.change-email'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'profile.delete-account',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('profile.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_account'), route('profile.delete-account'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// REPORTS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.reports'), route('reports.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.report.audit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.report.budget',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.report.tag',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.report.category',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_category', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
2019-09-04 03:27:13 -05:00
|
|
|
'reports.report.double',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, string $doubleIds, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_double', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
2019-09-04 03:27:13 -05:00
|
|
|
$breadcrumbs->push($title, route('reports.report.double', [$accountIds, $doubleIds, $start->format('Ymd'), $end->format('Ymd')]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'reports.report.default',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('reports.index');
|
|
|
|
|
2020-03-18 14:45:45 -05:00
|
|
|
$monthFormat = (string) trans('config.month_and_day');
|
2018-04-29 13:01:03 -05:00
|
|
|
$startString = $start->formatLocalized($monthFormat);
|
|
|
|
$endString = $end->formatLocalized($monthFormat);
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.report_default', ['start' => $startString, 'end' => $endString]);
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// New user Controller
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'new-user.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.getting_started'), route('new-user.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-06-10 09:59:03 -05:00
|
|
|
// Recurring transactions controller:
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-06-10 09:59:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.recurrences'), route('recurring.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Recurrence $recurrence) {
|
2018-06-10 09:59:03 -05:00
|
|
|
$breadcrumbs->parent('recurring.index');
|
|
|
|
$breadcrumbs->push($recurrence->title, route('recurring.show', [$recurrence->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-06-23 01:19:29 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Recurrence $recurrence) {
|
2018-06-23 01:19:29 -05:00
|
|
|
$breadcrumbs->parent('recurring.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_recurring', ['title' => $recurrence->title]), route('recurring.delete', [$recurrence->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-06-17 08:14:34 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Recurrence $recurrence) {
|
2018-06-17 08:14:34 -05:00
|
|
|
$breadcrumbs->parent('recurring.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.edit_recurrence', ['title' => $recurrence->title]), route('recurring.edit', [$recurrence->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-06-10 09:59:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-06-10 09:59:03 -05:00
|
|
|
$breadcrumbs->parent('recurring.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.create_new_recurrence'), route('recurring.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-08-07 04:38:31 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'recurring.create-from-journal',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2020-08-07 04:38:31 -05:00
|
|
|
$breadcrumbs->parent('recurring.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.create_new_recurrence'), route('recurring.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
// Rules
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('firefly.rules'), route('rules.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, RuleGroup $ruleGroup = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
2018-08-05 08:34:20 -05:00
|
|
|
if (null === $ruleGroup) {
|
|
|
|
$breadcrumbs->push(trans('firefly.make_new_rule_no_group'), route('rules.create'));
|
|
|
|
}
|
|
|
|
if (null !== $ruleGroup) {
|
|
|
|
$breadcrumbs->push(trans('firefly.make_new_rule', ['title' => $ruleGroup->title]), route('rules.create', [$ruleGroup]));
|
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
2018-08-05 11:59:15 -05:00
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.create-from-bill',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-08-05 11:59:15 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.make_new_rule_no_group'), route('rules.create'));
|
|
|
|
}
|
|
|
|
);
|
2020-01-24 23:32:15 -06:00
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.create-from-journal',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2020-01-24 23:32:15 -06:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.make_new_rule_no_group'), route('rules.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Rule $rule) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.edit_rule', ['title' => $rule->title]), route('rules.edit', [$rule]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Rule $rule) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_rule', ['title' => $rule->title]), route('rules.delete', [$rule]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rule-groups.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.make_new_rule_group'), route('rule-groups.create'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rule-groups.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, RuleGroup $ruleGroup) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.edit', [$ruleGroup]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rule-groups.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, RuleGroup $ruleGroup) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]), route('rule-groups.delete', [$ruleGroup]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rules.select-transactions',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Rule $rule) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(
|
2020-03-20 11:31:54 -05:00
|
|
|
trans('firefly.rule_select_transactions', ['title' => $rule->title]),
|
|
|
|
route('rules.select-transactions', [$rule])
|
2017-11-15 04:33:07 -06:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'rule-groups.select-transactions',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, RuleGroup $ruleGroup) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('rules.index');
|
|
|
|
$breadcrumbs->push(
|
2020-03-20 11:31:54 -05:00
|
|
|
trans('firefly.rule_group_select_transactions', ['title' => $ruleGroup->title]),
|
|
|
|
route('rule-groups.select-transactions', [$ruleGroup])
|
2017-11-15 04:33:07 -06:00
|
|
|
);
|
2017-11-15 03:52:29 -06:00
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
// SEARCH
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'search.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, $query) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.search_result', ['query' => $query]), route('search.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// TAGS
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.tags'), route('tags.index'));
|
|
|
|
}
|
|
|
|
);
|
2016-02-10 07:36:21 -06:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('tags.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.createTag'), route('tags.create'));
|
|
|
|
}
|
|
|
|
);
|
2018-03-25 06:30:55 -05:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Tag $tag) {
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->parent('tags.show', $tag);
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.edit_tag', ['tag' => $tag->tag]), route('tags.edit', [$tag->id]));
|
|
|
|
}
|
|
|
|
);
|
2017-11-15 03:52:29 -06:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Tag $tag) {
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->parent('tags.show', $tag);
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(trans('breadcrumbs.delete_tag', ['tag' => $tag->tag]), route('tags.delete', [$tag->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Tag $tag, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('tags.index');
|
2018-08-07 14:00:25 -05:00
|
|
|
|
|
|
|
$breadcrumbs->push($tag->tag, route('tags.show', [$tag->id, $start, $end]));
|
2020-03-17 11:06:30 -05:00
|
|
|
if (null !== $start && null !== $end) {
|
2018-08-08 10:53:40 -05:00
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-08-08 10:53:40 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('tags.show', [$tag->id, $start, $end]));
|
|
|
|
}
|
2018-08-07 14:00:25 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'tags.show.all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, Tag $tag) {
|
2018-08-07 14:00:25 -05:00
|
|
|
$breadcrumbs->parent('tags.index');
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->push($tag->tag, route('tags.show', [$tag->id]));
|
2020-03-18 14:45:45 -05:00
|
|
|
$title = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
|
2018-08-08 10:53:40 -05:00
|
|
|
$breadcrumbs->push($title, route('tags.show.all', $tag->id));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// TRANSACTIONS
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $what, Carbon $start = null, Carbon $end = null) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what]));
|
|
|
|
|
|
|
|
if (null !== $start && null !== $end) {
|
|
|
|
// add date range:
|
|
|
|
$title = trans(
|
|
|
|
'firefly.between_dates_breadcrumb',
|
2020-03-20 11:31:54 -05:00
|
|
|
['start' => $start->formatLocalized((string) trans('config.month_and_day')),
|
|
|
|
'end' => $end->formatLocalized((string) trans('config.month_and_day')),]
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
$breadcrumbs->push($title, route('transactions.index', [$what, $start, $end]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.index.all',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $what) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('home');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.create',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, string $objectType) {
|
2019-05-04 13:58:11 -05:00
|
|
|
$breadcrumbs->parent('transactions.index', $objectType);
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.create_new_transaction'), route('transactions.create', [$objectType]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
2016-12-11 03:38:06 -06:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionGroup $group) {
|
2019-06-01 13:38:18 -05:00
|
|
|
$breadcrumbs->parent('transactions.show', $group);
|
|
|
|
|
|
|
|
/** @var TransactionJournal $first */
|
|
|
|
$first = $group->transactionJournals()->first();
|
|
|
|
|
2018-08-07 14:00:25 -05:00
|
|
|
$breadcrumbs->push(
|
2020-03-20 11:31:54 -05:00
|
|
|
trans('breadcrumbs.edit_journal', ['description' => limitStringLength($first->description)]),
|
|
|
|
route('transactions.edit', [$group->id])
|
2018-08-07 14:00:25 -05:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// also edit reconciliations:
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'accounts.reconcile.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionJournal $journal) {
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('transactions.show', $journal);
|
|
|
|
$breadcrumbs->push(
|
2018-08-07 14:00:25 -05:00
|
|
|
trans('breadcrumbs.edit_reconciliation', ['description' => limitStringLength($journal->description)]),
|
|
|
|
route('accounts.reconcile.edit', [$journal->id])
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionGroup $group) {
|
2019-07-31 23:22:07 -05:00
|
|
|
$breadcrumbs->parent('transactions.show', $group);
|
|
|
|
|
2020-03-20 11:31:54 -05:00
|
|
|
$journal = $group->transactionJournals->first();
|
2018-08-07 14:00:25 -05:00
|
|
|
$breadcrumbs->push(
|
2019-07-31 23:22:07 -05:00
|
|
|
trans('breadcrumbs.delete_group', ['description' => limitStringLength($group->title ?? $journal->description)]),
|
|
|
|
route('transactions.delete', [$group->id])
|
2018-08-07 14:00:25 -05:00
|
|
|
);
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.show',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionGroup $group) {
|
2019-04-08 13:31:31 -05:00
|
|
|
/** @var TransactionJournal $first */
|
|
|
|
$first = $group->transactionJournals()->first();
|
|
|
|
$type = strtolower($first->transactionType->type);
|
|
|
|
$title = limitStringLength($first->description);
|
|
|
|
if ($group->transactionJournals()->count() > 1) {
|
|
|
|
$title = limitStringLength($group->title);
|
|
|
|
}
|
2020-03-17 11:06:30 -05:00
|
|
|
if ('opening balance' === $type) {
|
2020-03-11 00:50:23 -05:00
|
|
|
// TODO link to account.
|
|
|
|
$breadcrumbs->push($title, route('transactions.show', [$group->id]));
|
2020-03-17 11:06:30 -05:00
|
|
|
|
2020-03-11 00:50:23 -05:00
|
|
|
return;
|
|
|
|
}
|
2020-03-17 11:06:30 -05:00
|
|
|
if ('reconciliation' === $type) {
|
2020-03-11 00:50:23 -05:00
|
|
|
// TODO link to account.
|
2019-08-23 06:06:00 -05:00
|
|
|
$breadcrumbs->push($title, route('transactions.show', [$group->id]));
|
2020-03-17 11:06:30 -05:00
|
|
|
|
2019-08-23 06:06:00 -05:00
|
|
|
return;
|
|
|
|
}
|
2018-08-05 00:36:33 -05:00
|
|
|
|
2019-04-08 13:31:31 -05:00
|
|
|
$breadcrumbs->parent('transactions.index', $type);
|
|
|
|
$breadcrumbs->push($title, route('transactions.show', [$group->id]));
|
2017-11-15 03:52:29 -06:00
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.convert.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, TransactionGroup $group, string $groupTitle) {
|
2019-07-05 12:43:16 -05:00
|
|
|
$breadcrumbs->parent('transactions.show', $group);
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->push(
|
2019-07-05 12:43:16 -05:00
|
|
|
trans('firefly.breadcrumb_convert_group', ['description' => limitStringLength($groupTitle)]),
|
|
|
|
route('transactions.convert.index', [$group->id, 'something'])
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// MASS TRANSACTION EDIT / DELETE
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.mass.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, array $journals): void {
|
2020-10-26 13:15:57 -05:00
|
|
|
if (!empty($journals)) {
|
2019-07-20 09:02:50 -05:00
|
|
|
$objectType = strtolower(reset($journals)['transaction_type_type']);
|
|
|
|
$breadcrumbs->parent('transactions.index', $objectType);
|
|
|
|
$breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.edit', ['']));
|
2018-04-29 13:01:03 -05:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$breadcrumbs->parent('index');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.mass.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, array $journals) {
|
2020-03-20 11:31:54 -05:00
|
|
|
$objectType = strtolower(reset($journals)['transaction_type_type']);
|
2019-07-20 09:02:50 -05:00
|
|
|
$breadcrumbs->parent('transactions.index', $objectType);
|
|
|
|
$breadcrumbs->push(trans('firefly.mass_edit_journals'), route('transactions.mass.delete', ['']));
|
2017-12-30 05:43:57 -06:00
|
|
|
}
|
2018-04-29 13:01:03 -05:00
|
|
|
);
|
|
|
|
|
|
|
|
// BULK EDIT
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'transactions.bulk.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, array $journals): void {
|
2020-10-26 13:15:57 -05:00
|
|
|
if (!empty($journals)) {
|
2020-03-20 11:31:54 -05:00
|
|
|
$ids = Arr::pluck($journals, 'transaction_journal_id');
|
2019-07-04 10:31:47 -05:00
|
|
|
$first = reset($journals);
|
|
|
|
$breadcrumbs->parent('transactions.index', strtolower($first['transaction_type_type']));
|
|
|
|
$breadcrumbs->push(trans('firefly.mass_bulk_journals'), route('transactions.bulk.edit', $ids));
|
2017-12-30 05:43:57 -06:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
return;
|
|
|
|
}
|
2017-12-30 05:43:57 -06:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
$breadcrumbs->parent('index');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2020-06-20 03:10:55 -05:00
|
|
|
// object groups
|
2018-04-29 13:01:03 -05:00
|
|
|
Breadcrumbs::register(
|
2020-06-20 03:10:55 -05:00
|
|
|
'object-groups.index',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs): void {
|
2020-06-20 03:10:55 -05:00
|
|
|
$breadcrumbs->parent('index');
|
|
|
|
$breadcrumbs->push(trans('firefly.object_groups_breadcrumb'), route('object-groups.index'));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'object-groups.edit',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, ObjectGroup $objectGroup) {
|
2020-06-20 03:10:55 -05:00
|
|
|
$breadcrumbs->parent('object-groups.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.edit_object_group', ['title' => $objectGroup->title]), route('object-groups.edit', [$objectGroup->id]));
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
Breadcrumbs::register(
|
|
|
|
'object-groups.delete',
|
2020-11-07 13:13:06 -06:00
|
|
|
static function (Generator $breadcrumbs, ObjectGroup $objectGroup) {
|
2020-06-20 03:10:55 -05:00
|
|
|
$breadcrumbs->parent('object-groups.index');
|
|
|
|
$breadcrumbs->push(trans('breadcrumbs.delete_object_group', ['title' => $objectGroup->title]), route('object-groups.delete', [$objectGroup->id]));
|
2018-04-29 13:01:03 -05:00
|
|
|
}
|
|
|
|
);
|
2020-06-20 03:10:55 -05:00
|
|
|
|
2018-04-29 13:01:03 -05:00
|
|
|
} catch (DuplicateBreadcrumbException $e) {
|
2020-08-01 10:51:52 -05:00
|
|
|
// @ignoreException
|
2018-12-31 00:48:23 -06:00
|
|
|
}
|