mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-10 07:19:42 +00:00
Compare commits
83 Commits
export-202
...
phpstan-fi
Author | SHA1 | Date | |
---|---|---|---|
70871176fc
|
|||
4b2c330d22
|
|||
aa41070a66
|
|||
070e153263
|
|||
264a6ef43e
|
|||
584ac05b53
|
|||
856eea37ee
|
|||
a01cc23c14
|
|||
344a65e99d
|
|||
c64ec89274 | |||
16ec858ee8 | |||
de55ff920f
|
|||
885256ac0d
|
|||
f53d3852c3 | |||
9f5b11e6cc | |||
e5bc74d11d | |||
5c0d89a88b | |||
56a17a0bcd | |||
9ffe1ff8a8 | |||
c790b22496 | |||
e54c2ca712 | |||
9ada19ef23 | |||
8ee184e665 | |||
c5f842076f | |||
f9b151e4db | |||
2c360e979b
|
|||
459df26fef
|
|||
e36d2a5eec
|
|||
0301641290
|
|||
5c413edb32
|
|||
06238c8355
|
|||
6b90a7d2a7
|
|||
de5f818c5a | |||
c4eb45edcc | |||
99482edf0d
|
|||
e87f0bf348
|
|||
bd324753f3
|
|||
7915aae86f
|
|||
4fec18f3aa
|
|||
583d7b24ba
|
|||
4a56c4c945
|
|||
239a978adb
|
|||
b2dec3e587
|
|||
6bba6f68b3
|
|||
164beb3ca9
|
|||
25dd65fbd8
|
|||
e99fb75ebd
|
|||
08ddbee6af
|
|||
a2b2cafbce
|
|||
a913d2820d
|
|||
34296e7841
|
|||
a34c102c4b
|
|||
c1c92dc296
|
|||
e542ebe531
|
|||
77e4b1d4ff
|
|||
b23019cb3a
|
|||
1fad0f88a4
|
|||
2deed644b6 | |||
5211d092e3 | |||
ac084a1309 | |||
2ca3cced2e | |||
f17c08f530 | |||
2a9ebe436e | |||
6ab5e708ec | |||
7abecdea02 | |||
2be8aefb38 | |||
ff930e94f6 | |||
38ff46f03f | |||
9f00754eb7 | |||
0f7d4ce5ee | |||
1eb1e2ec24 | |||
52512e45fc | |||
49380f5f61 | |||
ff7f5a5dd3 | |||
fb8f74119f | |||
34602d0a56 | |||
43a4576ed4 | |||
a32d20e320 | |||
7e6ef3dafe | |||
7e06d7beed | |||
8e65b3851a | |||
5a93e21758 | |||
368846e09b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@ composer
|
|||||||
composer.phar
|
composer.phar
|
||||||
composer.lock
|
composer.lock
|
||||||
docs/build/
|
docs/build/
|
||||||
|
node_modules/*
|
||||||
.php_cs.cache
|
.php_cs.cache
|
||||||
|
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
|
@@ -9,13 +9,24 @@ declare(strict_types=1);
|
|||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php73/php_cs_fixer.config.php';
|
$finder = PhpCsFixer\Finder::create();
|
||||||
|
|
||||||
$config
|
$finder
|
||||||
->getFinder()
|
->in(__DIR__.'/src')
|
||||||
->ignoreDotFiles(false)
|
->append([__FILE__])
|
||||||
|
->exclude(['docs/', 'tests/app'])
|
||||||
->notPath('tests/app')
|
->notPath('tests/app')
|
||||||
->name(['.php_cs.dist.php']);
|
->ignoreDotFiles(true)
|
||||||
|
->name('**.php')
|
||||||
|
;
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
$config
|
||||||
|
->setFinder($finder)
|
||||||
|
->setRiskyAllowed(true)
|
||||||
|
->setCacheFile('.php_cs.cache')
|
||||||
|
->setUsingCache(true)
|
||||||
|
;
|
||||||
|
|
||||||
$rules = $config->getRules();
|
$rules = $config->getRules();
|
||||||
|
|
||||||
@@ -68,9 +79,15 @@ $riskyRules = [
|
|||||||
// 'psr_autoloading' => false,
|
// 'psr_autoloading' => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$untilFullSwitchToPhp8 = [
|
||||||
|
'blank_line_between_import_groups' => false,
|
||||||
|
'declare_strict_types' => true,
|
||||||
|
];
|
||||||
|
|
||||||
$rules = array_merge(
|
$rules = array_merge(
|
||||||
$rules,
|
$rules,
|
||||||
$riskyRules
|
$riskyRules,
|
||||||
|
$untilFullSwitchToPhp8,
|
||||||
);
|
);
|
||||||
|
|
||||||
$rules['header_comment']['header'] = trim(file_get_contents(__DIR__ . '/resource/header.txt'));
|
$rules['header_comment']['header'] = trim(file_get_contents(__DIR__ . '/resource/header.txt'));
|
@@ -8,19 +8,23 @@
|
|||||||
"social worker"
|
"social worker"
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^7.4",
|
"php": "^7.4|^8.2",
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-openssl": "*",
|
||||||
|
"ext-redis": "*",
|
||||||
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
"champs-libres/async-uploader-bundle": "dev-sf4#d57134aee8e504a83c902ff0cf9f8d36ac418290",
|
||||||
"champs-libres/wopi-bundle": "dev-master#6dd8e0a14e00131eb4b889ecc30270ee4a0e5224",
|
"champs-libres/wopi-bundle": "dev-master@dev",
|
||||||
"champs-libres/wopi-lib": "dev-master#8615f4a45a39fc2b6a98765ea835fcfd39618787",
|
"champs-libres/wopi-lib": "dev-master@dev",
|
||||||
"doctrine/doctrine-bundle": "^2.1",
|
"doctrine/doctrine-bundle": "^2.1",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.0",
|
"doctrine/doctrine-migrations-bundle": "^3.0",
|
||||||
"doctrine/orm": "^2.7",
|
"doctrine/orm": "^2.13.0",
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"graylog2/gelf-php": "^1.5",
|
"graylog2/gelf-php": "^1.5",
|
||||||
"knplabs/knp-menu-bundle": "^3.0",
|
"knplabs/knp-menu-bundle": "^3.0",
|
||||||
"knplabs/knp-time-bundle": "^1.12",
|
"knplabs/knp-time-bundle": "^1.12",
|
||||||
"knpuniversity/oauth2-client-bundle": "^2.10",
|
"knpuniversity/oauth2-client-bundle": "^2.10",
|
||||||
"league/csv": "^9.7.1",
|
"league/csv": "^9.7.1",
|
||||||
|
"lexik/jwt-authentication-bundle": "^2.16",
|
||||||
"nyholm/psr7": "^1.4",
|
"nyholm/psr7": "^1.4",
|
||||||
"ocramius/package-versions": "^1.10 || ^2",
|
"ocramius/package-versions": "^1.10 || ^2",
|
||||||
"odolbeau/phone-number-bundle": "^3.6",
|
"odolbeau/phone-number-bundle": "^3.6",
|
||||||
@@ -29,12 +33,12 @@
|
|||||||
"ramsey/uuid-doctrine": "^1.7",
|
"ramsey/uuid-doctrine": "^1.7",
|
||||||
"sensio/framework-extra-bundle": "^5.5",
|
"sensio/framework-extra-bundle": "^5.5",
|
||||||
"spomky-labs/base64url": "^2.0",
|
"spomky-labs/base64url": "^2.0",
|
||||||
"symfony/asset": "^4.4",
|
|
||||||
"symfony/browser-kit": "^4.4",
|
"symfony/browser-kit": "^4.4",
|
||||||
"symfony/css-selector": "^4.4",
|
"symfony/css-selector": "^4.4",
|
||||||
"symfony/expression-language": "^4.4",
|
"symfony/expression-language": "^4.4",
|
||||||
"symfony/form": "^4.4",
|
"symfony/form": "^4.4",
|
||||||
"symfony/framework-bundle": "^4.4",
|
"symfony/framework-bundle": "^4.4",
|
||||||
|
"symfony/http-client": "^4.4 || ^5",
|
||||||
"symfony/http-foundation": "^4.4",
|
"symfony/http-foundation": "^4.4",
|
||||||
"symfony/intl": "^4.4",
|
"symfony/intl": "^4.4",
|
||||||
"symfony/mailer": "^5.4",
|
"symfony/mailer": "^5.4",
|
||||||
@@ -48,7 +52,6 @@
|
|||||||
"symfony/translation": "^4.4",
|
"symfony/translation": "^4.4",
|
||||||
"symfony/twig-bundle": "^4.4",
|
"symfony/twig-bundle": "^4.4",
|
||||||
"symfony/validator": "^4.4",
|
"symfony/validator": "^4.4",
|
||||||
"symfony/web-link": "*",
|
|
||||||
"symfony/webpack-encore-bundle": "^1.11",
|
"symfony/webpack-encore-bundle": "^1.11",
|
||||||
"symfony/workflow": "^4.4",
|
"symfony/workflow": "^4.4",
|
||||||
"symfony/yaml": "^4.4",
|
"symfony/yaml": "^4.4",
|
||||||
@@ -61,19 +64,24 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/doctrine-fixtures-bundle": "^3.3",
|
"doctrine/doctrine-fixtures-bundle": "^3.3",
|
||||||
"drupol/php-conventions": "^5",
|
|
||||||
"fakerphp/faker": "^1.13",
|
"fakerphp/faker": "^1.13",
|
||||||
|
"jangregor/phpstan-prophecy": "^1.0",
|
||||||
"nelmio/alice": "^3.8",
|
"nelmio/alice": "^3.8",
|
||||||
"phpspec/prophecy-phpunit": "^2.0",
|
"phpspec/prophecy-phpunit": "^2.0",
|
||||||
|
"phpstan/extension-installer": "^1.2",
|
||||||
|
"phpstan/phpstan": "^1.9",
|
||||||
|
"phpstan/phpstan-deprecation-rules": "^1.1",
|
||||||
"phpstan/phpstan-strict-rules": "^1.0",
|
"phpstan/phpstan-strict-rules": "^1.0",
|
||||||
"phpunit/phpunit": ">= 7.5",
|
"phpunit/phpunit": ">= 7.5",
|
||||||
|
"psalm/plugin-phpunit": "^0.18.4",
|
||||||
|
"psalm/plugin-symfony": "^4.0.2",
|
||||||
"symfony/debug-bundle": "^5.1",
|
"symfony/debug-bundle": "^5.1",
|
||||||
"symfony/dotenv": "^4.4",
|
"symfony/dotenv": "^4.4",
|
||||||
"symfony/maker-bundle": "^1.20",
|
"symfony/maker-bundle": "^1.20",
|
||||||
"symfony/phpunit-bridge": "^4.4",
|
"symfony/phpunit-bridge": "^4.4",
|
||||||
"symfony/stopwatch": "^4.4",
|
"symfony/stopwatch": "^4.4",
|
||||||
"symfony/var-dumper": "^4.4",
|
"symfony/var-dumper": "^4.4",
|
||||||
"symfony/web-profiler-bundle": "^4.4"
|
"vimeo/psalm": "^4.30.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/symfony": "*"
|
"symfony/symfony": "*"
|
||||||
|
40
grumphp.yml
40
grumphp.yml
@@ -1,40 +0,0 @@
|
|||||||
imports:
|
|
||||||
- {
|
|
||||||
resource: tests/app/vendor/drupol/php-conventions/config/php73/grumphp.yml,
|
|
||||||
}
|
|
||||||
|
|
||||||
parameters:
|
|
||||||
tasks.phpcsfixer.config: .php_cs.dist.php
|
|
||||||
tasks.license.name: AGPL-3.0
|
|
||||||
tasks.license.holder: Champs-Libres
|
|
||||||
tasks.license.date_from: 2001
|
|
||||||
|
|
||||||
tasks.phpcsfixer.allow_risky: true
|
|
||||||
tasks.phpcsfixer.diff: true
|
|
||||||
tasks.phpstan.level: 1
|
|
||||||
tasks.phpstan.blocking: true
|
|
||||||
tasks.phpstan.ignore_patterns:
|
|
||||||
- "/.github/"
|
|
||||||
- "/.idea/"
|
|
||||||
- "/build/"
|
|
||||||
- "/benchmarks/"
|
|
||||||
- "/docs/"
|
|
||||||
- "/node_modules/"
|
|
||||||
- "/resource/"
|
|
||||||
- "/spec/"
|
|
||||||
- "/var/"
|
|
||||||
- "/vendor/"
|
|
||||||
- "/tests/app"
|
|
||||||
|
|
||||||
# Psalm
|
|
||||||
tasks.psalm.blocking: true
|
|
||||||
tasks.psalm.ignore_patterns:
|
|
||||||
- "/.github/"
|
|
||||||
- "/.idea/"
|
|
||||||
- "/build/"
|
|
||||||
- "/benchmarks/"
|
|
||||||
- "/node_modules/"
|
|
||||||
- "/resource/"
|
|
||||||
- "/spec/"
|
|
||||||
- "/var/"
|
|
||||||
- "/vendor/"
|
|
306
phpstan-baseline-level-2.neon
Normal file
306
phpstan-baseline-level-2.neon
Normal file
@@ -0,0 +1,306 @@
|
|||||||
|
parameters:
|
||||||
|
ignoreErrors:
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\ActivityBundle\\\\Entity\\\\Activity\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\MainBundle\\\\Entity\\\\Scope\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\PersonBundle\\\\Entity\\\\Person\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, DateTime\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\ActivityBundle\\\\Entity\\\\ActivityReasonCategory\\|null given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\ActivityBundle\\\\Entity\\\\ActivityReason\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method DateTime\\:\\:setTimezone\\(\\) with incorrect case\\: setTimeZone$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in &&, Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\|null given on the right side\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, Chill\\\\AsideActivityBundle\\\\Entity\\\\AsideActivityCategory\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivityCategory.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method DateTimeImmutable\\:\\:setTimezone\\(\\) with incorrect case\\: setTimeZone$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\MainBundle\\\\Entity\\\\Location\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Controller/CalendarController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, Symfony\\\\Component\\\\Validator\\\\ConstraintViolationListInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomFieldsGroup\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomField\\|null given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomFieldsGroup given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\CustomFieldsBundle\\\\Entity\\\\CustomFieldsGroup\\|null given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getFirstName\\(\\) with incorrect case\\: getFirstname$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getLastName\\(\\) with incorrect case\\: getLastname$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getMobilenumber\\(\\) with incorrect case\\: getMobileNumber$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getPhonenumber\\(\\) with incorrect case\\: getPhoneNumber$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\Event given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\Event\\|null given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only numeric types are allowed in pre\\-increment, string given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\EventType\\|null given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventTypeController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\Participation\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/ParticipationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\Role\\|null given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/RoleController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\EventBundle\\\\Entity\\\\Status\\|null given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/StatusController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\Language\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, Chill\\\\MainBundle\\\\Entity\\\\Language\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\Center\\|null given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/CenterController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Redis\\:\\:setex\\(\\) with incorrect case\\: setEx$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\PermissionsGroup\\|null given\\.$#"
|
||||||
|
count: 5
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\RoleScope\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\Scope\\|null given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ScopeController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\GroupCenter\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/UserController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\MainBundle\\\\Entity\\\\User\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/UserController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only numeric types are allowed in pre\\-increment, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, int given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, int\\<0, max\\> given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillMainBundle/Search/SearchApiQuery.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\MainBundle\\\\Entity\\\\Address\\:\\:getPostcode\\(\\) with incorrect case\\: getPostCode$#"
|
||||||
|
count: 6
|
||||||
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\ClassDiscriminatorMapping\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\MainBundle\\\\Entity\\\\Address\\:\\:getPostcode\\(\\) with incorrect case\\: getPostCode$#"
|
||||||
|
count: 6
|
||||||
|
path: src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriodParticipation\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getFirstName\\(\\) with incorrect case\\: getFirstname$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getLastName\\(\\) with incorrect case\\: getLastname$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in &&, null given on the left side\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, array\\<Chill\\\\PersonBundle\\\\Entity\\\\Person\\\\ResidentialAddress\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:getDeathdate\\(\\) with incorrect case\\: getDeathDate$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\PersonBundle\\\\Entity\\\\Person\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a negated boolean, Chill\\\\ReportBundle\\\\Entity\\\\Report given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Call to method Chill\\\\ThirdPartyBundle\\\\Entity\\\\ThirdParty\\:\\:setFirstname\\(\\) with incorrect case\\: setFirstName$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillThirdPartyBundle/EventListener/ThirdPartyEventListener.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Dynamic call to static method Chill\\\\ThirdPartyBundle\\\\ThirdPartyType\\\\ThirdPartyTypeProviderInterface\\:\\:getKey\\(\\)\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php
|
1021
phpstan-baseline-level-3.neon
Normal file
1021
phpstan-baseline-level-3.neon
Normal file
File diff suppressed because it is too large
Load Diff
5101
phpstan-baseline-level-4.neon
Normal file
5101
phpstan-baseline-level-4.neon
Normal file
File diff suppressed because it is too large
Load Diff
721
phpstan-baseline-level-5.neon
Normal file
721
phpstan-baseline-level-5.neon
Normal file
@@ -0,0 +1,721 @@
|
|||||||
|
parameters:
|
||||||
|
ignoreErrors:
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Controller/ActivityController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$context of method Chill\\\\ActivityBundle\\\\Timeline\\\\TimelineActivityProvider\\:\\:checkContext\\(\\) expects string, Chill\\\\MainBundle\\\\Timeline\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(Chill\\\\BudgetBundle\\\\Repository\\\\ChargeType\\)\\: mixed\\)\\|null, Closure\\(Chill\\\\BudgetBundle\\\\Entity\\\\ChargeKind\\)\\: int\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(Chill\\\\BudgetBundle\\\\Repository\\\\ResourceType\\)\\: mixed\\)\\|null, Closure\\(Chill\\\\BudgetBundle\\\\Entity\\\\ResourceKind\\)\\: int\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\InviteUpdateMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Chill\\\\MainBundle\\\\Entity\\\\Country\\:\\:setName\\(\\) expects string, array\\<string, string\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$title of method Chill\\\\MainBundle\\\\Entity\\\\LocationType\\:\\:setTitle\\(\\) expects array, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$status of method Chill\\\\CalendarBundle\\\\Entity\\\\Invite\\:\\:setStatus\\(\\) expects string, array\\<string, string\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRangeRemovedMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$byUser of class Chill\\\\CalendarBundle\\\\Messenger\\\\Message\\\\CalendarRangeMessage constructor expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$token of method Chill\\\\CalendarBundle\\\\RemoteCalendar\\\\Connector\\\\MSGraph\\\\OnBehalfOfUserTokenStorage\\:\\:setToken\\(\\) expects TheNetworg\\\\OAuth2\\\\Client\\\\Token\\\\AccessToken, League\\\\OAuth2\\\\Client\\\\Token\\\\AccessTokenInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$code of class Exception constructor expects int, array\\<string, int\\|string\\|null\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#4 \\$offset of method Chill\\\\CalendarBundle\\\\Repository\\\\CalendarRepository\\:\\:findBy\\(\\) expects int\\|null, array\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$prefix of function uniqid expects string, int\\<0, max\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$callback of function array_filter expects callable\\(Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadataInterface\\)\\: mixed, Closure\\(Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadata\\)\\: bool given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$metadata of method Chill\\\\DocGeneratorBundle\\\\Serializer\\\\Normalizer\\\\DocGenObjectNormalizer\\:\\:normalizeNullData\\(\\) expects Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\ClassMetadata, Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\ClassMetadataInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#4 \\$attributes of method Chill\\\\DocGeneratorBundle\\\\Serializer\\\\Normalizer\\\\DocGenObjectNormalizer\\:\\:normalizeNullData\\(\\) expects array\\<Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadata\\>, array\\<Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadataInterface\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#5 \\$metadata of method Chill\\\\DocGeneratorBundle\\\\Serializer\\\\Normalizer\\\\DocGenObjectNormalizer\\:\\:normalizeObject\\(\\) expects Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\ClassMetadata, Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\ClassMetadataInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#6 \\$attributes of method Chill\\\\DocGeneratorBundle\\\\Serializer\\\\Normalizer\\\\DocGenObjectNormalizer\\:\\:normalizeObject\\(\\) expects array\\<Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadata\\>, array\\<Symfony\\\\Component\\\\Serializer\\\\Mapping\\\\AttributeMetadataInterface\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Chill\\\\MainBundle\\\\Entity\\\\Center given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/EventController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$participations of method Chill\\\\EventBundle\\\\Controller\\\\ParticipationController\\:\\:createEditFormMultiple\\(\\) expects ArrayIterator, Traversable given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillEventBundle/Controller/ParticipationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$previous of class Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\BadRequestHttpException constructor expects Throwable\\|null, int given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$code of class Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\BadRequestHttpException constructor expects int, Symfony\\\\Component\\\\Serializer\\\\Exception\\\\NotEncodableValueException given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$code of class Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\BadRequestHttpException constructor expects int, Symfony\\\\Component\\\\Serializer\\\\Exception\\\\UnexpectedValueException given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$formClass of method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\CRUDController\\:\\:createFormFor\\(\\) expects string\\|null, Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\type\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$scope of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\Scope\\|null, Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\Scope\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Chill\\\\MainBundle\\\\Entity\\\\Country\\:\\:setName\\(\\) expects string, array\\<int\\|string, string\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#4 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, Chill\\\\MainBundle\\\\Entity\\\\the given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$alias of method Chill\\\\MainBundle\\\\Export\\\\ExportManager\\:\\:getExport\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Form\\\\FormFactoryInterface\\:\\:createNamedBuilder\\(\\) expects string, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:exportFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:formatterFormStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:forwardToGenerate\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$alias of method Chill\\\\MainBundle\\\\Controller\\\\ExportController\\:\\:selectCentersStep\\(\\) expects string, Symfony\\\\Component\\\\HttpFoundation\\\\Request given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/ExportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:countUnreadByUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:findUnreadByUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$addressee of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:countAllForAttendee\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$addressee of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:findAllForAttendee\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$sender of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:countAllForSender\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$sender of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:findAllForSender\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:countUnreadByUserWhereAddressee\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Repository\\\\NotificationRepository\\:\\:countUnreadByUserWhereSender\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/NotificationController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$token of class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent constructor expects Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\type\\|null, string given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$ip of class Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\PasswordRecoverEvent constructor expects Chill\\\\MainBundle\\\\Security\\\\PasswordRecover\\\\type\\|null, string\\|null given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/PasswordController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$context of method Chill\\\\MainBundle\\\\Timeline\\\\TimelineBuilder\\:\\:countItems\\(\\) expects Chill\\\\MainBundle\\\\Timeline\\\\unknown, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:addSubscriberToFinal\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:addSubscriberToStep\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:isUserSubscribedToFinal\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:isUserSubscribedToStep\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:removeSubscriberToFinal\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflow\\:\\:removeSubscriberToStep\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$place of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Configuration\\:\\:filterWidgetByPlace\\(\\) expects string, Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$place of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Configuration\\:\\:getWidgetAliasesbyPlace\\(\\) expects Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\type, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$array of function implode expects array\\|null, Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$place of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\WidgetFactoryInterface\\:\\:createDefinition\\(\\) expects Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\type, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$order of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\WidgetFactoryInterface\\:\\:createDefinition\\(\\) expects Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\type, float given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/AbstractWidgetsCompilerPass.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$place of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\WidgetFactoryInterface\\:\\:getServiceId\\(\\) expects string, Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$order of method Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\WidgetFactoryInterface\\:\\:getServiceId\\(\\) expects float, Chill\\\\MainBundle\\\\DependencyInjection\\\\Widget\\\\Factory\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$iterator of function iterator_to_array expects Traversable, array\\<Chill\\\\MainBundle\\\\Export\\\\AggregatorInterface\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/ExportManager.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$nbAggregators of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\CSVFormatter\\:\\:appendAggregatorForm\\(\\) expects string, int\\<0, max\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$array of function array_map expects array, Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$nbAggregators of method Chill\\\\MainBundle\\\\Export\\\\Formatter\\\\SpreadSheetFormatter\\:\\:appendAggregatorForm\\(\\) expects string, int\\<0, max\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\PrivateCommentEmbeddable\\:\\:getCommentForUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$em of class Chill\\\\MainBundle\\\\Form\\\\Type\\\\DataTransformer\\\\ObjectToIdTransformer constructor expects Doctrine\\\\ORM\\\\EntityManagerInterface, Doctrine\\\\Persistence\\\\ObjectManager given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$em of class Chill\\\\MainBundle\\\\Form\\\\Type\\\\DataTransformer\\\\MultipleObjectsToIdTransformer constructor expects Doctrine\\\\ORM\\\\EntityManagerInterface, Doctrine\\\\Persistence\\\\ObjectManager given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$translatableStrings of method Chill\\\\MainBundle\\\\Templating\\\\TranslatableStringHelper\\:\\:localize\\(\\) expects array, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$datetime of class DateTime constructor expects string, Chill\\\\MainBundle\\\\Search\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Search/AbstractSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#4 \\$paginator of method Chill\\\\MainBundle\\\\Search\\\\SearchApi\\:\\:fetchRawResult\\(\\) expects Chill\\\\MainBundle\\\\Pagination\\\\Paginator, Chill\\\\MainBundle\\\\Pagination\\\\PaginatorInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Search/SearchApi.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$callback of function uasort expects callable\\(Chill\\\\MainBundle\\\\Search\\\\HasAdvancedSearchForm, Chill\\\\MainBundle\\\\Search\\\\HasAdvancedSearchForm\\)\\: int, Closure\\(Chill\\\\MainBundle\\\\Search\\\\SearchInterface, Chill\\\\MainBundle\\\\Search\\\\SearchInterface\\)\\: \\-1\\|0\\|1 given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Search/SearchProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$subject of function preg_match_all expects string, Chill\\\\MainBundle\\\\Search\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Search/SearchProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$object of function get_class expects object, array\\<Chill\\\\MainBundle\\\\Entity\\\\Center\\> given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Notification\\:\\:isReadBy\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Entity\\\\Embeddable\\\\PrivateCommentEmbeddable\\:\\:setCommentForUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$context of method Chill\\\\MainBundle\\\\Timeline\\\\TimelineBuilder\\:\\:buildUnionQuery\\(\\) expects string, Chill\\\\MainBundle\\\\Timeline\\\\unknown given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$context of method Chill\\\\MainBundle\\\\Timeline\\\\TimelineProviderInterface\\:\\:getEntityTemplate\\(\\) expects Chill\\\\MainBundle\\\\Timeline\\\\type, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$phoneNumber of method Chill\\\\MainBundle\\\\Phonenumber\\\\PhoneNumberHelperInterface\\:\\:format\\(\\) expects libphonenumber\\\\PhoneNumber\\|null, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$transitionBy of method Chill\\\\MainBundle\\\\Entity\\\\Workflow\\\\EntityWorkflowStep\\:\\:setTransitionBy\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User\\|null, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$mobilenumber of method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:setMobilenumber\\(\\) expects libphonenumber\\\\PhoneNumber\\|null, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$phonenumber of method Chill\\\\PersonBundle\\\\Entity\\\\Person\\:\\:setPhonenumber\\(\\) expects libphonenumber\\\\PhoneNumber\\|null, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Command/ImportPeopleFromCSVCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(mixed, mixed\\)\\: int, Closure\\(mixed, mixed\\)\\: bool given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationRepository\\:\\:countNearMaxDateByUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkEvaluationRepository\\:\\:findNearMaxDateByUser\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$object of static method DateTimeImmutable\\:\\:createFromMutable\\(\\) expects DateTime, DateTimeInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(mixed, mixed\\)\\: int, Closure\\(mixed, mixed\\)\\: bool given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/HouseholdController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$previous of class Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\BadRequestHttpException constructor expects Throwable\\|null, int given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$code of class Symfony\\\\Component\\\\HttpKernel\\\\Exception\\\\BadRequestHttpException constructor expects int, Symfony\\\\Component\\\\Serializer\\\\Exception\\\\InvalidArgumentException\\|Symfony\\\\Component\\\\Serializer\\\\Exception\\\\UnexpectedValueException given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$form of method Chill\\\\PersonBundle\\\\Controller\\\\PersonController\\:\\:isLastPostDataChanges\\(\\) expects Symfony\\\\Component\\\\Form\\\\Form, Symfony\\\\Component\\\\Form\\\\FormInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$precision of method Chill\\\\PersonBundle\\\\Search\\\\SimilarPersonMatcher\\:\\:matchPerson\\(\\) expects float, Chill\\\\PersonBundle\\\\Repository\\\\PersonNotDuplicateRepository given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$orderBy of method Chill\\\\PersonBundle\\\\Search\\\\SimilarPersonMatcher\\:\\:matchPerson\\(\\) expects string, float given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#4 \\$addYearComparison of method Chill\\\\PersonBundle\\\\Search\\\\SimilarPersonMatcher\\:\\:matchPerson\\(\\) expects bool, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$context of method Chill\\\\MainBundle\\\\Timeline\\\\TimelineBuilder\\:\\:countItems\\(\\) expects Chill\\\\MainBundle\\\\Timeline\\\\unknown, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$period of method Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\AccompanyingPeriodLocationHistory\\:\\:setPeriod\\(\\) expects Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod, null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$now of method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getCurrentMembers\\(\\) expects DateTimeImmutable\\|null, DateTimeInterface\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$now of method Chill\\\\PersonBundle\\\\Entity\\\\Household\\\\Household\\:\\:getNonCurrentMembers\\(\\) expects DateTimeImmutable\\|null, DateTimeInterface\\|null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/Household/Household.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$key of method Doctrine\\\\Common\\\\Collections\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:remove\\(\\) expects \\(int\\|string\\), Chill\\\\PersonBundle\\\\Entity\\\\SocialWork\\\\SocialAction given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$translatableStrings of method Chill\\\\MainBundle\\\\Templating\\\\TranslatableStringHelper\\:\\:localize\\(\\) expects array, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, null given\\.$#"
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$entity of method Chill\\\\PersonBundle\\\\Templating\\\\Entity\\\\ClosingMotiveRender\\:\\:renderString\\(\\) expects Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\\\ClosingMotive, Chill\\\\MainBundle\\\\Templating\\\\Entity\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillPersonBundle\\:AccompanyingPeriod\\>, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$user of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:filterReachableCenters\\(\\) expects Chill\\\\MainBundle\\\\Entity\\\\User, Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\|null given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$context of method Chill\\\\PersonBundle\\\\Timeline\\\\AbstractTimelineAccompanyingPeriod\\:\\:getBasicEntityTemplate\\(\\) expects string, Chill\\\\MainBundle\\\\Timeline\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodClosing.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#3 \\$context of method Chill\\\\PersonBundle\\\\Timeline\\\\AbstractTimelineAccompanyingPeriod\\:\\:getBasicEntityTemplate\\(\\) expects string, Chill\\\\MainBundle\\\\Timeline\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodOpening.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelperInterface\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$className of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillReportBundle\\:Report\\>, string given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$entity of method Chill\\\\ReportBundle\\\\Controller\\\\ReportController\\:\\:createEditForm\\(\\) expects Chill\\\\ReportBundle\\\\Entity\\\\Report, ChillReportBundle\\:Report given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableScopes\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$em of class Chill\\\\MainBundle\\\\Form\\\\Type\\\\DataTransformer\\\\ScopeTransformer constructor expects Doctrine\\\\ORM\\\\EntityManagerInterface, Doctrine\\\\Persistence\\\\ObjectManager given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Form/ReportType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableScopes\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Form/ReportType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableScopes\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$context of method Chill\\\\ReportBundle\\\\Timeline\\\\TimelineReportProvider\\:\\:checkContext\\(\\) expects string, Chill\\\\MainBundle\\\\Timeline\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$entity of method Chill\\\\ReportBundle\\\\Timeline\\\\TimelineReportProvider\\:\\:getFieldsToRender\\(\\) expects Chill\\\\ReportBundle\\\\Entity\\\\Report, Chill\\\\MainBundle\\\\Timeline\\\\type given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$entityName of method Doctrine\\\\ORM\\\\EntityManager\\:\\:getRepository\\(\\) expects class\\-string\\<ChillReportBundle\\:Report\\>, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 6
|
||||||
|
path: src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Controller/TaskController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$keys of function array_fill_keys expects array, Chill\\\\TaskBundle\\\\Entity\\\\json given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Entity/AbstractTask.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$task of method Chill\\\\TaskBundle\\\\Entity\\\\Task\\\\SingleTaskPlaceEvent\\:\\:setTask\\(\\) expects Chill\\\\TaskBundle\\\\Entity\\\\SingleTask, Chill\\\\TaskBundle\\\\Entity\\\\AbstractTask given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Event/Lifecycle/TaskLifecycleEvent.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$repository of class Chill\\\\PersonBundle\\\\Form\\\\DataTransformer\\\\PersonToIdTransformer constructor expects Chill\\\\PersonBundle\\\\Repository\\\\PersonRepository, Doctrine\\\\ORM\\\\EntityManagerInterface given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 4
|
||||||
|
path: src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$extras of method Knp\\\\Menu\\\\MenuItem\\:\\:setExtras\\(\\) expects array\\<string, mixed\\>, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#2 \\$role of method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:\\:getReachableCenters\\(\\) expects string, Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$storedObject of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:getContent\\(\\) expects Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject, ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document given\\.$#"
|
||||||
|
count: 3
|
||||||
|
path: src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$storedObject of method Chill\\\\WopiBundle\\\\Service\\\\Wopi\\\\ChillDocumentManager\\:\\:setContent\\(\\) expects Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject, ChampsLibres\\\\WopiLib\\\\Contract\\\\Entity\\\\Document given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Parameter \\#1 \\$type of method Chill\\\\DocStoreBundle\\\\Entity\\\\StoredObject\\:\\:setType\\(\\) expects string\\|null, false given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php
|
@@ -1,76 +1,6 @@
|
|||||||
parameters:
|
parameters:
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
-
|
|
||||||
message: "#^Implicit array creation is not allowed \\- variable \\$centers might not exist\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Entity\\\\AccompanyingPeriod\\:\\:\\$work\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Undefined variable\\: \\$person$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Variable variables are not allowed\\.$#"
|
|
||||||
count: 4
|
|
||||||
path: src/Bundle/ChillPersonBundle/Search/PersonSearch.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Function Chill\\\\PersonBundle\\\\Serializer\\\\Normalizer\\\\·\\\\is_array not found\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Undefined variable\\: \\$choiceSlug$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Undefined variable\\: \\$type$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillTaskBundle/Controller/TaskController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\CRUD\\\\Controller\\\\AbstractCRUDController\\:\\:getRoleFor\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Controller\\\\UserController\\:\\:createEditForm\\(\\)\\.$#"
|
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Controller\\\\UserController\\:\\:createEditForm\\(\\)\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Controller/UserController.php
|
path: src/Bundle/ChillMainBundle/Controller/UserController.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Undefined variable\\: \\$current$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Pagination/PageGenerator.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedAttributes\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:getSupportedClasses\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AbstractChillVoter\\:\\:isGranted\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Access to an undefined property Chill\\\\PersonBundle\\\\Controller\\\\PersonController\\:\\:\\$security\\.$#"
|
|
||||||
count: 3
|
|
||||||
path: src/Bundle/ChillPersonBundle/Controller/PersonController.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to an undefined method Chill\\\\ThirdPartyBundle\\\\Form\\\\Type\\\\PickThirdPartyTypeCategoryType\\:\\:transform\\(\\)\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php
|
|
||||||
|
@@ -400,16 +400,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
path: src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Method Chill\\\\ThirdPartyBundle\\\\Search\\\\ThirdPartySearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
|
message: "#^Method Chill\\\\ThirdPartyBundle\\\\Search\\\\ThirdPartySearch\\:\\:renderResult\\(\\) should return string but return statement is missing\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
parameters:
|
parameters:
|
||||||
level: 1
|
level: 5
|
||||||
paths:
|
paths:
|
||||||
- src/
|
- src/
|
||||||
|
reportUnmatchedIgnoredErrors: false
|
||||||
excludePaths:
|
excludePaths:
|
||||||
- .php_cs*
|
- .php_cs*
|
||||||
- docs/
|
- docs/
|
||||||
@@ -24,4 +25,8 @@ includes:
|
|||||||
- phpstan-critical.neon
|
- phpstan-critical.neon
|
||||||
- phpstan-deprecations.neon
|
- phpstan-deprecations.neon
|
||||||
- phpstan-types.neon
|
- phpstan-types.neon
|
||||||
|
- phpstan-baseline-level-2.neon
|
||||||
|
- phpstan-baseline-level-3.neon
|
||||||
|
- phpstan-baseline-level-4.neon
|
||||||
|
- phpstan-baseline-level-5.neon
|
||||||
|
|
||||||
|
19
psalm.xml
19
psalm.xml
@@ -12,6 +12,7 @@
|
|||||||
<directory name="src"/>
|
<directory name="src"/>
|
||||||
<ignoreFiles>
|
<ignoreFiles>
|
||||||
<directory name="./tests/"/>
|
<directory name="./tests/"/>
|
||||||
|
<directory name="./node_modules/"/>
|
||||||
</ignoreFiles>
|
</ignoreFiles>
|
||||||
</projectFiles>
|
</projectFiles>
|
||||||
|
|
||||||
@@ -25,4 +26,22 @@
|
|||||||
</UndefinedDocblockClass>
|
</UndefinedDocblockClass>
|
||||||
</issueHandlers>
|
</issueHandlers>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<fileExtensions>
|
||||||
|
<extension name=".php"/>
|
||||||
|
<extension name=".twig" checker="tests/app/vendor/psalm/plugin-symfony/src/Twig/TemplateFileAnalyzer.php" />
|
||||||
|
</fileExtensions>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
|
||||||
|
<!--
|
||||||
|
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
|
||||||
|
<containerXml>tests/app/var/cache/dev/srcApp_KernelDevDebugContainer.xml</containerXml>
|
||||||
|
<stubs>
|
||||||
|
<file name="vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php" />
|
||||||
|
</stubs>
|
||||||
|
</pluginClass>
|
||||||
|
-->
|
||||||
|
</plugins>
|
||||||
</psalm>
|
</psalm>
|
||||||
|
@@ -43,6 +43,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
final class ActivityController extends AbstractController
|
final class ActivityController extends AbstractController
|
||||||
@@ -73,6 +74,8 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
private ThirdPartyRepository $thirdPartyRepository;
|
private ThirdPartyRepository $thirdPartyRepository;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
private UserRepositoryInterface $userRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@@ -89,7 +92,8 @@ final class ActivityController extends AbstractController
|
|||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
SerializerInterface $serializer,
|
SerializerInterface $serializer,
|
||||||
UserRepositoryInterface $userRepository,
|
UserRepositoryInterface $userRepository,
|
||||||
CenterResolverManagerInterface $centerResolver
|
CenterResolverManagerInterface $centerResolver,
|
||||||
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$this->activityACLAwareRepository = $activityACLAwareRepository;
|
$this->activityACLAwareRepository = $activityACLAwareRepository;
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
$this->activityTypeRepository = $activityTypeRepository;
|
||||||
@@ -105,6 +109,7 @@ final class ActivityController extends AbstractController
|
|||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->userRepository = $userRepository;
|
$this->userRepository = $userRepository;
|
||||||
$this->centerResolver = $centerResolver;
|
$this->centerResolver = $centerResolver;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +165,7 @@ final class ActivityController extends AbstractController
|
|||||||
$this->entityManager->remove($activity);
|
$this->entityManager->remove($activity);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')
|
$this->addFlash('success', $this->translator
|
||||||
->trans('The activity has been successfully removed.'));
|
->trans('The activity has been successfully removed.'));
|
||||||
|
|
||||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||||
@@ -245,7 +250,7 @@ final class ActivityController extends AbstractController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
|
$this->addFlash('success', $this->translator->trans('Success : activity updated!'));
|
||||||
|
|
||||||
return $this->redirectToRoute('chill_activity_activity_show', $params);
|
return $this->redirectToRoute('chill_activity_activity_show', $params);
|
||||||
}
|
}
|
||||||
@@ -473,7 +478,7 @@ final class ActivityController extends AbstractController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')->trans('Success : activity created!'));
|
$this->addFlash('success', $this->translator->trans('Success : activity created!'));
|
||||||
|
|
||||||
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
|
||||||
|
|
||||||
|
@@ -13,15 +13,24 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
use Chill\ActivityBundle\Form\ActivityReasonType;
|
use Chill\ActivityBundle\Form\ActivityReasonType;
|
||||||
|
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityReason controller.
|
* ActivityReason controller.
|
||||||
*/
|
*/
|
||||||
class ActivityReasonController extends AbstractController
|
class ActivityReasonController extends AbstractController
|
||||||
{
|
{
|
||||||
|
private ActivityReasonRepository $activityReasonRepository;
|
||||||
|
|
||||||
|
public function __construct(ActivityReasonRepository $activityReasonRepository)
|
||||||
|
{
|
||||||
|
$this->activityReasonRepository = $activityReasonRepository;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ActivityReason entity.
|
* Creates a new ActivityReason entity.
|
||||||
*/
|
*/
|
||||||
@@ -56,8 +65,8 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
$entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id);
|
||||||
|
|
||||||
if (!$entity) {
|
if (null === $entity) {
|
||||||
throw $this->createNotFoundException('Unable to find ActivityReason entity.');
|
throw new NotFoundHttpException('Unable to find ActivityReason entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$editForm = $this->createEditForm($entity);
|
$editForm = $this->createEditForm($entity);
|
||||||
@@ -75,7 +84,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->findAll();
|
$entities = $this->activityReasonRepository->findAll();
|
||||||
|
|
||||||
return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', [
|
return $this->render('ChillActivityBundle:ActivityReason:index.html.twig', [
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
|
@@ -63,10 +63,8 @@ class ActivityReason
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get category.
|
* Get category.
|
||||||
*
|
|
||||||
* @return ActivityReasonCategory
|
|
||||||
*/
|
*/
|
||||||
public function getCategory()
|
public function getCategory(): ?ActivityReasonCategory
|
||||||
{
|
{
|
||||||
return $this->category;
|
return $this->category;
|
||||||
}
|
}
|
||||||
@@ -107,6 +105,11 @@ class ActivityReason
|
|||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isActiveAndParentActive(): bool
|
||||||
|
{
|
||||||
|
return $this->active && null !== $this->getCategory() && $this->getCategory()->getActive();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set active.
|
* Set active.
|
||||||
*
|
*
|
||||||
|
@@ -58,7 +58,8 @@ class DateAggregator implements AggregatorInterface
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
$fmt = 'YYYY'; $order = 'DESC';
|
$fmt = 'YYYY';
|
||||||
|
$order = 'DESC';
|
||||||
|
|
||||||
break; // order DESC does not works !
|
break; // order DESC does not works !
|
||||||
|
|
||||||
|
@@ -50,7 +50,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
{
|
{
|
||||||
$where = $qb->getDQLPart('where');
|
$where = $qb->getDQLPart('where');
|
||||||
$join = $qb->getDQLPart('join');
|
$join = $qb->getDQLPart('join');
|
||||||
$clause = $qb->expr()->in('reasons', ':selected_activity_reasons');
|
$clause = $qb->expr()->in('actreasons', ':selected_activity_reasons');
|
||||||
|
|
||||||
if (!in_array('actreasons', $qb->getAllAliases(), true)) {
|
if (!in_array('actreasons', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.reasons', 'actreasons');
|
$qb->join('activity.reasons', 'actreasons');
|
||||||
@@ -77,6 +77,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt
|
|||||||
'class' => ActivityReason::class,
|
'class' => ActivityReason::class,
|
||||||
'choice_label' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getName()),
|
'choice_label' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getName()),
|
||||||
'group_by' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
|
'group_by' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getCategory()->getName()),
|
||||||
|
'attr' => ['class' => 'select2 '],
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => false,
|
'expanded' => false,
|
||||||
]);
|
]);
|
||||||
|
@@ -11,7 +11,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategoryType;
|
||||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
@@ -25,13 +26,13 @@ class ActivityReasonType extends AbstractType
|
|||||||
$builder
|
$builder
|
||||||
->add('name', TranslatableStringFormType::class)
|
->add('name', TranslatableStringFormType::class)
|
||||||
->add('active', CheckboxType::class, ['required' => false])
|
->add('active', CheckboxType::class, ['required' => false])
|
||||||
->add('category', TranslatableActivityReasonCategory::class);
|
->add('category', TranslatableActivityReasonCategoryType::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReason',
|
'data_class' => ActivityReason::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ namespace Chill\ActivityBundle\Form;
|
|||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Form\Type\PickActivityReasonType;
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
use Chill\DocStoreBundle\Form\StoredObjectType;
|
use Chill\DocStoreBundle\Form\StoredObjectType;
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
@@ -229,19 +229,10 @@ class ActivityType extends AbstractType
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($activityType->isVisible('reasons')) {
|
if ($activityType->isVisible('reasons')) {
|
||||||
$builder->add('reasons', EntityType::class, [
|
$builder->add('reasons', PickActivityReasonType::class, [
|
||||||
'label' => $activityType->getLabel('reasons'),
|
'label' => $activityType->getLabel('reasons'),
|
||||||
'required' => $activityType->isRequired('reasons'),
|
'required' => $activityType->isRequired('reasons'),
|
||||||
'class' => ActivityReason::class,
|
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'choice_label' => function (ActivityReason $activityReason) {
|
|
||||||
return $this->translatableStringHelper->localize($activityReason->getName());
|
|
||||||
},
|
|
||||||
'attr' => ['class' => 'select2 '],
|
|
||||||
'query_builder' => static function (EntityRepository $er) {
|
|
||||||
return $er->createQueryBuilder('a')
|
|
||||||
->where('a.active = true');
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,9 +12,9 @@ declare(strict_types=1);
|
|||||||
namespace Chill\ActivityBundle\Form\Type;
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
use Chill\ActivityBundle\Repository\ActivityReasonRepository;
|
||||||
use Chill\ActivityBundle\Templating\Entity\ActivityReasonRender;
|
use Chill\ActivityBundle\Templating\Entity\ActivityReasonRender;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
@@ -22,31 +22,29 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
/**
|
/**
|
||||||
* FormType to choose amongst activity reasons.
|
* FormType to choose amongst activity reasons.
|
||||||
*/
|
*/
|
||||||
class TranslatableActivityReason extends AbstractType
|
class PickActivityReasonType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
private ActivityReasonRepository $activityReasonRepository;
|
||||||
* @var ActivityReasonRender
|
|
||||||
*/
|
|
||||||
protected $reasonRender;
|
|
||||||
|
|
||||||
/**
|
private ActivityReasonRender $reasonRender;
|
||||||
* @var TranslatableStringHelper
|
|
||||||
*/
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
protected $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
ActivityReasonRepository $activityReasonRepository,
|
||||||
ActivityReasonRender $reasonRender
|
ActivityReasonRender $reasonRender,
|
||||||
|
TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {
|
) {
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->activityReasonRepository = $activityReasonRepository;
|
||||||
$this->reasonRender = $reasonRender;
|
$this->reasonRender = $reasonRender;
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
'class' => 'ChillActivityBundle:ActivityReason',
|
'class' => ActivityReason::class,
|
||||||
'choice_label' => function (ActivityReason $choice) {
|
'choice_label' => function (ActivityReason $choice) {
|
||||||
return $this->reasonRender->renderString($choice, []);
|
return $this->reasonRender->renderString($choice, []);
|
||||||
},
|
},
|
||||||
@@ -57,10 +55,7 @@ class TranslatableActivityReason extends AbstractType
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
'query_builder' => static function (EntityRepository $er) {
|
'choices' => $this->activityReasonRepository->findAll(),
|
||||||
return $er->createQueryBuilder('r')
|
|
||||||
->where('r.active = true');
|
|
||||||
},
|
|
||||||
'attr' => ['class' => ' select2 '],
|
'attr' => ['class' => ' select2 '],
|
||||||
]
|
]
|
||||||
);
|
);
|
@@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form\Type;
|
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description of TranslatableActivityReasonCategory.
|
|
||||||
*/
|
|
||||||
class TranslatableActivityReasonCategory extends AbstractType
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var RequestStack
|
|
||||||
*/
|
|
||||||
private $requestStack;
|
|
||||||
|
|
||||||
public function __construct(RequestStack $requestStack)
|
|
||||||
{
|
|
||||||
$this->requestStack = $requestStack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
|
||||||
{
|
|
||||||
$locale = $this->requestStack->getCurrentRequest()->getLocale();
|
|
||||||
$resolver->setDefaults(
|
|
||||||
[
|
|
||||||
'class' => 'ChillActivityBundle:ActivityReasonCategory',
|
|
||||||
'choice_label' => 'name[' . $locale . ']',
|
|
||||||
'query_builder' => static function (EntityRepository $er) {
|
|
||||||
return $er->createQueryBuilder('c')
|
|
||||||
->where('c.active = true');
|
|
||||||
},
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getBlockPrefix()
|
|
||||||
{
|
|
||||||
return 'translatable_activity_reason_category';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getParent()
|
|
||||||
{
|
|
||||||
return EntityType::class;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of TranslatableActivityReasonCategory.
|
||||||
|
*/
|
||||||
|
class TranslatableActivityReasonCategoryType extends AbstractType
|
||||||
|
{
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
|
public function __construct(TranslatableStringHelperInterface $translatableStringHelper, TranslatorInterface $translator)
|
||||||
|
{
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->translator = $translator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver->setDefaults(
|
||||||
|
[
|
||||||
|
'class' => ActivityReasonCategory::class,
|
||||||
|
'choice_label' => function (ActivityReasonCategory $category) {
|
||||||
|
return $this->translatableStringHelper->localize($category->getName())
|
||||||
|
. (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : '');
|
||||||
|
},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBlockPrefix()
|
||||||
|
{
|
||||||
|
return 'translatable_activity_reason_category';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getParent()
|
||||||
|
{
|
||||||
|
return EntityType::class;
|
||||||
|
}
|
||||||
|
}
|
@@ -36,7 +36,6 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setAttribute('class', 'list-group-item-header')
|
->setAttribute('class', 'list-group-item-header')
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => 5000,
|
'order' => 5000,
|
||||||
'icons' => ['exchange'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menu->addChild('Activity Reasons', [
|
$menu->addChild('Activity Reasons', [
|
||||||
|
@@ -225,10 +225,9 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
$personToCenter = $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'];
|
$personToCenter = $metadataPerson->getAssociationMapping('center')['joinColumns'][0]['name'];
|
||||||
|
|
||||||
// acls:
|
// acls:
|
||||||
$role = new Role(ActivityVoter::SEE);
|
|
||||||
$reachableCenters = $this->authorizationHelper->getReachableCenters(
|
$reachableCenters = $this->authorizationHelper->getReachableCenters(
|
||||||
$this->tokenStorage->getToken()->getUser(),
|
$this->tokenStorage->getToken()->getUser(),
|
||||||
$role
|
ActivityVoter::SEE
|
||||||
);
|
);
|
||||||
|
|
||||||
if (count($reachableCenters) === 0) {
|
if (count($reachableCenters) === 0) {
|
||||||
@@ -239,7 +238,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
if ('person' === $context) {
|
if ('person' === $context) {
|
||||||
// we start with activities having the person_id linked to person
|
// we start with activities having the person_id linked to person
|
||||||
$where .= sprintf('%s = ? AND ', $activityToPerson);
|
$where .= sprintf('%s = ? AND ', $activityToPerson);
|
||||||
$parameters[] = $person->getId();
|
$parameters[] = $args['context']->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// we add acl (reachable center and scopes)
|
// we add acl (reachable center and scopes)
|
||||||
@@ -252,7 +251,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// we get all the reachable scopes for this center
|
// we get all the reachable scopes for this center
|
||||||
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), $role, $center);
|
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), ActivityVoter::SEE, $center);
|
||||||
// we get the ids for those scopes
|
// we get the ids for those scopes
|
||||||
$reachablesScopesId = array_map(
|
$reachablesScopesId = array_map(
|
||||||
static function (Scope $scope) {
|
static function (Scope $scope) {
|
||||||
|
@@ -14,17 +14,38 @@ namespace Chill\ActivityBundle\Repository;
|
|||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method ActivityReason|null find($id, $lockMode = null, $lockVersion = null)
|
* @method ActivityReason|null find($id, $lockMode = null, $lockVersion = null)
|
||||||
* @method ActivityReason|null findOneBy(array $criteria, array $orderBy = null)
|
* @method ActivityReason|null findOneBy(array $criteria, array $orderBy = null)
|
||||||
* @method ActivityReason[] findAll()
|
|
||||||
* @method ActivityReason[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method ActivityReason[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
class ActivityReasonRepository extends ServiceEntityRepository
|
class ActivityReasonRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
public function __construct(ManagerRegistry $registry)
|
private RequestStack $requestStack;
|
||||||
{
|
|
||||||
|
public function __construct(
|
||||||
|
ManagerRegistry $registry,
|
||||||
|
RequestStack $requestStack
|
||||||
|
) {
|
||||||
parent::__construct($registry, ActivityReason::class);
|
parent::__construct($registry, ActivityReason::class);
|
||||||
|
|
||||||
|
$this->requestStack = $requestStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ActivityReason[]
|
||||||
|
*/
|
||||||
|
public function findAll(): array
|
||||||
|
{
|
||||||
|
$qb = $this->createQueryBuilder('ar');
|
||||||
|
$qb->select(['ar'])
|
||||||
|
->leftJoin('ar.category', 'category')
|
||||||
|
->addOrderBy('JSON_EXTRACT(category.name, :lang)')
|
||||||
|
->addOrderBy('JSON_EXTRACT(ar.name, :lang)')
|
||||||
|
->setParameter('lang', $this->requestStack->getCurrentRequest()->getLocale() ?? 'fr');
|
||||||
|
|
||||||
|
return $qb->getQuery()->getResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -156,7 +156,7 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<section class="chill-entity entity-comment-embeddable">
|
<section class="chill-entity entity-comment-embeddable">
|
||||||
<blockquote class="chill-user-quote private-quote">
|
<blockquote class="chill-user-quote private-quote">
|
||||||
{{ entity.privateComment.comments[userId] }}
|
{{ entity.privateComment.comments[userId]|chill_markdown_to_html }}
|
||||||
</blockquote>
|
</blockquote>
|
||||||
</section>
|
</section>
|
||||||
</dd>
|
</dd>
|
||||||
@@ -168,11 +168,11 @@
|
|||||||
{% if entity.documents|length > 0 %}
|
{% if entity.documents|length > 0 %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for d in entity.documents %}
|
{% for d in entity.documents %}
|
||||||
<li>{{ d.title }}{{ m.download_button(d) }}</li>
|
<li>{{ d.title }} {{ d|chill_document_button_group() }}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'Any document found'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No document found'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@@ -8,12 +8,14 @@
|
|||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||||
{{ encore_entry_script_tags('mod_async_upload') }}
|
{{ encore_entry_script_tags('mod_async_upload') }}
|
||||||
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_async_upload') }}
|
||||||
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||||
|
@@ -7,13 +7,13 @@
|
|||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
|
||||||
{{ encore_entry_link_tags('mod_async_upload') }}
|
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||||
|
@@ -7,13 +7,25 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ 'Name'|trans }}</th>
|
<th>{{ 'Name'|trans }}</th>
|
||||||
|
<th>{{ 'Active'|trans }}</th>
|
||||||
<th>{{ 'Actions'|trans }}</th>
|
<th>{{ 'Actions'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for entity in entities %}
|
{% for entity in entities %}
|
||||||
<tr class="{% if entity.active %}active{% else %}inactive{% endif %}">
|
<tr class="{% if entity.active %}active{% else %}inactive{% endif %}">
|
||||||
<td><a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
|
<td>
|
||||||
|
{% if entity.category is not null -%}
|
||||||
|
{{ entity.category.name|localize_translatable_string }} >
|
||||||
|
{% endif -%}
|
||||||
|
{{ entity.name|localize_translatable_string }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i>
|
||||||
|
{% if entity.active and not entity.isActiveAndParentActive %}
|
||||||
|
<span class="badge text-bg-danger text-white">{{ 'Associated activity reason category is inactive'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ 'Name'|trans }}</th>
|
<th>{{ 'Name'|trans }}</th>
|
||||||
|
<th>{{ 'Active'|trans }}</th>
|
||||||
<th>{{ 'Actions'|trans }}</th>
|
<th>{{ 'Actions'|trans }}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -14,7 +15,11 @@
|
|||||||
{% for entity in entities %}
|
{% for entity in entities %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
|
{{ entity.name|localize_translatable_string }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
|
@@ -11,7 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\ActivityBundle\Tests\Form\Type;
|
namespace Chill\ActivityBundle\Tests\Form\Type;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
|
use Chill\ActivityBundle\Form\Type\PickActivityReasonType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Symfony\Component\Form\PreloadedExtension;
|
use Symfony\Component\Form\PreloadedExtension;
|
||||||
use Symfony\Component\Form\Test\TypeTestCase;
|
use Symfony\Component\Form\Test\TypeTestCase;
|
||||||
@@ -36,7 +36,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
|||||||
|
|
||||||
public function testSimple()
|
public function testSimple()
|
||||||
{
|
{
|
||||||
$translatableActivityReasonType = new TranslatableActivityReason(
|
$translatableActivityReasonType = new PickActivityReasonType(
|
||||||
$this->getTranslatableStringHelper()
|
$this->getTranslatableStringHelper()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -1,4 +1,11 @@
|
|||||||
services:
|
services:
|
||||||
Chill\ActivityBundle\Controller\ActivityController:
|
_defaults:
|
||||||
autowire: true
|
autowire: true
|
||||||
|
autoconfigure: true
|
||||||
|
|
||||||
|
Chill\ActivityBundle\Controller\:
|
||||||
|
resource: '../../Controller/'
|
||||||
|
tags: ['controller.service_arguments']
|
||||||
|
|
||||||
|
Chill\ActivityBundle\Controller\ActivityController:
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
@@ -1,19 +1,12 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
chill.activity.form.type.translatableactivityreasoncategory:
|
Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategoryType:
|
||||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory
|
autowire: true
|
||||||
arguments:
|
autoconfigure: true
|
||||||
- "@request_stack"
|
|
||||||
tags:
|
|
||||||
- { name: form.type, alias: translatable_activity_reason_category }
|
|
||||||
|
|
||||||
chill.activity.form.type.translatableactivityreason:
|
Chill\ActivityBundle\Form\Type\PickActivityReasonType:
|
||||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason
|
autowire: true
|
||||||
arguments:
|
autoconfigure: true
|
||||||
$translatableStringHelper: "@chill.main.helper.translatable_string"
|
|
||||||
$reasonRender: '@Chill\ActivityBundle\Templating\Entity\ActivityReasonRender'
|
|
||||||
tags:
|
|
||||||
- { name: form.type, alias: translatable_activity_reason }
|
|
||||||
|
|
||||||
chill.activity.form.type.translatableactivitytype:
|
chill.activity.form.type.translatableactivitytype:
|
||||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityType
|
class: Chill\ActivityBundle\Form\Type\TranslatableActivityType
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
|
Chill\ActivityBundle\Repository\ActivityReasonRepository:
|
||||||
|
autowire: true
|
||||||
|
|
||||||
chill_activity.repository.activity_type: '@Chill\ActivityBundle\Repository\ActivityTypeRepository'
|
chill_activity.repository.activity_type: '@Chill\ActivityBundle\Repository\ActivityTypeRepository'
|
||||||
chill_activity.repository.reason: '@Chill\ActivityBundle\Repository\ActivityReasonRepository'
|
chill_activity.repository.reason: '@Chill\ActivityBundle\Repository\ActivityReasonRepository'
|
||||||
chill_activity.repository.reason_category: '@Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository'
|
chill_activity.repository.reason_category: '@Chill\ActivityBundle\Repository\ActivityReasonCategoryRepository'
|
||||||
|
@@ -117,6 +117,7 @@ Activity Reasons: Sujets d'une activité
|
|||||||
Activity Reasons Category: Catégories de sujet d'activités
|
Activity Reasons Category: Catégories de sujet d'activités
|
||||||
Activity Types Categories: Catégories des types d'activité
|
Activity Types Categories: Catégories des types d'activité
|
||||||
Activity Presences: Presences aux activités
|
Activity Presences: Presences aux activités
|
||||||
|
Associated activity reason category is inactive: La catégorie de sujet attachée est inactive
|
||||||
|
|
||||||
|
|
||||||
# Crud
|
# Crud
|
||||||
|
@@ -11,12 +11,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\AsideActivityBundle\Export\Export;
|
namespace Chill\AsideActivityBundle\Export\Export;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Export\Declarations;
|
||||||
use Chill\AsideActivityBundle\Repository\AsideActivityRepository;
|
use Chill\AsideActivityBundle\Repository\AsideActivityRepository;
|
||||||
use Chill\AsideActivityBundle\Security\AsideActivityVoter;
|
use Chill\AsideActivityBundle\Security\AsideActivityVoter;
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use ChillAsideActivityBundle\Export\Declarations;
|
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
@@ -12,8 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\AsideActivityBundle\Form;
|
namespace Chill\AsideActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\AsideActivityBundle\Entity\AsideActivity;
|
use Chill\AsideActivityBundle\Entity\AsideActivity;
|
||||||
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
|
use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType;
|
||||||
use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
use Chill\MainBundle\Form\Type\ChillTextareaType;
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
||||||
@@ -21,8 +20,6 @@ use DateInterval;
|
|||||||
use DateTime;
|
use DateTime;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Doctrine\ORM\EntityRepository;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
|
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
|
||||||
@@ -37,20 +34,16 @@ use function in_array;
|
|||||||
|
|
||||||
final class AsideActivityFormType extends AbstractType
|
final class AsideActivityFormType extends AbstractType
|
||||||
{
|
{
|
||||||
private CategoryRender $categoryRender;
|
|
||||||
|
|
||||||
private TokenStorageInterface $storage;
|
private TokenStorageInterface $storage;
|
||||||
|
|
||||||
private array $timeChoices;
|
private array $timeChoices;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ParameterBagInterface $parameterBag,
|
ParameterBagInterface $parameterBag,
|
||||||
TokenStorageInterface $storage,
|
TokenStorageInterface $storage
|
||||||
CategoryRender $categoryRender
|
|
||||||
) {
|
) {
|
||||||
$this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration');
|
$this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration');
|
||||||
$this->storage = $storage;
|
$this->storage = $storage;
|
||||||
$this->categoryRender = $categoryRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
@@ -81,28 +74,10 @@ final class AsideActivityFormType extends AbstractType
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->add(
|
->add('type', PickAsideActivityCategoryType::class, [
|
||||||
'type',
|
|
||||||
EntityType::class,
|
|
||||||
[
|
|
||||||
'label' => 'Type',
|
'label' => 'Type',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'class' => AsideActivityCategory::class,
|
])
|
||||||
'placeholder' => 'Choose the activity category',
|
|
||||||
'query_builder' => static function (EntityRepository $er) {
|
|
||||||
$qb = $er->createQueryBuilder('ac');
|
|
||||||
$qb->where($qb->expr()->eq('ac.isActive', 'TRUE'))
|
|
||||||
->addOrderBy('ac.ordering', 'ASC');
|
|
||||||
|
|
||||||
return $qb;
|
|
||||||
},
|
|
||||||
'choice_label' => function (AsideActivityCategory $asideActivityCategory) {
|
|
||||||
$options = [];
|
|
||||||
|
|
||||||
return $this->categoryRender->renderString($asideActivityCategory, $options);
|
|
||||||
},
|
|
||||||
]
|
|
||||||
)
|
|
||||||
->add('duration', ChoiceType::class, $durationTimeOptions)
|
->add('duration', ChoiceType::class, $durationTimeOptions)
|
||||||
->add('note', ChillTextareaType::class, [
|
->add('note', ChillTextareaType::class, [
|
||||||
'label' => 'Note',
|
'label' => 'Note',
|
||||||
|
@@ -0,0 +1,57 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\AsideActivityBundle\Form\Type;
|
||||||
|
|
||||||
|
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
|
||||||
|
use Chill\AsideActivityBundle\Templating\Entity\CategoryRender;
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
final class PickAsideActivityCategoryType extends AbstractType
|
||||||
|
{
|
||||||
|
private CategoryRender $categoryRender;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
CategoryRender $categoryRender
|
||||||
|
) {
|
||||||
|
$this->categoryRender = $categoryRender;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver
|
||||||
|
->setDefaults([
|
||||||
|
'class' => AsideActivityCategory::class,
|
||||||
|
'placeholder' => 'Choose the activity category',
|
||||||
|
'query_builder' => static function (EntityRepository $er) {
|
||||||
|
$qb = $er->createQueryBuilder('ac');
|
||||||
|
$qb->where($qb->expr()->eq('ac.isActive', 'TRUE'))
|
||||||
|
->addOrderBy('ac.ordering', 'ASC');
|
||||||
|
|
||||||
|
return $qb;
|
||||||
|
},
|
||||||
|
'choice_label' => function (AsideActivityCategory $asideActivityCategory) {
|
||||||
|
$options = [];
|
||||||
|
|
||||||
|
return $this->categoryRender->renderString($asideActivityCategory, $options);
|
||||||
|
},
|
||||||
|
'attr' => ['class' => 'select2'],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getParent(): string
|
||||||
|
{
|
||||||
|
return EntityType::class;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
<div class="{% block crud_content_main_div_class %}col-10 centered{% endblock %}">
|
|
||||||
{% block crud_content_header %}
|
{% block crud_content_header %}
|
||||||
<h1>{{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': 'Aside Activity' }) }}</h1>
|
<h1>{{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': 'Aside Activity' }) }}</h1>
|
||||||
{% endblock crud_content_header %}
|
{% endblock crud_content_header %}
|
||||||
@@ -27,4 +27,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ form_end(form) }}
|
{{ form_end(form) }}
|
||||||
</div>
|
|
||||||
|
@@ -87,5 +87,5 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{% extends '@ChillMain/Admin/layout.html.twig' %}
|
{% extends '@ChillMain/layout.html.twig' %}
|
||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block admin_content %}
|
{% block content %}
|
||||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
{% endembed %}
|
{% endembed %}
|
||||||
|
@@ -183,4 +183,5 @@ export:
|
|||||||
Group by aside activity type: Grouper les activités annexes par type d'activité
|
Group by aside activity type: Grouper les activités annexes par type d'activité
|
||||||
Aside activity type: Type d'activité annexe
|
Aside activity type: Type d'activité annexe
|
||||||
|
|
||||||
|
# ROLES
|
||||||
|
CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes
|
||||||
|
@@ -1,102 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\BudgetBundle\Config;
|
|
||||||
|
|
||||||
class ConfigRepository
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $charges;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $resources;
|
|
||||||
|
|
||||||
public function __construct($resources, $charges)
|
|
||||||
{
|
|
||||||
$this->resources = $resources;
|
|
||||||
$this->charges = $charges;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getChargesKeys(bool $onlyActive = false): array
|
|
||||||
{
|
|
||||||
return array_map(static function ($element) {
|
|
||||||
return $element['key'];
|
|
||||||
}, $this->getCharges($onlyActive));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array where keys are the resource'key and label the ressource label
|
|
||||||
*/
|
|
||||||
public function getChargesLabels(bool $onlyActive = false)
|
|
||||||
{
|
|
||||||
$charges = [];
|
|
||||||
|
|
||||||
foreach ($this->getCharges($onlyActive) as $definition) {
|
|
||||||
$charges[$definition['key']] = $this->normalizeLabel($definition['labels']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $charges;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getResourcesKeys(bool $onlyActive = false): array
|
|
||||||
{
|
|
||||||
return array_map(static function ($element) {
|
|
||||||
return $element['key'];
|
|
||||||
}, $this->getResources($onlyActive));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array where keys are the resource'key and label the ressource label
|
|
||||||
*/
|
|
||||||
public function getResourcesLabels(bool $onlyActive = false)
|
|
||||||
{
|
|
||||||
$resources = [];
|
|
||||||
|
|
||||||
foreach ($this->getResources($onlyActive) as $definition) {
|
|
||||||
$resources[$definition['key']] = $this->normalizeLabel($definition['labels']);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $resources;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getCharges(bool $onlyActive = false): array
|
|
||||||
{
|
|
||||||
return $onlyActive ?
|
|
||||||
array_filter($this->charges, static function ($el) {
|
|
||||||
return $el['active'];
|
|
||||||
})
|
|
||||||
: $this->charges;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getResources(bool $onlyActive = false): array
|
|
||||||
{
|
|
||||||
return $onlyActive ?
|
|
||||||
array_filter($this->resources, static function ($el) {
|
|
||||||
return $el['active'];
|
|
||||||
})
|
|
||||||
: $this->resources;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function normalizeLabel($labels)
|
|
||||||
{
|
|
||||||
$normalizedLabels = [];
|
|
||||||
|
|
||||||
foreach ($labels as $labelDefinition) {
|
|
||||||
$normalizedLabels[$labelDefinition['lang']] = $labelDefinition['label'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $normalizedLabels;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Controller\Admin;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
|
class AdminController extends AbstractController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @Route("/{_locale}/admin/budget", name="chill_admin_budget")
|
||||||
|
*/
|
||||||
|
public function indexAdminAction()
|
||||||
|
{
|
||||||
|
return $this->render('@ChillBudget/Admin/index.html.twig');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Controller\Admin;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
class ChargeKindController extends CRUDController
|
||||||
|
{
|
||||||
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
|
{
|
||||||
|
/** @var QueryBuilder $query */
|
||||||
|
$query->addOrderBy('e.ordering', 'ASC');
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Controller\Admin;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
class ResourceKindController extends CRUDController
|
||||||
|
{
|
||||||
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
|
{
|
||||||
|
/** @var QueryBuilder $query */
|
||||||
|
$query->addOrderBy('e.ordering', 'ASC');
|
||||||
|
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
}
|
@@ -11,6 +11,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\DependencyInjection;
|
namespace Chill\BudgetBundle\DependencyInjection;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Controller\Admin\ChargeKindController;
|
||||||
|
use Chill\BudgetBundle\Controller\Admin\ResourceKindController;
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
|
use Chill\BudgetBundle\Security\Authorization\BudgetElementVoter;
|
||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
@@ -31,8 +35,8 @@ class ChillBudgetExtension extends Extension implements PrependExtensionInterfac
|
|||||||
$config = $this->processConfiguration($configuration, $configs);
|
$config = $this->processConfiguration($configuration, $configs);
|
||||||
|
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../config'));
|
||||||
$loader->load('services/config.yaml');
|
|
||||||
$loader->load('services/form.yaml');
|
$loader->load('services/form.yaml');
|
||||||
|
$loader->load('services/repository.yaml');
|
||||||
$loader->load('services/security.yaml');
|
$loader->load('services/security.yaml');
|
||||||
$loader->load('services/controller.yaml');
|
$loader->load('services/controller.yaml');
|
||||||
$loader->load('services/templating.yaml');
|
$loader->load('services/templating.yaml');
|
||||||
@@ -48,6 +52,7 @@ class ChillBudgetExtension extends Extension implements PrependExtensionInterfac
|
|||||||
{
|
{
|
||||||
$this->prependAuthorization($container);
|
$this->prependAuthorization($container);
|
||||||
$this->prependRoutes($container);
|
$this->prependRoutes($container);
|
||||||
|
$this->prependCruds($container);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** (non-PHPdoc).
|
/** (non-PHPdoc).
|
||||||
@@ -75,6 +80,56 @@ class ChillBudgetExtension extends Extension implements PrependExtensionInterfac
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function prependCruds(ContainerBuilder $container)
|
||||||
|
{
|
||||||
|
$container->prependExtensionConfig('chill_main', [
|
||||||
|
'cruds' => [
|
||||||
|
[
|
||||||
|
'class' => ChargeKind::class,
|
||||||
|
'name' => 'charge_kind',
|
||||||
|
'base_path' => '/admin/budget/charge-kind',
|
||||||
|
'form_class' => \Chill\BudgetBundle\Form\Admin\ChargeKindType::class,
|
||||||
|
'controller' => ChargeKindController::class,
|
||||||
|
'actions' => [
|
||||||
|
'index' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Charge/index.html.twig',
|
||||||
|
],
|
||||||
|
'new' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Charge/new.html.twig',
|
||||||
|
],
|
||||||
|
'edit' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Charge/edit.html.twig',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => ResourceKind::class,
|
||||||
|
'name' => 'resource_kind',
|
||||||
|
'base_path' => '/admin/budget/resource-kind',
|
||||||
|
'form_class' => \Chill\BudgetBundle\Form\Admin\ResourceKindType::class,
|
||||||
|
'controller' => ResourceKindController::class,
|
||||||
|
'actions' => [
|
||||||
|
'index' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Resource/index.html.twig',
|
||||||
|
],
|
||||||
|
'new' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Resource/new.html.twig',
|
||||||
|
],
|
||||||
|
'edit' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillBudget/Admin/Resource/edit.html.twig',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
protected function storeConfig($position, array $config, ContainerBuilder $container)
|
protected function storeConfig($position, array $config, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$container
|
$container
|
||||||
|
@@ -26,6 +26,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
|
|
||||||
// ressources
|
// ressources
|
||||||
->arrayNode('resources')->defaultValue([])
|
->arrayNode('resources')->defaultValue([])
|
||||||
|
->setDeprecated('Chill', '2.0', 'Since the introduction of budget admin entities, config is no longer used')
|
||||||
->arrayPrototype()
|
->arrayPrototype()
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('key')->isRequired()->cannotBeEmpty()
|
->scalarNode('key')->isRequired()->cannotBeEmpty()
|
||||||
@@ -49,6 +50,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->arrayNode('charges')->defaultValue([])
|
->arrayNode('charges')->defaultValue([])
|
||||||
|
->setDeprecated('Chill', '2.0', 'Since the introduction of budget admin entities, config is no longer used')
|
||||||
->arrayPrototype()
|
->arrayPrototype()
|
||||||
->children()
|
->children()
|
||||||
->scalarNode('key')->isRequired()->cannotBeEmpty()
|
->scalarNode('key')->isRequired()->cannotBeEmpty()
|
||||||
|
@@ -75,7 +75,7 @@ abstract class AbstractElement
|
|||||||
/**
|
/**
|
||||||
* @ORM\Column(name="type", type="string", length=255)
|
* @ORM\Column(name="type", type="string", length=255)
|
||||||
*/
|
*/
|
||||||
private string $type;
|
private string $type = '';
|
||||||
|
|
||||||
/*Getters and Setters */
|
/*Getters and Setters */
|
||||||
|
|
||||||
|
@@ -39,6 +39,12 @@ class Charge extends AbstractElement implements HasCentersInterface
|
|||||||
self::HELP_NOT_RELEVANT,
|
self::HELP_NOT_RELEVANT,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity=ChargeKind::class, inversedBy="AbstractElement")
|
||||||
|
* @ORM\JoinColumn
|
||||||
|
*/
|
||||||
|
private ?ChargeKind $charge = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="help", type="string", nullable=true)
|
* @ORM\Column(name="help", type="string", nullable=true)
|
||||||
@@ -66,6 +72,11 @@ class Charge extends AbstractElement implements HasCentersInterface
|
|||||||
return $this->getHousehold()->getCurrentPersons()->map(static fn (Person $p) => $p->getCenter())->toArray();
|
return $this->getHousehold()->getCurrentPersons()->map(static fn (Person $p) => $p->getCenter())->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCharge(): ?ChargeKind
|
||||||
|
{
|
||||||
|
return $this->charge;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHelp()
|
public function getHelp()
|
||||||
{
|
{
|
||||||
return $this->help;
|
return $this->help;
|
||||||
@@ -91,6 +102,13 @@ class Charge extends AbstractElement implements HasCentersInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setCharge(?ChargeKind $charge): self
|
||||||
|
{
|
||||||
|
$this->charge = $charge;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function setHelp($help)
|
public function setHelp($help)
|
||||||
{
|
{
|
||||||
$this->help = $help;
|
$this->help = $help;
|
||||||
|
108
src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php
Normal file
108
src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of charge.
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="chill_budget.charge_type")
|
||||||
|
* @ORM\Entity
|
||||||
|
*/
|
||||||
|
class ChargeKind
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\GeneratedValue
|
||||||
|
* @ORM\Column(type="integer")
|
||||||
|
*/
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="boolean", options={"default": true})
|
||||||
|
*/
|
||||||
|
private bool $isActive = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=255, options={"default": ""}, nullable=false)
|
||||||
|
*/
|
||||||
|
private string $kind = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="json", length=255, options={"default": "[]"})
|
||||||
|
*/
|
||||||
|
private array $name = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="float", options={"default": 0.00})
|
||||||
|
*/
|
||||||
|
private float $ordering = 0.00;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="json", length=255, options={"default": "[]"})
|
||||||
|
*/
|
||||||
|
private array $tags = [];
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIsActive(): bool
|
||||||
|
{
|
||||||
|
return $this->isActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getKind(): ?string
|
||||||
|
{
|
||||||
|
return $this->kind;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): ?array
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOrdering(): float
|
||||||
|
{
|
||||||
|
return $this->ordering;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIsActive(bool $isActive): self
|
||||||
|
{
|
||||||
|
$this->isActive = $isActive;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setKind(?string $kind): self
|
||||||
|
{
|
||||||
|
$this->kind = $kind;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setName(array $name): self
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOrdering(float $ordering): ChargeKind
|
||||||
|
{
|
||||||
|
$this->ordering = $ordering;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@@ -31,6 +31,12 @@ class Resource extends AbstractElement implements HasCentersInterface
|
|||||||
*/
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\ManyToOne(targetEntity=ResourceKind::class, inversedBy="AbstractElement")
|
||||||
|
* @ORM\JoinColumn
|
||||||
|
*/
|
||||||
|
private ?ResourceKind $resource = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->setStartDate(new DateTimeImmutable('today'));
|
$this->setStartDate(new DateTimeImmutable('today'));
|
||||||
@@ -55,6 +61,11 @@ class Resource extends AbstractElement implements HasCentersInterface
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getResource(): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->resource;
|
||||||
|
}
|
||||||
|
|
||||||
public function isCharge(): bool
|
public function isCharge(): bool
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -64,4 +75,11 @@ class Resource extends AbstractElement implements HasCentersInterface
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setResource(?ResourceKind $resource): self
|
||||||
|
{
|
||||||
|
$this->resource = $resource;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
108
src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php
Normal file
108
src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of resource.
|
||||||
|
*
|
||||||
|
* @ORM\Table(name="chill_budget.resource_type")
|
||||||
|
* @ORM\Entity
|
||||||
|
*/
|
||||||
|
class ResourceKind
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @ORM\Id
|
||||||
|
* @ORM\GeneratedValue
|
||||||
|
* @ORM\Column(type="integer")
|
||||||
|
*/
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="boolean", options={"default": true})
|
||||||
|
*/
|
||||||
|
private bool $isActive = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=255, nullable=false, options={"default": ""})
|
||||||
|
*/
|
||||||
|
private string $kind = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="json", length=255, options={"default": "[]"})
|
||||||
|
*/
|
||||||
|
private array $name = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="float", options={"default": 0.00})
|
||||||
|
*/
|
||||||
|
private float $ordering = 0.00;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="json", length=255, options={"default": "[]"})
|
||||||
|
*/
|
||||||
|
private array $tags = [];
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIsActive(): bool
|
||||||
|
{
|
||||||
|
return $this->isActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getKind(): ?string
|
||||||
|
{
|
||||||
|
return $this->kind;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): ?array
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOrdering(): float
|
||||||
|
{
|
||||||
|
return $this->ordering;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIsActive(bool $isActive): self
|
||||||
|
{
|
||||||
|
$this->isActive = $isActive;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setKind(?string $kind): self
|
||||||
|
{
|
||||||
|
$this->kind = $kind;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setName(array $name): self
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOrdering(float $ordering): self
|
||||||
|
{
|
||||||
|
$this->ordering = $ordering;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
42
src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php
Normal file
42
src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Form\Admin;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
class ChargeKindType extends AbstractType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
$builder
|
||||||
|
->add('name', TranslatableStringFormType::class, [
|
||||||
|
'label' => 'Nom',
|
||||||
|
])
|
||||||
|
->add('ordering', NumberType::class)
|
||||||
|
->add('isActive', CheckboxType::class, [
|
||||||
|
'label' => 'Actif ?',
|
||||||
|
'required' => false,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver
|
||||||
|
->setDefault('class', ChargeKind::class);
|
||||||
|
}
|
||||||
|
}
|
42
src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php
Normal file
42
src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Form\Admin;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
class ResourceKindType extends AbstractType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
{
|
||||||
|
$builder
|
||||||
|
->add('name', TranslatableStringFormType::class, [
|
||||||
|
'label' => 'Nom',
|
||||||
|
])
|
||||||
|
->add('ordering', NumberType::class)
|
||||||
|
->add('isActive', CheckboxType::class, [
|
||||||
|
'label' => 'Actif ?',
|
||||||
|
'required' => false,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver
|
||||||
|
->setDefault('class', ResourceKind::class);
|
||||||
|
}
|
||||||
|
}
|
@@ -11,40 +11,50 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Form;
|
namespace Chill\BudgetBundle\Form;
|
||||||
|
|
||||||
use Chill\BudgetBundle\Config\ConfigRepository;
|
|
||||||
use Chill\BudgetBundle\Entity\Charge;
|
use Chill\BudgetBundle\Entity\Charge;
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\BudgetBundle\Repository\ChargeKindRepository;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use function array_flip;
|
|
||||||
use function asort;
|
|
||||||
|
|
||||||
class ChargeType extends AbstractType
|
class ChargeType extends AbstractType
|
||||||
{
|
{
|
||||||
protected ConfigRepository $configRepository;
|
|
||||||
|
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
protected TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private ChargeKindRepository $repository;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ConfigRepository $configRepository,
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
ChargeKindRepository $repository,
|
||||||
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$this->configRepository = $configRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->repository = $repository;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('type', ChoiceType::class, [
|
->add('charge', EntityType::class, [
|
||||||
'choices' => $this->getTypes(),
|
'class' => ChargeKind::class,
|
||||||
'placeholder' => 'Choose a charge type',
|
'choices' => $this->repository->findAllActive(),
|
||||||
|
'label' => 'Charge type',
|
||||||
|
'required' => true,
|
||||||
|
'placeholder' => $this->translator->trans('admin.form.Choose the type of charge'),
|
||||||
|
'choice_label' => function (ChargeKind $resource) {
|
||||||
|
return $this->translatableStringHelper->localize($resource->getName());
|
||||||
|
},
|
||||||
'attr' => ['class' => 'select2'],
|
'attr' => ['class' => 'select2'],
|
||||||
])
|
])
|
||||||
->add('amount', MoneyType::class)
|
->add('amount', MoneyType::class)
|
||||||
@@ -99,19 +109,4 @@ class ChargeType extends AbstractType
|
|||||||
{
|
{
|
||||||
return 'chill_budgetbundle_charge';
|
return 'chill_budgetbundle_charge';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTypes()
|
|
||||||
{
|
|
||||||
$charges = $this->configRepository
|
|
||||||
->getChargesLabels(true);
|
|
||||||
|
|
||||||
// rewrite labels to filter in language
|
|
||||||
foreach ($charges as $key => $labels) {
|
|
||||||
$charges[$key] = $this->translatableStringHelper->localize($labels);
|
|
||||||
}
|
|
||||||
|
|
||||||
asort($charges);
|
|
||||||
|
|
||||||
return array_flip($charges);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -11,40 +11,49 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Form;
|
namespace Chill\BudgetBundle\Form;
|
||||||
|
|
||||||
use Chill\BudgetBundle\Config\ConfigRepository;
|
|
||||||
use Chill\BudgetBundle\Entity\Resource;
|
use Chill\BudgetBundle\Entity\Resource;
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Chill\BudgetBundle\Repository\ResourceKindRepository;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
use function array_flip;
|
|
||||||
|
|
||||||
class ResourceType extends AbstractType
|
class ResourceType extends AbstractType
|
||||||
{
|
{
|
||||||
protected ConfigRepository $configRepository;
|
|
||||||
|
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
protected TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private ResourceKindRepository $repository;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ConfigRepository $configRepository,
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
ResourceKindRepository $repository,
|
||||||
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$this->configRepository = $configRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->repository = $repository;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('type', ChoiceType::class, [
|
->add('resource', EntityType::class, [
|
||||||
'choices' => $this->getTypes(),
|
'class' => ResourceKind::class,
|
||||||
'placeholder' => 'Choose a resource type',
|
'choices' => $this->repository->findAllActive(),
|
||||||
'label' => 'Resource element type',
|
'label' => 'Resource type',
|
||||||
|
'required' => true,
|
||||||
|
'placeholder' => $this->translator->trans('admin.form.Choose the type of resource'),
|
||||||
|
'choice_label' => function (ResourceKind $resource) {
|
||||||
|
return $this->translatableStringHelper->localize($resource->getName());
|
||||||
|
},
|
||||||
'attr' => ['class' => 'select2'],
|
'attr' => ['class' => 'select2'],
|
||||||
])
|
])
|
||||||
->add('amount', MoneyType::class)
|
->add('amount', MoneyType::class)
|
||||||
@@ -83,19 +92,4 @@ class ResourceType extends AbstractType
|
|||||||
{
|
{
|
||||||
return 'chill_budgetbundle_resource';
|
return 'chill_budgetbundle_resource';
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getTypes()
|
|
||||||
{
|
|
||||||
$resources = $this->configRepository
|
|
||||||
->getResourcesLabels(true);
|
|
||||||
|
|
||||||
// rewrite labels to filter in language
|
|
||||||
foreach ($resources as $key => $labels) {
|
|
||||||
$resources[$key] = $this->translatableStringHelper->localize($labels);
|
|
||||||
}
|
|
||||||
|
|
||||||
asort($resources);
|
|
||||||
|
|
||||||
return array_flip($resources);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
62
src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php
Normal file
62
src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Menu;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
|
use Knp\Menu\MenuItem;
|
||||||
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
|
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
|
{
|
||||||
|
private Security $security;
|
||||||
|
|
||||||
|
public function __construct(Security $security)
|
||||||
|
{
|
||||||
|
$this->security = $security;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
|
{
|
||||||
|
// all the entries below must have ROLE_ADMIN permissions
|
||||||
|
if (!$this->security->isGranted('ROLE_ADMIN')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$menu->addChild('Budget', [
|
||||||
|
'route' => 'chill_admin_budget',
|
||||||
|
])
|
||||||
|
->setAttribute('class', 'list-group-item-header')
|
||||||
|
->setExtras([
|
||||||
|
'order' => 7050,
|
||||||
|
'explain' => 'Budget resource and charge type configuration',
|
||||||
|
]);
|
||||||
|
$menu
|
||||||
|
->addChild('admin.menu.Resource types', [
|
||||||
|
'route' => 'chill_crud_resource_kind_index',
|
||||||
|
])
|
||||||
|
->setExtras([
|
||||||
|
'order' => 7060,
|
||||||
|
]);
|
||||||
|
$menu
|
||||||
|
->addChild('admin.menu.Charge types', [
|
||||||
|
'route' => 'chill_crud_charge_kind_index',
|
||||||
|
])
|
||||||
|
->setExtras([
|
||||||
|
'order' => 7070,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getMenuIds(): array
|
||||||
|
{
|
||||||
|
return ['admin_section', 'admin_budget'];
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
|
class ChargeKindRepository implements ObjectRepository
|
||||||
|
{
|
||||||
|
private EntityRepository $repository;
|
||||||
|
|
||||||
|
public function __construct(EntityManagerInterface $entityManager)
|
||||||
|
{
|
||||||
|
$this->repository = $entityManager->getRepository(ChargeKind::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function find($id): ?ChargeKind
|
||||||
|
{
|
||||||
|
return $this->repository->find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ChargeType[]
|
||||||
|
*/
|
||||||
|
public function findAll(): array
|
||||||
|
{
|
||||||
|
return $this->repository->findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ChargeType[]
|
||||||
|
*/
|
||||||
|
public function findAllActive(): array
|
||||||
|
{
|
||||||
|
$qb = $this->repository->createQueryBuilder('c');
|
||||||
|
|
||||||
|
return $qb
|
||||||
|
->select('c')
|
||||||
|
->where($qb->expr()->eq('c.isActive', 'true'))
|
||||||
|
->orderBy('c.ordering', 'ASC')
|
||||||
|
->getQuery()
|
||||||
|
->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ChargeType[]
|
||||||
|
*/
|
||||||
|
public function findAllByType(string $type): array
|
||||||
|
{
|
||||||
|
return $this->findBy(['elementType' => $type]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed|null $limit
|
||||||
|
* @param mixed|null $offset
|
||||||
|
*
|
||||||
|
* @return ChargeType[]
|
||||||
|
*/
|
||||||
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||||
|
{
|
||||||
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findOneBy(array $criteria): ?ChargeKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getClassName(): string
|
||||||
|
{
|
||||||
|
return ChargeKind::class;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
|
class ResourceKindRepository implements ObjectRepository
|
||||||
|
{
|
||||||
|
private EntityRepository $repository;
|
||||||
|
|
||||||
|
public function __construct(EntityManagerInterface $entityManager)
|
||||||
|
{
|
||||||
|
$this->repository = $entityManager->getRepository(ResourceKind::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function find($id): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->repository->find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ResourceType[]
|
||||||
|
*/
|
||||||
|
public function findAll(): array
|
||||||
|
{
|
||||||
|
return $this->repository->findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ResourceType[]
|
||||||
|
*/
|
||||||
|
public function findAllActive(): array
|
||||||
|
{
|
||||||
|
$qb = $this->repository->createQueryBuilder('r');
|
||||||
|
|
||||||
|
return $qb
|
||||||
|
->select('r')
|
||||||
|
->where($qb->expr()->eq('r.isActive', 'true'))
|
||||||
|
->orderBy('r.ordering', 'ASC')
|
||||||
|
->getQuery()
|
||||||
|
->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy(['kind' => $kind]) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ResourceType[]
|
||||||
|
*/
|
||||||
|
public function findAllByType(string $type): array
|
||||||
|
{
|
||||||
|
return $this->findBy(['elementType' => $type]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mixed|null $limit
|
||||||
|
* @param mixed|null $offset
|
||||||
|
*
|
||||||
|
* @return ResourceType[]
|
||||||
|
*/
|
||||||
|
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array
|
||||||
|
{
|
||||||
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findOneBy(array $criteria): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy($criteria);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getClassName(): string
|
||||||
|
{
|
||||||
|
return ResourceKind::class;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||||
|
{% block content_form_actions_view %}{% endblock %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,49 @@
|
|||||||
|
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}{{ 'admin.title.Charge Type List'|trans }}{% endblock title %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
|
||||||
|
<h1>{{ 'admin.title.Charge Type List'|trans }}</h1>
|
||||||
|
|
||||||
|
<table class="records_list table table-bordered border-dark">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ 'Ordering'|trans }}</th>
|
||||||
|
<th>{{ 'Name'|trans }}</th>
|
||||||
|
<th>{{ 'Active'|trans }}</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for entity in entities %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ entity.ordering }}</td>
|
||||||
|
<td>{{ entity|chill_entity_render_box }}</td>
|
||||||
|
<td style="text-align:center;">
|
||||||
|
{%- if entity.isActive -%}
|
||||||
|
<i class="fa fa-check-square-o"></i>
|
||||||
|
{%- else -%}
|
||||||
|
<i class="fa fa-square-o"></i>
|
||||||
|
{%- endif -%}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_crud_charge_kind_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_crud_charge_kind_new') }}" class="btn btn-create">
|
||||||
|
{{ 'admin.new.Create a new charge type'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,11 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,12 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||||
|
{% block content_form_actions_view %}{% endblock %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,49 @@
|
|||||||
|
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}{{ 'admin.title.Resource Type List'|trans }}{% endblock title %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
|
||||||
|
<h1>{{ 'admin.title.Resource Type List'|trans }}</h1>
|
||||||
|
|
||||||
|
<table class="records_list table table-bordered border-dark">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ 'Ordering'|trans }}</th>
|
||||||
|
<th>{{ 'Name'|trans }}</th>
|
||||||
|
<th>{{ 'Active'|trans }}</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for entity in entities %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ entity.ordering }}</td>
|
||||||
|
<td>{{ entity|chill_entity_render_box }}</td>
|
||||||
|
<td style="text-align:center;">
|
||||||
|
{%- if entity.isActive -%}
|
||||||
|
<i class="fa fa-check-square-o"></i>
|
||||||
|
{%- else -%}
|
||||||
|
<i class="fa fa-square-o"></i>
|
||||||
|
{%- endif -%}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_crud_resource_kind_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_crud_resource_kind_new') }}" class="btn btn-create">
|
||||||
|
{{ 'admin.new.Create a new resource type'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,11 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock %}
|
@@ -0,0 +1,14 @@
|
|||||||
|
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||||
|
|
||||||
|
{% block vertical_menu_content %}
|
||||||
|
{{ chill_menu('admin_budget', {
|
||||||
|
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||||
|
}) }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block layout_wvm_content %}
|
||||||
|
{% block admin_content %}
|
||||||
|
<!-- block content empty -->
|
||||||
|
<h1>{{ 'admin.title.Budget configuration'|trans }}</h1>
|
||||||
|
{% endblock %}
|
||||||
|
{% endblock %}
|
@@ -16,7 +16,11 @@
|
|||||||
<td class="column-wide el-type">
|
<td class="column-wide el-type">
|
||||||
<span class="badge-title">
|
<span class="badge-title">
|
||||||
<span class="title_label title_label_{{ family }}"></span>
|
<span class="title_label title_label_{{ family }}"></span>
|
||||||
<span class="title_action">{{ f.type|budget_element_type_display(family) }}<span>
|
{% if f.isResource %}
|
||||||
|
<span class="title_action">{{ f.resource.name|localize_translatable_string }}<span>
|
||||||
|
{% else %}
|
||||||
|
<span class="title_action">{{ f.charge.name|localize_translatable_string }}<span>
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="column-small">{{ f.amount|format_currency('EUR') }}</td>
|
<td class="column-small">{{ f.amount|format_currency('EUR') }}</td>
|
||||||
|
@@ -3,13 +3,13 @@
|
|||||||
{% set indexPage = 'chill_budget_elements_index' %}
|
{% set indexPage = 'chill_budget_elements_index' %}
|
||||||
{% set activeRouteKey = '' %}
|
{% set activeRouteKey = '' %}
|
||||||
{% set person = element.person %}
|
{% set person = element.person %}
|
||||||
{% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ) %}
|
{% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.charge.getName | localize_translatable_string } ) %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set template = '@ChillPerson/Household/layout.html.twig' %}
|
{% set template = '@ChillPerson/Household/layout.html.twig' %}
|
||||||
{% set indexPage = 'chill_budget_elements_household_index' %}
|
{% set indexPage = 'chill_budget_elements_household_index' %}
|
||||||
{% set activeRouteKey = '' %}
|
{% set activeRouteKey = '' %}
|
||||||
{% set household = element.household %}
|
{% set household = element.household %}
|
||||||
{% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.type|budget_element_type_display('charge') } ) %}
|
{% set confirm_question = 'Are you sure you want to remove the charge "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.charge.getName | localize_translatable_string } ) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% extends template %}
|
{% extends template %}
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
{{ form_row(form.type) }}
|
{{ form_row(form.charge) }}
|
||||||
{{ form_row(form.amount) }}
|
{{ form_row(form.amount) }}
|
||||||
{{ form_row(form.help) }}
|
{{ form_row(form.help) }}
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
{{ form_row(form.type) }}
|
{{ form_row(form.charge) }}
|
||||||
{{ form_row(form.amount) }}
|
{{ form_row(form.amount) }}
|
||||||
{{ form_row(form.help) }}
|
{{ form_row(form.help) }}
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<h2 class="badge-title">
|
<h2 class="badge-title">
|
||||||
<span class="title_label title_label_charge"></span>
|
<span class="title_label title_label_charge"></span>
|
||||||
<span class="title_action">{{ element.type|budget_element_type_display('charge') }}</span>
|
<span class="title_action">{{ element.charge.getName | localize_translatable_string }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
<span class="chill-entity">{{ entity.name|localize_translatable_string }}</span>
|
@@ -3,13 +3,13 @@
|
|||||||
{% set indexPage = 'chill_budget_elements_index' %}
|
{% set indexPage = 'chill_budget_elements_index' %}
|
||||||
{% set activeRouteKey = '' %}
|
{% set activeRouteKey = '' %}
|
||||||
{% set person = element.person %}
|
{% set person = element.person %}
|
||||||
{% set confirm_question = 'Are you sure you want to remove the ressource "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('resource') } ) %}
|
{% set confirm_question = 'Are you sure you want to remove the ressource "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.resource.getName | localize_translatable_string } ) %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set template = '@ChillPerson/Household/layout.html.twig' %}
|
{% set template = '@ChillPerson/Household/layout.html.twig' %}
|
||||||
{% set indexPage = 'chill_budget_elements_household_index' %}
|
{% set indexPage = 'chill_budget_elements_household_index' %}
|
||||||
{% set activeRouteKey = '' %}
|
{% set activeRouteKey = '' %}
|
||||||
{% set household = element.household %}
|
{% set household = element.household %}
|
||||||
{% set confirm_question = 'Are you sure you want to remove the ressource "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.type|budget_element_type_display('resource') } ) %}
|
{% set confirm_question = 'Are you sure you want to remove the ressource "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.resource.getName | localize_translatable_string} ) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% extends template %}
|
{% extends template %}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
{{ form_row(form.type) }}
|
{{ form_row(form.resource) }}
|
||||||
{{ form_row(form.amount) }}
|
{{ form_row(form.amount) }}
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
{{ form_row(form.startDate) }}
|
{{ form_row(form.startDate) }}
|
||||||
|
@@ -22,8 +22,7 @@
|
|||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
|
|
||||||
{{ form_start(form) }}
|
{{ form_start(form) }}
|
||||||
|
{{ form_row(form.resource) }}
|
||||||
{{ form_row(form.type) }}
|
|
||||||
{{ form_row(form.amount) }}
|
{{ form_row(form.amount) }}
|
||||||
{{ form_row(form.comment) }}
|
{{ form_row(form.comment) }}
|
||||||
{{ form_row(form.startDate) }}
|
{{ form_row(form.startDate) }}
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
<div class="item-row">
|
<div class="item-row">
|
||||||
<h2 class="badge-title">
|
<h2 class="badge-title">
|
||||||
<span class="title_label title_label_resource"></span>
|
<span class="title_label title_label_resource"></span>
|
||||||
<span class="title_action title_action">{{ element.type|budget_element_type_display('resource') }}</span>
|
<span class="title_action title_action">{{ element.resource.getName | localize_translatable_string }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
|
@@ -11,13 +11,17 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Service\Summary;
|
namespace Chill\BudgetBundle\Service\Summary;
|
||||||
|
|
||||||
use Chill\BudgetBundle\Config\ConfigRepository;
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Chill\BudgetBundle\Repository\ChargeKindRepository;
|
||||||
|
use Chill\BudgetBundle\Repository\ResourceKindRepository;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Entity\Household\Household;
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Query\ResultSetMapping;
|
use Doctrine\ORM\Query\ResultSetMapping;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
|
use RuntimeException;
|
||||||
use function count;
|
use function count;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,31 +29,36 @@ use function count;
|
|||||||
*/
|
*/
|
||||||
class SummaryBudget implements SummaryBudgetInterface
|
class SummaryBudget implements SummaryBudgetInterface
|
||||||
{
|
{
|
||||||
private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, type FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY type';
|
private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id';
|
||||||
|
|
||||||
private const QUERY_CHARGE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, type FROM chill_budget.charge WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY type';
|
private const QUERY_CHARGE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id';
|
||||||
|
|
||||||
private const QUERY_RESOURCE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, type FROM chill_budget.resource WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY type';
|
private const QUERY_RESOURCE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id';
|
||||||
|
|
||||||
private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, type FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY type';
|
private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id';
|
||||||
|
|
||||||
|
private ChargeKindRepository $chargeKindRepository;
|
||||||
|
|
||||||
private array $chargeLabels;
|
private array $chargeLabels;
|
||||||
|
|
||||||
private ConfigRepository $configRepository;
|
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
|
private ResourceKindRepository $resourceKindRepository;
|
||||||
|
|
||||||
private array $resourcesLabels;
|
private array $resourcesLabels;
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, ConfigRepository $configRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
public function __construct(
|
||||||
{
|
EntityManagerInterface $em,
|
||||||
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
|
ResourceKindRepository $resourceKindRepository,
|
||||||
|
ChargeKindRepository $chargeKindRepository
|
||||||
|
) {
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->configRepository = $configRepository;
|
|
||||||
$this->chargeLabels = $configRepository->getChargesLabels();
|
|
||||||
$this->resourcesLabels = $configRepository->getResourcesLabels();
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->resourceKindRepository = $resourceKindRepository;
|
||||||
|
$this->chargeKindRepository = $chargeKindRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSummaryForHousehold(?Household $household): array
|
public function getSummaryForHousehold(?Household $household): array
|
||||||
@@ -112,7 +121,7 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
$rsm = new ResultSetMapping();
|
$rsm = new ResultSetMapping();
|
||||||
$rsm
|
$rsm
|
||||||
->addScalarResult('sum', 'sum')
|
->addScalarResult('sum', 'sum')
|
||||||
->addScalarResult('type', 'type')
|
->addScalarResult('kind_id', 'kind_id')
|
||||||
->addScalarResult('comment', 'comment');
|
->addScalarResult('comment', 'comment');
|
||||||
|
|
||||||
return $rsm;
|
return $rsm;
|
||||||
@@ -120,51 +129,62 @@ class SummaryBudget implements SummaryBudgetInterface
|
|||||||
|
|
||||||
private function getEmptyChargeArray(): array
|
private function getEmptyChargeArray(): array
|
||||||
{
|
{
|
||||||
$keys = $this->configRepository->getChargesKeys();
|
$keys = array_map(static fn (ChargeKind $kind) => $kind->getId(), $this->chargeKindRepository->findAll());
|
||||||
$labels = $this->chargeLabels;
|
|
||||||
|
|
||||||
return array_combine($keys, array_map(function ($i) use ($labels) {
|
return array_combine($keys, array_map(function ($id) {
|
||||||
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($labels[$i]), 'comment' => ''];
|
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->chargeKindRepository->find($id)->getName()), 'comment' => ''];
|
||||||
}, $keys));
|
}, $keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getEmptyResourceArray(): array
|
private function getEmptyResourceArray(): array
|
||||||
{
|
{
|
||||||
$keys = $this->configRepository->getResourcesKeys();
|
$keys = array_map(static fn (ResourceKind $kind) => $kind->getId(), $this->resourceKindRepository->findAll());
|
||||||
$labels = $this->resourcesLabels;
|
|
||||||
|
|
||||||
return array_combine($keys, array_map(function ($i) use ($labels) {
|
return array_combine($keys, array_map(function ($id) {
|
||||||
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($labels[$i]), 'comment' => ''];
|
return ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->resourceKindRepository->find($id)->getName()), 'comment' => ''];
|
||||||
}, $keys));
|
}, $keys));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function rowToArray(array $rows, string $kind): array
|
private function rowToArray(array $rows, string $kind): array
|
||||||
{
|
{
|
||||||
switch ($kind) {
|
|
||||||
case 'charge':
|
|
||||||
$label = $this->chargeLabels;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'resource':
|
|
||||||
$label = $this->resourcesLabels;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new LogicException();
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
switch ($kind) {
|
||||||
|
case 'charge':
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$result[$row['type']] = [
|
$chargeKind = $this->chargeKindRepository->find($row['kind_id']);
|
||||||
|
|
||||||
|
if (null === $chargeKind) {
|
||||||
|
throw new RuntimeException('charge kind not found');
|
||||||
|
}
|
||||||
|
$result[$chargeKind->getKind()] = [
|
||||||
'sum' => (float) $row['sum'],
|
'sum' => (float) $row['sum'],
|
||||||
'label' => $this->translatableStringHelper->localize($label[$row['type']]),
|
'label' => $this->translatableStringHelper->localize($chargeKind->getName()),
|
||||||
'comment' => (string) $row['comment'],
|
'comment' => (string) $row['comment'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
|
case 'resource':
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$resourceKind = $this->resourceKindRepository->find($row['kind_id']);
|
||||||
|
|
||||||
|
if (null === $resourceKind) {
|
||||||
|
throw new RuntimeException('charge kind not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$result[$resourceKind->getKind()] = [
|
||||||
|
'sum' => (float) $row['sum'],
|
||||||
|
'label' => $this->translatableStringHelper->localize($resourceKind->getName()),
|
||||||
|
'comment' => (string) $row['comment'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new LogicException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\BudgetBundle\Templating;
|
||||||
|
|
||||||
|
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||||
|
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||||
|
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Symfony\Component\Templating\EngineInterface;
|
||||||
|
|
||||||
|
final class BudgetElementTypeRender implements ChillEntityRenderInterface
|
||||||
|
{
|
||||||
|
private EngineInterface $engine;
|
||||||
|
|
||||||
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
public function __construct(TranslatableStringHelperInterface $translatableStringHelper, EngineInterface $engine)
|
||||||
|
{
|
||||||
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
|
$this->engine = $engine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderBox($entity, array $options): string
|
||||||
|
{
|
||||||
|
return $this->engine->render('@ChillBudget/Entity/budget_element_type.html.twig', [
|
||||||
|
'entity' => $entity,
|
||||||
|
'options' => $options,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function renderString($entity, array $options): string
|
||||||
|
{
|
||||||
|
$title = '';
|
||||||
|
|
||||||
|
if (null !== $entity->getName()) {
|
||||||
|
return $this->translatableStringHelper->localize($entity->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function supports($entity, array $options): bool
|
||||||
|
{
|
||||||
|
return $entity instanceof ChargeKind || $entity instanceof ResourceKind;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\BudgetBundle\Templating;
|
|
||||||
|
|
||||||
use Chill\BudgetBundle\Config\ConfigRepository;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
|
||||||
use Twig\Extension\AbstractExtension;
|
|
||||||
use Twig\TwigFilter;
|
|
||||||
use UnexpectedValueException;
|
|
||||||
|
|
||||||
class Twig extends AbstractExtension
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @var ConfigRepository
|
|
||||||
*/
|
|
||||||
protected $configRepository;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var TranslatableStringHelper
|
|
||||||
*/
|
|
||||||
protected $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ConfigRepository $configRepository,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->configRepository = $configRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function displayLink($link, $family)
|
|
||||||
{
|
|
||||||
switch ($family) {
|
|
||||||
case 'resource':
|
|
||||||
return $this->translatableStringHelper->localize(
|
|
||||||
$this->configRepository->getResourcesLabels()[$link]
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'charge':
|
|
||||||
return $this->translatableStringHelper->localize(
|
|
||||||
$this->configRepository->getChargesLabels()[$link]
|
|
||||||
);
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new UnexpectedValueException("This family of element: {$family} is not "
|
|
||||||
. "supported. Supported families are 'resource', 'charge'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFilters()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
new TwigFilter('budget_element_type_display', [$this, 'displayLink'], ['is_safe' => ['html']]),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +0,0 @@
|
|||||||
services:
|
|
||||||
Chill\BudgetBundle\Config\ConfigRepository:
|
|
||||||
arguments:
|
|
||||||
$resources: '%chill_budget.resources%'
|
|
||||||
$charges: '%chill_budget.charges%'
|
|
@@ -3,3 +3,7 @@ services:
|
|||||||
autowire: true
|
autowire: true
|
||||||
resource: '../../Controller'
|
resource: '../../Controller'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
Chill\BudgetBundle\Controller\Admin\:
|
||||||
|
autowire: true
|
||||||
|
autoconfigure: true
|
||||||
|
resource: '../../Controller/Admin'
|
||||||
|
@@ -1,14 +1,9 @@
|
|||||||
services:
|
services:
|
||||||
Chill\BudgetBundle\Form\ResourceType:
|
Chill\BudgetBundle\Form\:
|
||||||
arguments:
|
autowire: true
|
||||||
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
|
resource: '../../Form'
|
||||||
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
|
||||||
tags:
|
|
||||||
- { name: 'form.type' }
|
|
||||||
|
|
||||||
Chill\BudgetBundle\Form\ChargeType:
|
|
||||||
arguments:
|
|
||||||
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
|
|
||||||
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
|
||||||
tags:
|
tags:
|
||||||
- { name: 'form.type' }
|
- { name: 'form.type' }
|
||||||
|
# Chill\BudgetBundle\Form\Admin\:
|
||||||
|
# autowire: true
|
||||||
|
# resource: '../../Form/Admin'
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
Chill\BudgetBundle\Menu\PersonMenuBuilder:
|
Chill\BudgetBundle\Menu\:
|
||||||
autowire: true
|
|
||||||
autoconfigure: true
|
|
||||||
|
|
||||||
Chill\BudgetBundle\Menu\HouseholdMenuBuilder:
|
|
||||||
autowire: true
|
autowire: true
|
||||||
autoconfigure: true
|
autoconfigure: true
|
||||||
|
resource: './../../Menu'
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
services:
|
||||||
|
Chill\BudgetBundle\Repository\:
|
||||||
|
autowire: true
|
||||||
|
autoconfigure: true
|
||||||
|
resource: './../../Repository'
|
@@ -1,7 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
Chill\BudgetBundle\Templating\Twig:
|
Chill\BudgetBundle\Templating\:
|
||||||
arguments:
|
autowire: true
|
||||||
$configRepository: '@Chill\BudgetBundle\Config\ConfigRepository'
|
autoconfigure: true
|
||||||
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
resource: '../../Templating'
|
||||||
tags:
|
|
||||||
- { name: 'twig.extension' }
|
|
||||||
|
@@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20221116163445 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DROP SEQUENCE chill_budget.charge_type_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP SEQUENCE chill_budget.resource_type_id_seq CASCADE');
|
||||||
|
$this->addSql('DROP TABLE chill_budget.charge_type');
|
||||||
|
$this->addSql('DROP TABLE chill_budget.resource_type');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Create resource type and charge type';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('CREATE SEQUENCE chill_budget.charge_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE SEQUENCE chill_budget.resource_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE TABLE chill_budget.charge_type (id INT NOT NULL, isActive BOOLEAN DEFAULT TRUE NOT NULL, name JSONB DEFAULT \'{}\'::jsonb NOT NULL, ordering DOUBLE PRECISION DEFAULT \'0\' NOT NULL, PRIMARY KEY(id))');
|
||||||
|
$this->addSql('CREATE TABLE chill_budget.resource_type (id INT NOT NULL, isActive BOOLEAN DEFAULT TRUE NOT NULL, name JSONB DEFAULT \'{}\'::jsonb NOT NULL, ordering DOUBLE PRECISION DEFAULT \'0\' NOT NULL, PRIMARY KEY(id))');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20221130101659 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource_type DROP kind');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource_type DROP tags');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge_type DROP kind');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge_type DROP tags');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Add kind and tags property to charge and resource types';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge_type ADD kind VARCHAR(255) DEFAULT \'\' NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge_type ADD tags JSONB DEFAULT \'{}\'::jsonb NOT NULL');
|
||||||
|
$this->addSql('COMMENT ON COLUMN chill_budget.charge_type.tags IS \'(DC2Type:jsonb)\'');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource_type ADD kind VARCHAR(255) DEFAULT \'\' NOT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource_type ADD tags JSONB DEFAULT \'{}\'::jsonb NOT NULL');
|
||||||
|
$this->addSql('COMMENT ON COLUMN chill_budget.resource_type.tags IS \'(DC2Type:jsonb)\'');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20221202165608 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge DROP CONSTRAINT FK_5C99D2C355284914');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge DROP charge_id');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource DROP CONSTRAINT FK_5E0A5E9789329D25');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource DROP resource_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Integrate budget admin entity';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge ADD charge_id INT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.charge ADD CONSTRAINT FK_5C99D2C355284914 FOREIGN KEY (charge_id) REFERENCES chill_budget.charge_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('CREATE INDEX IDX_5C99D2C355284914 ON chill_budget.charge (charge_id)');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource ADD resource_id INT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_budget.resource ADD CONSTRAINT FK_5E0A5E9789329D25 FOREIGN KEY (resource_id) REFERENCES chill_budget.resource_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('CREATE INDEX IDX_5E0A5E9789329D25 ON chill_budget.resource (resource_id)');
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
|
||||||
|
final class Version20221207105407 extends AbstractMigration implements ContainerAwareInterface
|
||||||
|
{
|
||||||
|
public ContainerInterface $container;
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DELETE FROM chill_budget.resource_type;');
|
||||||
|
$this->addSql('DELETE FROM chill_budget.charge_type;');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Use new budget admin entities';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setContainer(?ContainerInterface $container = null)
|
||||||
|
{
|
||||||
|
$this->container = $container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$resources = $this->container->getParameter('chill_budget.resources');
|
||||||
|
$charges = $this->container->getParameter('chill_budget.charges');
|
||||||
|
|
||||||
|
foreach ($resources as $value) {
|
||||||
|
$lang = $value['labels'][0]['lang'];
|
||||||
|
$label = $value['labels'][0]['label'];
|
||||||
|
$kind = $value['key'];
|
||||||
|
$this->addSql(
|
||||||
|
'INSERT INTO chill_budget.resource_type (id, isActive, name, ordering, kind) VALUES (
|
||||||
|
nextval(\'chill_budget.resource_type_id_seq\'), true, jsonb_build_object(:lang::text, :label::text), 0, :kind::text)',
|
||||||
|
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||||
|
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||||
|
);
|
||||||
|
$this->addSql(
|
||||||
|
'UPDATE chill_budget.resource SET resource_id = resource_type.id
|
||||||
|
FROM chill_budget.resource_type WHERE resource.type = :kind AND resource_type.kind = resource.type;',
|
||||||
|
['kind' => $kind],
|
||||||
|
['kind' => Types::STRING]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($charges as $value) {
|
||||||
|
$lang = $value['labels'][0]['lang'];
|
||||||
|
$label = $value['labels'][0]['label'];
|
||||||
|
$kind = $value['key'];
|
||||||
|
$this->addSql(
|
||||||
|
'INSERT INTO chill_budget.charge_type VALUES (nextval(\'chill_budget.charge_type_id_seq\'), true,
|
||||||
|
jsonb_build_object(:lang::text, :label::text), 0, :kind::text);',
|
||||||
|
['lang' => $lang, 'label' => $label, 'kind' => $kind],
|
||||||
|
['lang' => Types::STRING, 'label' => Types::STRING, 'kind' => Types::STRING]
|
||||||
|
);
|
||||||
|
$this->addSql(
|
||||||
|
'UPDATE chill_budget.charge SET charge_id = charge_type.id
|
||||||
|
FROM chill_budget.charge_type WHERE charge.type = :kind AND charge_type.kind = charge.type;',
|
||||||
|
['kind' => $kind],
|
||||||
|
['kind' => Types::STRING]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Budget;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20230201131008 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this shouldn't be undone.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Fix the comment on tags column in resource and charge type';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('COMMENT ON COLUMN chill_budget.resource_type.tags IS \'(DC2Type:json)\'');
|
||||||
|
$this->addSql('COMMENT ON COLUMN chill_budget.charge_type.tags IS \'(DC2Type:json)\'');
|
||||||
|
}
|
||||||
|
}
|
@@ -58,6 +58,8 @@ Charge updated: charge mise à jour
|
|||||||
|
|
||||||
Choose a resource type: Choisissez un type de ressource
|
Choose a resource type: Choisissez un type de ressource
|
||||||
Choose a charge type: Choisissez un type de charge
|
Choose a charge type: Choisissez un type de charge
|
||||||
|
Resource type: Type de ressource
|
||||||
|
Charge type: Type de charge
|
||||||
Amount: Montant
|
Amount: Montant
|
||||||
Comment: Commentaire
|
Comment: Commentaire
|
||||||
|
|
||||||
@@ -74,3 +76,35 @@ The balance: Différence entre ressources et charges
|
|||||||
|
|
||||||
Valid since %startDate% until %endDate%: Valide depuis le %startDate% jusqu'au %endDate%
|
Valid since %startDate% until %endDate%: Valide depuis le %startDate% jusqu'au %endDate%
|
||||||
Valid since %startDate%: Valide depuis le %startDate%
|
Valid since %startDate%: Valide depuis le %startDate%
|
||||||
|
|
||||||
|
# ROLES
|
||||||
|
Budget elements: Budget
|
||||||
|
CHILL_BUDGET_ELEMENT_CREATE: Créer une ressource/charge
|
||||||
|
CHILL_BUDGET_ELEMENT_DELETE: Supprimer une ressource/charge
|
||||||
|
CHILL_BUDGET_ELEMENT_SEE: Voir les ressources/charges
|
||||||
|
CHILL_BUDGET_ELEMENT_UPDATE: Modifier une ressource/charge
|
||||||
|
|
||||||
|
## admin
|
||||||
|
|
||||||
|
crud:
|
||||||
|
resource_kind:
|
||||||
|
title_new: Nouveau type de ressource
|
||||||
|
title_edit: Modifier le type de ressource
|
||||||
|
charge_kind:
|
||||||
|
title_new: Nouveau type de charge
|
||||||
|
title_edit: Modifier le type de charge
|
||||||
|
|
||||||
|
admin:
|
||||||
|
menu:
|
||||||
|
Resource types: Types de ressource
|
||||||
|
Charge types: Types de charge
|
||||||
|
title:
|
||||||
|
Charge Type List: Liste des types de charge
|
||||||
|
Resource Type List: Liste des types de ressource
|
||||||
|
Budget configuration: Configuration des éléments de budget
|
||||||
|
new:
|
||||||
|
Create a new charge type: Créér un nouveau type de charge
|
||||||
|
Create a new resource type: Créér un nouveau type de ressource
|
||||||
|
form:
|
||||||
|
Choose the type of resource: Choisissez une type de ressource
|
||||||
|
Choose the type of charge: Choisissez une type de charge
|
||||||
|
@@ -45,6 +45,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
|
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class CalendarController extends AbstractController
|
class CalendarController extends AbstractController
|
||||||
{
|
{
|
||||||
@@ -68,6 +69,8 @@ class CalendarController extends AbstractController
|
|||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
private UserRepositoryInterface $userRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@@ -81,7 +84,8 @@ class CalendarController extends AbstractController
|
|||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
PersonRepository $personRepository,
|
PersonRepository $personRepository,
|
||||||
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||||
UserRepositoryInterface $userRepository
|
UserRepositoryInterface $userRepository,
|
||||||
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$this->calendarACLAwareRepository = $calendarACLAwareRepository;
|
$this->calendarACLAwareRepository = $calendarACLAwareRepository;
|
||||||
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
$this->docGeneratorTemplateRepository = $docGeneratorTemplateRepository;
|
||||||
@@ -94,6 +98,7 @@ class CalendarController extends AbstractController
|
|||||||
$this->personRepository = $personRepository;
|
$this->personRepository = $personRepository;
|
||||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
||||||
$this->userRepository = $userRepository;
|
$this->userRepository = $userRepository;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,7 +136,7 @@ class CalendarController extends AbstractController
|
|||||||
$em->remove($entity);
|
$em->remove($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')
|
$this->addFlash('success', $this->translator
|
||||||
->trans('The calendar item has been successfully removed.'));
|
->trans('The calendar item has been successfully removed.'));
|
||||||
|
|
||||||
return new RedirectResponse($redirectRoute);
|
return new RedirectResponse($redirectRoute);
|
||||||
@@ -190,7 +195,7 @@ class CalendarController extends AbstractController
|
|||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')->trans('Success : calendar item updated!'));
|
$this->addFlash('success', $this->translator->trans('Success : calendar item updated!'));
|
||||||
|
|
||||||
if ($form->get('save_and_upload_doc')->isClicked()) {
|
if ($form->get('save_and_upload_doc')->isClicked()) {
|
||||||
return $this->redirectToRoute('chill_calendar_calendardoc_new', ['id' => $entity->getId()]);
|
return $this->redirectToRoute('chill_calendar_calendardoc_new', ['id' => $entity->getId()]);
|
||||||
@@ -210,7 +215,7 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($form->isSubmitted() && !$form->isValid()) {
|
if ($form->isSubmitted() && !$form->isValid()) {
|
||||||
$this->addFlash('error', $this->get('translator')->trans('This form contains errors'));
|
$this->addFlash('error', $this->translator->trans('This form contains errors'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$entity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
|
$entity_array = $this->serializer->normalize($entity, 'json', ['groups' => 'read']);
|
||||||
@@ -369,7 +374,7 @@ class CalendarController extends AbstractController
|
|||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$this->addFlash('success', $this->get('translator')->trans('Success : calendar item created!'));
|
$this->addFlash('success', $this->translator->trans('Success : calendar item created!'));
|
||||||
|
|
||||||
if ($form->get('save_and_upload_doc')->isClicked()) {
|
if ($form->get('save_and_upload_doc')->isClicked()) {
|
||||||
return $this->redirectToRoute('chill_calendar_calendardoc_new', ['id' => $entity->getId()]);
|
return $this->redirectToRoute('chill_calendar_calendardoc_new', ['id' => $entity->getId()]);
|
||||||
@@ -393,7 +398,7 @@ class CalendarController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($form->isSubmitted() && !$form->isValid()) {
|
if ($form->isSubmitted() && !$form->isValid()) {
|
||||||
$this->addFlash('error', $this->get('translator')->trans('This form contains errors'));
|
$this->addFlash('error', $this->translator->trans('This form contains errors'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $view) {
|
if (null === $view) {
|
||||||
|
@@ -145,6 +145,9 @@ class CalendarDocController
|
|||||||
$returnParams = ['id' => $calendarDoc->getCalendar()->getPerson()->getId()];
|
$returnParams = ['id' => $calendarDoc->getCalendar()->getPerson()->getId()];
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new \LogicException(sprintf("This context '%s' is not supported", $calendarDoc->getCalendar()->getContext()));
|
||||||
}
|
}
|
||||||
|
|
||||||
$form = $this->formFactory->createBuilder()
|
$form = $this->formFactory->createBuilder()
|
||||||
|
@@ -512,7 +512,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
*/
|
*/
|
||||||
public function getUsers(): Collection
|
public function getUsers(): Collection
|
||||||
{
|
{
|
||||||
return $this->getInvites()->map(static function (Invite $i) { return $i->getUser(); });
|
return $this->getInvites()->map(static function (Invite $i) {
|
||||||
|
return $i->getUser();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasCalendarRange(): bool
|
public function hasCalendarRange(): bool
|
||||||
@@ -597,7 +599,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invite = $this->invites
|
$invite = $this->invites
|
||||||
->filter(static function (Invite $invite) use ($user) { return $invite->getUser() === $user; })
|
->filter(static function (Invite $invite) use ($user) {
|
||||||
|
return $invite->getUser() === $user;
|
||||||
|
})
|
||||||
->first();
|
->first();
|
||||||
$this->removeInvite($invite);
|
$this->removeInvite($invite);
|
||||||
|
|
||||||
|
@@ -39,7 +39,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
->setAttribute('class', 'list-group-item-header')
|
->setAttribute('class', 'list-group-item-header')
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => 6000,
|
'order' => 6000,
|
||||||
'icons' => ['calendar'],
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$menu->addChild('Cancel reason', [
|
$menu->addChild('Cancel reason', [
|
||||||
|
@@ -89,10 +89,14 @@ class CalendarToRemoteHandler implements MessageHandlerInterface
|
|||||||
|
|
||||||
$newInvites = array_filter(
|
$newInvites = array_filter(
|
||||||
array_map(
|
array_map(
|
||||||
function ($id) { return $this->inviteRepository->find($id); },
|
function ($id) {
|
||||||
|
return $this->inviteRepository->find($id);
|
||||||
|
},
|
||||||
$calendarMessage->getNewInvitesIds(),
|
$calendarMessage->getNewInvitesIds(),
|
||||||
),
|
),
|
||||||
static function (?Invite $invite) { return null !== $invite; }
|
static function (?Invite $invite) {
|
||||||
|
return null !== $invite;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->calendarConnector->syncCalendar(
|
$this->calendarConnector->syncCalendar(
|
||||||
|
@@ -167,7 +167,9 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
]
|
]
|
||||||
)->toArray();
|
)->toArray();
|
||||||
|
|
||||||
$ids = array_map(static function ($item) { return $item['id']; }, $bareEvents['value']);
|
$ids = array_map(static function ($item) {
|
||||||
|
return $item['id'];
|
||||||
|
}, $bareEvents['value']);
|
||||||
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
||||||
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
|
{% import "@ChillDocStore/Macro/macro.html.twig" as m %}
|
||||||
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
|
{% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %}
|
||||||
|
|
||||||
<div class="accompanying_course_work-list">
|
<div class="accompanying-course-work">
|
||||||
<table class="obj-res-eval my-3">
|
<table class="obj-res-eval my-3">
|
||||||
<thead>
|
<thead>
|
||||||
<th class="eval">
|
<th class="eval">
|
||||||
|
@@ -114,8 +114,12 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
||||||
$this->assertEquals(9, $calendar->getLocation()->getId());
|
$this->assertEquals(9, $calendar->getLocation()->getId());
|
||||||
$this->assertEquals(true, $calendar->getSendSMS());
|
$this->assertEquals(true, $calendar->getSendSMS());
|
||||||
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) {
|
||||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
return $u->getId();
|
||||||
|
}));
|
||||||
|
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) {
|
||||||
|
return $u->getId();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getExtensions()
|
protected function getExtensions()
|
||||||
@@ -147,7 +151,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
return implode(
|
||||||
',',
|
',',
|
||||||
array_map(static function ($p) { return $p->getId(); }, $args[0])
|
array_map(static function ($p) {
|
||||||
|
return $p->getId();
|
||||||
|
}, $args[0])
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
$transformer->transform(Argument::exact(null))
|
$transformer->transform(Argument::exact(null))
|
||||||
@@ -156,7 +162,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
return implode(
|
||||||
',',
|
',',
|
||||||
array_map(static function ($p) { return $p->getId(); }, $args[0]->toArray())
|
array_map(static function ($p) {
|
||||||
|
return $p->getId();
|
||||||
|
}, $args[0]->toArray())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
$transformer->reverseTransform(Argument::type('string'))
|
$transformer->reverseTransform(Argument::type('string'))
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user