mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-23 11:41:21 +00:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13f2e6537e | ||
|
|
613a02fa52 | ||
|
|
2b615cf757 | ||
|
|
52a593e2e0 | ||
|
|
cf89d93cec | ||
|
|
295724c4e9 | ||
|
|
39fbd545ad | ||
|
|
3373961143 | ||
|
|
7f5b50d1f6 | ||
|
|
04267f1388 | ||
|
|
cddba20499 | ||
|
|
791833ab61 | ||
|
|
0ad9a75274 | ||
|
|
172d78f810 | ||
|
|
d2018ad3ec | ||
|
|
97124bcbce | ||
|
|
27dd30785f | ||
|
|
093794f7a5 | ||
|
|
a67bad11b2 | ||
|
|
91a53032b9 | ||
|
|
a87ce030d8 | ||
|
|
799da3597f | ||
|
|
663bf22a2a | ||
|
|
5d3abb315c | ||
|
|
a6ce34b67e | ||
|
|
75f5b5b51d | ||
|
|
555b358b80 | ||
|
|
7772190d45 | ||
|
|
311effb518 | ||
|
|
d2ccb33c54 | ||
|
|
5b312708f9 | ||
|
|
f4ae1e6c79 | ||
|
|
a91298d045 | ||
|
|
0fea3a5a85 | ||
|
|
7b830a69d9 | ||
|
|
22af0b373e | ||
|
|
ca34e0ebd5 | ||
|
|
e139cf76de | ||
|
|
50f87a210a | ||
|
|
ac5c11a8d7 | ||
|
|
3813b7a9e8 | ||
|
|
86a6e51ebc | ||
|
|
eb4343407d | ||
|
|
8eb4c64602 | ||
|
|
f033a14bc7 | ||
|
|
59199134a6 | ||
|
|
c6d831fd94 | ||
|
|
a963e1bc03 | ||
|
|
be48d3bea2 | ||
|
|
b20b8868bf | ||
|
|
e243ec10ba |
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -19,3 +19,10 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
target-branch: develop
|
||||||
|
labels: ["bug"]
|
||||||
|
versioning-strategy: increase
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
|||||||
6
.github/workflows/lock.yml
vendored
6
.github/workflows/lock.yml
vendored
@@ -5,8 +5,14 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lock:
|
lock:
|
||||||
|
permissions:
|
||||||
|
issues: write # for dessant/lock-threads to lock issues
|
||||||
|
pull-requests: write # for dessant/lock-threads to lock PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v2
|
- uses: dessant/lock-threads@v2
|
||||||
|
|||||||
6
.github/workflows/stale.yml
vendored
6
.github/workflows/stale.yml
vendored
@@ -3,8 +3,14 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "30 1 * * *"
|
- cron: "30 1 * * *"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stale:
|
stale:
|
||||||
|
permissions:
|
||||||
|
issues: write # for actions/stale to close stale issues
|
||||||
|
pull-requests: write # for actions/stale to close stale PRs
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v3
|
- uses: actions/stale@v3
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ abstract class Controller extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to grab all parameters from the URI.
|
* Method to grab all parameters from the URL.
|
||||||
*
|
*
|
||||||
* @return ParameterBag
|
* @return ParameterBag
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
@@ -148,7 +148,7 @@ abstract class Controller extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to help build URI's.
|
* Method to help build URL's.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ class StoreController extends Controller
|
|||||||
|
|
||||||
$selectedGroup = $collector->getGroups()->first();
|
$selectedGroup = $collector->getGroups()->first();
|
||||||
if (null === $selectedGroup) {
|
if (null === $selectedGroup) {
|
||||||
throw new FireflyException('Cannot find transaction. Possibly, a rule deleted this transaction after its creation.');
|
throw new FireflyException('200032: Cannot find transaction. Possibly, a rule deleted this transaction after its creation.');
|
||||||
}
|
}
|
||||||
/** @var TransactionGroupTransformer $transformer */
|
/** @var TransactionGroupTransformer $transformer */
|
||||||
$transformer = app(TransactionGroupTransformer::class);
|
$transformer = app(TransactionGroupTransformer::class);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class ListController extends Controller
|
|||||||
{
|
{
|
||||||
$manager = $this->getManager();
|
$manager = $this->getManager();
|
||||||
|
|
||||||
// read type from URI
|
// read type from URL
|
||||||
$type = $request->get('type') ?? 'all';
|
$type = $request->get('type') ?? 'all';
|
||||||
$this->parameters->set('type', $type);
|
$this->parameters->set('type', $type);
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class ShowController extends Controller
|
|||||||
{
|
{
|
||||||
// create some objects:
|
// create some objects:
|
||||||
$manager = $this->getManager();
|
$manager = $this->getManager();
|
||||||
// read type from URI
|
// read type from URL
|
||||||
$name = $request->get('name');
|
$name = $request->get('name');
|
||||||
|
|
||||||
// types to get, page size:
|
// types to get, page size:
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class AutocompleteRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function getData(): array
|
public function getData(): array
|
||||||
{
|
{
|
||||||
$types = $this->string('types');
|
$types = $this->convertString('types');
|
||||||
$array = [];
|
$array = [];
|
||||||
if ('' !== $types) {
|
if ('' !== $types) {
|
||||||
$array = explode(',', $types);
|
$array = explode(',', $types);
|
||||||
@@ -53,7 +53,7 @@ class AutocompleteRequest extends FormRequest
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'types' => $array,
|
'types' => $array,
|
||||||
'query' => $this->string('query'),
|
'query' => $this->convertString('query'),
|
||||||
'date' => $this->getCarbonDate('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'limit' => $limit,
|
'limit' => $limit,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ class ExportRequest extends FormRequest
|
|||||||
$result = [
|
$result = [
|
||||||
'start' => $this->getCarbonDate('start') ?? Carbon::now()->subYear(),
|
'start' => $this->getCarbonDate('start') ?? Carbon::now()->subYear(),
|
||||||
'end' => $this->getCarbonDate('end') ?? Carbon::now(),
|
'end' => $this->getCarbonDate('end') ?? Carbon::now(),
|
||||||
'type' => $this->string('type'),
|
'type' => $this->convertString('type'),
|
||||||
];
|
];
|
||||||
$parts = explode(',', $this->string('accounts'));
|
$parts = explode(',', $this->convertString('accounts'));
|
||||||
$repository = app(AccountRepositoryInterface::class);
|
$repository = app(AccountRepositoryInterface::class);
|
||||||
$repository->setUser(auth()->user());
|
$repository->setUser(auth()->user());
|
||||||
|
|
||||||
|
|||||||
@@ -56,35 +56,35 @@ class StoreRequest extends FormRequest
|
|||||||
$includeNetWorth = $this->boolean('include_net_worth');
|
$includeNetWorth = $this->boolean('include_net_worth');
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'active' => $active,
|
'active' => $active,
|
||||||
'include_net_worth' => $includeNetWorth,
|
'include_net_worth' => $includeNetWorth,
|
||||||
'account_type_name' => $this->string('type'),
|
'account_type_name' => $this->convertString('type'),
|
||||||
'account_type_id' => null,
|
'account_type_id' => null,
|
||||||
'currency_id' => $this->integer('currency_id'),
|
'currency_id' => $this->integer('currency_id'),
|
||||||
'order' => $this->integer('order'),
|
'order' => $this->integer('order'),
|
||||||
'currency_code' => $this->string('currency_code'),
|
'currency_code' => $this->convertString('currency_code'),
|
||||||
'virtual_balance' => $this->string('virtual_balance'),
|
'virtual_balance' => $this->convertString('virtual_balance'),
|
||||||
'iban' => $this->string('iban'),
|
'iban' => $this->convertString('iban'),
|
||||||
'BIC' => $this->string('bic'),
|
'BIC' => $this->convertString('bic'),
|
||||||
'account_number' => $this->string('account_number'),
|
'account_number' => $this->convertString('account_number'),
|
||||||
'account_role' => $this->string('account_role'),
|
'account_role' => $this->convertString('account_role'),
|
||||||
'opening_balance' => $this->string('opening_balance'),
|
'opening_balance' => $this->convertString('opening_balance'),
|
||||||
'opening_balance_date' => $this->getCarbonDate('opening_balance_date'),
|
'opening_balance_date' => $this->getCarbonDate('opening_balance_date'),
|
||||||
'cc_type' => $this->string('credit_card_type'),
|
'cc_type' => $this->convertString('credit_card_type'),
|
||||||
'cc_monthly_payment_date' => $this->string('monthly_payment_date'),
|
'cc_monthly_payment_date' => $this->convertString('monthly_payment_date'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'interest' => $this->string('interest'),
|
'interest' => $this->convertString('interest'),
|
||||||
'interest_period' => $this->string('interest_period'),
|
'interest_period' => $this->convertString('interest_period'),
|
||||||
];
|
];
|
||||||
// append location information.
|
// append location information.
|
||||||
$data = $this->appendLocationData($data, null);
|
$data = $this->appendLocationData($data, null);
|
||||||
|
|
||||||
if ('liability' === $data['account_type_name'] || 'liabilities' === $data['account_type_name']) {
|
if ('liability' === $data['account_type_name'] || 'liabilities' === $data['account_type_name']) {
|
||||||
$data['opening_balance'] = app('steam')->negative($this->string('liability_amount'));
|
$data['opening_balance'] = app('steam')->negative($this->convertString('liability_amount'));
|
||||||
$data['opening_balance_date'] = $this->getCarbonDate('liability_start_date');
|
$data['opening_balance_date'] = $this->getCarbonDate('liability_start_date');
|
||||||
$data['account_type_name'] = $this->string('liability_type');
|
$data['account_type_name'] = $this->convertString('liability_type');
|
||||||
$data['liability_direction'] = $this->string('liability_direction');
|
$data['liability_direction'] = $this->convertString('liability_direction');
|
||||||
$data['account_type_id'] = null;
|
$data['account_type_id'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class StoreRequest extends FormRequest
|
|||||||
$accountRoles = implode(',', config('firefly.accountRoles'));
|
$accountRoles = implode(',', config('firefly.accountRoles'));
|
||||||
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
$types = implode(',', array_keys(config('firefly.subTitlesByIdentifier')));
|
||||||
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
||||||
$type = $this->string('type');
|
$type = $this->convertString('type');
|
||||||
$rules = [
|
$rules = [
|
||||||
'name' => 'required|min:1|uniqueAccountForUser',
|
'name' => 'required|min:1|uniqueAccountForUser',
|
||||||
'type' => 'required|' . sprintf('in:%s', $types),
|
'type' => 'required|' . sprintf('in:%s', $types),
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ class UpdateRequest extends FormRequest
|
|||||||
$rules = [
|
$rules = [
|
||||||
'name' => sprintf('min:1|uniqueAccountForUser:%d', $account->id),
|
'name' => sprintf('min:1|uniqueAccountForUser:%d', $account->id),
|
||||||
'type' => sprintf('in:%s', $types),
|
'type' => sprintf('in:%s', $types),
|
||||||
'iban' => ['iban', 'nullable', new UniqueIban($account, $this->string('type'))],
|
'iban' => ['iban', 'nullable', new UniqueIban($account, $this->convertString('type'))],
|
||||||
'bic' => 'bic|nullable',
|
'bic' => 'bic|nullable',
|
||||||
'account_number' => ['between:1,255', 'nullable', new UniqueAccountNumber($account, $this->string('type'))],
|
'account_number' => ['between:1,255', 'nullable', new UniqueAccountNumber($account, $this->convertString('type'))],
|
||||||
'opening_balance' => 'numeric|required_with:opening_balance_date|nullable',
|
'opening_balance' => 'numeric|required_with:opening_balance_date|nullable',
|
||||||
'opening_balance_date' => 'date|required_with:opening_balance|nullable',
|
'opening_balance_date' => 'date|required_with:opening_balance|nullable',
|
||||||
'virtual_balance' => 'numeric|nullable',
|
'virtual_balance' => 'numeric|nullable',
|
||||||
|
|||||||
@@ -45,10 +45,10 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'filename' => $this->string('filename'),
|
'filename' => $this->convertString('filename'),
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'attachable_type' => $this->string('attachable_type'),
|
'attachable_type' => $this->convertString('attachable_type'),
|
||||||
'attachable_id' => $this->integer('attachable_id'),
|
'attachable_id' => $this->integer('attachable_id'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ class StoreRequest extends FormRequest
|
|||||||
}, $models
|
}, $models
|
||||||
);
|
);
|
||||||
$models = implode(',', $models);
|
$models = implode(',', $models);
|
||||||
$model = $this->string('attachable_type');
|
$model = $this->convertString('attachable_type');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'filename' => 'required|between:1,255',
|
'filename' => 'required|between:1,255',
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class UpdateRequest extends FormRequest
|
|||||||
}, $models
|
}, $models
|
||||||
);
|
);
|
||||||
$models = implode(',', $models);
|
$models = implode(',', $models);
|
||||||
$model = $this->string('attachable_type');
|
$model = $this->convertString('attachable_type');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'filename' => 'between:1,255',
|
'filename' => 'between:1,255',
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ class StoreRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'start' => $this->getCarbonDate('start'),
|
'start' => $this->getCarbonDate('start'),
|
||||||
'end' => $this->getCarbonDate('end'),
|
'end' => $this->getCarbonDate('end'),
|
||||||
'amount' => $this->string('amount'),
|
'amount' => $this->convertString('amount'),
|
||||||
'currency_id' => $this->integer('currency_id'),
|
'currency_id' => $this->integer('currency_id'),
|
||||||
'currency_code' => $this->string('currency_code'),
|
'currency_code' => $this->convertString('currency_code'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,15 +47,15 @@ class StoreRequest extends FormRequest
|
|||||||
'order' => ['order', 'integer'],
|
'order' => ['order', 'integer'],
|
||||||
];
|
];
|
||||||
$data = $this->getAllData($fields);
|
$data = $this->getAllData($fields);
|
||||||
$data['name'] = $this->string('name');
|
$data['name'] = $this->convertString('name');
|
||||||
$data['account_id'] = $this->integer('account_id');
|
$data['account_id'] = $this->integer('account_id');
|
||||||
$data['targetamount'] = $this->string('target_amount');
|
$data['targetamount'] = $this->convertString('target_amount');
|
||||||
$data['current_amount'] = $this->string('current_amount');
|
$data['current_amount'] = $this->convertString('current_amount');
|
||||||
$data['startdate'] = $this->getCarbonDate('start_date');
|
$data['startdate'] = $this->getCarbonDate('start_date');
|
||||||
$data['targetdate'] = $this->getCarbonDate('target_date');
|
$data['targetdate'] = $this->getCarbonDate('target_date');
|
||||||
$data['notes'] = $this->stringWithNewlines('notes');
|
$data['notes'] = $this->stringWithNewlines('notes');
|
||||||
$data['object_group_id'] = $this->integer('object_group_id');
|
$data['object_group_id'] = $this->integer('object_group_id');
|
||||||
$data['object_group_title'] = $this->string('object_group_title');
|
$data['object_group_title'] = $this->convertString('object_group_title');
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ class StoreRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'description' => $this->string('description'),
|
'description' => $this->convertString('description'),
|
||||||
'active' => $active,
|
'active' => $active,
|
||||||
'order' => $order,
|
'order' => $order,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'tag' => $this->string('tag'),
|
'tag' => $this->convertString('tag'),
|
||||||
'date' => $this->getCarbonDate('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'description' => $this->string('description'),
|
'description' => $this->convertString('description'),
|
||||||
'has_location' => true,
|
'has_location' => true,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class StoreRequest extends FormRequest
|
|||||||
Log::debug('get all data in TransactionStoreRequest');
|
Log::debug('get all data in TransactionStoreRequest');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'group_title' => $this->string('group_title'),
|
'group_title' => $this->convertString('group_title'),
|
||||||
'error_if_duplicate_hash' => $this->boolean('error_if_duplicate_hash'),
|
'error_if_duplicate_hash' => $this->boolean('error_if_duplicate_hash'),
|
||||||
'apply_rules' => $this->boolean('apply_rules', true),
|
'apply_rules' => $this->boolean('apply_rules', true),
|
||||||
'fire_webhooks' => $this->boolean('fire_webhooks', true),
|
'fire_webhooks' => $this->boolean('fire_webhooks', true),
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'notes',
|
'notes',
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->stringFields = [
|
$this->convertStringFields = [
|
||||||
'type',
|
'type',
|
||||||
'currency_code',
|
'currency_code',
|
||||||
'foreign_currency_code',
|
'foreign_currency_code',
|
||||||
@@ -133,7 +133,7 @@ class UpdateRequest extends FormRequest
|
|||||||
$data['fire_webhooks'] = $this->boolean('fire_webhooks', true);
|
$data['fire_webhooks'] = $this->boolean('fire_webhooks', true);
|
||||||
}
|
}
|
||||||
if ($this->has('group_title')) {
|
if ($this->has('group_title')) {
|
||||||
$data['group_title'] = $this->string('group_title');
|
$data['group_title'] = $this->convertString('group_title');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
@@ -196,7 +196,7 @@ class UpdateRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
private function getStringData(array $current, array $transaction): array
|
private function getStringData(array $current, array $transaction): array
|
||||||
{
|
{
|
||||||
foreach ($this->stringFields as $fieldName) {
|
foreach ($this->convertStringFields as $fieldName) {
|
||||||
if (array_key_exists($fieldName, $transaction)) {
|
if (array_key_exists($fieldName, $transaction)) {
|
||||||
$current[$fieldName] = $this->clearString((string) $transaction[$fieldName], false);
|
$current[$fieldName] = $this->clearString((string) $transaction[$fieldName], false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ class StoreRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'code' => $this->string('code'),
|
'code' => $this->convertString('code'),
|
||||||
'symbol' => $this->string('symbol'),
|
'symbol' => $this->convertString('symbol'),
|
||||||
'decimal_places' => $this->integer('decimal_places'),
|
'decimal_places' => $this->integer('decimal_places'),
|
||||||
'default' => $default,
|
'default' => $default,
|
||||||
'enabled' => $enabled,
|
'enabled' => $enabled,
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class StoreRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'link_type_id' => $this->integer('link_type_id'),
|
'link_type_id' => $this->integer('link_type_id'),
|
||||||
'link_type_name' => $this->string('link_type_name'),
|
'link_type_name' => $this->convertString('link_type_name'),
|
||||||
'inward_id' => $this->integer('inward_id'),
|
'inward_id' => $this->integer('inward_id'),
|
||||||
'outward_id' => $this->integer('outward_id'),
|
'outward_id' => $this->integer('outward_id'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class UpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'link_type_id' => $this->integer('link_type_id'),
|
'link_type_id' => $this->integer('link_type_id'),
|
||||||
'link_type_name' => $this->string('link_type_name'),
|
'link_type_name' => $this->convertString('link_type_name'),
|
||||||
'inward_id' => $this->integer('inward_id'),
|
'inward_id' => $this->integer('inward_id'),
|
||||||
'outward_id' => $this->integer('outward_id'),
|
'outward_id' => $this->integer('outward_id'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'outward' => $this->string('outward'),
|
'outward' => $this->convertString('outward'),
|
||||||
'inward' => $this->string('inward'),
|
'inward' => $this->convertString('inward'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ class UpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'outward' => $this->string('outward'),
|
'outward' => $this->convertString('outward'),
|
||||||
'inward' => $this->string('inward'),
|
'inward' => $this->convertString('inward'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class UpdateRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
$return['secret'] = null !== $this->get('secret');
|
$return['secret'] = null !== $this->get('secret');
|
||||||
if (null !== $this->get('title')) {
|
if (null !== $this->get('title')) {
|
||||||
$return['title'] = $this->string('title');
|
$return['title'] = $this->convertString('title');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class UpdateRequest extends FormRequest
|
|||||||
return ['value' => $this->integer('value')];
|
return ['value' => $this->integer('value')];
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['value' => $this->string('value')];
|
return ['value' => $this->convertString('value')];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ class UserStoreRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'email' => $this->string('email'),
|
'email' => $this->convertString('email'),
|
||||||
'blocked' => $blocked,
|
'blocked' => $blocked,
|
||||||
'blocked_code' => $this->string('blocked_code'),
|
'blocked_code' => $this->convertString('blocked_code'),
|
||||||
'role' => $this->string('role'),
|
'role' => $this->convertString('role'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ class UserUpdateRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'email' => $this->string('email'),
|
'email' => $this->convertString('email'),
|
||||||
'blocked' => $blocked,
|
'blocked' => $blocked,
|
||||||
'blocked_code' => $this->string('blocked_code'),
|
'blocked_code' => $this->convertString('blocked_code'),
|
||||||
'role' => $this->string('role'),
|
'role' => $this->convertString('role'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class PreferenceStoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$array = [
|
$array = [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'data' => $this->get('data'),
|
'data' => $this->get('data'),
|
||||||
];
|
];
|
||||||
if ('true' === $array['data']) {
|
if ('true' === $array['data']) {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class PreferenceUpdateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$array = [
|
$array = [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'data' => $this->get('data'),
|
'data' => $this->get('data'),
|
||||||
];
|
];
|
||||||
if ('true' === $array['data']) {
|
if ('true' === $array['data']) {
|
||||||
|
|||||||
@@ -230,9 +230,9 @@ class UserEventHandler
|
|||||||
$oldEmail = $event->oldEmail;
|
$oldEmail = $event->oldEmail;
|
||||||
$user = $event->user;
|
$user = $event->user;
|
||||||
$token = app('preferences')->getForUser($user, 'email_change_confirm_token', 'invalid');
|
$token = app('preferences')->getForUser($user, 'email_change_confirm_token', 'invalid');
|
||||||
$uri = route('profile.confirm-email-change', [$token->data]);
|
$url = route('profile.confirm-email-change', [$token->data]);
|
||||||
try {
|
try {
|
||||||
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $uri));
|
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
|
||||||
|
|
||||||
} catch (Exception $e) { // @phpstan-ignore-line
|
} catch (Exception $e) { // @phpstan-ignore-line
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
@@ -256,9 +256,9 @@ class UserEventHandler
|
|||||||
$user = $event->user;
|
$user = $event->user;
|
||||||
$token = app('preferences')->getForUser($user, 'email_change_undo_token', 'invalid');
|
$token = app('preferences')->getForUser($user, 'email_change_undo_token', 'invalid');
|
||||||
$hashed = hash('sha256', sprintf('%s%s', (string) config('app.key'), $oldEmail));
|
$hashed = hash('sha256', sprintf('%s%s', (string) config('app.key'), $oldEmail));
|
||||||
$uri = route('profile.undo-email-change', [$token->data, $hashed]);
|
$url = route('profile.undo-email-change', [$token->data, $hashed]);
|
||||||
try {
|
try {
|
||||||
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $uri));
|
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
|
||||||
|
|
||||||
} catch (Exception $e) { // @phpstan-ignore-line
|
} catch (Exception $e) { // @phpstan-ignore-line
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
@@ -308,7 +308,7 @@ class UserEventHandler
|
|||||||
if ($sendMail) {
|
if ($sendMail) {
|
||||||
// get the email address
|
// get the email address
|
||||||
$email = $event->user->email;
|
$email = $event->user->email;
|
||||||
$uri = route('index');
|
$url = route('index');
|
||||||
|
|
||||||
// see if user has alternative email address:
|
// see if user has alternative email address:
|
||||||
$pref = app('preferences')->getForUser($event->user, 'remote_guard_alt_email');
|
$pref = app('preferences')->getForUser($event->user, 'remote_guard_alt_email');
|
||||||
@@ -318,7 +318,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
// send email.
|
// send email.
|
||||||
try {
|
try {
|
||||||
Mail::to($email)->send(new RegisteredUserMail($uri));
|
Mail::to($email)->send(new RegisteredUserMail($url));
|
||||||
|
|
||||||
} catch (Exception $e) { // @phpstan-ignore-line
|
} catch (Exception $e) { // @phpstan-ignore-line
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
|
|||||||
@@ -555,7 +555,9 @@ trait TimeCollection
|
|||||||
*/
|
*/
|
||||||
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface
|
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
die('a');
|
$afterStr = $date->format('Y-m-d 00:00:00');
|
||||||
|
$this->query->where(sprintf('transaction_journals.%s', $field), '<=', $afterStr);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('accounts.create.fromStore')) {
|
if (true !== session('accounts.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('accounts.create.uri');
|
$this->rememberPreviousUrl('accounts.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('accounts.create.fromStore');
|
$request->session()->forget('accounts.create.fromStore');
|
||||||
Log::channel('audit')->info('Creating new account.');
|
Log::channel('audit')->info('Creating new account.');
|
||||||
@@ -171,7 +171,7 @@ class CreateController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// redirect to previous URL.
|
// redirect to previous URL.
|
||||||
$redirect = redirect($this->getPreviousUri('accounts.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('accounts.create.url'));
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
// set value so create routine will not overwrite URL:
|
// set value so create routine will not overwrite URL:
|
||||||
$request->session()->put('accounts.create.fromStore', true);
|
$request->session()->put('accounts.create.fromStore', true);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class DeleteController extends Controller
|
|||||||
unset($accountList[$account->id]);
|
unset($accountList[$account->id]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('accounts.delete.uri');
|
$this->rememberPreviousUrl('accounts.delete.url');
|
||||||
|
|
||||||
return view('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
return view('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ class DeleteController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans(sprintf('firefly.%s_deleted', $typeName), ['name' => $name]));
|
$request->session()->flash('success', (string) trans(sprintf('firefly.%s_deleted', $typeName), ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('accounts.delete.uri'));
|
return redirect($this->getPreviousUrl('accounts.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('accounts.edit.fromUpdate')) {
|
if (true !== session('accounts.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('accounts.edit.uri');
|
$this->rememberPreviousUrl('accounts.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('accounts.edit.fromUpdate');
|
$request->session()->forget('accounts.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ class EditController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// redirect
|
// redirect
|
||||||
$redirect = redirect($this->getPreviousUri('accounts.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('accounts.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
// set value so edit routine will not overwrite URL:
|
// set value so edit routine will not overwrite URL:
|
||||||
$request->session()->put('accounts.edit.fromUpdate', true);
|
$request->session()->put('accounts.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -134,9 +134,9 @@ class ReconcileController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.reconcile_account', ['account' => $account->name]);
|
$subTitle = (string) trans('firefly.reconcile_account', ['account' => $account->name]);
|
||||||
|
|
||||||
// various links
|
// various links
|
||||||
$transactionsUri = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']);
|
$transactionsUrl = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']);
|
||||||
$overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
|
$overviewUrl = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
|
||||||
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
|
$indexUrl = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
|
||||||
$objectType = 'asset';
|
$objectType = 'asset';
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
@@ -151,9 +151,9 @@ class ReconcileController extends Controller
|
|||||||
'subTitle',
|
'subTitle',
|
||||||
'startBalance',
|
'startBalance',
|
||||||
'endBalance',
|
'endBalance',
|
||||||
'transactionsUri',
|
'transactionsUrl',
|
||||||
'overviewUri',
|
'overviewUrl',
|
||||||
'indexUri'
|
'indexUrl'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class ShowController extends Controller
|
|||||||
$fStart = $start->isoFormat($this->monthAndDayFormat);
|
$fStart = $start->isoFormat($this->monthAndDayFormat);
|
||||||
$fEnd = $end->isoFormat($this->monthAndDayFormat);
|
$fEnd = $end->isoFormat($this->monthAndDayFormat);
|
||||||
$subTitle = (string) trans('firefly.journals_in_period_for_account', ['name' => $account->name, 'start' => $fStart, 'end' => $fEnd]);
|
$subTitle = (string) trans('firefly.journals_in_period_for_account', ['name' => $account->name, 'start' => $fStart, 'end' => $fEnd]);
|
||||||
$chartUri = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
|
$chartUrl = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
|
||||||
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
|
$firstTransaction = $this->repository->oldestJournalDate($account) ?? $start;
|
||||||
$periods = $this->getAccountPeriodOverview($account, $firstTransaction, $end);
|
$periods = $this->getAccountPeriodOverview($account, $firstTransaction, $end);
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ class ShowController extends Controller
|
|||||||
'subTitle',
|
'subTitle',
|
||||||
'start',
|
'start',
|
||||||
'end',
|
'end',
|
||||||
'chartUri',
|
'chartUrl',
|
||||||
'location',
|
'location',
|
||||||
'balance'
|
'balance'
|
||||||
)
|
)
|
||||||
@@ -194,7 +194,7 @@ class ShowController extends Controller
|
|||||||
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page)->withAccountInformation()->withCategoryInformation();
|
$collector->setAccounts(new Collection([$account]))->setLimit($pageSize)->setPage($page)->withAccountInformation()->withCategoryInformation();
|
||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath(route('accounts.show.all', [$account->id]));
|
$groups->setPath(route('accounts.show.all', [$account->id]));
|
||||||
$chartUri = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
|
$chartUrl = route('chart.account.period', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
|
||||||
$showAll = true;
|
$showAll = true;
|
||||||
$balance = app('steam')->balance($account, $end);
|
$balance = app('steam')->balance($account, $end);
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ class ShowController extends Controller
|
|||||||
'attachments',
|
'attachments',
|
||||||
'currency',
|
'currency',
|
||||||
'today',
|
'today',
|
||||||
'chartUri',
|
'chartUrl',
|
||||||
'periods',
|
'periods',
|
||||||
'subTitleIcon',
|
'subTitleIcon',
|
||||||
'groups',
|
'groups',
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class LinkController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('link-types.create.fromStore')) {
|
if (true !== session('link-types.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('link-types.create.uri');
|
$this->rememberPreviousUrl('link-types.create.url');
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.link.create', compact('subTitle', 'subTitleIcon'));
|
return view('admin.link.create', compact('subTitle', 'subTitleIcon'));
|
||||||
@@ -113,7 +113,7 @@ class LinkController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('link-types.delete.uri');
|
$this->rememberPreviousUrl('link-types.delete.url');
|
||||||
|
|
||||||
return view('admin.link.delete', compact('linkType', 'subTitle', 'moveTo', 'count'));
|
return view('admin.link.delete', compact('linkType', 'subTitle', 'moveTo', 'count'));
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ class LinkController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.deleted_link_type', ['name' => $name]));
|
$request->session()->flash('success', (string) trans('firefly.deleted_link_type', ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('link-types.delete.uri'));
|
return redirect($this->getPreviousUrl('link-types.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -161,7 +161,7 @@ class LinkController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('link-types.edit.fromUpdate')) {
|
if (true !== session('link-types.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('link-types.edit.uri');
|
$this->rememberPreviousUrl('link-types.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('link-types.edit.fromUpdate');
|
$request->session()->forget('link-types.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -217,16 +217,16 @@ class LinkController extends Controller
|
|||||||
public function store(LinkTypeFormRequest $request)
|
public function store(LinkTypeFormRequest $request)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'name' => $request->string('name'),
|
'name' => $request->convertString('name'),
|
||||||
'inward' => $request->string('inward'),
|
'inward' => $request->convertString('inward'),
|
||||||
'outward' => $request->string('outward'),
|
'outward' => $request->convertString('outward'),
|
||||||
];
|
];
|
||||||
$linkType = $this->repository->store($data);
|
$linkType = $this->repository->store($data);
|
||||||
|
|
||||||
Log::channel('audit')->info('User stored new link type.', $linkType->toArray());
|
Log::channel('audit')->info('User stored new link type.', $linkType->toArray());
|
||||||
|
|
||||||
$request->session()->flash('success', (string) trans('firefly.stored_new_link_type', ['name' => $linkType->name]));
|
$request->session()->flash('success', (string) trans('firefly.stored_new_link_type', ['name' => $linkType->name]));
|
||||||
$redirect = redirect($this->getPreviousUri('link-types.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('link-types.create.url'));
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
// set value so create routine will not overwrite URL:
|
// set value so create routine will not overwrite URL:
|
||||||
$request->session()->put('link-types.create.fromStore', true);
|
$request->session()->put('link-types.create.fromStore', true);
|
||||||
@@ -255,9 +255,9 @@ class LinkController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'name' => $request->string('name'),
|
'name' => $request->convertString('name'),
|
||||||
'inward' => $request->string('inward'),
|
'inward' => $request->convertString('inward'),
|
||||||
'outward' => $request->string('outward'),
|
'outward' => $request->convertString('outward'),
|
||||||
];
|
];
|
||||||
$this->repository->update($linkType, $data);
|
$this->repository->update($linkType, $data);
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ class LinkController extends Controller
|
|||||||
|
|
||||||
$request->session()->flash('success', (string) trans('firefly.updated_link_type', ['name' => $linkType->name]));
|
$request->session()->flash('success', (string) trans('firefly.updated_link_type', ['name' => $linkType->name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$redirect = redirect($this->getPreviousUri('link-types.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('link-types.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
// set value so edit routine will not overwrite URL:
|
// set value so edit routine will not overwrite URL:
|
||||||
$request->session()->put('link-types.edit.fromUpdate', true);
|
$request->session()->put('link-types.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('users.edit.fromUpdate')) {
|
if (true !== session('users.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('users.edit.uri');
|
$this->rememberPreviousUrl('users.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('users.edit.fromUpdate');
|
session()->forget('users.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
session()->flash('success', (string) trans('firefly.updated_user', ['email' => $user->email]));
|
session()->flash('success', (string) trans('firefly.updated_user', ['email' => $user->email]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$redirect = redirect($this->getPreviousUri('users.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('users.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
session()->put('users.edit.fromUpdate', true);
|
session()->put('users.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class AttachmentController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_attachment', ['name' => $attachment->filename]);
|
$subTitle = (string) trans('firefly.delete_attachment', ['name' => $attachment->filename]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('attachments.delete.uri');
|
$this->rememberPreviousUrl('attachments.delete.url');
|
||||||
|
|
||||||
return view('attachments.delete', compact('attachment', 'subTitle'));
|
return view('attachments.delete', compact('attachment', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ class AttachmentController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.attachment_deleted', ['name' => $name]));
|
$request->session()->flash('success', (string) trans('firefly.attachment_deleted', ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('attachments.delete.uri'));
|
return redirect($this->getPreviousUrl('attachments.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,7 @@ class AttachmentController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('attachments.edit.fromUpdate')) {
|
if (true !== session('attachments.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('attachments.edit.uri');
|
$this->rememberPreviousUrl('attachments.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('attachments.edit.fromUpdate');
|
$request->session()->forget('attachments.edit.fromUpdate');
|
||||||
$preFilled = [
|
$preFilled = [
|
||||||
@@ -196,7 +196,7 @@ class AttachmentController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.attachment_updated', ['name' => $attachment->filename]));
|
$request->session()->flash('success', (string) trans('firefly.attachment_updated', ['name' => $attachment->filename]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('attachments.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('attachments.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
$request->session()->put('attachments.edit.fromUpdate', true);
|
$request->session()->put('attachments.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -169,11 +169,11 @@ class LoginController extends Controller
|
|||||||
public function logout(Request $request)
|
public function logout(Request $request)
|
||||||
{
|
{
|
||||||
$authGuard = config('firefly.authentication_guard');
|
$authGuard = config('firefly.authentication_guard');
|
||||||
$logoutUri = config('firefly.custom_logout_url');
|
$logoutUrl = config('firefly.custom_logout_url');
|
||||||
if ('remote_user_guard' === $authGuard && '' !== $logoutUri) {
|
if ('remote_user_guard' === $authGuard && '' !== $logoutUrl) {
|
||||||
return redirect($logoutUri);
|
return redirect($logoutUrl);
|
||||||
}
|
}
|
||||||
if ('remote_user_guard' === $authGuard && '' === $logoutUri) {
|
if ('remote_user_guard' === $authGuard && '' === $logoutUrl) {
|
||||||
session()->flash('error', trans('firefly.cant_logout_guard'));
|
session()->flash('error', trans('firefly.cant_logout_guard'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('bills.create.fromStore')) {
|
if (true !== session('bills.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('bills.create.uri');
|
$this->rememberPreviousUrl('bills.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('bills.create.fromStore');
|
$request->session()->forget('bills.create.fromStore');
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class DeleteController extends Controller
|
|||||||
public function delete(Bill $bill)
|
public function delete(Bill $bill)
|
||||||
{
|
{
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('bills.delete.uri');
|
$this->rememberPreviousUrl('bills.delete.url');
|
||||||
$subTitle = (string) trans('firefly.delete_bill', ['name' => $bill->name]);
|
$subTitle = (string) trans('firefly.delete_bill', ['name' => $bill->name]);
|
||||||
|
|
||||||
return view('bills.delete', compact('bill', 'subTitle'));
|
return view('bills.delete', compact('bill', 'subTitle'));
|
||||||
@@ -94,6 +94,6 @@ class DeleteController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.deleted_bill', ['name' => $name]));
|
$request->session()->flash('success', (string) trans('firefly.deleted_bill', ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('bills.delete.uri'));
|
return redirect($this->getPreviousUrl('bills.delete.url'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('bills.edit.fromUpdate')) {
|
if (true !== session('bills.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('bills.edit.uri');
|
$this->rememberPreviousUrl('bills.edit.url');
|
||||||
}
|
}
|
||||||
|
|
||||||
$currency = app('amount')->getDefaultCurrency();
|
$currency = app('amount')->getDefaultCurrency();
|
||||||
@@ -141,7 +141,7 @@ class EditController extends Controller
|
|||||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('bills.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('bills.edit.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('budgets.create.fromStore')) {
|
if (true !== session('budgets.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('budgets.create.uri');
|
$this->rememberPreviousUrl('budgets.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('budgets.create.fromStore');
|
$request->session()->forget('budgets.create.fromStore');
|
||||||
$subTitle = (string) trans('firefly.create_new_budget');
|
$subTitle = (string) trans('firefly.create_new_budget');
|
||||||
@@ -136,7 +136,7 @@ class CreateController extends Controller
|
|||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('budgets.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('budgets.create.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_budget', ['name' => $budget->name]);
|
$subTitle = (string) trans('firefly.delete_budget', ['name' => $budget->name]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('budgets.delete.uri');
|
$this->rememberPreviousUrl('budgets.delete.url');
|
||||||
|
|
||||||
return view('budgets.delete', compact('budget', 'subTitle'));
|
return view('budgets.delete', compact('budget', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ class DeleteController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.deleted_budget', ['name' => $name]));
|
$request->session()->flash('success', (string) trans('firefly.deleted_budget', ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('budgets.delete.uri'));
|
return redirect($this->getPreviousUrl('budgets.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('budgets.edit.fromUpdate')) {
|
if (true !== session('budgets.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('budgets.edit.uri');
|
$this->rememberPreviousUrl('budgets.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('budgets.edit.fromUpdate');
|
$request->session()->forget('budgets.edit.fromUpdate');
|
||||||
$request->session()->flash('preFilled', $preFilled);
|
$request->session()->flash('preFilled', $preFilled);
|
||||||
@@ -133,7 +133,7 @@ class EditController extends Controller
|
|||||||
$this->repository->cleanupBudgets();
|
$this->repository->cleanupBudgets();
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('budgets.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('budgets.edit.url'));
|
||||||
|
|
||||||
// store new attachment(s):
|
// store new attachment(s):
|
||||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class CreateController extends Controller
|
|||||||
public function create(Request $request)
|
public function create(Request $request)
|
||||||
{
|
{
|
||||||
if (true !== session('categories.create.fromStore')) {
|
if (true !== session('categories.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('categories.create.uri');
|
$this->rememberPreviousUrl('categories.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('categories.create.fromStore');
|
$request->session()->forget('categories.create.fromStore');
|
||||||
$subTitle = (string) trans('firefly.create_new_category');
|
$subTitle = (string) trans('firefly.create_new_category');
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_category', ['name' => $category->name]);
|
$subTitle = (string) trans('firefly.delete_category', ['name' => $category->name]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('categories.delete.uri');
|
$this->rememberPreviousUrl('categories.delete.url');
|
||||||
|
|
||||||
return view('categories.delete', compact('category', 'subTitle'));
|
return view('categories.delete', compact('category', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -93,6 +93,6 @@ class DeleteController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.deleted_category', ['name' => $name]));
|
$request->session()->flash('success', (string) trans('firefly.deleted_category', ['name' => $name]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('categories.delete.uri'));
|
return redirect($this->getPreviousUrl('categories.delete.url'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('categories.edit.fromUpdate')) {
|
if (true !== session('categories.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('categories.edit.uri');
|
$this->rememberPreviousUrl('categories.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('categories.edit.fromUpdate');
|
$request->session()->forget('categories.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class EditController extends Controller
|
|||||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('categories.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('categories.edit.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ abstract class Controller extends BaseController
|
|||||||
protected string $dateTimeFormat;
|
protected string $dateTimeFormat;
|
||||||
protected string $monthAndDayFormat;
|
protected string $monthAndDayFormat;
|
||||||
protected string $monthFormat;
|
protected string $monthFormat;
|
||||||
protected string $redirectUri = '/';
|
protected string $redirectUrl = '/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controller constructor.
|
* Controller constructor.
|
||||||
@@ -63,10 +63,10 @@ abstract class Controller extends BaseController
|
|||||||
|
|
||||||
// share custom auth guard info.
|
// share custom auth guard info.
|
||||||
$authGuard = config('firefly.authentication_guard');
|
$authGuard = config('firefly.authentication_guard');
|
||||||
$logoutUri = config('firefly.custom_logout_url');
|
$logoutUrl = config('firefly.custom_logout_url');
|
||||||
|
|
||||||
app('view')->share('authGuard', $authGuard);
|
app('view')->share('authGuard', $authGuard);
|
||||||
app('view')->share('logoutUri', $logoutUri);
|
app('view')->share('logoutUrl', $logoutUrl);
|
||||||
|
|
||||||
// upload size
|
// upload size
|
||||||
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('currencies.create.fromStore')) {
|
if (true !== session('currencies.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('currencies.create.uri');
|
$this->rememberPreviousUrl('currencies.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('currencies.create.fromStore');
|
$request->session()->forget('currencies.create.fromStore');
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ class CurrencyController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('currencies.delete.uri');
|
$this->rememberPreviousUrl('currencies.delete.url');
|
||||||
$subTitle = (string) trans('form.delete_currency', ['name' => $currency->name]);
|
$subTitle = (string) trans('form.delete_currency', ['name' => $currency->name]);
|
||||||
Log::channel('audit')->info(sprintf('Visit page to delete currency %s.', $currency->code));
|
Log::channel('audit')->info(sprintf('Visit page to delete currency %s.', $currency->code));
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
$request->session()->flash('success', (string) trans('firefly.deleted_currency', ['name' => $currency->name]));
|
$request->session()->flash('success', (string) trans('firefly.deleted_currency', ['name' => $currency->name]));
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('currencies.delete.uri'));
|
return redirect($this->getPreviousUrl('currencies.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -297,7 +297,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('currencies.edit.fromUpdate')) {
|
if (true !== session('currencies.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('currencies.edit.uri');
|
$this->rememberPreviousUrl('currencies.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('currencies.edit.fromUpdate');
|
$request->session()->forget('currencies.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ class CurrencyController extends Controller
|
|||||||
Log::error('User ' . auth()->user()->id . ' is not admin, but tried to store a currency.');
|
Log::error('User ' . auth()->user()->id . ' is not admin, but tried to store a currency.');
|
||||||
Log::channel('audit')->info('Tried to create (POST) currency without admin rights.', $data);
|
Log::channel('audit')->info('Tried to create (POST) currency without admin rights.', $data);
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('currencies.create.uri'));
|
return redirect($this->getPreviousUrl('currencies.create.url'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ class CurrencyController extends Controller
|
|||||||
$request->session()->flash('error', (string) trans('firefly.could_not_store_currency'));
|
$request->session()->flash('error', (string) trans('firefly.could_not_store_currency'));
|
||||||
$currency = null;
|
$currency = null;
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('currencies.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('currencies.create.url'));
|
||||||
|
|
||||||
if (null !== $currency) {
|
if (null !== $currency) {
|
||||||
$request->session()->flash('success', (string) trans('firefly.created_currency', ['name' => $currency->name]));
|
$request->session()->flash('success', (string) trans('firefly.created_currency', ['name' => $currency->name]));
|
||||||
@@ -443,6 +443,6 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('currencies.edit.uri'));
|
return redirect($this->getPreviousUrl('currencies.edit.url'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ class ReconcileController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$return = [
|
$return = [
|
||||||
'post_uri' => $route,
|
'post_url' => $route,
|
||||||
'html' => $view,
|
'html' => $view,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class NewUserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository)
|
public function submit(NewUserFormRequest $request, CurrencyRepositoryInterface $currencyRepository)
|
||||||
{
|
{
|
||||||
$language = $request->string('language');
|
$language = $request->convertString('language');
|
||||||
if (!array_key_exists($language, config('firefly.languages'))) {
|
if (!array_key_exists($language, config('firefly.languages'))) {
|
||||||
$language = 'en_US';
|
$language = 'en_US';
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class DeleteController extends Controller
|
|||||||
$piggyBanks = $objectGroup->piggyBanks()->count();
|
$piggyBanks = $objectGroup->piggyBanks()->count();
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('object-groups.delete.uri');
|
$this->rememberPreviousUrl('object-groups.delete.url');
|
||||||
|
|
||||||
return view('object-groups.delete', compact('objectGroup', 'subTitle', 'piggyBanks'));
|
return view('object-groups.delete', compact('objectGroup', 'subTitle', 'piggyBanks'));
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ class DeleteController extends Controller
|
|||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$this->repository->destroy($objectGroup);
|
$this->repository->destroy($objectGroup);
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('object-groups.delete.uri'));
|
return redirect($this->getPreviousUrl('object-groups.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class EditController extends Controller
|
|||||||
$subTitleIcon = 'fa-pencil';
|
$subTitleIcon = 'fa-pencil';
|
||||||
|
|
||||||
if (true !== session('object-groups.edit.fromUpdate')) {
|
if (true !== session('object-groups.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('object-groups.edit.uri');
|
$this->rememberPreviousUrl('object-groups.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('object-groups.edit.fromUpdate');
|
session()->forget('object-groups.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class EditController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.updated_object_group', ['title' => $objectGroup->title]));
|
session()->flash('success', (string) trans('firefly.updated_object_group', ['title' => $objectGroup->title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('object-groups.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('object-groups.edit.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('piggy-banks.create.fromStore')) {
|
if (true !== session('piggy-banks.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('piggy-banks.create.uri');
|
$this->rememberPreviousUrl('piggy-banks.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('piggy-banks.create.fromStore');
|
session()->forget('piggy-banks.create.fromStore');
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class CreateController extends Controller
|
|||||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('piggy-banks.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('piggy-banks.create.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_piggy_bank', ['name' => $piggyBank->name]);
|
$subTitle = (string) trans('firefly.delete_piggy_bank', ['name' => $piggyBank->name]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('piggy-banks.delete.uri');
|
$this->rememberPreviousUrl('piggy-banks.delete.url');
|
||||||
|
|
||||||
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -90,6 +90,6 @@ class DeleteController extends Controller
|
|||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$this->piggyRepos->destroy($piggyBank);
|
$this->piggyRepos->destroy($piggyBank);
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('piggy-banks.delete.uri'));
|
return redirect($this->getPreviousUrl('piggy-banks.delete.url'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('piggy-banks.edit.fromUpdate')) {
|
if (true !== session('piggy-banks.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('piggy-banks.edit.uri');
|
$this->rememberPreviousUrl('piggy-banks.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('piggy-banks.edit.fromUpdate');
|
session()->forget('piggy-banks.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ class EditController extends Controller
|
|||||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('piggy-banks.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('piggy-banks.edit.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ class ProfileController extends Controller
|
|||||||
|
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
$newEmail = $request->string('email');
|
$newEmail = $request->convertString('email');
|
||||||
$oldEmail = $user->email;
|
$oldEmail = $user->email;
|
||||||
if ($newEmail === $user->email) {
|
if ($newEmail === $user->email) {
|
||||||
session()->flash('error', (string) trans('firefly.email_not_changed'));
|
session()->flash('error', (string) trans('firefly.email_not_changed'));
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('recurring.create.fromStore')) {
|
if (true !== session('recurring.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('recurring.create.uri');
|
$this->rememberPreviousUrl('recurring.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('recurring.create.fromStore');
|
$request->session()->forget('recurring.create.fromStore');
|
||||||
$repetitionEnds = [
|
$repetitionEnds = [
|
||||||
@@ -139,7 +139,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('recurring.create.fromStore')) {
|
if (true !== session('recurring.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('recurring.create.uri');
|
$this->rememberPreviousUrl('recurring.create.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('recurring.create.fromStore');
|
$request->session()->forget('recurring.create.fromStore');
|
||||||
$repetitionEnds = [
|
$repetitionEnds = [
|
||||||
@@ -253,7 +253,7 @@ class CreateController extends Controller
|
|||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('recurring.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('recurring.create.url'));
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
// set value so create routine will not overwrite URL:
|
// set value so create routine will not overwrite URL:
|
||||||
$request->session()->put('recurring.create.fromStore', true);
|
$request->session()->put('recurring.create.fromStore', true);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class DeleteController extends Controller
|
|||||||
{
|
{
|
||||||
$subTitle = (string) trans('firefly.delete_recurring', ['title' => $recurrence->title]);
|
$subTitle = (string) trans('firefly.delete_recurring', ['title' => $recurrence->title]);
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('recurrences.delete.uri');
|
$this->rememberPreviousUrl('recurrences.delete.url');
|
||||||
|
|
||||||
$journalsCreated = $this->recurring->getTransactions($recurrence)->count();
|
$journalsCreated = $this->recurring->getTransactions($recurrence)->count();
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ class DeleteController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans('firefly.' . 'recurrence_deleted', ['title' => $recurrence->title]));
|
$request->session()->flash('success', (string) trans('firefly.' . 'recurrence_deleted', ['title' => $recurrence->title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('recurrences.delete.uri'));
|
return redirect($this->getPreviousUrl('recurrences.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('recurrences.edit.fromUpdate')) {
|
if (true !== session('recurrences.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('recurrences.edit.uri');
|
$this->rememberPreviousUrl('recurrences.edit.url');
|
||||||
}
|
}
|
||||||
$request->session()->forget('recurrences.edit.fromUpdate');
|
$request->session()->forget('recurrences.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ class EditController extends Controller
|
|||||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$redirect = redirect($this->getPreviousUri('recurrences.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('recurrences.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
// set value so edit routine will not overwrite URL:
|
// set value so edit routine will not overwrite URL:
|
||||||
$request->session()->put('recurrences.edit.fromUpdate', true);
|
$request->session()->put('recurrences.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ class ReportController extends Controller
|
|||||||
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
|
return view('error')->with('message', (string) trans('firefly.end_after_start_date'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = match ($reportType) {
|
$url = match ($reportType) {
|
||||||
default => route('reports.report.default', [$accounts, $start, $end]),
|
default => route('reports.report.default', [$accounts, $start, $end]),
|
||||||
'category' => route('reports.report.category', [$accounts, $categories, $start, $end]),
|
'category' => route('reports.report.category', [$accounts, $categories, $start, $end]),
|
||||||
'audit' => route('reports.report.audit', [$accounts, $start, $end]),
|
'audit' => route('reports.report.audit', [$accounts, $start, $end]),
|
||||||
@@ -386,7 +386,7 @@ class ReportController extends Controller
|
|||||||
'double' => route('reports.report.double', [$accounts, $double, $start, $end]),
|
'double' => route('reports.report.double', [$accounts, $double, $start, $end]),
|
||||||
};
|
};
|
||||||
|
|
||||||
return redirect($uri);
|
return redirect($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('rules.create.fromStore')) {
|
if (true !== session('rules.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('rules.create.uri');
|
$this->rememberPreviousUrl('rules.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('rules.create.fromStore');
|
session()->forget('rules.create.fromStore');
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('rules.create.fromStore')) {
|
if (true !== session('rules.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('rules.create.uri');
|
$this->rememberPreviousUrl('rules.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('rules.create.fromStore');
|
session()->forget('rules.create.fromStore');
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('rules.create.fromStore')) {
|
if (true !== session('rules.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('rules.create.uri');
|
$this->rememberPreviousUrl('rules.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('rules.create.fromStore');
|
session()->forget('rules.create.fromStore');
|
||||||
|
|
||||||
@@ -272,10 +272,10 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// redirect to new bill creation.
|
// redirect to new bill creation.
|
||||||
if ((int) $request->get('bill_id') > 0) {
|
if ((int) $request->get('bill_id') > 0) {
|
||||||
return redirect($this->getPreviousUri('bills.create.uri'));
|
return redirect($this->getPreviousUrl('bills.create.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('rules.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('rules.create.url'));
|
||||||
|
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_rule', ['title' => $rule->title]);
|
$subTitle = (string) trans('firefly.delete_rule', ['title' => $rule->title]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('rules.delete.uri');
|
$this->rememberPreviousUrl('rules.delete.url');
|
||||||
|
|
||||||
return view('rules.rule.delete', compact('rule', 'subTitle'));
|
return view('rules.rule.delete', compact('rule', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ class DeleteController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.deleted_rule', ['title' => $title]));
|
session()->flash('success', (string) trans('firefly.deleted_rule', ['title' => $title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('rules.delete.uri'));
|
return redirect($this->getPreviousUrl('rules.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('rules.edit.fromUpdate')) {
|
if (true !== session('rules.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('rules.edit.uri');
|
$this->rememberPreviousUrl('rules.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('rules.edit.fromUpdate');
|
session()->forget('rules.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
session()->flash('success', (string) trans('firefly.updated_rule', ['title' => $rule->title]));
|
session()->flash('success', (string) trans('firefly.updated_rule', ['title' => $rule->title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$redirect = redirect($this->getPreviousUri('rules.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('rules.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
session()->put('rules.edit.fromUpdate', true);
|
session()->put('rules.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class CreateController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('rule-groups.create.fromStore')) {
|
if (true !== session('rule-groups.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('rule-groups.create.uri');
|
$this->rememberPreviousUrl('rule-groups.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('rule-groups.create.fromStore');
|
session()->forget('rule-groups.create.fromStore');
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class CreateController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]));
|
session()->flash('success', (string) trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
$redirect = redirect($this->getPreviousUri('rule-groups.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('rule-groups.create.url'));
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
|
|
||||||
session()->put('rule-groups.create.fromStore', true);
|
session()->put('rule-groups.create.fromStore', true);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]);
|
$subTitle = (string) trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('rule-groups.delete.uri');
|
$this->rememberPreviousUrl('rule-groups.delete.url');
|
||||||
|
|
||||||
return view('rules.rule-group.delete', compact('ruleGroup', 'subTitle'));
|
return view('rules.rule-group.delete', compact('ruleGroup', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ class DeleteController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.deleted_rule_group', ['title' => $title]));
|
session()->flash('success', (string) trans('firefly.deleted_rule_group', ['title' => $title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('rule-groups.delete.uri'));
|
return redirect($this->getPreviousUrl('rule-groups.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class EditController extends Controller
|
|||||||
];
|
];
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('rule-groups.edit.fromUpdate')) {
|
if (true !== session('rule-groups.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('rule-groups.edit.uri');
|
$this->rememberPreviousUrl('rule-groups.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('rule-groups.edit.fromUpdate');
|
session()->forget('rule-groups.edit.fromUpdate');
|
||||||
session()->flash('preFilled', $preFilled);
|
session()->flash('preFilled', $preFilled);
|
||||||
@@ -131,7 +131,7 @@ class EditController extends Controller
|
|||||||
public function update(RuleGroupFormRequest $request, RuleGroup $ruleGroup)
|
public function update(RuleGroupFormRequest $request, RuleGroup $ruleGroup)
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'title' => $request->string('title'),
|
'title' => $request->convertString('title'),
|
||||||
'description' => $request->stringWithNewlines('description'),
|
'description' => $request->stringWithNewlines('description'),
|
||||||
'active' => 1 === (int) $request->input('active'),
|
'active' => 1 === (int) $request->input('active'),
|
||||||
];
|
];
|
||||||
@@ -140,7 +140,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
session()->flash('success', (string) trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]));
|
session()->flash('success', (string) trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$redirect = redirect($this->getPreviousUri('rule-groups.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('rule-groups.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
session()->put('rule-groups.edit.fromUpdate', true);
|
session()->put('rule-groups.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class TagController extends Controller
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->redirectUri = route('tags.index');
|
$this->redirectUrl = route('tags.index');
|
||||||
|
|
||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
@@ -90,7 +90,7 @@ class TagController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "create another").
|
// put previous url in session if not redirect from store (not "create another").
|
||||||
if (true !== session('tags.create.fromStore')) {
|
if (true !== session('tags.create.fromStore')) {
|
||||||
$this->rememberPreviousUri('tags.create.uri');
|
$this->rememberPreviousUrl('tags.create.url');
|
||||||
}
|
}
|
||||||
session()->forget('tags.create.fromStore');
|
session()->forget('tags.create.fromStore');
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ class TagController extends Controller
|
|||||||
$subTitle = (string) trans('breadcrumbs.delete_tag', ['tag' => $tag->tag]);
|
$subTitle = (string) trans('breadcrumbs.delete_tag', ['tag' => $tag->tag]);
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('tags.delete.uri');
|
$this->rememberPreviousUrl('tags.delete.url');
|
||||||
|
|
||||||
return view('tags.delete', compact('tag', 'subTitle'));
|
return view('tags.delete', compact('tag', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -129,7 +129,7 @@ class TagController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.deleted_tag', ['tag' => $tagName]));
|
session()->flash('success', (string) trans('firefly.deleted_tag', ['tag' => $tagName]));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('tags.delete.uri'));
|
return redirect($this->getPreviousUrl('tags.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +160,7 @@ class TagController extends Controller
|
|||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
if (true !== session('tags.edit.fromUpdate')) {
|
if (true !== session('tags.edit.fromUpdate')) {
|
||||||
$this->rememberPreviousUri('tags.edit.uri');
|
$this->rememberPreviousUrl('tags.edit.url');
|
||||||
}
|
}
|
||||||
session()->forget('tags.edit.fromUpdate');
|
session()->forget('tags.edit.fromUpdate');
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ class TagController extends Controller
|
|||||||
if (count($this->attachmentsHelper->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachmentsHelper->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachmentsHelper->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachmentsHelper->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('tags.create.uri'));
|
$redirect = redirect($this->getPreviousUrl('tags.create.url'));
|
||||||
if (1 === (int) $request->get('create_another')) {
|
if (1 === (int) $request->get('create_another')) {
|
||||||
|
|
||||||
session()->put('tags.create.fromStore', true);
|
session()->put('tags.create.fromStore', true);
|
||||||
@@ -374,7 +374,7 @@ class TagController extends Controller
|
|||||||
if (count($this->attachmentsHelper->getMessages()->get('attachments')) > 0) {
|
if (count($this->attachmentsHelper->getMessages()->get('attachments')) > 0) {
|
||||||
$request->session()->flash('info', $this->attachmentsHelper->getMessages()->get('attachments'));
|
$request->session()->flash('info', $this->attachmentsHelper->getMessages()->get('attachments'));
|
||||||
}
|
}
|
||||||
$redirect = redirect($this->getPreviousUri('tags.edit.uri'));
|
$redirect = redirect($this->getPreviousUrl('tags.edit.url'));
|
||||||
if (1 === (int) $request->get('return_to_edit')) {
|
if (1 === (int) $request->get('return_to_edit')) {
|
||||||
|
|
||||||
session()->put('tags.edit.fromUpdate', true);
|
session()->put('tags.edit.fromUpdate', true);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class BulkController extends Controller
|
|||||||
{
|
{
|
||||||
$subTitle = (string) trans('firefly.mass_bulk_journals');
|
$subTitle = (string) trans('firefly.mass_bulk_journals');
|
||||||
|
|
||||||
$this->rememberPreviousUri('transactions.bulk-edit.uri');
|
$this->rememberPreviousUrl('transactions.bulk-edit.url');
|
||||||
|
|
||||||
// make amounts positive.
|
// make amounts positive.
|
||||||
|
|
||||||
@@ -110,8 +110,8 @@ class BulkController extends Controller
|
|||||||
$journal = $this->repository->find($journalId);
|
$journal = $this->repository->find($journalId);
|
||||||
if (null !== $journal) {
|
if (null !== $journal) {
|
||||||
$resultA = $this->updateJournalBudget($journal, $ignoreBudget, $request->integer('budget_id'));
|
$resultA = $this->updateJournalBudget($journal, $ignoreBudget, $request->integer('budget_id'));
|
||||||
$resultB = $this->updateJournalTags($journal, $tagsAction, explode(',', $request->string('tags')));
|
$resultB = $this->updateJournalTags($journal, $tagsAction, explode(',', $request->convertString('tags')));
|
||||||
$resultC = $this->updateJournalCategory($journal, $ignoreCategory, $request->string('category'));
|
$resultC = $this->updateJournalCategory($journal, $ignoreCategory, $request->convertString('category'));
|
||||||
if ($resultA || $resultB || $resultC) {
|
if ($resultA || $resultB || $resultC) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ class BulkController extends Controller
|
|||||||
$request->session()->flash('success', (string) trans_choice('firefly.mass_edited_transactions_success', $count));
|
$request->session()->flash('success', (string) trans_choice('firefly.mass_edited_transactions_success', $count));
|
||||||
|
|
||||||
// redirect to previous URL:
|
// redirect to previous URL:
|
||||||
return redirect($this->getPreviousUri('transactions.bulk-edit.uri'));
|
return redirect($this->getPreviousUrl('transactions.bulk-edit.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class CreateController extends Controller
|
|||||||
$allowedOpposingTypes = config('firefly.allowed_opposing_types');
|
$allowedOpposingTypes = config('firefly.allowed_opposing_types');
|
||||||
$accountToTypes = config('firefly.account_to_transaction');
|
$accountToTypes = config('firefly.account_to_transaction');
|
||||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||||
$previousUrl = $this->rememberPreviousUri('transactions.create.uri');
|
$previousUrl = $this->rememberPreviousUrl('transactions.create.url');
|
||||||
$parts = parse_url($previousUrl);
|
$parts = parse_url($previousUrl);
|
||||||
$search = sprintf('?%s', $parts['query'] ?? '');
|
$search = sprintf('?%s', $parts['query'] ?? '');
|
||||||
$previousUrl = str_replace($search, '', $previousUrl);
|
$previousUrl = str_replace($search, '', $previousUrl);
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ class DeleteController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.delete_' . $objectType, ['description' => $group->title ?? $journal->description]);
|
$subTitle = (string) trans('firefly.delete_' . $objectType, ['description' => $group->title ?? $journal->description]);
|
||||||
$previous = app('steam')->getSafePreviousUrl(route('index'));
|
$previous = app('steam')->getSafePreviousUrl(route('index'));
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
Log::debug('Will try to remember previous URI');
|
Log::debug('Will try to remember previous URL');
|
||||||
$this->rememberPreviousUri('transactions.delete.uri');
|
$this->rememberPreviousUrl('transactions.delete.url');
|
||||||
|
|
||||||
return view('transactions.delete', compact('group', 'journal', 'subTitle', 'objectType', 'previous'));
|
return view('transactions.delete', compact('group', 'journal', 'subTitle', 'objectType', 'previous'));
|
||||||
}
|
}
|
||||||
@@ -115,6 +115,6 @@ class DeleteController extends Controller
|
|||||||
|
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect($this->getPreviousUri('transactions.delete.uri'));
|
return redirect($this->getPreviousUrl('transactions.delete.url'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||||
$cash = $repository->getCashAccount();
|
$cash = $repository->getCashAccount();
|
||||||
$previousUrl = $this->rememberPreviousUri('transactions.edit.uri');
|
$previousUrl = $this->rememberPreviousUrl('transactions.edit.url');
|
||||||
$parts = parse_url($previousUrl);
|
$parts = parse_url($previousUrl);
|
||||||
$search = sprintf('?%s', $parts['query'] ?? '');
|
$search = sprintf('?%s', $parts['query'] ?? '');
|
||||||
$previousUrl = str_replace($search, '', $previousUrl);
|
$previousUrl = str_replace($search, '', $previousUrl);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class LinkController extends Controller
|
|||||||
{
|
{
|
||||||
$subTitleIcon = 'fa-link';
|
$subTitleIcon = 'fa-link';
|
||||||
$subTitle = (string) trans('breadcrumbs.delete_journal_link');
|
$subTitle = (string) trans('breadcrumbs.delete_journal_link');
|
||||||
$this->rememberPreviousUri('journal_links.delete.uri');
|
$this->rememberPreviousUrl('journal_links.delete.url');
|
||||||
|
|
||||||
return view('transactions.links.delete', compact('link', 'subTitle', 'subTitleIcon'));
|
return view('transactions.links.delete', compact('link', 'subTitle', 'subTitleIcon'));
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ class LinkController extends Controller
|
|||||||
session()->flash('success', (string) trans('firefly.deleted_link'));
|
session()->flash('success', (string) trans('firefly.deleted_link'));
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
|
|
||||||
return redirect((string) session('journal_links.delete.uri'));
|
return redirect((string) session('journal_links.delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class MassController extends Controller
|
|||||||
$subTitle = (string) trans('firefly.mass_delete_journals');
|
$subTitle = (string) trans('firefly.mass_delete_journals');
|
||||||
|
|
||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('transactions.mass-delete.uri');
|
$this->rememberPreviousUrl('transactions.mass-delete.url');
|
||||||
|
|
||||||
return view('transactions.mass.delete', compact('journals', 'subTitle'));
|
return view('transactions.mass.delete', compact('journals', 'subTitle'));
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ class MassController extends Controller
|
|||||||
session()->flash('success', (string) trans_choice('firefly.mass_deleted_transactions_success', $count));
|
session()->flash('success', (string) trans_choice('firefly.mass_deleted_transactions_success', $count));
|
||||||
|
|
||||||
// redirect to previous URL:
|
// redirect to previous URL:
|
||||||
return redirect($this->getPreviousUri('transactions.mass-delete.uri'));
|
return redirect($this->getPreviousUrl('transactions.mass-delete.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -151,7 +151,7 @@ class MassController extends Controller
|
|||||||
null : app('steam')->positive($journal['foreign_amount']);
|
null : app('steam')->positive($journal['foreign_amount']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rememberPreviousUri('transactions.mass-edit.uri');
|
$this->rememberPreviousUrl('transactions.mass-edit.url');
|
||||||
|
|
||||||
return view('transactions.mass.edit', compact('journals', 'subTitle', 'withdrawalSources', 'depositDestinations', 'budgets'));
|
return view('transactions.mass.edit', compact('journals', 'subTitle', 'withdrawalSources', 'depositDestinations', 'budgets'));
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ class MassController extends Controller
|
|||||||
session()->flash('success', (string) trans_choice('firefly.mass_edited_transactions_success', $count));
|
session()->flash('success', (string) trans_choice('firefly.mass_edited_transactions_success', $count));
|
||||||
|
|
||||||
// redirect to previous URL:
|
// redirect to previous URL:
|
||||||
return redirect($this->getPreviousUri('transactions.mass-edit.uri'));
|
return redirect($this->getPreviousUrl('transactions.mass-edit.url'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -60,8 +60,6 @@ class Kernel extends HttpKernel
|
|||||||
/**
|
/**
|
||||||
* The application's global HTTP middleware stack.
|
* The application's global HTTP middleware stack.
|
||||||
*
|
*
|
||||||
* These middleware are run during every request to your application.
|
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $middleware
|
protected $middleware
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class Installer
|
|||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Installer middleware for URI %s', $request->url()));
|
Log::debug(sprintf('Installer middleware for URL %s', $request->url()));
|
||||||
// ignore installer in test environment.
|
// ignore installer in test environment.
|
||||||
if ('testing' === config('app.env')) {
|
if ('testing' === config('app.env')) {
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|||||||
@@ -45,24 +45,24 @@ class AccountFormRequest extends FormRequest
|
|||||||
public function getAccountData(): array
|
public function getAccountData(): array
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'account_type_name' => $this->string('objectType'),
|
'account_type_name' => $this->convertString('objectType'),
|
||||||
'currency_id' => $this->integer('currency_id'),
|
'currency_id' => $this->integer('currency_id'),
|
||||||
'virtual_balance' => $this->string('virtual_balance'),
|
'virtual_balance' => $this->convertString('virtual_balance'),
|
||||||
'iban' => $this->string('iban'),
|
'iban' => $this->convertString('iban'),
|
||||||
'BIC' => $this->string('BIC'),
|
'BIC' => $this->convertString('BIC'),
|
||||||
'account_number' => $this->string('account_number'),
|
'account_number' => $this->convertString('account_number'),
|
||||||
'account_role' => $this->string('account_role'),
|
'account_role' => $this->convertString('account_role'),
|
||||||
'opening_balance' => $this->string('opening_balance'),
|
'opening_balance' => $this->convertString('opening_balance'),
|
||||||
'opening_balance_date' => $this->getCarbonDate('opening_balance_date'),
|
'opening_balance_date' => $this->getCarbonDate('opening_balance_date'),
|
||||||
'cc_type' => $this->string('cc_type'),
|
'cc_type' => $this->convertString('cc_type'),
|
||||||
'cc_monthly_payment_date' => $this->string('cc_monthly_payment_date'),
|
'cc_monthly_payment_date' => $this->convertString('cc_monthly_payment_date'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'interest' => $this->string('interest'),
|
'interest' => $this->convertString('interest'),
|
||||||
'interest_period' => $this->string('interest_period'),
|
'interest_period' => $this->convertString('interest_period'),
|
||||||
'include_net_worth' => '1',
|
'include_net_worth' => '1',
|
||||||
'liability_direction' => $this->string('liability_direction'),
|
'liability_direction' => $this->convertString('liability_direction'),
|
||||||
];
|
];
|
||||||
|
|
||||||
$data = $this->appendLocationData($data, 'location');
|
$data = $this->appendLocationData($data, 'location');
|
||||||
@@ -100,7 +100,7 @@ class AccountFormRequest extends FormRequest
|
|||||||
'name' => 'required|min:1|uniqueAccountForUser',
|
'name' => 'required|min:1|uniqueAccountForUser',
|
||||||
'opening_balance' => 'numeric|nullable|max:1000000000',
|
'opening_balance' => 'numeric|nullable|max:1000000000',
|
||||||
'opening_balance_date' => 'date|required_with:opening_balance|nullable',
|
'opening_balance_date' => 'date|required_with:opening_balance|nullable',
|
||||||
'iban' => ['iban', 'nullable', new UniqueIban(null, $this->string('objectType'))],
|
'iban' => ['iban', 'nullable', new UniqueIban(null, $this->convertString('objectType'))],
|
||||||
'BIC' => 'bic|nullable',
|
'BIC' => 'bic|nullable',
|
||||||
'virtual_balance' => 'numeric|nullable|max:1000000000',
|
'virtual_balance' => 'numeric|nullable|max:1000000000',
|
||||||
'currency_id' => 'exists:transaction_currencies,id',
|
'currency_id' => 'exists:transaction_currencies,id',
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ class AttachmentFormRequest extends FormRequest
|
|||||||
public function getAttachmentData(): array
|
public function getAttachmentData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'notes' => $this->string('notes'),
|
'notes' => $this->convertString('notes'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,19 +41,19 @@ class BillStoreRequest extends FormRequest
|
|||||||
public function getBillData(): array
|
public function getBillData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'amount_min' => $this->string('amount_min'),
|
'amount_min' => $this->convertString('amount_min'),
|
||||||
'currency_id' => $this->integer('transaction_currency_id'),
|
'currency_id' => $this->integer('transaction_currency_id'),
|
||||||
'currency_code' => '',
|
'currency_code' => '',
|
||||||
'amount_max' => $this->string('amount_max'),
|
'amount_max' => $this->convertString('amount_max'),
|
||||||
'date' => $this->getCarbonDate('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'end_date' => $this->getCarbonDate('bill_end_date'),
|
'end_date' => $this->getCarbonDate('bill_end_date'),
|
||||||
'extension_date' => $this->getCarbonDate('extension_date'),
|
'extension_date' => $this->getCarbonDate('extension_date'),
|
||||||
'repeat_freq' => $this->string('repeat_freq'),
|
'repeat_freq' => $this->convertString('repeat_freq'),
|
||||||
'skip' => $this->integer('skip'),
|
'skip' => $this->integer('skip'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'object_group_title' => $this->string('object_group'),
|
'object_group_title' => $this->convertString('object_group'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,19 +42,19 @@ class BillUpdateRequest extends FormRequest
|
|||||||
public function getBillData(): array
|
public function getBillData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'amount_min' => $this->string('amount_min'),
|
'amount_min' => $this->convertString('amount_min'),
|
||||||
'currency_id' => $this->integer('transaction_currency_id'),
|
'currency_id' => $this->integer('transaction_currency_id'),
|
||||||
'currency_code' => '',
|
'currency_code' => '',
|
||||||
'amount_max' => $this->string('amount_max'),
|
'amount_max' => $this->convertString('amount_max'),
|
||||||
'date' => $this->getCarbonDate('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'end_date' => $this->getCarbonDate('bill_end_date'),
|
'end_date' => $this->getCarbonDate('bill_end_date'),
|
||||||
'extension_date' => $this->getCarbonDate('extension_date'),
|
'extension_date' => $this->getCarbonDate('extension_date'),
|
||||||
'repeat_freq' => $this->string('repeat_freq'),
|
'repeat_freq' => $this->convertString('repeat_freq'),
|
||||||
'skip' => $this->integer('skip'),
|
'skip' => $this->integer('skip'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'object_group_title' => $this->string('object_group'),
|
'object_group_title' => $this->convertString('object_group'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,12 @@ class BudgetFormStoreRequest extends FormRequest
|
|||||||
public function getBudgetData(): array
|
public function getBudgetData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||||
'currency_id' => $this->integer('auto_budget_currency_id'),
|
'currency_id' => $this->integer('auto_budget_currency_id'),
|
||||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
'auto_budget_amount' => $this->convertString('auto_budget_amount'),
|
||||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
'auto_budget_period' => $this->convertString('auto_budget_period'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,12 @@ class BudgetFormUpdateRequest extends FormRequest
|
|||||||
public function getBudgetData(): array
|
public function getBudgetData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'auto_budget_type' => $this->integer('auto_budget_type'),
|
'auto_budget_type' => $this->integer('auto_budget_type'),
|
||||||
'currency_id' => $this->integer('auto_budget_currency_id'),
|
'currency_id' => $this->integer('auto_budget_currency_id'),
|
||||||
'auto_budget_amount' => $this->string('auto_budget_amount'),
|
'auto_budget_amount' => $this->convertString('auto_budget_amount'),
|
||||||
'auto_budget_period' => $this->string('auto_budget_period'),
|
'auto_budget_period' => $this->convertString('auto_budget_period'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class CategoryFormRequest extends FormRequest
|
|||||||
public function getCategoryData(): array
|
public function getCategoryData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ class CurrencyFormRequest extends FormRequest
|
|||||||
public function getCurrencyData(): array
|
public function getCurrencyData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'code' => $this->string('code'),
|
'code' => $this->convertString('code'),
|
||||||
'symbol' => $this->string('symbol'),
|
'symbol' => $this->convertString('symbol'),
|
||||||
'decimal_places' => $this->integer('decimal_places'),
|
'decimal_places' => $this->integer('decimal_places'),
|
||||||
'enabled' => $this->boolean('enabled'),
|
'enabled' => $this->boolean('enabled'),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class JournalLinkRequest extends FormRequest
|
|||||||
$parts = explode('_', $linkType);
|
$parts = explode('_', $linkType);
|
||||||
$return['link_type_id'] = (int) $parts[0];
|
$return['link_type_id'] = (int) $parts[0];
|
||||||
$return['transaction_journal_id'] = $this->integer('opposing');
|
$return['transaction_journal_id'] = $this->integer('opposing');
|
||||||
$return['notes'] = $this->string('notes');
|
$return['notes'] = $this->convertString('notes');
|
||||||
$return['direction'] = $parts[1];
|
$return['direction'] = $parts[1];
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class ObjectGroupFormRequest extends FormRequest
|
|||||||
public function getObjectGroupData(): array
|
public function getObjectGroupData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ class PiggyBankStoreRequest extends FormRequest
|
|||||||
public function getPiggyBankData(): array
|
public function getPiggyBankData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'startdate' => $this->getCarbonDate('startdate'),
|
'startdate' => $this->getCarbonDate('startdate'),
|
||||||
'account_id' => $this->integer('account_id'),
|
'account_id' => $this->integer('account_id'),
|
||||||
'targetamount' => $this->string('targetamount'),
|
'targetamount' => $this->convertString('targetamount'),
|
||||||
'targetdate' => $this->getCarbonDate('targetdate'),
|
'targetdate' => $this->getCarbonDate('targetdate'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'object_group_title' => $this->string('object_group'),
|
'object_group_title' => $this->convertString('object_group'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ class PiggyBankUpdateRequest extends FormRequest
|
|||||||
public function getPiggyBankData(): array
|
public function getPiggyBankData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->string('name'),
|
'name' => $this->convertString('name'),
|
||||||
'startdate' => $this->getCarbonDate('startdate'),
|
'startdate' => $this->getCarbonDate('startdate'),
|
||||||
'account_id' => $this->integer('account_id'),
|
'account_id' => $this->integer('account_id'),
|
||||||
'targetamount' => $this->string('targetamount'),
|
'targetamount' => $this->convertString('targetamount'),
|
||||||
'targetdate' => $this->getCarbonDate('targetdate'),
|
'targetdate' => $this->getCarbonDate('targetdate'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'object_group_title' => $this->string('object_group'),
|
'object_group_title' => $this->convertString('object_group'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ class ReconciliationStoreRequest extends FormRequest
|
|||||||
$data = [
|
$data = [
|
||||||
'start' => $this->getCarbonDate('start'),
|
'start' => $this->getCarbonDate('start'),
|
||||||
'end' => $this->getCarbonDate('end'),
|
'end' => $this->getCarbonDate('end'),
|
||||||
'start_balance' => $this->string('startBalance'),
|
'start_balance' => $this->convertString('startBalance'),
|
||||||
'end_balance' => $this->string('endBalance'),
|
'end_balance' => $this->convertString('endBalance'),
|
||||||
'difference' => $this->string('difference'),
|
'difference' => $this->convertString('difference'),
|
||||||
'journals' => $transactions,
|
'journals' => $transactions,
|
||||||
'reconcile' => $this->string('reconcile'),
|
'reconcile' => $this->convertString('reconcile'),
|
||||||
];
|
];
|
||||||
Log::debug('In ReconciliationStoreRequest::getAll(). Will now return data.');
|
Log::debug('In ReconciliationStoreRequest::getAll(). Will now return data.');
|
||||||
|
|
||||||
|
|||||||
@@ -56,23 +56,23 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
$repetitionData = $this->parseRepetitionData();
|
$repetitionData = $this->parseRepetitionData();
|
||||||
$return = [
|
$return = [
|
||||||
'recurrence' => [
|
'recurrence' => [
|
||||||
'type' => $this->string('transaction_type'),
|
'type' => $this->convertString('transaction_type'),
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'description' => $this->string('recurring_description'),
|
'description' => $this->convertString('recurring_description'),
|
||||||
'first_date' => $this->getCarbonDate('first_date'),
|
'first_date' => $this->getCarbonDate('first_date'),
|
||||||
'repeat_until' => $this->getCarbonDate('repeat_until'),
|
'repeat_until' => $this->getCarbonDate('repeat_until'),
|
||||||
'nr_of_repetitions' => $this->integer('repetitions'),
|
'nr_of_repetitions' => $this->integer('repetitions'),
|
||||||
'apply_rules' => $this->boolean('apply_rules'),
|
'apply_rules' => $this->boolean('apply_rules'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'repetition_end' => $this->string('repetition_end'),
|
'repetition_end' => $this->convertString('repetition_end'),
|
||||||
],
|
],
|
||||||
'transactions' => [
|
'transactions' => [
|
||||||
[
|
[
|
||||||
'currency_id' => $this->integer('transaction_currency_id'),
|
'currency_id' => $this->integer('transaction_currency_id'),
|
||||||
'currency_code' => null,
|
'currency_code' => null,
|
||||||
'type' => $this->string('transaction_type'),
|
'type' => $this->convertString('transaction_type'),
|
||||||
'description' => $this->string('transaction_description'),
|
'description' => $this->convertString('transaction_description'),
|
||||||
'amount' => $this->string('amount'),
|
'amount' => $this->convertString('amount'),
|
||||||
'foreign_amount' => null,
|
'foreign_amount' => null,
|
||||||
'foreign_currency_id' => null,
|
'foreign_currency_id' => null,
|
||||||
'foreign_currency_code' => null,
|
'foreign_currency_code' => null,
|
||||||
@@ -81,8 +81,8 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
'bill_id' => $this->integer('bill_id'),
|
'bill_id' => $this->integer('bill_id'),
|
||||||
'bill_name' => null,
|
'bill_name' => null,
|
||||||
'category_id' => null,
|
'category_id' => null,
|
||||||
'category_name' => $this->string('category'),
|
'category_name' => $this->convertString('category'),
|
||||||
'tags' => '' !== $this->string('tags') ? explode(',', $this->string('tags')) : [],
|
'tags' => '' !== $this->convertString('tags') ? explode(',', $this->convertString('tags')) : [],
|
||||||
'piggy_bank_id' => $this->integer('piggy_bank_id'),
|
'piggy_bank_id' => $this->integer('piggy_bank_id'),
|
||||||
'piggy_bank_name' => null,
|
'piggy_bank_name' => null,
|
||||||
],
|
],
|
||||||
@@ -100,7 +100,7 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
|
|
||||||
// fill in foreign currency data
|
// fill in foreign currency data
|
||||||
if (null !== $this->float('foreign_amount')) {
|
if (null !== $this->float('foreign_amount')) {
|
||||||
$return['transactions'][0]['foreign_amount'] = $this->string('foreign_amount');
|
$return['transactions'][0]['foreign_amount'] = $this->convertString('foreign_amount');
|
||||||
$return['transactions'][0]['foreign_currency_id'] = $this->integer('foreign_currency_id');
|
$return['transactions'][0]['foreign_currency_id'] = $this->integer('foreign_currency_id');
|
||||||
}
|
}
|
||||||
// default values:
|
// default values:
|
||||||
@@ -109,9 +109,9 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
$return['transactions'][0]['destination_id'] = null;
|
$return['transactions'][0]['destination_id'] = null;
|
||||||
$return['transactions'][0]['destination_name'] = null;
|
$return['transactions'][0]['destination_name'] = null;
|
||||||
// fill in source and destination account data
|
// fill in source and destination account data
|
||||||
switch ($this->string('transaction_type')) {
|
switch ($this->convertString('transaction_type')) {
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type')));
|
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->convertString('transaction_type')));
|
||||||
case 'withdrawal':
|
case 'withdrawal':
|
||||||
$return['transactions'][0]['source_id'] = $this->integer('source_id');
|
$return['transactions'][0]['source_id'] = $this->integer('source_id');
|
||||||
$return['transactions'][0]['destination_id'] = $this->integer('withdrawal_destination_id');
|
$return['transactions'][0]['destination_id'] = $this->integer('withdrawal_destination_id');
|
||||||
@@ -149,7 +149,7 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
private function parseRepetitionData(): array
|
private function parseRepetitionData(): array
|
||||||
{
|
{
|
||||||
$value = $this->string('repetition_type');
|
$value = $this->convertString('repetition_type');
|
||||||
$return = [
|
$return = [
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'moment' => '',
|
'moment' => '',
|
||||||
@@ -224,7 +224,7 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if ends after X repetitions, set another rule
|
// if ends after X repetitions, set another rule
|
||||||
if ('times' === $this->string('repetition_end')) {
|
if ('times' === $this->convertString('repetition_end')) {
|
||||||
$rules['repetitions'] = 'required|numeric|between:0,254';
|
$rules['repetitions'] = 'required|numeric|between:0,254';
|
||||||
}
|
}
|
||||||
// if foreign amount, currency must be different.
|
// if foreign amount, currency must be different.
|
||||||
@@ -233,12 +233,12 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if ends at date X, set another rule.
|
// if ends at date X, set another rule.
|
||||||
if ('until_date' === $this->string('repetition_end')) {
|
if ('until_date' === $this->convertString('repetition_end')) {
|
||||||
$rules['repeat_until'] = 'required|date|after:' . $tomorrow->format('Y-m-d');
|
$rules['repeat_until'] = 'required|date|after:' . $tomorrow->format('Y-m-d');
|
||||||
}
|
}
|
||||||
|
|
||||||
// switchc on type to expand rules for source and destination accounts:
|
// switchc on type to expand rules for source and destination accounts:
|
||||||
switch ($this->string('transaction_type')) {
|
switch ($this->convertString('transaction_type')) {
|
||||||
case strtolower(TransactionType::WITHDRAWAL):
|
case strtolower(TransactionType::WITHDRAWAL):
|
||||||
$rules['source_id'] = 'required|exists:accounts,id|belongsToUser:accounts';
|
$rules['source_id'] = 'required|exists:accounts,id|belongsToUser:accounts';
|
||||||
$rules['destination_name'] = 'between:1,255|nullable';
|
$rules['destination_name'] = 'between:1,255|nullable';
|
||||||
@@ -254,7 +254,7 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('Cannot handle transaction type of type "%s"', $this->string('transaction_type')));
|
throw new FireflyException(sprintf('Cannot handle transaction type of type "%s"', $this->convertString('transaction_type')));
|
||||||
}
|
}
|
||||||
|
|
||||||
// update some rules in case the user is editing a post:
|
// update some rules in case the user is editing a post:
|
||||||
@@ -309,9 +309,9 @@ class RecurrenceFormRequest extends FormRequest
|
|||||||
|
|
||||||
// See reference nr. 45
|
// See reference nr. 45
|
||||||
|
|
||||||
switch ($this->string('transaction_type')) {
|
switch ($this->convertString('transaction_type')) {
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->string('transaction_type')));
|
throw new FireflyException(sprintf('Cannot handle transaction type "%s"', $this->convertString('transaction_type')));
|
||||||
case 'withdrawal':
|
case 'withdrawal':
|
||||||
$sourceId = (int) $data['source_id'];
|
$sourceId = (int) $data['source_id'];
|
||||||
$destinationId = (int) $data['withdrawal_destination_id'];
|
$destinationId = (int) $data['withdrawal_destination_id'];
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ class RuleFormRequest extends FormRequest
|
|||||||
public function getRuleData(): array
|
public function getRuleData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'rule_group_id' => $this->integer('rule_group_id'),
|
'rule_group_id' => $this->integer('rule_group_id'),
|
||||||
'active' => $this->boolean('active'),
|
'active' => $this->boolean('active'),
|
||||||
'trigger' => $this->string('trigger'),
|
'trigger' => $this->convertString('trigger'),
|
||||||
'description' => $this->stringWithNewlines('description'),
|
'description' => $this->stringWithNewlines('description'),
|
||||||
'stop_processing' => $this->boolean('stop_processing'),
|
'stop_processing' => $this->boolean('stop_processing'),
|
||||||
'strict' => $this->boolean('strict'),
|
'strict' => $this->boolean('strict'),
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class RuleGroupFormRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => $this->string('title'),
|
'title' => $this->convertString('title'),
|
||||||
'description' => $this->stringWithNewlines('description'),
|
'description' => $this->stringWithNewlines('description'),
|
||||||
'active' => $active,
|
'active' => $active,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ class TagFormRequest extends FormRequest
|
|||||||
public function collectTagData(): array
|
public function collectTagData(): array
|
||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'tag' => $this->string('tag'),
|
'tag' => $this->convertString('tag'),
|
||||||
'date' => $this->getCarbonDate('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'description' => $this->string('description'),
|
'description' => $this->convertString('description'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->appendLocationData($data, 'location');
|
return $this->appendLocationData($data, 'location');
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ class UserFormRequest extends FormRequest
|
|||||||
public function getUserData(): array
|
public function getUserData(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email' => $this->string('email'),
|
'email' => $this->convertString('email'),
|
||||||
'blocked' => 1 === $this->integer('blocked'),
|
'blocked' => 1 === $this->integer('blocked'),
|
||||||
'blocked_code' => $this->string('blocked_code'),
|
'blocked_code' => $this->convertString('blocked_code'),
|
||||||
'password' => $this->string('password'),
|
'password' => $this->convertString('password'),
|
||||||
'is_owner' => 1 === $this->integer('is_owner'),
|
'is_owner' => 1 === $this->integer('is_owner'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
if ('heroku' === config('app.env')) {
|
if ('heroku' === config('app.env')) {
|
||||||
URL::forceScheme('https');
|
URL::forceScheme('https');
|
||||||
}
|
}
|
||||||
Sanctum::ignoreMigrations();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,5 +55,6 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
Passport::ignoreMigrations();
|
Passport::ignoreMigrations();
|
||||||
|
Sanctum::ignoreMigrations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,6 +261,12 @@ trait ModifiesPiggyBanks
|
|||||||
$piggyData = $data;
|
$piggyData = $data;
|
||||||
// unset fields just in case.
|
// unset fields just in case.
|
||||||
unset($piggyData['object_group_title'], $piggyData['object_group_id'], $piggyData['notes'], $piggyData['current_amount']);
|
unset($piggyData['object_group_title'], $piggyData['object_group_id'], $piggyData['notes'], $piggyData['current_amount']);
|
||||||
|
|
||||||
|
// validate amount:
|
||||||
|
if (array_key_exists('targetamount', $piggyData) && '' === (string) $piggyData['targetamount']) {
|
||||||
|
$piggyData['targetamount'] = '0';
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/** @var PiggyBank $piggyBank */
|
/** @var PiggyBank $piggyBank */
|
||||||
$piggyBank = PiggyBank::create($piggyData);
|
$piggyBank = PiggyBank::create($piggyData);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user