Compare commits

...

149 Commits

Author SHA1 Message Date
github-actions
abd34ba1dc Auto commit for release 'v6.1.8' on 2024-02-03 2024-02-03 16:38:48 +01:00
James Cole
89b7596caf Add fixed issue to changelog. 2024-02-03 16:31:58 +01:00
James Cole
3543548ba0 Fix https://github.com/firefly-iii/firefly-iii/issues/8497 2024-02-03 13:09:44 +01:00
James Cole
a932965908 Merge branch 'main' into develop 2024-02-03 10:09:41 +01:00
James Cole
9056126328 Update release script. 2024-02-03 10:09:30 +01:00
James Cole
0e85a5123d Changelog for next release. 2024-02-03 10:08:46 +01:00
James Cole
d3f19db42d This should fix the tests again. 2024-02-03 10:08:34 +01:00
James Cole
9894d16d26 Fix https://github.com/firefly-iii/firefly-iii/issues/8493 2024-02-03 07:51:18 +01:00
James Cole
0b069bcb58 Merge branch 'main' into develop 2024-02-01 05:44:52 +01:00
James Cole
36d54c3fac Cast to string. 2024-02-01 05:44:41 +01:00
James Cole
530e48f16e Fix description. 2024-02-01 05:43:48 +01:00
github-actions
9763f9f922 Auto commit for release 'develop' on 2024-02-01 2024-02-01 01:31:55 +01:00
James Cole
bbd4d7a8ef Rebuild JS as well. 2024-01-31 07:35:43 +01:00
James Cole
bafe2ece8c Should fix message title. 2024-01-31 07:25:51 +01:00
James Cole
b2449eb726 Merge branch 'main' into develop 2024-01-31 06:38:48 +01:00
James Cole
353c345d9a Updated release script. 2024-01-31 06:38:36 +01:00
James Cole
e2461ba839 Also support redirect 2024-01-30 18:14:56 +01:00
James Cole
e199fdd2b6 Make sure the demo user can't export data. 2024-01-30 18:11:45 +01:00
James Cole
592a89d6a5 Merge pull request #8478 from firefly-iii/dependabot/github_actions/actions/github-script-7
Bump actions/github-script from 6 to 7
2024-01-30 08:31:34 +01:00
James Cole
7a7b629225 Merge pull request #8477 from firefly-iii/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2024-01-30 08:31:25 +01:00
James Cole
21a4774561 Merge pull request #8476 from firefly-iii/dependabot/github_actions/actions/dependency-review-action-4
Bump actions/dependency-review-action from 3 to 4
2024-01-30 08:31:17 +01:00
James Cole
5be97bb18f Merge pull request #8475 from firefly-iii/dependabot/github_actions/JC5/firefly-iii-dev-29
Bump JC5/firefly-iii-dev from 16 to 29
2024-01-30 08:31:07 +01:00
dependabot[bot]
a12ff10550 Bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 07:28:29 +00:00
dependabot[bot]
c808294ca1 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 07:28:25 +00:00
dependabot[bot]
9dcf264658 Bump actions/dependency-review-action from 3 to 4
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3 to 4.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 07:28:21 +00:00
dependabot[bot]
e0bbd3a810 Bump JC5/firefly-iii-dev from 16 to 29
Bumps [JC5/firefly-iii-dev](https://github.com/jc5/firefly-iii-dev) from 16 to 29.
- [Commits](https://github.com/jc5/firefly-iii-dev/compare/v16...v29)

---
updated-dependencies:
- dependency-name: JC5/firefly-iii-dev
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 07:28:16 +00:00
James Cole
2886a22f4e Update dependabot.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-30 08:27:47 +01:00
James Cole
6f783f7662 Update stale.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-30 08:24:08 +01:00
James Cole
992fdc9e27 Merge branch 'main' into develop 2024-01-30 05:41:55 +01:00
James Cole
73529c31e0 Only monday / thursday 2024-01-30 05:41:44 +01:00
github-actions
d9fc91a432 Auto commit for release 'develop' on 2024-01-30 2024-01-30 01:29:11 +01:00
James Cole
6a432e7931 Fix https://github.com/firefly-iii/firefly-iii/issues/8447 2024-01-29 19:47:00 +01:00
James Cole
26f7575ba2 Fix https://github.com/firefly-iii/firefly-iii/issues/8471 2024-01-29 19:10:24 +01:00
James Cole
b1c1bbd6c0 Fix https://github.com/firefly-iii/firefly-iii/issues/8472 2024-01-29 19:05:40 +01:00
James Cole
d40643af54 Merge branch 'main' into develop 2024-01-29 06:24:46 +01:00
James Cole
11cfefd908 Update workflow and support guide. 2024-01-29 06:24:24 +01:00
github-actions
ff2b2eec9b Auto commit for release 'develop' on 2024-01-29 2024-01-29 02:35:54 +00:00
James Cole
4f1187bf6e Fix https://github.com/firefly-iii/firefly-iii/issues/8467 2024-01-28 17:29:25 +01:00
James Cole
642539e410 Fix https://github.com/firefly-iii/firefly-iii/issues/8457 2024-01-28 16:34:17 +01:00
github-actions
1f774e0d71 Auto commit for release 'develop' on 2024-01-28 2024-01-28 13:48:09 +00:00
James Cole
1da19cde6f Merge branch 'main' into develop 2024-01-28 14:42:40 +01:00
James Cole
ac5973833e Fix phpcs before it fails anyway 2024-01-28 14:42:23 +01:00
James Cole
40b0e31d27 Merge branch 'main' into develop 2024-01-28 14:37:24 +01:00
James Cole
f56f8d72df Make sure crowdin config is correct. 2024-01-28 14:37:12 +01:00
James Cole
b47bb13558 Change some code. 2024-01-28 14:34:07 +01:00
James Cole
b4133b6512 Merge branch 'main' into develop 2024-01-28 14:33:21 +01:00
James Cole
fb20095502 Slight change in workflow. 2024-01-28 14:33:07 +01:00
James Cole
cfc23c4cb9 Merge branch 'main' into develop 2024-01-28 14:28:33 +01:00
James Cole
44701f1633 Clean up workflow. 2024-01-28 14:25:38 +01:00
James Cole
fadf799b9c Add new workflow. 2024-01-28 12:41:23 +01:00
James Cole
c22a9784ee Clean up code 2024-01-25 03:18:23 +01:00
James Cole
a6512d3d74 Add manifest to session pages. https://github.com/firefly-iii/firefly-iii/issues/8455 2024-01-25 03:18:13 +01:00
James Cole
cea2ca7532 Rebuild old and new JS. 2024-01-24 07:03:08 +01:00
James Cole
e322069bb4 Possible fix for https://github.com/firefly-iii/firefly-iii/issues/8442 2024-01-24 07:00:06 +01:00
James Cole
da7a976c4e Fix https://github.com/firefly-iii/firefly-iii/issues/8446 2024-01-23 20:21:41 +01:00
James Cole
300dba7257 Rebuild frontend for dynamic title update 2024-01-23 19:36:45 +01:00
James Cole
ec59f80fe3 Fix label actions. 2024-01-22 06:17:26 +01:00
James Cole
37aa5bcc60 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2024-01-22 06:13:26 +01:00
James Cole
e50d2cb481 Add experimental menu. 2024-01-22 06:13:19 +01:00
James Cole
468709c092 Merge pull request #8438 from firefly-iii/dependabot/composer/develop/doctrine/dbal-3.7.3
Bump doctrine/dbal from 3.7.2 to 3.7.3
2024-01-22 06:12:18 +01:00
James Cole
11ced9216c Merge pull request #8439 from firefly-iii/dependabot/npm_and_yarn/develop/i18next-23.7.18
Bump i18next from 23.7.17 to 23.7.18
2024-01-22 06:12:08 +01:00
dependabot[bot]
cfa9151f45 Bump i18next from 23.7.17 to 23.7.18
Bumps [i18next](https://github.com/i18next/i18next) from 23.7.17 to 23.7.18.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.7.17...v23.7.18)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 03:59:00 +00:00
dependabot[bot]
6577224a55 Bump doctrine/dbal from 3.7.2 to 3.7.3
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/3.7.2...3.7.3)

---
updated-dependencies:
- dependency-name: doctrine/dbal
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 03:18:11 +00:00
James Cole
b4209f2e72 Enable inline edit. 2024-01-21 19:36:56 +01:00
James Cole
f045e4ea69 Fix amount 2024-01-21 18:01:00 +01:00
James Cole
4a37152aea Fix https://github.com/firefly-iii/firefly-iii/issues/8433 2024-01-21 15:58:40 +01:00
James Cole
2907db1380 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2024-01-21 15:00:59 +01:00
James Cole
80a35692c5 Fix logs. 2024-01-21 15:00:51 +01:00
James Cole
1a6fe5ca3c Apparently people need to be warned. 2024-01-21 15:00:43 +01:00
James Cole
13ec3493bd Merge pull request #8432 from stevietv/patch-1
Update favicons.twig
2024-01-21 14:56:15 +01:00
Stevie Robinson
bf55e8df72 Update favicons.twig
Signed-off-by: Stevie Robinson <stevie.robinson@gmail.com>
2024-01-21 11:18:34 +01:00
James Cole
775504d812 Merge branch 'main' into develop 2024-01-21 07:35:14 +01:00
James Cole
8d6c45b68e No longer lock issues. 2024-01-21 07:35:02 +01:00
James Cole
db9094956e Support even bigger amounts for https://github.com/firefly-iii/firefly-iii/issues/8431 2024-01-21 07:24:16 +01:00
James Cole
25d02e92f4 Change issue to PR. 2024-01-20 18:30:46 +01:00
James Cole
81cb0a38f3 Add debug trigger label. 2024-01-20 16:44:10 +01:00
James Cole
e07a9d6162 Remove huntr thing. 2024-01-20 16:37:28 +01:00
James Cole
2ccbc16dfa Merge tag 'v6.1.7' into develop
v6.1.7
2024-01-20 16:30:23 +01:00
James Cole
e00addc0b0 Merge branch 'release/v6.1.7' 2024-01-20 16:30:16 +01:00
James Cole
da7a2cf0c0 Update meta data for new release. 2024-01-20 16:29:00 +01:00
James Cole
2368788405 Fix issue with "createFromFormat". 2024-01-20 08:07:27 +01:00
James Cole
f603415931 Rebuild edit script. 2024-01-20 07:09:26 +01:00
James Cole
523fa42998 Merge branch 'main' into develop 2024-01-20 07:05:27 +01:00
James Cole
e449395f3f Clean up some code. 2024-01-20 07:04:19 +01:00
James Cole
d8d8002f1e Add some debug to non strict search 2024-01-20 06:53:43 +01:00
James Cole
2570ca9573 Fix account type filter 2024-01-20 06:53:30 +01:00
James Cole
e5fdc2cbfd Merge pull request #8429 from firefly-iii/dependabot/npm_and_yarn/vite-4.5.2
Bump vite from 4.5.1 to 4.5.2
2024-01-20 06:53:12 +01:00
dependabot[bot]
0349cdbc1b Bump vite from 4.5.1 to 4.5.2
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-20 05:39:48 +00:00
James Cole
122f0309a6 Fix #8425 2024-01-19 20:23:04 +01:00
James Cole
09bff5ea4e Fix https://github.com/firefly-iii/firefly-iii/issues/8418 2024-01-18 18:57:29 +01:00
James Cole
7ea112c5e7 Fix https://github.com/firefly-iii/firefly-iii/issues/8349 and 2024-01-18 18:57:23 +01:00
James Cole
44df07a5f5 Update, rebuild, and add a new API endpoint. 2024-01-17 20:23:02 +01:00
James Cole
66b0d9d309 Merge pull request #8394 from firefly-iii/dependabot/npm_and_yarn/develop/date-fns-3.2.0 2024-01-15 05:24:53 +01:00
dependabot[bot]
6ac3d3e62c Bump date-fns from 3.1.0 to 3.2.0
Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/date-fns/date-fns/releases)
- [Changelog](https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md)
- [Commits](https://github.com/date-fns/date-fns/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: date-fns
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 03:22:07 +00:00
James Cole
925450f84c Fix https://github.com/firefly-iii/firefly-iii/issues/8390 2024-01-14 13:59:09 +01:00
James Cole
62f59c6a19 Update packages 2024-01-14 13:58:16 +01:00
James Cole
7db21612a0 Escape backticks [skip ci] 2024-01-14 11:20:43 +01:00
James Cole
2c0da2cf26 Duh, single quotes [skip ci] 2024-01-14 11:19:47 +01:00
James Cole
79484cc194 Experimental action [skip ci] 2024-01-14 11:18:17 +01:00
James Cole
6f18748c72 Merge branch 'main' into develop 2024-01-14 07:16:21 +01:00
James Cole
577824930f Attempt at newline. 2024-01-14 07:15:08 +01:00
James Cole
d614519ee7 Add necessary params. 2024-01-14 07:12:47 +01:00
James Cole
ae31041f7f Add context 2024-01-14 07:11:39 +01:00
James Cole
62c4d0cf86 new command 2024-01-14 07:07:14 +01:00
James Cole
c2ddabbad2 Expand index. 2024-01-14 07:06:55 +01:00
James Cole
458402aaff Code cleanup. 2024-01-14 05:10:05 +01:00
James Cole
5c81e98218 Add list of transactions. 2024-01-13 20:34:09 +01:00
James Cole
37a46b02f4 Fix https://github.com/firefly-iii/firefly-iii/issues/8374 2024-01-13 08:13:25 +01:00
James Cole
b3e1ecdd02 Merge branch 'main' into develop 2024-01-13 08:13:10 +01:00
James Cole
1780e6dc61 Remove label step, no longer necessary. 2024-01-13 07:55:04 +01:00
James Cole
50f346d092 Add body to secret 2024-01-13 07:54:12 +01:00
James Cole
ccc851090a Manually add comment, lock and redirect user. 2024-01-13 07:50:43 +01:00
James Cole
4605d84cc8 Add more permissions 2024-01-13 07:41:15 +01:00
James Cole
8c7ab50325 Add the action manually. 2024-01-13 07:40:01 +01:00
James Cole
908539836b Use correct string name. 2024-01-13 07:38:21 +01:00
James Cole
9f71cf966c Remove the old step. 2024-01-13 07:36:55 +01:00
James Cole
02ed47c578 Update job. Do it manually. 2024-01-13 07:36:09 +01:00
James Cole
1ddbaf0884 Merge branch 'main' into develop 2024-01-13 07:24:23 +01:00
James Cole
d3ed8c6f0f New action for issues. 2024-01-13 07:24:11 +01:00
James Cole
4f1ac2ac6f Minor code cleanup 2024-01-12 19:03:51 +01:00
James Cole
1e733f4c8b Fix https://github.com/firefly-iii/firefly-iii/issues/8377 2024-01-12 18:57:38 +01:00
James Cole
8e2546da9d Update translations. 2024-01-10 20:29:00 +01:00
James Cole
3a8162d3c5 Add button for https://github.com/firefly-iii/firefly-iii/issues/8369 2024-01-10 05:34:20 +01:00
James Cole
f7ceb75316 Merge pull request #8370 from luzpaz/typos
Fix various typos
2024-01-10 05:31:16 +01:00
luzpaz
744e193faa Fix various typos
Found via `codespell -q 3 -S "./resources/lang,./resources/assets/js/locales" -L hastable`
2024-01-10 01:12:48 +00:00
James Cole
12b0e11592 From error to debug. 2024-01-09 21:05:17 +01:00
James Cole
717f3a9e3d From info to debug 2024-01-09 21:04:12 +01:00
James Cole
b9f0682f04 Add audit entries. 2024-01-09 21:03:26 +01:00
James Cole
8792465fd5 Add validation warnings in audit logs. 2024-01-09 20:58:18 +01:00
James Cole
6fbf9a119d Change priority on audit messages. 2024-01-09 20:48:17 +01:00
James Cole
0dfa21a92e Merge branch 'main' into develop 2024-01-08 20:39:02 +01:00
James Cole
136fe8e8eb Update label-actions.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-08 20:32:31 +01:00
James Cole
d510c4e31d Rebuild frontend v2 2024-01-08 20:31:35 +01:00
James Cole
c066bcc4ce Update label-actions.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-08 20:30:47 +01:00
James Cole
c9e7ae1f08 Update label-actions.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-08 20:25:25 +01:00
James Cole
6a9b4f4d55 Update label-actions.yml
Signed-off-by: James Cole <james@firefly-iii.org>
2024-01-08 20:20:22 +01:00
James Cole
2b5054b905 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2024-01-08 20:11:39 +01:00
James Cole
0a45a2485b Small edit and show updates 2024-01-08 20:11:27 +01:00
James Cole
fcc0294d07 Smaller max size 2024-01-08 12:56:57 +01:00
James Cole
ad981c2bf0 Fix breadcrumb bg color. 2024-01-07 19:55:56 +01:00
James Cole
75a32b2f94 Expand v2 layout with experimental view. 2024-01-07 12:51:42 +01:00
James Cole
70b60f756b Rebuild frontend [skip ci] 2024-01-07 07:02:53 +01:00
James Cole
0d2ae8ae23 Clean up languages [skip ci] 2024-01-07 07:02:28 +01:00
James Cole
8043c86942 Update readme. 2024-01-06 19:22:38 +01:00
James Cole
4c30a7bc55 Expand edit form. 2024-01-06 17:24:54 +01:00
James Cole
f615b9c252 Fix https://github.com/firefly-iii/firefly-iii/issues/8352 2024-01-06 14:44:50 +01:00
James Cole
c19b36a391 Fix https://github.com/firefly-iii/firefly-iii/issues/8352 2024-01-06 14:40:06 +01:00
James Cole
935634e487 Sanity check on number. 2024-01-06 14:23:20 +01:00
James Cole
7e62b75b12 Merge tag 'v6.1.6' into develop
v6.1.6
2024-01-06 11:13:41 +01:00
380 changed files with 89418 additions and 85625 deletions

View File

@@ -226,16 +226,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.46.0",
"version": "v3.49.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "be6831c9af1740470d2a773119b9273f8ac1c3d2"
"reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/be6831c9af1740470d2a773119b9273f8ac1c3d2",
"reference": "be6831c9af1740470d2a773119b9273f8ac1c3d2",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8742f7aa6f72a399688b65e4f58992c2d4681fc2",
"reference": "8742f7aa6f72a399688b65e4f58992c2d4681fc2",
"shasum": ""
},
"require": {
@@ -305,7 +305,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.46.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.49.0"
},
"funding": [
{
@@ -313,7 +313,7 @@
"type": "github"
}
],
"time": "2024-01-03T21:38:46+00:00"
"time": "2024-02-02T00:41:40+00:00"
},
{
"name": "psr/container",
@@ -537,16 +537,16 @@
},
{
"name": "symfony/console",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "f8587c4cdc5acad67af71c37db34ef03af91e59c"
"reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/f8587c4cdc5acad67af71c37db34ef03af91e59c",
"reference": "f8587c4cdc5acad67af71c37db34ef03af91e59c",
"url": "https://api.github.com/repos/symfony/console/zipball/c5010d50f1ee4b25cfa0201d9915cf1b14071456",
"reference": "c5010d50f1ee4b25cfa0201d9915cf1b14071456",
"shasum": ""
},
"require": {
@@ -610,7 +610,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.0.2"
"source": "https://github.com/symfony/console/tree/v7.0.3"
},
"funding": [
{
@@ -626,7 +626,7 @@
"type": "tidelift"
}
],
"time": "2023-12-10T16:54:46+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -697,16 +697,16 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "098b62ae81fdd6cbf941f355059f617db28f4f9a"
"reference": "834c28d533dd0636f910909d01b9ff45cc094b5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/098b62ae81fdd6cbf941f355059f617db28f4f9a",
"reference": "098b62ae81fdd6cbf941f355059f617db28f4f9a",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/834c28d533dd0636f910909d01b9ff45cc094b5e",
"reference": "834c28d533dd0636f910909d01b9ff45cc094b5e",
"shasum": ""
},
"require": {
@@ -757,7 +757,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.2"
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.3"
},
"funding": [
{
@@ -773,7 +773,7 @@
"type": "tidelift"
}
],
"time": "2023-12-27T22:24:19+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -853,16 +853,16 @@
},
{
"name": "symfony/filesystem",
"version": "v7.0.0",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7"
"reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7",
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12",
"reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12",
"shasum": ""
},
"require": {
@@ -896,7 +896,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v7.0.0"
"source": "https://github.com/symfony/filesystem/tree/v7.0.3"
},
"funding": [
{
@@ -912,7 +912,7 @@
"type": "tidelift"
}
],
"time": "2023-07-27T06:33:22+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/finder",
@@ -1539,16 +1539,16 @@
},
{
"name": "symfony/process",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a"
"reference": "937a195147e0c27b2759ade834169ed006d0bc74"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a",
"reference": "acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a",
"url": "https://api.github.com/repos/symfony/process/zipball/937a195147e0c27b2759ade834169ed006d0bc74",
"reference": "937a195147e0c27b2759ade834169ed006d0bc74",
"shasum": ""
},
"require": {
@@ -1580,7 +1580,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.0.2"
"source": "https://github.com/symfony/process/tree/v7.0.3"
},
"funding": [
{
@@ -1596,7 +1596,7 @@
"type": "tidelift"
}
],
"time": "2023-12-24T09:15:37+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/service-contracts",
@@ -1682,16 +1682,16 @@
},
{
"name": "symfony/stopwatch",
"version": "v7.0.0",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a"
"reference": "983900d6fddf2b0cbaacacbbad07610854bd8112"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a",
"reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/983900d6fddf2b0cbaacacbbad07610854bd8112",
"reference": "983900d6fddf2b0cbaacacbbad07610854bd8112",
"shasum": ""
},
"require": {
@@ -1724,7 +1724,7 @@
"description": "Provides a way to profile code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/stopwatch/tree/v7.0.0"
"source": "https://github.com/symfony/stopwatch/tree/v7.0.3"
},
"funding": [
{
@@ -1740,20 +1740,20 @@
"type": "tidelift"
}
],
"time": "2023-07-05T13:06:06+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/string",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "cc78f14f91f5e53b42044d0620961c48028ff9f5"
"reference": "524aac4a280b90a4420d8d6a040718d0586505ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/cc78f14f91f5e53b42044d0620961c48028ff9f5",
"reference": "cc78f14f91f5e53b42044d0620961c48028ff9f5",
"url": "https://api.github.com/repos/symfony/string/zipball/524aac4a280b90a4420d8d6a040718d0586505ac",
"reference": "524aac4a280b90a4420d8d6a040718d0586505ac",
"shasum": ""
},
"require": {
@@ -1810,7 +1810,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.0.2"
"source": "https://github.com/symfony/string/tree/v7.0.3"
},
"funding": [
{
@@ -1826,7 +1826,7 @@
"type": "tidelift"
}
],
"time": "2023-12-10T16:54:46+00:00"
"time": "2024-01-29T15:41:16+00:00"
}
],
"packages-dev": [],

View File

@@ -29,12 +29,12 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# cp .ci/.env.ci .env
OUTPUT_FORMAT=txt
EXTRA_PARAMS="-v"
EXTRA_PARAMS=""
if [[ $GITHUB_ACTIONS = "true" ]]
then
OUTPUT_FORMAT=gitlab
EXTRA_PARAMS="--diff --dry-run"
OUTPUT_FORMAT=txt
EXTRA_PARAMS=""
fi
# clean up php code

View File

@@ -395,16 +395,16 @@
},
{
"name": "symfony/config",
"version": "v7.0.0",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "8789646600f4e7e451dde9e1dc81cfa429f3857a"
"reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/8789646600f4e7e451dde9e1dc81cfa429f3857a",
"reference": "8789646600f4e7e451dde9e1dc81cfa429f3857a",
"url": "https://api.github.com/repos/symfony/config/zipball/86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16",
"reference": "86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16",
"shasum": ""
},
"require": {
@@ -450,7 +450,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/config/tree/v7.0.0"
"source": "https://github.com/symfony/config/tree/v7.0.3"
},
"funding": [
{
@@ -466,20 +466,20 @@
"type": "tidelift"
}
],
"time": "2023-11-09T08:30:23+00:00"
"time": "2024-01-30T08:34:29+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "bd25ef7c937b9da12510bdc4f1c66728f19620e3"
"reference": "e915c6684b8e3ae90a4441f6823ebbb40edf0b92"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/bd25ef7c937b9da12510bdc4f1c66728f19620e3",
"reference": "bd25ef7c937b9da12510bdc4f1c66728f19620e3",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e915c6684b8e3ae90a4441f6823ebbb40edf0b92",
"reference": "e915c6684b8e3ae90a4441f6823ebbb40edf0b92",
"shasum": ""
},
"require": {
@@ -530,7 +530,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dependency-injection/tree/v7.0.2"
"source": "https://github.com/symfony/dependency-injection/tree/v7.0.3"
},
"funding": [
{
@@ -546,7 +546,7 @@
"type": "tidelift"
}
],
"time": "2023-12-28T19:18:20+00:00"
"time": "2024-01-30T08:34:29+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -617,16 +617,16 @@
},
{
"name": "symfony/filesystem",
"version": "v7.0.0",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7"
"reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7",
"reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12",
"reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12",
"shasum": ""
},
"require": {
@@ -660,7 +660,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v7.0.0"
"source": "https://github.com/symfony/filesystem/tree/v7.0.3"
},
"funding": [
{
@@ -676,7 +676,7 @@
"type": "tidelift"
}
],
"time": "2023-07-27T06:33:22+00:00"
"time": "2024-01-23T15:02:46+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -927,16 +927,16 @@
},
{
"name": "symfony/var-exporter",
"version": "v7.0.2",
"version": "v7.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
"reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764"
"reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/345c62fefe92243c3a06fc0cc65f2ec1a47e0764",
"reference": "345c62fefe92243c3a06fc0cc65f2ec1a47e0764",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/1fb79308cb5fc2b44bff6e8af10a5af6812e05b8",
"reference": "1fb79308cb5fc2b44bff6e8af10a5af6812e05b8",
"shasum": ""
},
"require": {
@@ -981,7 +981,7 @@
"serialize"
],
"support": {
"source": "https://github.com/symfony/var-exporter/tree/v7.0.2"
"source": "https://github.com/symfony/var-exporter/tree/v7.0.3"
},
"funding": [
{
@@ -997,7 +997,7 @@
"type": "tidelift"
}
],
"time": "2023-12-27T08:42:13+00:00"
"time": "2024-01-23T15:02:46+00:00"
}
],
"aliases": [],

View File

@@ -122,7 +122,7 @@ SESSION_DRIVER=file
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
# can be tcp, unix or http
# can be tcp or unix. http is not supported
REDIS_SCHEME=tcp
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
@@ -324,6 +324,11 @@ PUSHER_SECRET=
PUSHER_ID=
DEMO_USERNAME=
DEMO_PASSWORD=
#
# The v2 layout is very experimental. If it breaks you get to keep both parts.
# Be wary of data loss.
#
FIREFLY_III_LAYOUT=v1
#

View File

@@ -1,11 +1,16 @@
version: 2
updates:
# Check for updates to GitHub Actions every week
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# composer updates
- package-ecosystem: "composer"
directory: "/" # Location of package manifests
target-branch: develop
labels: [ "bug" ]
versioning-strategy: increase
schedule:
interval: "weekly"
@@ -14,15 +19,6 @@ updates:
- package-ecosystem: "npm"
directory: "/"
target-branch: develop
labels: [ "bug" ]
versioning-strategy: increase
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: develop
labels: [ "bug" ]
versioning-strategy: increase
schedule:
interval: "weekly"

View File

@@ -5,7 +5,9 @@ feature:
issues:
# Post a comment, `{issue-author}` is an optional placeholder
comment: |
Hi there! This is an automatic reply. `Share and enjoy`
Hi there!
This is an automatic reply. `Share and enjoy`
This issue has been marked as a feature request. The requested (new) feature will become a part of Firefly III or the data importer in due course.
@@ -13,11 +15,29 @@ feature:
Thank you for your contributions.
epic:
issues:
# Post a comment, `{issue-author}` is an optional placeholder
comment: |
Hi there!
This is an automatic reply. `Share and enjoy`
This issue has been marked as an epic. In epics, large amounts of works are collected that will be part of a major new feature. If you have more ideas that could be a part of this epic, feel free to reply.
*However*, please be aware there is NO need to reply with "+1" or "me too" or "I need this too" or whatever. Such comments are not helpful, and do not influence [the roadmap](https://roadmap.firefly-iii.org/). Your comment may be :skull: deleted.
If you are merely interested in this epic's progress, you can subscribe to this issue to get updates.
Thank you for your contributions.
enhancement:
issues:
# Post a comment, `{issue-author}` is an optional placeholder
comment: |
Hi there! This is an automatic reply. `Share and enjoy`
Hi there!
This is an automatic reply. `Share and enjoy`
This issue has been marked as an enhancement. The requested enhancement to an existing feature will become a part of Firefly III or the data importer in due course.
@@ -25,13 +45,67 @@ enhancement:
Thank you for your contributions.
# The `solved` label is added to discussions
triage:
issues:
# Post a comment, `{issue-author}` is an optional placeholder
comment: |
Hi there! This is an automatic reply. `Share and enjoy`
Hi there!
This is an automatic reply. `Share and enjoy`
This issue has been marked as being in triage. The root cause is not known yet, or the issue needs more investigation. You can help by sharing debug information (from `/debug`) if you also have this issue or when you haven't already done so.
Thank you for your contributions.
needs-moar-debug:
issues:
comment: |
Hi there!
This is an automatic reply. `Share and enjoy`
To learn more about this issue, please make sure you share at least:
1. The table you can find on the `/debug` page
2. Firefly III version
2. Docker, self-hosted, or hosted by a third party?
3. Operating system and browser
Thank you for your contributions.
unlabel: needs-moar-debug
needs-moar-logs:
issues:
comment: |
Hi there!
This is an automatic reply. `Share and enjoy`
To learn more about this issue, please share the relevant log files from your Firefly III or data importer installation.
The relevant instructions can be found in the documentation: [How to debug Firefly III?](https://docs.firefly-iii.org/how-to/general/debug/) Once debug mode is activated per these instructions, you can repeat your action and find the logs, depending on your method of installation. All is explained on the page.
Please share the relevant log lines in your issue, either inline or as an attachment. If you feel the logs contain sensitive information, you may also send them to [james@firefly-iii.org](mailto:james@firefly-iii.org). Without these logs, it may not be possible to properly investigate this issue.
Thank you for your contributions.
unlabel: needs-moar-logs
v2-layout-issue:
issues:
comment: |
Hi there!
This is an automatic reply. `Share and enjoy`
It seems your issue is about the new v2-layout that is currently in development for Firefly III.
These issues are collected in [a GitHub discussion](https://github.com/firefly-iii/firefly-iii/issues/8361).
Please note that the v2 layout is still very much in development.
Thank you for your contributions.
close: true
close-reason: completed
lock: false
unlabel: v2-layout-issue

View File

@@ -12,7 +12,7 @@ jobs:
timeout-minutes: 10
steps:
- name: Prune cancelled/skipped runs
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
script: |
@@ -42,7 +42,7 @@ jobs:
}
- name: Prune runs older than 3 days
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
script: |
@@ -56,10 +56,13 @@ jobs:
const workflows = [
'cleanup.yml',
'close-duplicates.yml',
'closed-issues.yml',
'debug-info-actions.yml',
'depsreview.yml',
'label-actions.yml',
'lock.yml',
'release.yml',
'sonarcloud.yml',
'stale.yml'
]

39
.github/workflows/close-duplicates.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: "Issues - Command to close duplicate issues"
# the workflow to execute on is comments that are newly created
on:
issue_comment:
types: [created]
permissions:
issues: write
checks: read
jobs:
close_duplicates:
runs-on: ubuntu-latest
steps:
- uses: github/command@v1.1.0
id: command
with:
allowed_contexts: "issue"
command: ".duplicate"
- name: reply
if: ${{ steps.command.outputs.continue == 'true' }}
run: |
ISSUE_TITLE=$(gh issue view ${{ steps.command.outputs.params }} --json title --jq '.title')
gh issue comment "$NUMBER" --body "Hi there!
This is an automatic reply. \`Share and enjoy\`.
Your issue is probably a duplicate of issue <span>#</span>${{ steps.command.outputs.params }}: [$ISSUE_TITLE](https://github.com/firefly-iii/firefly-iii/issues/${{ steps.command.outputs.params }}). Please refer to issue #${{ steps.command.outputs.params }} for support.
You can close this issue now. If you believe this is not in fact a duplicate, please reply and let us know. Otherwise, this issue will be automatically closed in a few days time.
Thank you for your contributions."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}

View File

@@ -23,6 +23,3 @@ jobs:
Thank you for your contributions.
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: OSDKDev/lock-issues@v1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,32 @@
name: 'Issues - Respond to hidden commands'
# the workflow to execute on is comments that are newly created
on:
issues:
types: [opened, edited]
issue_comment:
types: [created]
# permissions needed for reacting to IssueOps commands on issues and PRs
permissions:
contents: read
pull-requests: write
issues: write
checks: read
jobs:
respond:
runs-on: ubuntu-latest
steps:
- run: |
ISSUE_BODY=$(gh issue view $NUMBER --json body)
if [[ $ISSUE_BODY == *".eOxNZAmyGz6CXMyf"* ]]; then
gh issue comment "$NUMBER" --body "$V2_ISSUE_REPLY_BODY"
gh issue close "$NUMBER" --reason completed
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
V2_ISSUE_REPLY_BODY: ${{ secrets.V2_ISSUE_REPLY_BODY }}
LABELS: v2-layout-issue

View File

@@ -9,8 +9,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Dependency review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4

View File

@@ -18,4 +18,4 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v3
- uses: dessant/label-actions@v4

View File

@@ -15,5 +15,5 @@ jobs:
- uses: JC5/lock-threads@main
with:
github-token: ${{ github.token }}
issue-inactive-days: 90
pr-inactive-days: 90
issue-inactive-days: 7
pr-inactive-days: 7

163
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,163 @@
name: 'Code - Create new release'
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: 'develop'
schedule:
- cron: '15 0 * * MON,THU'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Switch branch
run: |
if [[ "develop" == "$version" ]]; then
git checkout --track origin/develop
git pull
else
git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git checkout --track origin/develop
git pull
git checkout main
git merge develop
fi
env:
version: ${{ github.event_name == 'schedule' && 'develop' || github.event.inputs.version }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, zip, bcmath
- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
download_translations: true
push_translations: false
push_sources: false
env:
GITHUB_TOKEN: ${{ github.token }}
CROWDIN_PROJECT_NR: ${{ secrets.CROWDIN_PROJECT_NR }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: Cleanup translations
id: cleanup-transactions
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:crowdin-warning'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ''
- name: Cleanup changelog
id: cleanup-changelog
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:changelog'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ${{ secrets.CHANGELOG_TOKEN }}
- name: Extract changelog
id: extract-changelog
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:extract-changelog'
output: 'output'
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ""
- name: Generate JSON v1
id: json-v1
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:json-translations v1'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ''
- name: Generate JSON v2
id: json-v2
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:json-translations v2'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ''
- name: Code cleanup
id: code-cleanup
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:code'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ''
- name: Build new JS
run: |
npm upgrade
npm run build
- name: Build old JS
id: old-js
uses: JC5/firefly-iii-dev@v30
with:
action: 'ff3:old-js'
output: ''
env:
FIREFLY_III_ROOT: /github/workspace
GH_TOKEN: ''
- name: Run CI
run: |
rm -rf vendor composer.lock
composer validate --strict
composer update --no-dev --no-scripts --no-plugins -q
sudo chown -R runner:docker resources/lang
.ci/phpcs.sh
- name: Release
run: |
sudo timedatectl set-timezone Europe/Amsterdam
git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config advice.addIgnoredFile false
if [[ "develop" == "$version" ]]; then
[[ -z $(git status --untracked-files=normal --porcelain) ]] && echo "this branch is clean, no need to push..." && exit 0;
fi
git add -A
if test -f "output.txt"; then
git reset output.txt
fi
git commit -m "Auto commit for release '$version' on $(date +'%Y-%m-%d')" || true
git push
if [[ "develop" == "$version" ]]; then
echo "Create nightly release."
git tag -a $version-$(date +'%Y%m%d') -m "Nightly development release '$version' on $(date +'%Y-%m-%d')"
git push origin $version-$(date +'%Y%m%d')
gh release create $version-$(date +'%Y%m%d') -p --verify-tag \
-t "Development release for $(date +'%Y-%m-%d')" \
-n "Bi-weekly development release of Firefly III with the latest fixes, translations and features. This release was created on **$(date +'%Y-%m-%d')** and may contain bugs. Use at your own risk. Docker users can find this release under the \`develop\` tag."
else
echo "Create default release."
git tag -a $version -m "Here be changelog"
git push origin $version
gh release create $version -F output.txt -t "$version" --verify-tag
rm output.txt
git checkout develop
git merge main
git push
fi
env:
GH_TOKEN: ${{ github.token }}
version: ${{ github.event_name == 'schedule' && 'develop' || github.event.inputs.version }}

View File

@@ -1,4 +1,4 @@
name: "Issues - Close stale issues"
name: "Issues - Mark and close stale issues"
on:
schedule:
- cron: "30 1 * * *"
@@ -14,21 +14,25 @@ jobs:
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: >
Hi there! This is an automatic reply. `Share and enjoy`
Hi there!
This is an automatic reply. `Share and enjoy`
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.
stale-pr-message: >
Hi there! This is an automatic reply. `Share and enjoy`
Hi there!
This is an automatic reply. `Share and enjoy`
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.
days-before-stale: 14
days-before-close: 7
exempt-issue-labels: 'enhancement,feature,bug,announcement,epic'
exempt-issue-labels: 'enhancement,feature,bug,announcement,epic,triage'

View File

@@ -183,7 +183,7 @@ class DestroyController extends Controller
}
if (false === $this->unused) {
app('log')->info(sprintf('Deleting account #%d "%s"', $account->id, $account->name));
Log::channel('audit')->info(sprintf('Deleted account #%d "%s"', $account->id, $account->name));
Log::channel('audit')->warning(sprintf('Deleted account #%d "%s"', $account->id, $account->name));
$service->destroy($account, null);
}
}

View File

@@ -67,7 +67,7 @@ class DestroyController extends Controller
public function destroy(Attachment $attachment): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}

View File

@@ -76,7 +76,7 @@ class ShowController extends Controller
public function download(Attachment $attachment): LaravelResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}
@@ -124,7 +124,7 @@ class ShowController extends Controller
public function index(): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}
@@ -162,7 +162,7 @@ class ShowController extends Controller
public function show(Attachment $attachment): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}

View File

@@ -75,7 +75,7 @@ class StoreController extends Controller
public function store(StoreRequest $request): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}
@@ -99,7 +99,7 @@ class StoreController extends Controller
public function upload(Request $request, Attachment $attachment): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}

View File

@@ -70,7 +70,7 @@ class UpdateController extends Controller
public function update(UpdateRequest $request, Attachment $attachment): JsonResponse
{
if(true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
throw new NotFoundHttpException();
}

View File

@@ -147,7 +147,7 @@ class TriggerController extends Controller
// add a range:
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
}
if (array_key_exists('accounts', $parameters) && '' !== $parameters['accounts']) {
if (array_key_exists('accounts', $parameters) && is_array($parameters['accounts']) && count($parameters['accounts']) > 0) {
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
}

View File

@@ -71,7 +71,7 @@ class AttemptController extends Controller
throw new FireflyException('200040: Webhook and webhook message are no match');
}
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User lists webhook attempts of webhook #%d and message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
Log::channel('audit')->warning(sprintf('User lists webhook attempts of webhook #%d and message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}
@@ -115,7 +115,7 @@ class AttemptController extends Controller
}
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User views single webhook attempt #%d of webhook #%d and message #%d, but webhooks are DISABLED', $attempt->id, $webhook->id, $message->id));
Log::channel('audit')->warning(sprintf('User views single webhook attempt #%d of webhook #%d and message #%d, but webhooks are DISABLED', $attempt->id, $webhook->id, $message->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -63,7 +63,7 @@ class DestroyController extends Controller
public function destroy(Webhook $webhook): JsonResponse
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d. but webhooks are DISABLED.', $webhook->id));
Log::channel('audit')->warning(sprintf('User tries to destroy webhook #%d. but webhooks are DISABLED.', $webhook->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}
@@ -93,7 +93,7 @@ class DestroyController extends Controller
}
if (false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d, message #%d, attempt #%d, but webhooks are DISABLED.', $webhook->id, $message->id, $attempt->id));
Log::channel('audit')->warning(sprintf('User tries to destroy webhook #%d, message #%d, attempt #%d, but webhooks are DISABLED.', $webhook->id, $message->id, $attempt->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}
@@ -121,7 +121,7 @@ class DestroyController extends Controller
}
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User tries to destroy webhook #%d, message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
Log::channel('audit')->warning(sprintf('User tries to destroy webhook #%d, message #%d, but webhooks are DISABLED.', $webhook->id, $message->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -67,7 +67,7 @@ class MessageController extends Controller
public function index(Webhook $webhook): JsonResponse
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User tries to view messages of webhook #%d, but webhooks are DISABLED.', $webhook->id));
Log::channel('audit')->warning(sprintf('User tries to view messages of webhook #%d, but webhooks are DISABLED.', $webhook->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}
@@ -107,7 +107,7 @@ class MessageController extends Controller
throw new FireflyException('200040: Webhook and webhook message are no match');
}
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User tries to view message #%d of webhook #%d, but webhooks are DISABLED.', $message->id, $webhook->id));
Log::channel('audit')->warning(sprintf('User tries to view message #%d of webhook #%d, but webhooks are DISABLED.', $message->id, $webhook->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -28,6 +28,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -72,6 +73,9 @@ class MoveTransactionsRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
private function validateMove(Validator $validator): void

View File

@@ -30,6 +30,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -72,5 +73,8 @@ class TransactionRequest extends FormRequest
$this->validateTransactionQuery($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -71,7 +71,7 @@ class ExportRequest extends FormRequest
{
return [
'type' => 'in:csv',
'accounts' => 'min:1|max:65536',
'accounts' => 'min:1|max:32768',
'start' => 'date|before:end',
'end' => 'date|after:start',
];

View File

@@ -119,7 +119,7 @@ class StoreRequest extends FormRequest
'liability_direction' => 'nullable|required_if:type,liability|required_if:type,liabilities|in:credit,debit',
'interest' => 'min:0|max:100|numeric',
'interest_period' => sprintf('nullable|in:%s', implode(',', config('firefly.interest_periods'))),
'notes' => 'min:0|max:65536',
'notes' => 'min:0|max:32768',
];
return Location::requestRules($rules);

View File

@@ -107,7 +107,7 @@ class UpdateRequest extends FormRequest
'liability_direction' => 'required_if:type,liability|in:credit,debit',
'interest' => 'required_if:type,liability|min:0|max:100|numeric',
'interest_period' => 'required_if:type,liability|in:daily,monthly,yearly',
'notes' => 'min:0|max:65536',
'notes' => 'min:0|max:32768',
];
return Location::requestRules($rules);

View File

@@ -28,6 +28,7 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -87,5 +88,8 @@ class Request extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -29,6 +29,7 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -103,5 +104,8 @@ class StoreRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -30,6 +30,7 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -108,5 +109,8 @@ class UpdateRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -29,6 +29,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -91,5 +92,8 @@ class StoreRequest extends FormRequest
$this->validateAutoBudgetAmount($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -30,6 +30,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -103,5 +104,8 @@ class UpdateRequest extends FormRequest
$this->validateAutoBudgetAmount($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -28,6 +28,7 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -87,5 +88,8 @@ class UpdateRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -33,6 +33,7 @@ use FireflyIII\Validation\CurrencyValidation;
use FireflyIII\Validation\RecurrenceValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -131,6 +132,9 @@ class StoreRequest extends FormRequest
$this->validateAccountInformation($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -34,6 +34,7 @@ use FireflyIII\Validation\CurrencyValidation;
use FireflyIII\Validation\RecurrenceValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -141,6 +142,9 @@ class UpdateRequest extends FormRequest
$this->valUpdateAccountInfo($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -28,6 +28,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Support\Request\GetRuleConfiguration;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -108,6 +109,9 @@ class StoreRequest extends FormRequest
$this->atLeastOneActiveAction($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -29,6 +29,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Support\Request\GetRuleConfiguration;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -118,6 +119,9 @@ class UpdateRequest extends FormRequest
$this->atLeastOneValidAction($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -71,6 +71,10 @@ class TriggerRequest extends FormRequest
private function getAccounts(): array
{
if(null === $this->get('accounts')) {
return [];
}
return $this->get('accounts');
}
}

View File

@@ -60,7 +60,7 @@ class StoreRequest extends FormRequest
{
$rules = [
'tag' => 'required|min:1|uniqueObjectForUser:tags,tag|max:1024',
'description' => 'min:1|nullable|max:65536',
'description' => 'min:1|nullable|max:32768',
'date' => 'date|nullable',
];

View File

@@ -66,7 +66,7 @@ class UpdateRequest extends FormRequest
// TODO check if uniqueObjectForUser is obsolete
$rules = [
'tag' => 'min:1|max:1024|uniqueObjectForUser:tags,tag,'.$tag->id,
'description' => 'min:1|nullable|max:65536',
'description' => 'min:1|nullable|max:32768',
'date' => 'date|nullable',
];

View File

@@ -37,6 +37,7 @@ use FireflyIII\Validation\CurrencyValidation;
use FireflyIII\Validation\GroupValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -191,6 +192,9 @@ class StoreRequest extends FormRequest
$this->validateGroupDescription($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -36,6 +36,7 @@ use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\GroupValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -117,7 +118,7 @@ class UpdateRequest extends FormRequest
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
// amount
'transactions.*.amount' => ['nullable', new IsValidPositiveAmount()],
'transactions.*.amount' => [new IsValidPositiveAmount()],
'transactions.*.foreign_amount' => ['nullable', new IsValidZeroOrMoreAmount()],
// description
@@ -205,6 +206,9 @@ class UpdateRequest extends FormRequest
$this->validateAccountInformationUpdate($validator, $transactionGroup);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -42,7 +42,7 @@ class UpdateRequest extends FormRequest
*/
public function getAll(): array
{
// return nothing that isn't explicitely in the array:
// return nothing that isn't explicitly in the array:
$fields = [
'name' => ['name', 'convertString'],
'code' => ['code', 'convertString'],

View File

@@ -29,6 +29,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -77,6 +78,9 @@ class StoreRequest extends FormRequest
$this->validateExistingLink($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
private function validateExistingLink(Validator $validator): void

View File

@@ -29,6 +29,7 @@ use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -77,6 +78,9 @@ class UpdateRequest extends FormRequest
$this->validateUpdate($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
private function validateUpdate(Validator $validator): void

View File

@@ -29,6 +29,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -97,5 +98,8 @@ class UserUpdateRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -0,0 +1,93 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Model\Transaction;
use FireflyIII\Api\V2\Controllers\Controller;
use FireflyIII\Api\V2\Request\Model\Transaction\UpdateRequest;
use FireflyIII\Events\UpdatedTransactionGroup;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
use FireflyIII\Transformers\V2\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
class UpdateController extends Controller
{
private TransactionGroupRepositoryInterface $groupRepository;
/**
* TransactionController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->groupRepository = app(TransactionGroupRepositoryInterface::class);
return $next($request);
}
);
}
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/transactions/updateTransaction
*
* Update a transaction.
*
* @throws FireflyException
*/
public function update(UpdateRequest $request, TransactionGroup $transactionGroup): JsonResponse
{
app('log')->debug('Now in update routine for transaction group [v2]!');
$data = $request->getAll();
$transactionGroup = $this->groupRepository->update($transactionGroup, $data);
$applyRules = $data['apply_rules'] ?? true;
$fireWebhooks = $data['fire_webhooks'] ?? true;
event(new UpdatedTransactionGroup($transactionGroup, $applyRules, $fireWebhooks));
app('preferences')->mark();
/** @var User $admin */
$admin = auth()->user();
// use new group collector:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setUser($admin)->setTransactionGroup($transactionGroup);
$selectedGroup = $collector->getGroups()->first();
if (null === $selectedGroup) {
throw new FireflyException('200032: Cannot find transaction. Possibly, a rule deleted this transaction after its creation.');
}
$transformer = new TransactionGroupTransformer();
$transformer->setParameters($this->parameters);
return response()->api($this->jsonApiObject('transactions', $selectedGroup, $transformer))->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -28,6 +28,7 @@ use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -79,5 +80,8 @@ class BalanceChartRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,7 @@ use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -77,5 +78,8 @@ class DashboardChartRequest extends FormRequest
}
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -38,6 +38,7 @@ use FireflyIII\Validation\CurrencyValidation;
use FireflyIII\Validation\GroupValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -211,6 +212,9 @@ class StoreRequest extends FormRequest
$this->validateGroupDescription($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**

View File

@@ -0,0 +1,366 @@
<?php
/*
* UpdateRequest.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V2\Request\Model\Transaction;
use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Rules\BelongsUser;
use FireflyIII\Rules\IsBoolean;
use FireflyIII\Rules\IsDateOrTime;
use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Rules\IsValidZeroOrMoreAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\GroupValidation;
use FireflyIII\Validation\TransactionValidation;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class UpdateRequest
*
* TODO it's the same as the v1
*/
class UpdateRequest extends Request
{
use ChecksLogin;
use ConvertsDataTypes;
use GroupValidation;
use TransactionValidation;
private array $arrayFields;
private array $booleanFields;
private array $dateFields;
private array $floatFields;
private array $integerFields;
private array $stringFields;
private array $textareaFields;
/**
* Get all data. Is pretty complex because of all the ??-statements.
*
* @throws FireflyException
*/
public function getAll(): array
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
$this->integerFields = ['order', 'currency_id', 'foreign_currency_id', 'transaction_journal_id', 'source_id', 'destination_id', 'budget_id', 'category_id', 'bill_id', 'recurrence_id'];
$this->dateFields = ['date', 'interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date'];
$this->textareaFields = ['notes'];
// not really floats, for validation.
$this->floatFields = ['amount', 'foreign_amount'];
$this->stringFields = ['type', 'currency_code', 'foreign_currency_code', 'description', 'source_name', 'source_iban', 'source_number', 'source_bic', 'destination_name', 'destination_iban', 'destination_number', 'destination_bic', 'budget_name', 'category_name', 'bill_name', 'internal_reference', 'external_id', 'bunq_payment_id', 'sepa_cc', 'sepa_ct_op', 'sepa_ct_id', 'sepa_db', 'sepa_country', 'sepa_ep', 'sepa_ci', 'sepa_batch_id', 'external_url'];
$this->booleanFields = ['reconciled'];
$this->arrayFields = ['tags'];
$data = [];
if ($this->has('transactions')) {
$data['transactions'] = $this->getTransactionData();
}
if ($this->has('apply_rules')) {
$data['apply_rules'] = $this->boolean('apply_rules', true);
}
if ($this->has('fire_webhooks')) {
$data['fire_webhooks'] = $this->boolean('fire_webhooks', true);
}
if ($this->has('group_title')) {
$data['group_title'] = $this->convertString('group_title');
}
return $data;
}
/**
* The rules that the incoming request must be matched against.
*/
public function rules(): array
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
$validProtocols = config('firefly.valid_url_protocols');
return [
// basic fields for group:
'group_title' => 'min:1|max:1000|nullable',
'apply_rules' => [new IsBoolean()],
// transaction rules (in array for splits):
'transactions.*.type' => 'in:withdrawal,deposit,transfer,opening-balance,reconciliation',
'transactions.*.date' => [new IsDateOrTime()],
'transactions.*.order' => 'numeric|min:0',
// group id:
'transactions.*.transaction_journal_id' => ['nullable', 'numeric', new BelongsUser()],
// currency info
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id|nullable',
'transactions.*.currency_code' => 'min:3|max:51|exists:transaction_currencies,code|nullable',
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
// amount
'transactions.*.amount' => ['nullable', new IsValidPositiveAmount()],
'transactions.*.foreign_amount' => ['nullable', new IsValidZeroOrMoreAmount()],
// description
'transactions.*.description' => 'nullable|min:1|max:1000',
// source of transaction
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser()],
'transactions.*.source_name' => 'min:1|max:255|nullable',
// destination of transaction
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser()],
'transactions.*.destination_name' => 'min:1|max:255|nullable',
// budget, category, bill and piggy
'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser(), 'nullable'],
'transactions.*.budget_name' => ['min:1', 'max:255', 'nullable', new BelongsUser()],
'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser(), 'nullable'],
'transactions.*.category_name' => 'min:1|max:255|nullable',
'transactions.*.bill_id' => ['numeric', 'nullable', 'mustExist:bills,id', new BelongsUser()],
'transactions.*.bill_name' => ['min:1', 'max:255', 'nullable', new BelongsUser()],
// other interesting fields
'transactions.*.reconciled' => [new IsBoolean()],
'transactions.*.notes' => 'min:1|max:32768|nullable',
'transactions.*.tags' => 'min:0|max:255|nullable',
'transactions.*.tags.*' => 'min:0|max:255',
// meta info fields
'transactions.*.internal_reference' => 'min:1|max:255|nullable',
'transactions.*.external_id' => 'min:1|max:255|nullable',
'transactions.*.recurrence_id' => 'min:1|max:255|nullable',
'transactions.*.bunq_payment_id' => 'min:1|max:255|nullable',
'transactions.*.external_url' => sprintf('min:1|max:255|nullable|url:%s', $validProtocols),
// SEPA fields:
'transactions.*.sepa_cc' => 'min:1|max:255|nullable',
'transactions.*.sepa_ct_op' => 'min:1|max:255|nullable',
'transactions.*.sepa_ct_id' => 'min:1|max:255|nullable',
'transactions.*.sepa_db' => 'min:1|max:255|nullable',
'transactions.*.sepa_country' => 'min:1|max:255|nullable',
'transactions.*.sepa_ep' => 'min:1|max:255|nullable',
'transactions.*.sepa_ci' => 'min:1|max:255|nullable',
'transactions.*.sepa_batch_id' => 'min:1|max:255|nullable',
// dates
'transactions.*.interest_date' => 'date|nullable',
'transactions.*.book_date' => 'date|nullable',
'transactions.*.process_date' => 'date|nullable',
'transactions.*.due_date' => 'date|nullable',
'transactions.*.payment_date' => 'date|nullable',
'transactions.*.invoice_date' => 'date|nullable',
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
app('log')->debug('Now in withValidator');
/** @var TransactionGroup $transactionGroup */
$transactionGroup = $this->route()->parameter('userGroupTransaction');
$validator->after(
function (Validator $validator) use ($transactionGroup): void {
// if more than one, verify that there are journal ID's present.
$this->validateJournalIds($validator, $transactionGroup);
// all transaction types must be equal:
$this->validateTransactionTypesForUpdate($validator);
// user wants to update a reconciled transaction.
// source, destination, amount + foreign_amount cannot be changed
// and must be omitted from the request.
$this->preventUpdateReconciled($validator, $transactionGroup);
// validate source/destination is equal, depending on the transaction journal type.
$this->validateEqualAccountsForUpdate($validator, $transactionGroup);
// see method:
// $this->preventNoAccountInfo($validator, );
// validate that the currency fits the source and/or destination account.
// validate all account info
$this->validateAccountInformationUpdate($validator, $transactionGroup);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
/**
* Get transaction data.
*
* @throws FireflyException
*/
private function getTransactionData(): array
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
$return = [];
/** @var null|array $transactions */
$transactions = $this->get('transactions');
if (!is_countable($transactions)) {
return $return;
}
/** @var null|array $transaction */
foreach ($transactions as $transaction) {
if (!is_array($transaction)) {
throw new FireflyException('Invalid data submitted: transaction is not array.');
}
// default response is to update nothing in the transaction:
$current = [];
$current = $this->getIntegerData($current, $transaction);
$current = $this->getStringData($current, $transaction);
$current = $this->getNlStringData($current, $transaction);
$current = $this->getDateData($current, $transaction);
$current = $this->getBooleanData($current, $transaction);
$current = $this->getArrayData($current, $transaction);
$current = $this->getFloatData($current, $transaction);
$return[] = $current;
}
return $return;
}
/**
* For each field, add it to the array if a reference is present in the request:
*
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getIntegerData(array $current, array $transaction): array
{
foreach ($this->integerFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->integerFromValue((string) $transaction[$fieldName]);
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getStringData(array $current, array $transaction): array
{
foreach ($this->stringFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->clearString((string) $transaction[$fieldName]);
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getNlStringData(array $current, array $transaction): array
{
foreach ($this->textareaFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->clearStringKeepNewlines((string) $transaction[$fieldName]); // keep newlines
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getDateData(array $current, array $transaction): array
{
foreach ($this->dateFields as $fieldName) {
app('log')->debug(sprintf('Now at date field %s', $fieldName));
if (array_key_exists($fieldName, $transaction)) {
app('log')->debug(sprintf('New value: "%s"', (string) $transaction[$fieldName]));
$current[$fieldName] = $this->dateFromValue((string) $transaction[$fieldName]);
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getBooleanData(array $current, array $transaction): array
{
foreach ($this->booleanFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->convertBoolean((string) $transaction[$fieldName]);
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getArrayData(array $current, array $transaction): array
{
foreach ($this->arrayFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$current[$fieldName] = $this->arrayFromValue($transaction[$fieldName]);
}
}
return $current;
}
/**
* @param array<string, string> $current
* @param array<string, mixed> $transaction
*/
private function getFloatData(array $current, array $transaction): array
{
foreach ($this->floatFields as $fieldName) {
if (array_key_exists($fieldName, $transaction)) {
$value = $transaction[$fieldName];
if (is_float($value)) {
$current[$fieldName] = sprintf('%.12f', $value);
}
if (!is_float($value)) {
$current[$fieldName] = (string) $value;
}
}
}
return $current;
}
}

View File

@@ -71,7 +71,6 @@ class EnableCurrencies extends Command
$found = [$defaultCurrency->id];
// get all meta entries
/** @var Collection $meta */
$meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
->where('accounts.user_group_id', $userGroup->id)
->where('account_meta.name', 'currency_id')->groupBy('data')->get(['data'])
@@ -108,6 +107,12 @@ class EnableCurrencies extends Command
$found[] = $entry->transaction_currency_id;
}
// also get all currencies already enabled.
$alreadyEnabled = $userGroup->currencies()->get(['transaction_currencies.id'])->pluck('id')->toArray();
foreach ($alreadyEnabled as $currencyId) {
$found[] = $currencyId;
}
$found = array_values(array_unique($found));
$found = array_values(
array_filter(

View File

@@ -182,7 +182,7 @@ trait MetaCollection
public function excludeInternalReference(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -203,7 +203,7 @@ trait MetaCollection
public function externalIdContains(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -215,7 +215,7 @@ trait MetaCollection
public function externalIdDoesNotContain(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -227,7 +227,7 @@ trait MetaCollection
public function externalIdDoesNotEnd(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -239,7 +239,7 @@ trait MetaCollection
public function externalIdDoesNotStart(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -251,7 +251,7 @@ trait MetaCollection
public function externalIdEnds(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -263,7 +263,7 @@ trait MetaCollection
public function externalIdStarts(string $externalId): GroupCollectorInterface
{
$externalId = (string) json_encode($externalId);
$externalId = (string)json_encode($externalId);
$externalId = str_replace('\\', '\\\\', trim($externalId, '"'));
$this->joinMetaDataTables();
@@ -276,7 +276,7 @@ trait MetaCollection
public function externalUrlContains(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', trim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_url');
$this->query->where('journal_meta.data', 'LIKE', sprintf('%%%s%%', $url));
@@ -287,7 +287,7 @@ trait MetaCollection
public function externalUrlDoesNotContain(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', trim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_url');
$this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s%%', $url));
@@ -298,7 +298,7 @@ trait MetaCollection
public function externalUrlDoesNotEnd(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', ltrim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_url');
$this->query->where('journal_meta.data', 'NOT LIKE', sprintf('%%%s', $url));
@@ -309,7 +309,7 @@ trait MetaCollection
public function externalUrlDoesNotStart(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', rtrim($url, '"'));
// var_dump($url);
@@ -322,7 +322,7 @@ trait MetaCollection
public function externalUrlEnds(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', ltrim($url, '"'));
$this->query->where('journal_meta.name', '=', 'external_url');
$this->query->where('journal_meta.data', 'LIKE', sprintf('%%%s', $url));
@@ -333,7 +333,7 @@ trait MetaCollection
public function externalUrlStarts(string $url): GroupCollectorInterface
{
$this->joinMetaDataTables();
$url = (string) json_encode($url);
$url = (string)json_encode($url);
$url = str_replace('\\', '\\\\', rtrim($url, '"'));
// var_dump($url);
@@ -371,7 +371,7 @@ trait MetaCollection
public function internalReferenceContains(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
// var_dump($internalReference);
// exit;
@@ -385,7 +385,7 @@ trait MetaCollection
public function internalReferenceDoesNotContain(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -397,7 +397,7 @@ trait MetaCollection
public function internalReferenceDoesNotEnd(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -409,7 +409,7 @@ trait MetaCollection
public function internalReferenceDoesNotStart(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -421,7 +421,7 @@ trait MetaCollection
public function internalReferenceEnds(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -433,7 +433,7 @@ trait MetaCollection
public function internalReferenceStarts(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -629,7 +629,7 @@ trait MetaCollection
public function setInternalReference(string $internalReference): GroupCollectorInterface
{
$internalReference = (string) json_encode($internalReference);
$internalReference = (string)json_encode($internalReference);
$internalReference = str_replace('\\', '\\\\', trim($internalReference, '"'));
$this->joinMetaDataTables();
@@ -682,6 +682,7 @@ trait MetaCollection
$list = $tags->pluck('tag')->toArray();
$list = array_map('strtolower', $list);
$filter = static function (array $object) use ($list): bool|array {
$includedJournals = [];
$return = $object;
unset($return['transactions']);
$return['transactions'] = [];
@@ -701,7 +702,12 @@ trait MetaCollection
if (in_array(strtolower($tag['name']), $list, true)) {
app('log')->debug(sprintf('Transaction has tag "%s" so count++.', $tag['name']));
++$foundTagCount;
$return['transactions'][] = $transaction;
$journalId = $transaction['transaction_journal_id'];
// #8377 prevent adding a transaction twice when multiple tag searches find this transaction
if (!in_array($journalId, $includedJournals, true)) {
$includedJournals[] = $journalId;
$return['transactions'][] = $transaction;
}
}
}
}

View File

@@ -286,7 +286,7 @@ class GroupCollector implements GroupCollectorInterface
foreach ($params as $param) {
$replace = sprintf('"%s"', $param);
if (is_int($param)) {
$replace = (string) $param;
$replace = (string)$param;
}
$pos = strpos($query, '?');
if (false !== $pos) {
@@ -692,13 +692,13 @@ class GroupCollector implements GroupCollectorInterface
/** @var TransactionJournal $augumentedJournal */
foreach ($collection as $augumentedJournal) {
$groupId = (int) $augumentedJournal->transaction_group_id;
$groupId = (int)$augumentedJournal->transaction_group_id;
if (!array_key_exists($groupId, $groups)) {
// make new array
$parsedGroup = $this->parseAugmentedJournal($augumentedJournal);
$groupArray = [
'id' => (int) $augumentedJournal->transaction_group_id,
'id' => (int)$augumentedJournal->transaction_group_id,
'user_id' => $augumentedJournal->user_id,
'user_group_id' => $augumentedJournal->user_group_id,
// Field transaction_group_title was added by the query.
@@ -711,7 +711,7 @@ class GroupCollector implements GroupCollectorInterface
'transactions' => [],
];
// Field transaction_journal_id was added by the query.
$journalId = (int) $augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
$journalId = (int)$augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
$groupArray['transactions'][$journalId] = $parsedGroup;
$groups[$groupId] = $groupArray;
@@ -719,7 +719,7 @@ class GroupCollector implements GroupCollectorInterface
}
// or parse the rest.
// Field transaction_journal_id was added by the query.
$journalId = (int) $augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
$journalId = (int)$augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
if (array_key_exists($journalId, $groups[$groupId]['transactions'])) {
// append data to existing group + journal (for multiple tags or multiple attachments)
$groups[$groupId]['transactions'][$journalId] = $this->mergeTags($groups[$groupId]['transactions'][$journalId], $augumentedJournal);
@@ -772,7 +772,7 @@ class GroupCollector implements GroupCollectorInterface
$dates = ['interest_date', 'payment_date', 'invoice_date', 'book_date', 'due_date', 'process_date'];
if (array_key_exists('meta_name', $result) && in_array($result['meta_name'], $dates, true)) {
$name = $result['meta_name'];
if (array_key_exists('meta_data', $result) && '' !== (string) $result['meta_data']) {
if (array_key_exists('meta_data', $result) && '' !== (string)$result['meta_data']) {
$result[$name] = Carbon::createFromFormat('!Y-m-d', substr(json_decode($result['meta_data']), 0, 10));
}
}
@@ -783,9 +783,9 @@ class GroupCollector implements GroupCollectorInterface
// convert back to strings because SQLite is dumb like that.
$result = $this->convertToStrings($result);
$result['reconciled'] = 1 === (int) $result['reconciled'];
$result['reconciled'] = 1 === (int)$result['reconciled'];
if (array_key_exists('tag_id', $result) && null !== $result['tag_id']) { // assume the other fields are present as well.
$tagId = (int) $augumentedJournal['tag_id'];
$tagId = (int)$augumentedJournal['tag_id'];
$tagDate = null;
try {
@@ -795,7 +795,7 @@ class GroupCollector implements GroupCollectorInterface
}
$result['tags'][$tagId] = [
'id' => (int) $result['tag_id'],
'id' => (int)$result['tag_id'],
'name' => $result['tag_name'],
'date' => $tagDate,
'description' => $result['tag_description'],
@@ -804,8 +804,8 @@ class GroupCollector implements GroupCollectorInterface
// also merge attachments:
if (array_key_exists('attachment_id', $result)) {
$uploaded = 1 === (int) $result['attachment_uploaded'];
$attachmentId = (int) $augumentedJournal['attachment_id'];
$uploaded = 1 === (int)$result['attachment_uploaded'];
$attachmentId = (int)$augumentedJournal['attachment_id'];
if (0 !== $attachmentId && $uploaded) {
$result['attachments'][$attachmentId] = [
'id' => $attachmentId,
@@ -831,7 +831,7 @@ class GroupCollector implements GroupCollectorInterface
private function convertToInteger(array $array): array
{
foreach ($this->integerFields as $field) {
$array[$field] = array_key_exists($field, $array) ? (int) $array[$field] : null;
$array[$field] = array_key_exists($field, $array) ? (int)$array[$field] : null;
}
return $array;
@@ -840,7 +840,7 @@ class GroupCollector implements GroupCollectorInterface
private function convertToStrings(array $array): array
{
foreach ($this->stringFields as $field) {
$array[$field] = array_key_exists($field, $array) && null !== $array[$field] ? (string) $array[$field] : null;
$array[$field] = array_key_exists($field, $array) && null !== $array[$field] ? (string)$array[$field] : null;
}
return $array;
@@ -850,7 +850,7 @@ class GroupCollector implements GroupCollectorInterface
{
$newArray = $newJournal->toArray();
if (array_key_exists('tag_id', $newArray)) { // assume the other fields are present as well.
$tagId = (int) $newJournal['tag_id'];
$tagId = (int)$newJournal['tag_id'];
$tagDate = null;
@@ -861,7 +861,7 @@ class GroupCollector implements GroupCollectorInterface
}
$existingJournal['tags'][$tagId] = [
'id' => (int) $newArray['tag_id'],
'id' => (int)$newArray['tag_id'],
'name' => $newArray['tag_name'],
'date' => $tagDate,
'description' => $newArray['tag_description'],
@@ -875,7 +875,7 @@ class GroupCollector implements GroupCollectorInterface
{
$newArray = $newJournal->toArray();
if (array_key_exists('attachment_id', $newArray)) {
$attachmentId = (int) $newJournal['attachment_id'];
$attachmentId = (int)$newJournal['attachment_id'];
$existingJournal['attachments'][$attachmentId] = [
'id' => $attachmentId,
@@ -894,7 +894,7 @@ class GroupCollector implements GroupCollectorInterface
foreach ($groups as $groudId => $group) {
/** @var array $transaction */
foreach ($group['transactions'] as $transaction) {
$currencyId = (int) $transaction['currency_id'];
$currencyId = (int)$transaction['currency_id'];
if (null === $transaction['amount']) {
throw new FireflyException(sprintf('Amount is NULL for a transaction in group #%d, please investigate.', $groudId));
}
@@ -910,7 +910,7 @@ class GroupCollector implements GroupCollectorInterface
$groups[$groudId]['sums'][$currencyId]['amount'] = bcadd($groups[$groudId]['sums'][$currencyId]['amount'], $transaction['amount']);
if (null !== $transaction['foreign_amount'] && null !== $transaction['foreign_currency_id']) {
$currencyId = (int) $transaction['foreign_currency_id'];
$currencyId = (int)$transaction['foreign_currency_id'];
// set default:
if (!array_key_exists($currencyId, $groups[$groudId]['sums'])) {
@@ -931,7 +931,6 @@ class GroupCollector implements GroupCollectorInterface
private function postFilterCollection(Collection $collection): Collection
{
$currentCollection = $collection;
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection)));
/**

View File

@@ -161,7 +161,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($account, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string) trans('firefly.no_att_demo_user'));
}

View File

@@ -187,7 +187,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($account, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string) trans('firefly.no_att_demo_user'));
}

View File

@@ -78,7 +78,7 @@ class LoginController extends Controller
public function login(Request $request): JsonResponse|RedirectResponse
{
Log::channel('audit')->info(sprintf('User is trying to login using "%s"', $request->get($this->username())));
app('log')->info('User is trying to login.');
app('log')->debug('User is trying to login.');
$this->validateLogin($request);
app('log')->debug('Login data is present.');
@@ -88,7 +88,7 @@ class LoginController extends Controller
// the login attempts for this application. We'll key this by the username and
// the IP address of the client making these requests into this application.
if ($this->hasTooManyLoginAttempts($request)) {
Log::channel('audit')->info(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
Log::channel('audit')->warning(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
app('log')->error(sprintf('Login for user "%s" was locked out.', $request->get($this->username())));
$this->fireLockoutEvent($request);
@@ -114,7 +114,7 @@ class LoginController extends Controller
// to login and redirect the user back to the login form. Of course, when this
// user surpasses their maximum number of attempts they will get locked out.
$this->incrementLoginAttempts($request);
Log::channel('audit')->info(sprintf('Login failed. Attempt for user "%s" failed.', $request->get($this->username())));
Log::channel('audit')->warning(sprintf('Login failed. Attempt for user "%s" failed.', $request->get($this->username())));
$this->sendFailedLoginResponse($request);

View File

@@ -116,7 +116,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($bill, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -128,7 +128,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($bill, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string) trans('firefly.no_att_demo_user'));
}

View File

@@ -202,7 +202,9 @@ class BudgetLimitController extends Controller
if ('' === $amount) {
$amount = '0';
}
if ((int)$amount > 268435456) { // 268 million, intentional integer
$amount = '268435456';
}
// sanity check on amount:
if (0 === bccomp($amount, '0')) {
$budgetId = $budgetLimit->budget_id;
@@ -217,9 +219,7 @@ class BudgetLimitController extends Controller
return response()->json($array);
}
if ((int)$amount > 268435456) { // 268 million, intentional integer
$amount = '268435456';
}
if (-1 === bccomp($amount, '0')) {
$amount = bcmul($amount, '-1');
}

View File

@@ -127,7 +127,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($budget, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -137,7 +137,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($budget, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -100,7 +100,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($category, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -104,7 +104,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($category, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -108,7 +108,7 @@ class ReportController extends Controller
continue;
}
$currencyId = $netWorthItem['currency_id'];
$label = $current->isoFormat((string) trans('config.month_and_day_js', [], $locale));
$label = $current->isoFormat((string)trans('config.month_and_day_js', [], $locale));
if (!array_key_exists($currencyId, $chartData)) {
$chartData[$currencyId] = [
'label' => 'Net worth in '.$netWorthItem['currency_name'],
@@ -145,6 +145,7 @@ class ReportController extends Controller
if ($cache->has()) {
return response()->json($cache->get());
}
app('log')->debug('Going to do operations for accounts ', $accounts->pluck('id')->toArray());
$format = app('navigation')->preferredCarbonFormat($start, $end);
$titleFormat = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
@@ -164,13 +165,13 @@ class ReportController extends Controller
/** @var array $journal */
foreach ($journals as $journal) {
$period = $journal['date']->format($format);
$currencyId = (int) $journal['currency_id'];
$currencyId = (int)$journal['currency_id'];
$data[$currencyId] ??= [
'currency_id' => $currencyId,
'currency_symbol' => $journal['currency_symbol'],
'currency_code' => $journal['currency_code'],
'currency_name' => $journal['currency_name'],
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
'currency_decimal_places' => (int)$journal['currency_decimal_places'],
];
$data[$currencyId][$period] ??= [
'period' => $period,
@@ -193,7 +194,7 @@ class ReportController extends Controller
/** @var array $currency */
foreach ($data as $currency) {
$income = [
'label' => (string) trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
'type' => 'bar',
'backgroundColor' => 'rgba(0, 141, 76, 0.5)', // green
'currency_id' => $currency['currency_id'],
@@ -202,7 +203,7 @@ class ReportController extends Controller
'entries' => [],
];
$expense = [
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'type' => 'bar',
'backgroundColor' => 'rgba(219, 68, 55, 0.5)', // red
'currency_id' => $currency['currency_id'],
@@ -212,7 +213,13 @@ class ReportController extends Controller
];
// loop all possible periods between $start and $end
$currentStart = clone $start;
while ($currentStart <= $end) {
$currentEnd = clone $end;
// #8374. Sloppy fix for yearly charts. Not really interested in a better fix with v2 layout and all.
if ('1Y' === $preferredRange) {
$currentEnd = app('navigation')->endOfPeriod($currentEnd, $preferredRange);
}
while ($currentStart <= $currentEnd) {
$key = $currentStart->format($format);
$title = $currentStart->isoFormat($titleFormat);
$income['entries'][$title] = app('steam')->bcround($currency[$key]['earned'] ?? '0', $currency['currency_decimal_places']);

View File

@@ -30,6 +30,7 @@ use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Support\Export\ExportDataGenerator;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Response as LaravelResponse;
use Illuminate\View\View;
@@ -63,8 +64,14 @@ class IndexController extends Controller
/**
* @throws FireflyException
*/
public function export(): LaravelResponse
public function export(): LaravelResponse|RedirectResponse
{
if(auth()->user()->hasRole('demo')) {
session()->flash('info', (string) trans('firefly.demo_user_export'));
return redirect(route('export.index'));
}
/** @var ExportDataGenerator $generator */
$generator = app(ExportDataGenerator::class);
$generator->setUser(auth()->user());

View File

@@ -36,6 +36,7 @@ use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
use FireflyIII\Repositories\UserGroups\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse;
/**
@@ -43,6 +44,8 @@ use Illuminate\Http\JsonResponse;
*/
class BoxController extends Controller
{
use DateCalculation;
/**
* This box has three types of info to display:
* 0) If the user has available amount this period and has overspent: overspent box.
@@ -122,12 +125,12 @@ class BoxController extends Controller
// calculate with available budget.
$leftToSpendAmount = bcadd($totalAvailableSum, $spentAmount);
app('log')->debug(sprintf('So left to spend is %s', $leftToSpendAmount));
if (1 === bccomp($leftToSpendAmount, '0')) {
app('log')->debug('Left to spend is positive!');
if (bccomp($leftToSpendAmount, '0') >= 0) {
app('log')->debug('Left to spend is positive or zero!');
$boxTitle = (string)trans('firefly.left_to_spend');
$days = $today->diffInDays($end) + 1;
$activeDaysLeft = $this->activeDaysLeft($start, $end); // see method description.
$display = 1; // not overspent
$leftPerDayAmount = bcdiv($leftToSpendAmount, (string)$days);
$leftPerDayAmount = bcdiv($leftToSpendAmount, (string)$activeDaysLeft);
app('log')->debug(sprintf('Left to spend per day is %s', $leftPerDayAmount));
}
}

View File

@@ -107,7 +107,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($piggyBank, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -127,7 +127,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($piggyBank, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -243,7 +243,7 @@ class CreateController extends Controller
$this->attachments->saveAttachmentsForModel($recurrence, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -181,7 +181,7 @@ class EditController extends Controller
$this->attachments->saveAttachmentsForModel($recurrence, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -136,9 +136,13 @@ class SelectController extends Controller
}
foreach ($textTriggers as $textTrigger) {
$needsContext = config(sprintf('search.operators.%s.needs_context', $textTrigger['type'])) ?? true;
$trigger = new RuleTrigger();
$trigger->trigger_type = $textTrigger['type'];
$trigger->trigger_value = $textTrigger['value'];
if(false === $needsContext) {
$trigger->trigger_value = 'true';
}
$trigger->stop_processing = $textTrigger['stop_processing'];
if ($textTrigger['prohibited']) {
$trigger->trigger_type = sprintf('-%s', $textTrigger['type']);

View File

@@ -305,7 +305,7 @@ class TagController extends Controller
$this->attachmentsHelper->saveAttachmentsForModel($result, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}
@@ -340,7 +340,7 @@ class TagController extends Controller
$this->attachmentsHelper->saveAttachmentsForModel($tag, $files);
}
if (null !== $files && auth()->user()->hasRole('demo')) {
Log::channel('audit')->info(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
Log::channel('audit')->warning(sprintf('The demo user is trying to upload attachments in %s.', __METHOD__));
session()->flash('info', (string)trans('firefly.no_att_demo_user'));
}

View File

@@ -106,7 +106,7 @@ class EditController extends Controller
$optionalFields['location'] ??= false;
$optionalFields['location'] = $optionalFields['location'] && true === config('firefly.enable_external_map');
// map info:
// map info voor v2:
$longitude = config('firefly.default_location.longitude');
$latitude = config('firefly.default_location.latitude');
$zoomLevel = config('firefly.default_location.zoom_level');

View File

@@ -75,45 +75,52 @@ class IndexController extends Controller
$objectType = 'transfer';
}
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int)$request->get('page');
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
if (null === $start) {
$start = session('start');
$end = session('end');
// add a split for the (future) v2 release.
$periods = [];
$groups = [];
$subTitle = 'TODO page subtitle in v2';
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int)$request->get('page');
$pageSize = (int)app('preferences')->get('listPageSize', 50)->data;
if ('v2' !== (string)config('firefly.layout')) {
if (null === $start) {
$start = session('start');
$end = session('end');
}
if (null === $end) {
// get last transaction ever?
$last = $this->repository->getLast();
$end = null !== $last ? $last->date : session('end');
}
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
$startStr = $start->isoFormat($this->monthAndDayFormat);
$endStr = $end->isoFormat($this->monthAndDayFormat);
$subTitle = (string)trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$path = route('transactions.index', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$firstJournal = $this->repository->firstNull();
$startPeriod = null === $firstJournal ? new Carbon() : $firstJournal->date;
$endPeriod = clone $end;
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setRange($start, $end)
->setTypes($types)
->setLimit($pageSize)
->setPage($page)
->withBudgetInformation()
->withCategoryInformation()
->withAccountInformation()
->withAttachmentInformation()
;
$groups = $collector->getPaginatedGroups();
$groups->setPath($path);
}
if (null === $end) {
// get last transaction ever?
$last = $this->repository->getLast();
$end = null !== $last ? $last->date : session('end');
}
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
$path = route('transactions.index', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$startStr = $start->isoFormat($this->monthAndDayFormat);
$endStr = $end->isoFormat($this->monthAndDayFormat);
$subTitle = (string)trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$firstJournal = $this->repository->firstNull();
$startPeriod = null === $firstJournal ? new Carbon() : $firstJournal->date;
$endPeriod = clone $end;
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setRange($start, $end)
->setTypes($types)
->setLimit($pageSize)
->setPage($page)
->withBudgetInformation()
->withCategoryInformation()
->withAccountInformation()
->withAttachmentInformation()
;
$groups = $collector->getPaginatedGroups();
$groups->setPath($path);
return view('transactions.index', compact('subTitle', 'objectType', 'subTitleIcon', 'groups', 'periods', 'start', 'end'));
}

View File

@@ -105,7 +105,7 @@ class CreateController extends Controller
$data = $request->getCurrencyData();
if (!$this->userRepository->hasRole($user, 'owner')) {
app('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')->warning('Tried to create (POST) currency without admin rights.', $data);
return redirect($this->getPreviousUrl('currencies.create.url'))->withInput();
}
@@ -116,7 +116,7 @@ class CreateController extends Controller
$currency = $this->repository->store($data);
} catch (FireflyException $e) {
app('log')->error($e->getMessage());
Log::channel('audit')->info('Could not store (POST) currency without admin rights.', $data);
Log::channel('audit')->warning('Could not store (POST) currency without admin rights.', $data);
$request->session()->flash('error', (string)trans('firefly.could_not_store_currency'));
$currency = null;
}

View File

@@ -74,7 +74,7 @@ class DeleteController extends Controller
$user = auth()->user();
if (!$this->userRepository->hasRole($user, 'owner')) {
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
Log::channel('audit')->info(sprintf('Tried to visit page to delete currency %s but is not site owner.', $currency->code));
Log::channel('audit')->warning(sprintf('Tried to visit page to delete currency %s but is not site owner.', $currency->code));
return redirect(route('currencies.index'));
}
@@ -83,7 +83,7 @@ class DeleteController extends Controller
$location = $this->repository->currencyInUseAt($currency);
$message = (string)trans(sprintf('firefly.cannot_disable_currency_%s', $location), ['name' => e($currency->name)]);
$request->session()->flash('error', $message);
Log::channel('audit')->info(sprintf('Tried to visit page to delete currency %s but currency is in use.', $currency->code));
Log::channel('audit')->warning(sprintf('Tried to visit page to delete currency %s but currency is in use.', $currency->code));
return redirect(route('currencies.index'));
}
@@ -107,7 +107,7 @@ class DeleteController extends Controller
$user = auth()->user();
if (!$this->userRepository->hasRole($user, 'owner')) {
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
Log::channel('audit')->info(sprintf('Tried to delete currency %s but is not site owner.', $currency->code));
Log::channel('audit')->warning(sprintf('Tried to delete currency %s but is not site owner.', $currency->code));
return redirect(route('currencies.index'));
}

View File

@@ -72,7 +72,7 @@ class EditController extends Controller
$user = auth()->user();
if (!$this->userRepository->hasRole($user, 'owner')) {
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
Log::channel('audit')->info(sprintf('Tried to edit currency %s but is not owner.', $currency->code));
Log::channel('audit')->warning(sprintf('Tried to edit currency %s but is not owner.', $currency->code));
return redirect(route('currencies.index'));
}
@@ -120,7 +120,7 @@ class EditController extends Controller
if (!$this->userRepository->hasRole($user, 'owner')) {
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
Log::channel('audit')->info('Tried to update (POST) currency without admin rights.', $data);
Log::channel('audit')->warning('Tried to update (POST) currency without admin rights.', $data);
return redirect(route('currencies.index'));
}

View File

@@ -60,7 +60,7 @@ class CreateController extends Controller
public function index()
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info('User visits webhook create page, but webhooks are DISABLED.');
Log::channel('audit')->warning('User visits webhook create page, but webhooks are DISABLED.');
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -64,7 +64,7 @@ class DeleteController extends Controller
public function index(Webhook $webhook)
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info('User visits webhook delete page, but webhooks are DISABLED.');
Log::channel('audit')->warning('User visits webhook delete page, but webhooks are DISABLED.');
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -63,7 +63,7 @@ class EditController extends Controller
public function index(Webhook $webhook)
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info('User visits webhook edit page, but webhooks are DISABLED.');
Log::channel('audit')->warning('User visits webhook edit page, but webhooks are DISABLED.');
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -56,7 +56,7 @@ class IndexController extends Controller
public function index()
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info('User visits webhook index page, but webhooks are DISABLED.');
Log::channel('audit')->warning('User visits webhook index page, but webhooks are DISABLED.');
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -63,7 +63,7 @@ class ShowController extends Controller
public function index(Webhook $webhook)
{
if(false === config('firefly.allow_webhooks')) {
Log::channel('audit')->info(sprintf('User visits webhook #%d page, but webhooks are DISABLED.', $webhook->id));
Log::channel('audit')->warning(sprintf('User visits webhook #%d page, but webhooks are DISABLED.', $webhook->id));
throw new NotFoundHttpException('Webhooks are not enabled.');
}

View File

@@ -32,6 +32,8 @@ use FireflyIII\Support\Request\AppendsLocationData;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class AccountFormRequest.
@@ -131,4 +133,11 @@ class AccountFormRequest extends FormRequest
return $rules;
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -26,6 +26,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class AttachmentFormRequest.
@@ -57,4 +59,11 @@ class AttachmentFormRequest extends FormRequest
'notes' => 'min:1|max:32768|nullable',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,8 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class BillStoreRequest.
@@ -77,4 +79,11 @@ class BillStoreRequest extends FormRequest
'active' => 'boolean',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -28,6 +28,8 @@ use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class BillUpdateRequest.
@@ -81,4 +83,11 @@ class BillUpdateRequest extends FormRequest
'notes' => 'min:1|max:32768|nullable',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -76,15 +76,15 @@ class BudgetFormStoreRequest extends FormRequest
*/
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error('Validation errors for budget', $validator->errors()->toArray());
}
$validator->after(
function (Validator $validator): void {
// validate all account info
$this->validateAutoBudgetAmount($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -29,6 +29,7 @@ use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use FireflyIII\Validation\AutoBudget\ValidatesAutoBudgetRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
@@ -91,5 +92,8 @@ class BudgetFormUpdateRequest extends FormRequest
$this->validateAutoBudgetAmount($validator);
}
);
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -26,6 +26,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Rules\IsValidPositiveAmount;
use FireflyIII\Support\Request\ChecksLogin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class BudgetIncomeRequest.
@@ -46,4 +48,11 @@ class BudgetIncomeRequest extends FormRequest
'end' => 'required|date|after:start',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -26,6 +26,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class MassEditBulkJournalRequest.
@@ -46,4 +48,11 @@ class BulkEditJournalRequest extends FormRequest
'tags_action' => 'in:no_nothing,do_replace,do_append',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,8 @@ use FireflyIII\Models\Category;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class CategoryFormRequest.
@@ -67,4 +69,11 @@ class CategoryFormRequest extends FormRequest
'notes' => 'min:1|max:32768|nullable',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -25,6 +25,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class ConfigurationRequest.
@@ -55,4 +57,11 @@ class ConfigurationRequest extends FormRequest
'is_demo_site' => 'min:0|max:1|numeric',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,8 @@ use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class CurrencyFormRequest.
@@ -79,4 +81,11 @@ class CurrencyFormRequest extends FormRequest
return $rules;
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -25,6 +25,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class DeleteAccountFormRequest.
@@ -43,4 +45,11 @@ class DeleteAccountFormRequest extends FormRequest
'password' => 'required',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -26,6 +26,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class EmailFormRequest.
@@ -45,4 +47,11 @@ class EmailFormRequest extends FormRequest
'email' => 'required|email',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,8 @@ namespace FireflyIII\Http\Requests;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class InviteUserFormRequest
@@ -45,4 +47,11 @@ class InviteUserFormRequest extends FormRequest
'invited_user' => 'required|email|unique:invited_users,email',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

View File

@@ -27,6 +27,8 @@ use FireflyIII\Models\LinkType;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Log;
use Illuminate\Validation\Validator;
/**
* Class JournalLink.
@@ -74,4 +76,11 @@ class JournalLinkRequest extends FormRequest
'opposing' => 'belongsToUser:transaction_journals',
];
}
public function withValidator(Validator $validator): void
{
if($validator->fails()) {
Log::channel('audit')->error(sprintf('Validation errors in %s', __CLASS__), $validator->errors()->toArray());
}
}
}

Some files were not shown because too many files have changed in this diff Show More