mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-12 01:34:58 +00:00
Compare commits
167 Commits
rector-boo
...
upgrade/sy
Author | SHA1 | Date | |
---|---|---|---|
13bc9683fb
|
|||
958e2b5cf2
|
|||
f7ed390c96
|
|||
217ce99851
|
|||
efaa01f4f6
|
|||
f04ef9c931
|
|||
9252e92da0
|
|||
4ab4554e63
|
|||
6d63177ff4
|
|||
81e8928344
|
|||
737f5f9275
|
|||
07c681fcec
|
|||
1c7d90a6ef
|
|||
24c33b306b
|
|||
7e19419861
|
|||
c35994203d
|
|||
9027cbd196
|
|||
dde3002100
|
|||
d8870e906f
|
|||
7e3295c71f | |||
b3d881c675 | |||
47d0334b9e
|
|||
c94653a388
|
|||
00e62442cc
|
|||
a539febcfe | |||
1eb78d7273 | |||
1e2ca764c1
|
|||
a859b7ea93 | |||
49094ff54a | |||
1d2b6e167f | |||
9918cf2d58
|
|||
0c5a06c678
|
|||
13feb3b212 | |||
dc22c94b95 | |||
7cb7897e12 | |||
01f2697b8d | |||
025ee2ea95 | |||
631d65a57f | |||
dde35be9c3 | |||
a59e84b029 | |||
60ada2edce | |||
e6163b2bc3
|
|||
906d1fdab5
|
|||
a1421ea99f
|
|||
cb1ea8c622
|
|||
b985e1c93e | |||
929c9f4f72 | |||
eaeab4ed2b | |||
034e2553bc | |||
a0d0c3840f | |||
b69fb740b1
|
|||
d31021247b | |||
d898f3ffce | |||
25c033be61
|
|||
746ed4f5e5
|
|||
80647147ee
|
|||
a9db133a7b
|
|||
858ade467c
|
|||
a68190f0c6
|
|||
459b91001f
|
|||
19034ac1d8
|
|||
4c2e78ada7
|
|||
bef1d6b4a3 | |||
c48c5875c6
|
|||
ffa94dbe40
|
|||
33051366d4
|
|||
2b42db87dc
|
|||
ffc3a97651 | |||
499417aea5 | |||
91d40d9153 | |||
ec7f59fc03 | |||
83ce3b3e92 | |||
324a350bf1 | |||
27415ce868 | |||
8042edc13c | |||
318a84e04d | |||
d759b9c727
|
|||
0af13b028e | |||
91ba0c983d | |||
78d3c6f1be | |||
19e51cc74c
|
|||
48f5e7d21f | |||
a9fe834978
|
|||
a21637331f
|
|||
63759a940f
|
|||
1cd153fb78
|
|||
0335986326
|
|||
1ecb285687 | |||
a553dc9aab
|
|||
d0830079da
|
|||
2a4b73457b
|
|||
d04011ca07
|
|||
796608b399 | |||
b0ac8ce5af
|
|||
d70a0fa08b | |||
8bec6feb96
|
|||
4db1ff405e
|
|||
841bdb0ebf
|
|||
d9dd8d7317
|
|||
98aad8c4b6
|
|||
ef13833966
|
|||
9853845c9c
|
|||
a42a4ab9bd
|
|||
839b0fc826
|
|||
cc69a3e86b
|
|||
4d734714a8
|
|||
1c19d01b60
|
|||
3df8ee6dc4
|
|||
386d1e44d0
|
|||
907c724047
|
|||
4cf6721e35
|
|||
46e1891386
|
|||
380ad2e2e6
|
|||
cba2bd8260 | |||
ee61d131ec
|
|||
70141fd0e3
|
|||
94c8b571f0 | |||
94a099c30c | |||
3ce6af4c36 | |||
c8e33daf4b | |||
0f635847f2 | |||
d290572ca8 | |||
3c88630edc
|
|||
866b92f7e5
|
|||
e84a93bd0c
|
|||
4c5dae60a8
|
|||
b9a7530f7a
|
|||
64b8ae3df1
|
|||
|
c9f26f3635 | ||
a943639cf1
|
|||
40e751c783
|
|||
|
6d6aa689d0 | ||
|
03fe9210a9 | ||
|
f3ede8122d | ||
|
801853e60a | ||
|
3927a7f62b | ||
|
1167ff25b1 | ||
|
5bba1aca93 | ||
|
9ded3eb631 | ||
|
bf79e0afdb | ||
|
6bf8789f85 | ||
|
8c37afa3a9 | ||
|
a8c2750ac8 | ||
e45952f28c | |||
|
3de5d29fe8 | ||
|
94046aab81 | ||
|
a3db67fd1e | ||
|
295406d9b7 | ||
|
35174e4241 | ||
|
7580565e08 | ||
|
a992c45720 | ||
|
1789a75216 | ||
|
2b3d7f34fc | ||
|
cbc3ee68b5 | ||
58faac5bca
|
|||
99cdf0ebaf
|
|||
204c28d373
|
|||
adc80d5080
|
|||
f256dda6fe
|
|||
8177a0fcce
|
|||
21e24c60c7
|
|||
71d0785ab4
|
|||
b740a88ae3
|
|||
c56ae08fae
|
|||
c9fe5a393f
|
|||
8e0d144dd1
|
|||
2fe77f2610 |
35
.env.test
35
.env.test
@@ -3,3 +3,38 @@
|
|||||||
# Run tests from root to adapt your own environment
|
# Run tests from root to adapt your own environment
|
||||||
KERNEL_CLASS='App\Kernel'
|
KERNEL_CLASS='App\Kernel'
|
||||||
APP_SECRET='$ecretf0rt3st'
|
APP_SECRET='$ecretf0rt3st'
|
||||||
|
|
||||||
|
ADMIN_PASSWORD=admin
|
||||||
|
|
||||||
|
LOCALE=fr
|
||||||
|
REDIS_URL=redis
|
||||||
|
REDIS_PORT=6379
|
||||||
|
REDIS_URL=redis://${REDIS_HOST}:${REDIS_PORT}
|
||||||
|
|
||||||
|
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
|
||||||
|
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
|
||||||
|
JWT_PASSPHRASE=2a30f6ba26521a2613821da35f28386e
|
||||||
|
|
||||||
|
TWILIO_SID=~
|
||||||
|
TWILIO_SECRET=~
|
||||||
|
DEFAULT_CARRIER_CODE=BE
|
||||||
|
|
||||||
|
ADD_ADDRESS_DEFAULT_COUNTRY=BE
|
||||||
|
|
||||||
|
ADD_ADDRESS_MAP_CENTER_X=50.8443
|
||||||
|
ADD_ADDRESS_MAP_CENTER_Y=4.3523
|
||||||
|
ADD_ADDRESS_MAP_CENTER_Z=15
|
||||||
|
|
||||||
|
SHORT_MESSAGE_DSN=null://null
|
||||||
|
MESSENGER_TRANSPORT_DSN=sync://
|
||||||
|
###< symfony/messenger ###
|
||||||
|
|
||||||
|
###> doctrine/doctrine-bundle ###
|
||||||
|
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||||
|
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||||
|
#
|
||||||
|
DATABASE_URL="postgresql://postgres:postgres@db:5432/test?serverVersion=14&charset=utf8"
|
||||||
|
|
||||||
|
ASYNC_UPLOAD_TEMP_URL_KEY=
|
||||||
|
ASYNC_UPLOAD_TEMP_URL_BASE_PATH=
|
||||||
|
ASYNC_UPLOAD_TEMP_URL_CONTAINER=
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
# Select what we should cache between builds
|
# Select what we should cache between builds
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- tests/app/vendor/
|
|
||||||
- .cache
|
- .cache
|
||||||
|
|
||||||
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||||
@@ -28,7 +27,7 @@ variables:
|
|||||||
REDIS_PORT: 6379
|
REDIS_PORT: 6379
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
# change vendor dir to make the app install into tests/apps
|
# change vendor dir to make the app install into tests/apps
|
||||||
COMPOSER_VENDOR_DIR: tests/app/vendor
|
#COMPOSER_VENDOR_DIR: /vendor
|
||||||
DEFAULT_CARRIER_CODE: BE
|
DEFAULT_CARRIER_CODE: BE
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
@@ -49,7 +48,7 @@ build:
|
|||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- vendor/
|
||||||
|
|
||||||
code_style:
|
code_style:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
@@ -63,7 +62,7 @@ code_style:
|
|||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- vendor/
|
||||||
|
|
||||||
phpstan_tests:
|
phpstan_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
@@ -77,7 +76,7 @@ phpstan_tests:
|
|||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- vendor/
|
||||||
|
|
||||||
rector_tests:
|
rector_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
@@ -91,7 +90,7 @@ rector_tests:
|
|||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- vendor/
|
||||||
|
|
||||||
# psalm_tests:
|
# psalm_tests:
|
||||||
# stage: Tests
|
# stage: Tests
|
||||||
@@ -108,14 +107,15 @@ rector_tests:
|
|||||||
unit_tests:
|
unit_tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
image: gitea.champs-libres.be/chill-project/chill-skeleton-basic/base-image:php82
|
||||||
|
# until we fix testes
|
||||||
|
allow_failure: true
|
||||||
script:
|
script:
|
||||||
- php tests/app/bin/console doctrine:migrations:migrate -n
|
- php tests/console doctrine:migrations:migrate -n
|
||||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=dev
|
- php -d memory_limit=3G tests/console doctrine:fixtures:load -n
|
||||||
- php -d memory_limit=3G tests/app/bin/console doctrine:fixtures:load -n
|
- php -d memory_limit=2G tests/console cache:clear --env=test
|
||||||
- php -d memory_limit=2G tests/app/bin/console cache:clear --env=test
|
|
||||||
- php -d memory_limit=4G bin/phpunit --colors=never
|
- php -d memory_limit=4G bin/phpunit --colors=never
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 30 min
|
expire_in: 30 min
|
||||||
paths:
|
paths:
|
||||||
- bin
|
- bin
|
||||||
- tests/app/vendor/
|
- vendor/
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,6 +1,3 @@
|
|||||||
[submodule "_exts/sphinx-php"]
|
[submodule "_exts/sphinx-php"]
|
||||||
path = _exts/sphinx-php
|
path = _exts/sphinx-php
|
||||||
url = https://github.com/fabpot/sphinx-php.git
|
url = https://github.com/fabpot/sphinx-php.git
|
||||||
[submodule "tests/app"]
|
|
||||||
path = tests/app
|
|
||||||
url = https://gitlab.com/Chill-projet/chill-app.git
|
|
||||||
|
@@ -47,7 +47,6 @@
|
|||||||
"symfony/monolog-bundle": "^3.5",
|
"symfony/monolog-bundle": "^3.5",
|
||||||
"symfony/security-bundle": "^4.4",
|
"symfony/security-bundle": "^4.4",
|
||||||
"symfony/serializer": "^5.3",
|
"symfony/serializer": "^5.3",
|
||||||
"symfony/swiftmailer-bundle": "^3.5",
|
|
||||||
"symfony/templating": "^4.4",
|
"symfony/templating": "^4.4",
|
||||||
"symfony/translation": "^4.4",
|
"symfony/translation": "^4.4",
|
||||||
"symfony/twig-bundle": "^4.4",
|
"symfony/twig-bundle": "^4.4",
|
||||||
@@ -108,7 +107,7 @@
|
|||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"App\\": "tests/app/src/",
|
"App\\": "tests/",
|
||||||
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests",
|
"Chill\\DocGeneratorBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests",
|
||||||
"Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
"Chill\\WopiBundle\\Tests\\": "src/Bundle/ChillDocGeneratorBundle/tests"
|
||||||
}
|
}
|
||||||
@@ -124,12 +123,10 @@
|
|||||||
},
|
},
|
||||||
"bin-dir": "bin",
|
"bin-dir": "bin",
|
||||||
"optimize-autoloader": true,
|
"optimize-autoloader": true,
|
||||||
"sort-packages": true,
|
"sort-packages": true
|
||||||
"vendor-dir": "tests/app/vendor"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"auto-scripts": {
|
"auto-scripts": {
|
||||||
"assets:install %PUBLIC_DIR%": "symfony-cmd",
|
|
||||||
"cache:clear": "symfony-cmd"
|
"cache:clear": "symfony-cmd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -50,18 +50,9 @@ class CountPerson implements ExportInterface
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
// the Closure which will be executed by the formatter.
|
// the Closure which will be executed by the formatter.
|
||||||
return function ($value) {
|
return fn($value) => match ($value) {
|
||||||
switch ($value) {
|
'_header' => $this->getTitle(),
|
||||||
case '_header':
|
default => $value,
|
||||||
// we have to process specifically the '_header' string,
|
|
||||||
// which will be used by the formatter to show a column title
|
|
||||||
return $this->getTitle();
|
|
||||||
|
|
||||||
default:
|
|
||||||
// for all value, we do not process them and return them
|
|
||||||
// immediatly
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,9 +81,7 @@ class CountPerson implements ExportInterface
|
|||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
// we gather all center the user choose.
|
// we gather all center the user choose.
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder();
|
$qb = $this->entityManager->createQueryBuilder();
|
||||||
|
|
||||||
|
@@ -23,19 +23,12 @@ class ChillMainConfiguration implements ConfigurationInterface
|
|||||||
{
|
{
|
||||||
use AddWidgetConfigurationTrait;
|
use AddWidgetConfigurationTrait;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var ContainerBuilder
|
|
||||||
*/
|
|
||||||
private $containerBuilder;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $widgetFactories,
|
array $widgetFactories,
|
||||||
ContainerBuilder $containerBuilder
|
private readonly ContainerBuilder $containerBuilder
|
||||||
) {
|
) {
|
||||||
// we register here widget factories (see below)
|
// we register here widget factories (see below)
|
||||||
$this->setWidgetFactories($widgetFactories);
|
$this->setWidgetFactories($widgetFactories);
|
||||||
// we will need the container builder later...
|
|
||||||
$this->containerBuilder = $containerBuilder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
"@fullcalendar/timegrid": "^6.1.4",
|
"@fullcalendar/timegrid": "^6.1.4",
|
||||||
"@fullcalendar/vue3": "^6.1.4",
|
"@fullcalendar/vue3": "^6.1.4",
|
||||||
"@popperjs/core": "^2.9.2",
|
"@popperjs/core": "^2.9.2",
|
||||||
|
"@types/leaflet": "^1.9.3",
|
||||||
"dropzone": "^5.7.6",
|
"dropzone": "^5.7.6",
|
||||||
"es6-promise": "^4.2.8",
|
"es6-promise": "^4.2.8",
|
||||||
"leaflet": "^1.7.1",
|
"leaflet": "^1.7.1",
|
||||||
|
@@ -2631,11 +2631,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Call to method getRoleScopes\\(\\) on an unknown class Chill\\\\MainBundle\\\\Entity\\\\PermissionGroup\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Empty array passed to foreach\\.$#"
|
message: "#^Empty array passed to foreach\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="tests/app/vendor/phpunit/phpunit/phpunit.xsd"
|
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||||
backupGlobals="false"
|
backupGlobals="false"
|
||||||
colors="true"
|
colors="true"
|
||||||
bootstrap="tests/app/tests/bootstrap.php"
|
bootstrap="tests/bootstrap.php"
|
||||||
>
|
>
|
||||||
<php>
|
<php>
|
||||||
<ini name="error_reporting" value="-1" />
|
<ini name="error_reporting" value="-1" />
|
||||||
|
28
rector.php
28
rector.php
@@ -12,14 +12,30 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
__DIR__ . '/src',
|
__DIR__ . '/src',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
$rectorConfig->symfonyContainerXml(__DIR__ . '/var/cache/dev/testsApp_KernelDevDebugContainer.xml');
|
||||||
$rectorConfig->cacheDirectory(__DIR__.'/.cache/rector');
|
|
||||||
|
//$rectorConfig->cacheClass(\Rector\Caching\ValueObject\Storage\FileCacheStorage::class);
|
||||||
|
//$rectorConfig->cacheDirectory(__DIR__ . '/.cache/rector');
|
||||||
|
|
||||||
// register a single rule
|
// register a single rule
|
||||||
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
|
||||||
|
$rectorConfig->disableParallel();
|
||||||
|
|
||||||
// define sets of rules
|
//define sets of rules
|
||||||
// $rectorConfig->sets([
|
$rectorConfig->sets([
|
||||||
// LevelSetList::UP_TO_PHP_74
|
LevelSetList::UP_TO_PHP_82,
|
||||||
// ]);
|
\Rector\Symfony\Set\SymfonySetList::SYMFONY_44,
|
||||||
|
]);
|
||||||
|
|
||||||
|
// skip some path...
|
||||||
|
$rectorConfig->skip([
|
||||||
|
// make rector stuck for some files
|
||||||
|
\Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector::class,
|
||||||
|
|
||||||
|
// we need to discuss this: are we going to have FALSE in tests instead of an error ?
|
||||||
|
\Rector\Php71\Rector\FuncCall\CountOnNullRector::class,
|
||||||
|
|
||||||
|
// must merge MR500 and review a typing of "ArrayCollection" in entities
|
||||||
|
\Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector::class,
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
@@ -41,83 +41,35 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
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\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
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
|
||||||
{
|
{
|
||||||
private AccompanyingPeriodRepository $accompanyingPeriodRepository;
|
|
||||||
|
|
||||||
private ActivityACLAwareRepositoryInterface $activityACLAwareRepository;
|
|
||||||
|
|
||||||
private ActivityRepository $activityRepository;
|
|
||||||
|
|
||||||
private ActivityTypeCategoryRepository $activityTypeCategoryRepository;
|
|
||||||
|
|
||||||
private ActivityTypeRepositoryInterface $activityTypeRepository;
|
|
||||||
|
|
||||||
private CenterResolverManagerInterface $centerResolver;
|
|
||||||
|
|
||||||
private EntityManagerInterface $entityManager;
|
|
||||||
|
|
||||||
private EventDispatcherInterface $eventDispatcher;
|
|
||||||
|
|
||||||
private LocationRepository $locationRepository;
|
|
||||||
|
|
||||||
private LoggerInterface $logger;
|
|
||||||
|
|
||||||
private PersonRepository $personRepository;
|
|
||||||
|
|
||||||
private SerializerInterface $serializer;
|
|
||||||
|
|
||||||
private ThirdPartyRepository $thirdPartyRepository;
|
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository,
|
private readonly ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||||
ActivityTypeCategoryRepository $activityTypeCategoryRepository,
|
private readonly ActivityTypeCategoryRepository $activityTypeCategoryRepository,
|
||||||
PersonRepository $personRepository,
|
private readonly PersonRepository $personRepository,
|
||||||
ThirdPartyRepository $thirdPartyRepository,
|
private readonly ThirdPartyRepository $thirdPartyRepository,
|
||||||
LocationRepository $locationRepository,
|
private readonly LocationRepository $locationRepository,
|
||||||
ActivityRepository $activityRepository,
|
private readonly ActivityRepository $activityRepository,
|
||||||
AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||||
EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
EventDispatcherInterface $eventDispatcher,
|
private readonly EventDispatcherInterface $eventDispatcher,
|
||||||
LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
SerializerInterface $serializer,
|
private readonly SerializerInterface $serializer,
|
||||||
UserRepositoryInterface $userRepository,
|
private readonly UserRepositoryInterface $userRepository,
|
||||||
CenterResolverManagerInterface $centerResolver,
|
private readonly CenterResolverManagerInterface $centerResolver,
|
||||||
TranslatorInterface $translator
|
private readonly TranslatorInterface $translator,
|
||||||
) {
|
) {
|
||||||
$this->activityACLAwareRepository = $activityACLAwareRepository;
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
$this->activityTypeCategoryRepository = $activityTypeCategoryRepository;
|
|
||||||
$this->personRepository = $personRepository;
|
|
||||||
$this->thirdPartyRepository = $thirdPartyRepository;
|
|
||||||
$this->locationRepository = $locationRepository;
|
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
$this->accompanyingPeriodRepository = $accompanyingPeriodRepository;
|
|
||||||
$this->entityManager = $entityManager;
|
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
|
||||||
$this->logger = $logger;
|
|
||||||
$this->serializer = $serializer;
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->centerResolver = $centerResolver;
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a Activity entity.
|
* Deletes a Activity entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function deleteAction(Request $request, $id)
|
public function deleteAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$view = null;
|
$view = null;
|
||||||
|
|
||||||
@@ -213,7 +165,7 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
$form = $this->createForm(ActivityType::class, $entity, [
|
$form = $this->createForm(ActivityType::class, $entity, [
|
||||||
'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null,
|
'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null,
|
||||||
'role' => new Role('CHILL_ACTIVITY_UPDATE'),
|
'role' => 'CHILL_ACTIVITY_UPDATE',
|
||||||
'activityType' => $entity->getActivityType(),
|
'activityType' => $entity->getActivityType(),
|
||||||
'accompanyingPeriod' => $accompanyingPeriod,
|
'accompanyingPeriod' => $accompanyingPeriod,
|
||||||
]);
|
]);
|
||||||
@@ -442,7 +394,7 @@ final class ActivityController extends AbstractController
|
|||||||
|
|
||||||
$form = $this->createForm(ActivityType::class, $entity, [
|
$form = $this->createForm(ActivityType::class, $entity, [
|
||||||
'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null,
|
'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null,
|
||||||
'role' => new Role('CHILL_ACTIVITY_CREATE'),
|
'role' => 'CHILL_ACTIVITY_CREATE',
|
||||||
'activityType' => $entity->getActivityType(),
|
'activityType' => $entity->getActivityType(),
|
||||||
'accompanyingPeriod' => $accompanyingPeriod,
|
'accompanyingPeriod' => $accompanyingPeriod,
|
||||||
]);
|
]);
|
||||||
|
@@ -47,10 +47,8 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to edit an existing ActivityReasonCategory entity.
|
* Displays a form to edit an existing ActivityReasonCategory entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function editAction($id)
|
public function editAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
@@ -98,10 +96,8 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds and displays a ActivityReasonCategory entity.
|
* Finds and displays a ActivityReasonCategory entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function showAction($id)
|
public function showAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
@@ -118,10 +114,8 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits an existing ActivityReasonCategory entity.
|
* Edits an existing ActivityReasonCategory entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function updateAction(Request $request, $id)
|
public function updateAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
@@ -24,11 +24,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
*/
|
*/
|
||||||
class ActivityReasonController extends AbstractController
|
class ActivityReasonController extends AbstractController
|
||||||
{
|
{
|
||||||
private ActivityReasonRepository $activityReasonRepository;
|
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository)
|
||||||
|
|
||||||
public function __construct(ActivityReasonRepository $activityReasonRepository)
|
|
||||||
{
|
{
|
||||||
$this->activityReasonRepository = $activityReasonRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,10 +53,8 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a form to edit an existing ActivityReason entity.
|
* Displays a form to edit an existing ActivityReason entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function editAction($id)
|
public function editAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
@@ -107,10 +102,8 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds and displays a ActivityReason entity.
|
* Finds and displays a ActivityReason entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function showAction($id)
|
public function showAction(mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
@@ -127,10 +120,8 @@ class ActivityReasonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits an existing ActivityReason entity.
|
* Edits an existing ActivityReason entity.
|
||||||
*
|
|
||||||
* @param mixed $id
|
|
||||||
*/
|
*/
|
||||||
public function updateAction(Request $request, $id)
|
public function updateAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
@@ -25,17 +25,14 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
{
|
{
|
||||||
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Faker\Generator
|
* @var \Faker\Generator
|
||||||
*/
|
*/
|
||||||
private $faker;
|
private $faker;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(private readonly EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->faker = FakerFactory::create('fr_FR');
|
$this->faker = FakerFactory::create('fr_FR');
|
||||||
$this->em = $em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOrder()
|
public function getOrder()
|
||||||
@@ -50,7 +47,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
foreach ($persons as $person) {
|
foreach ($persons as $person) {
|
||||||
$activityNbr = mt_rand(0, 3);
|
$activityNbr = random_int(0, 3);
|
||||||
|
|
||||||
for ($i = 0; $i < $activityNbr; ++$i) {
|
for ($i = 0; $i < $activityNbr; ++$i) {
|
||||||
$activity = $this->newRandomActivity($person);
|
$activity = $this->newRandomActivity($person);
|
||||||
@@ -70,12 +67,12 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
->setPerson($person)
|
->setPerson($person)
|
||||||
->setDate($this->faker->dateTimeThisYear())
|
->setDate($this->faker->dateTimeThisYear())
|
||||||
->setDurationTime($this->faker->dateTime(36000))
|
->setDurationTime($this->faker->dateTime(36000))
|
||||||
->setType($this->getRandomActivityType())
|
->setActivityType($this->getRandomActivityType())
|
||||||
->setScope($this->getRandomScope());
|
->setScope($this->getRandomScope());
|
||||||
|
|
||||||
// ->setAttendee($this->faker->boolean())
|
// ->setAttendee($this->faker->boolean())
|
||||||
|
|
||||||
for ($i = 0; mt_rand(0, 4) > $i; ++$i) {
|
for ($i = 0; random_int(0, 4) > $i; ++$i) {
|
||||||
$reason = $this->getRandomActivityReason();
|
$reason = $this->getRandomActivityReason();
|
||||||
|
|
||||||
if (null !== $reason) {
|
if (null !== $reason) {
|
||||||
|
@@ -26,7 +26,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('chill_activity');
|
$treeBuilder = new TreeBuilder('chill_activity');
|
||||||
$rootNode = $treeBuilder->getRootNode('chill_activity');
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
@@ -59,9 +59,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->info('The number of seconds of this duration. Must be an integer.')
|
->info('The number of seconds of this duration. Must be an integer.')
|
||||||
->cannotBeEmpty()
|
->cannotBeEmpty()
|
||||||
->validate()
|
->validate()
|
||||||
->ifTrue(static function ($data) {
|
->ifTrue(static fn ($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer')
|
||||||
return !is_int($data);
|
|
||||||
})->thenInvalid('The value %s is not a valid integer')
|
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('label')
|
->scalarNode('label')
|
||||||
|
@@ -65,9 +65,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
|
|
||||||
use TrackUpdateTrait;
|
use TrackUpdateTrait;
|
||||||
|
|
||||||
public const SENTRECEIVED_RECEIVED = 'received';
|
final public const SENTRECEIVED_RECEIVED = 'received';
|
||||||
|
|
||||||
public const SENTRECEIVED_SENT = 'sent';
|
final public const SENTRECEIVED_SENT = 'sent';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
* @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||||
@@ -195,7 +195,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
|
||||||
* @Groups({"docgen:read"})
|
* @Groups({"docgen:read"})
|
||||||
*/
|
*/
|
||||||
private User $user;
|
private ?User $user = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
|
* @ORM\ManyToMany(targetEntity="Chill\MainBundle\Entity\User")
|
||||||
@@ -494,7 +494,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this->activityType;
|
return $this->activityType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUser(): User
|
public function getUser(): ?User
|
||||||
{
|
{
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
@@ -672,7 +672,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated use @link{self::setActivityType} instead
|
||||||
*/
|
*/
|
||||||
public function setType(ActivityType $activityType): self
|
public function setType(ActivityType $activityType): self
|
||||||
{
|
{
|
||||||
@@ -681,14 +681,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUser(UserInterface $user): self
|
public function setUser(?User $user): self
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUsers(?Collection $users): self
|
public function setUsers(Collection $users): self
|
||||||
{
|
{
|
||||||
$this->users = $users;
|
$this->users = $users;
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ class ActivityPresence
|
|||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
* @Serializer\Groups({"docgen:read"})
|
* @Serializer\Groups({"docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?int $id;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="json")
|
* @ORM\Column(type="json")
|
||||||
|
@@ -23,10 +23,9 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
class ActivityReason
|
class ActivityReason
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var bool
|
|
||||||
* @ORM\Column(type="boolean")
|
* @ORM\Column(type="boolean")
|
||||||
*/
|
*/
|
||||||
private $active = true;
|
private bool $active = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ActivityReasonCategory
|
* @var ActivityReasonCategory
|
||||||
@@ -34,7 +33,7 @@ class ActivityReason
|
|||||||
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
|
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
|
||||||
* inversedBy="reasons")
|
* inversedBy="reasons")
|
||||||
*/
|
*/
|
||||||
private $category;
|
private ?ActivityReasonCategory $category = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
@@ -43,13 +42,13 @@ class ActivityReason
|
|||||||
* @ORM\Column(name="id", type="integer")
|
* @ORM\Column(name="id", type="integer")
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
*/
|
*/
|
||||||
private $id;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
* @ORM\Column(type="json")
|
* @ORM\Column(type="json")
|
||||||
*/
|
*/
|
||||||
private $name;
|
private array $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get active.
|
* Get active.
|
||||||
@@ -81,27 +80,9 @@ class ActivityReason
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get name.
|
* Get name.
|
||||||
*
|
|
||||||
* @param mixed|null $locale
|
|
||||||
*
|
|
||||||
* @return array | string
|
|
||||||
*/
|
*/
|
||||||
public function getName($locale = null)
|
public function getName(): array
|
||||||
{
|
{
|
||||||
if ($locale) {
|
|
||||||
if (isset($this->name[$locale])) {
|
|
||||||
return $this->name[$locale];
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->name as $name) {
|
|
||||||
if (!empty($name)) {
|
|
||||||
return $name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* @ORM\Table(name="activityreasoncategory")
|
* @ORM\Table(name="activityreasoncategory")
|
||||||
* @ORM\HasLifecycleCallbacks
|
* @ORM\HasLifecycleCallbacks
|
||||||
*/
|
*/
|
||||||
class ActivityReasonCategory
|
class ActivityReasonCategory implements \Stringable
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
@@ -65,7 +65,7 @@ class ActivityReasonCategory
|
|||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function __toString()
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'ActivityReasonCategory(' . $this->getName('x') . ')';
|
return 'ActivityReasonCategory(' . $this->getName('x') . ')';
|
||||||
}
|
}
|
||||||
|
@@ -27,11 +27,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
|||||||
*/
|
*/
|
||||||
class ActivityType
|
class ActivityType
|
||||||
{
|
{
|
||||||
public const FIELD_INVISIBLE = 0;
|
final public const FIELD_INVISIBLE = 0;
|
||||||
|
|
||||||
public const FIELD_OPTIONAL = 1;
|
final public const FIELD_OPTIONAL = 1;
|
||||||
|
|
||||||
public const FIELD_REQUIRED = 2;
|
final public const FIELD_REQUIRED = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated not in use
|
* @deprecated not in use
|
||||||
@@ -122,7 +122,7 @@ class ActivityType
|
|||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||||||
* @Groups({"docgen:read"})
|
* @Groups({"docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?int $id;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||||
@@ -275,10 +275,8 @@ class ActivityType
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Assert\Callback
|
* @Assert\Callback
|
||||||
*
|
|
||||||
* @param mixed $payload
|
|
||||||
*/
|
*/
|
||||||
public function checkSocialActionsVisibility(ExecutionContextInterface $context, $payload)
|
public function checkSocialActionsVisibility(ExecutionContextInterface $context, mixed $payload)
|
||||||
{
|
{
|
||||||
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
if ($this->socialIssuesVisible !== $this->socialActionsVisible) {
|
||||||
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) {
|
if (!(2 === $this->socialIssuesVisible && 1 === $this->socialActionsVisible)) {
|
||||||
|
@@ -22,14 +22,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityEntityListener
|
class ActivityEntityListener
|
||||||
{
|
{
|
||||||
private EntityManagerInterface $em;
|
public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository)
|
||||||
|
|
||||||
private AccompanyingPeriodWorkRepository $workRepository;
|
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em, AccompanyingPeriodWorkRepository $workRepository)
|
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
|
||||||
$this->workRepository = $workRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function persistActionToCourse(Activity $activity)
|
public function persistActionToCourse(Activity $activity)
|
||||||
|
@@ -20,16 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ByCreatorAggregator implements AggregatorInterface
|
class ByCreatorAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
|
||||||
|
{
|
||||||
private UserRepositoryInterface $userRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
UserRepositoryInterface $userRepository,
|
|
||||||
UserRender $userRender
|
|
||||||
) {
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,16 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class BySocialActionAggregator implements AggregatorInterface
|
class BySocialActionAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private SocialActionRender $actionRender;
|
public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository)
|
||||||
|
{
|
||||||
private SocialActionRepository $actionRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
SocialActionRender $actionRender,
|
|
||||||
SocialActionRepository $actionRepository
|
|
||||||
) {
|
|
||||||
$this->actionRender = $actionRender;
|
|
||||||
$this->actionRepository = $actionRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,16 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class BySocialIssueAggregator implements AggregatorInterface
|
class BySocialIssueAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private SocialIssueRender $issueRender;
|
public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender)
|
||||||
|
{
|
||||||
private SocialIssueRepository $issueRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
SocialIssueRepository $issueRepository,
|
|
||||||
SocialIssueRender $issueRender
|
|
||||||
) {
|
|
||||||
$this->issueRepository = $issueRepository;
|
|
||||||
$this->issueRender = $issueRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,16 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ByThirdpartyAggregator implements AggregatorInterface
|
class ByThirdpartyAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private ThirdPartyRender $thirdPartyRender;
|
public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender)
|
||||||
|
{
|
||||||
private ThirdPartyRepository $thirdPartyRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ThirdPartyRepository $thirdPartyRepository,
|
|
||||||
ThirdPartyRender $thirdPartyRender
|
|
||||||
) {
|
|
||||||
$this->thirdPartyRepository = $thirdPartyRepository;
|
|
||||||
$this->thirdPartyRender = $thirdPartyRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,16 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class CreatorScopeAggregator implements AggregatorInterface
|
class CreatorScopeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private ScopeRepository $scopeRepository;
|
public function __construct(private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||||
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ScopeRepository $scopeRepository,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -29,12 +29,8 @@ class DateAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
private const DEFAULT_CHOICE = 'year';
|
private const DEFAULT_CHOICE = 'year';
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
public function __construct(private readonly TranslatorInterface $translator)
|
||||||
|
{
|
||||||
public function __construct(
|
|
||||||
TranslatorInterface $translator
|
|
||||||
) {
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -99,17 +95,9 @@ class DateAggregator implements AggregatorInterface
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($data['frequency']) {
|
return match ($data['frequency']) {
|
||||||
case 'month':
|
default => $value,
|
||||||
case 'week':
|
};
|
||||||
//return $this->translator->trans('for week') .' '. $value ;
|
|
||||||
|
|
||||||
case 'year':
|
|
||||||
//return $this->translator->trans('in year') .' '. $value ;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return $value;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,16 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class LocationTypeAggregator implements AggregatorInterface
|
class LocationTypeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private LocationTypeRepository $locationTypeRepository;
|
public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper)
|
||||||
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
LocationTypeRepository $locationTypeRepository,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->locationTypeRepository = $locationTypeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -22,18 +22,10 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityTypeAggregator implements AggregatorInterface
|
class ActivityTypeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
public const KEY = 'activity_type_aggregator';
|
final public const KEY = 'activity_type_aggregator';
|
||||||
|
|
||||||
protected ActivityTypeRepositoryInterface $activityTypeRepository;
|
public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,18 +21,10 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityUserAggregator implements AggregatorInterface
|
class ActivityUserAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
public const KEY = 'activity_user_id';
|
final public const KEY = 'activity_user_id';
|
||||||
|
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender)
|
||||||
|
{
|
||||||
private UserRepository $userRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
UserRepository $userRepository,
|
|
||||||
UserRender $userRender
|
|
||||||
) {
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,14 +21,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityUsersAggregator implements AggregatorInterface
|
class ActivityUsersAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender)
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
|
||||||
|
|
||||||
public function __construct(UserRepositoryInterface $userRepository, UserRender $userRender)
|
|
||||||
{
|
{
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -20,14 +20,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
||||||
{
|
{
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
|
||||||
private UserJobRepositoryInterface $userJobRepository;
|
|
||||||
|
|
||||||
public function __construct(UserJobRepositoryInterface $userJobRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->userJobRepository = $userJobRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -20,14 +20,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
||||||
{
|
{
|
||||||
private ScopeRepositoryInterface $scopeRepository;
|
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(ScopeRepositoryInterface $scopeRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -30,20 +30,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository;
|
public function __construct(protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonRepository $activityReasonRepository, protected TranslatableStringHelper $translatableStringHelper)
|
||||||
|
{
|
||||||
protected ActivityReasonRepository $activityReasonRepository;
|
|
||||||
|
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ActivityReasonCategoryRepository $activityReasonCategoryRepository,
|
|
||||||
ActivityReasonRepository $activityReasonRepository,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->activityReasonCategoryRepository = $activityReasonCategoryRepository;
|
|
||||||
$this->activityReasonRepository = $activityReasonRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -113,21 +101,11 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
// for performance reason, we load data from db only once
|
match ($data['level']) {
|
||||||
switch ($data['level']) {
|
'reasons' => $this->activityReasonRepository->findBy(['id' => $values]),
|
||||||
case 'reasons':
|
'categories' => $this->activityReasonCategoryRepository->findBy(['id' => $values]),
|
||||||
$this->activityReasonRepository->findBy(['id' => $values]);
|
default => throw new RuntimeException(sprintf("The level data '%s' is invalid.", $data['level'])),
|
||||||
|
};
|
||||||
break;
|
|
||||||
|
|
||||||
case 'categories':
|
|
||||||
$this->activityReasonCategoryRepository->findBy(['id' => $values]);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new RuntimeException(sprintf("The level data '%s' is invalid.", $data['level']));
|
|
||||||
}
|
|
||||||
|
|
||||||
return function ($value) use ($data) {
|
return function ($value) use ($data) {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
|
@@ -20,11 +20,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class SentReceivedAggregator implements AggregatorInterface
|
class SentReceivedAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private TranslatorInterface $translator;
|
public function __construct(private readonly TranslatorInterface $translator)
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator)
|
|
||||||
{
|
{
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -16,9 +16,9 @@ namespace Chill\ActivityBundle\Export;
|
|||||||
*/
|
*/
|
||||||
abstract class Declarations
|
abstract class Declarations
|
||||||
{
|
{
|
||||||
public const ACTIVITY = 'activity';
|
final public const ACTIVITY = 'activity';
|
||||||
|
|
||||||
public const ACTIVITY_ACP = 'activity_linked_to_acp';
|
final public const ACTIVITY_ACP = 'activity_linked_to_acp';
|
||||||
|
|
||||||
public const ACTIVITY_PERSON = 'activity_linked_to_person';
|
final public const ACTIVITY_PERSON = 'activity_linked_to_person';
|
||||||
}
|
}
|
||||||
|
@@ -86,9 +86,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository->createQueryBuilder('activity');
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
|
|
||||||
|
@@ -87,9 +87,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository->createQueryBuilder('activity');
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
|
|
||||||
|
@@ -86,9 +86,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
$qb = $this->repository
|
||||||
->createQueryBuilder('activity')
|
->createQueryBuilder('activity')
|
||||||
|
@@ -24,20 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ListActivity implements ListInterface, GroupedExportInterface
|
class ListActivity implements ListInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
private EntityManagerInterface $entityManager;
|
public function __construct(private readonly ListActivityHelper $helper, private readonly EntityManagerInterface $entityManager, private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper)
|
||||||
|
{
|
||||||
private ListActivityHelper $helper;
|
|
||||||
|
|
||||||
private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ListActivityHelper $helper,
|
|
||||||
EntityManagerInterface $entityManager,
|
|
||||||
TranslatableStringExportLabelHelper $translatableStringExportLabelHelper
|
|
||||||
) {
|
|
||||||
$this->helper = $helper;
|
|
||||||
$this->entityManager = $entityManager;
|
|
||||||
$this->translatableStringExportLabelHelper = $translatableStringExportLabelHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
@@ -62,22 +50,17 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
switch ($key) {
|
return match ($key) {
|
||||||
case 'acpId':
|
'acpId' => static function ($value) {
|
||||||
return static function ($value) {
|
if ('_header' === $value) {
|
||||||
if ('_header' === $value) {
|
return ListActivityHelper::MSG_KEY . 'accompanying course id';
|
||||||
return ListActivityHelper::MSG_KEY . 'accompanying course id';
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $value ?? '';
|
return $value ?? '';
|
||||||
};
|
},
|
||||||
|
'scopesNames' => $this->translatableStringExportLabelHelper->getLabelMulti($key, $values, ListActivityHelper::MSG_KEY . 'course circles'),
|
||||||
case 'scopesNames':
|
default => $this->helper->getLabels($key, $values, $data),
|
||||||
return $this->translatableStringExportLabelHelper->getLabelMulti($key, $values, ListActivityHelper::MSG_KEY . 'course circles');
|
};
|
||||||
|
|
||||||
default:
|
|
||||||
return $this->helper->getLabels($key, $values, $data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
@@ -109,9 +92,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder();
|
$qb = $this->entityManager->createQueryBuilder();
|
||||||
|
|
||||||
|
@@ -87,9 +87,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
$qb = $this->repository
|
||||||
->createQueryBuilder('activity')
|
->createQueryBuilder('activity')
|
||||||
|
@@ -87,9 +87,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
$qb = $this->repository
|
||||||
->createQueryBuilder('activity')
|
->createQueryBuilder('activity')
|
||||||
|
@@ -24,12 +24,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class CountActivity implements ExportInterface, GroupedExportInterface
|
class CountActivity implements ExportInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
protected ActivityRepository $activityRepository;
|
public function __construct(protected ActivityRepository $activityRepository)
|
||||||
|
{
|
||||||
public function __construct(
|
|
||||||
ActivityRepository $activityRepository
|
|
||||||
) {
|
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
@@ -36,8 +36,6 @@ use function in_array;
|
|||||||
|
|
||||||
class ListActivity implements ListInterface, GroupedExportInterface
|
class ListActivity implements ListInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
protected EntityManagerInterface $entityManager;
|
|
||||||
|
|
||||||
protected array $fields = [
|
protected array $fields = [
|
||||||
'id',
|
'id',
|
||||||
'date',
|
'date',
|
||||||
@@ -52,22 +50,8 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
'person_id',
|
'person_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
public function __construct(protected EntityManagerInterface $entityManager, protected TranslatorInterface $translator, protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ActivityRepository $activityRepository)
|
||||||
|
{
|
||||||
protected TranslatorInterface $translator;
|
|
||||||
|
|
||||||
private ActivityRepository $activityRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
TranslatorInterface $translator,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
|
||||||
ActivityRepository $activityRepository
|
|
||||||
) {
|
|
||||||
$this->entityManager = $em;
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
@@ -137,13 +121,11 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
|
|
||||||
$activity = $activityRepository->find($value);
|
$activity = $activityRepository->find($value);
|
||||||
|
|
||||||
return implode(', ', array_map(function (ActivityReason $r) {
|
return implode(', ', array_map(fn (ActivityReason $r) => '"' .
|
||||||
return '"' .
|
$this->translatableStringHelper->localize($r->getCategory()->getName())
|
||||||
$this->translatableStringHelper->localize($r->getCategory()->getName())
|
. ' > ' .
|
||||||
. ' > ' .
|
$this->translatableStringHelper->localize($r->getName())
|
||||||
$this->translatableStringHelper->localize($r->getName())
|
. '"', $activity->getReasons()->toArray()));
|
||||||
. '"';
|
|
||||||
}, $activity->getReasons()->toArray()));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
case 'circle_name':
|
case 'circle_name':
|
||||||
@@ -152,7 +134,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
return 'circle';
|
return 'circle';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize(json_decode($value, true));
|
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR));
|
||||||
};
|
};
|
||||||
|
|
||||||
case 'type_name':
|
case 'type_name':
|
||||||
@@ -161,7 +143,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
return 'activity type';
|
return 'activity type';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize(json_decode($value, true));
|
return $this->translatableStringHelper->localize(json_decode($value, true, 512, JSON_THROW_ON_ERROR));
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -197,9 +179,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
|
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(static function ($el) {
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
// throw an error if any fields are present
|
// throw an error if any fields are present
|
||||||
if (!array_key_exists('fields', $data)) {
|
if (!array_key_exists('fields', $data)) {
|
||||||
|
@@ -30,24 +30,18 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
*/
|
*/
|
||||||
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
{
|
{
|
||||||
public const SUM = 'sum';
|
final public const SUM = 'sum';
|
||||||
|
|
||||||
/**
|
|
||||||
* The action for this report.
|
|
||||||
*/
|
|
||||||
protected string $action;
|
|
||||||
|
|
||||||
private ActivityRepository $activityRepository;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $action the stat to perform
|
* @param string $action the stat to perform
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ActivityRepository $activityRepository,
|
private readonly ActivityRepository $activityRepository,
|
||||||
string $action = 'sum'
|
/**
|
||||||
|
* The action for this report.
|
||||||
|
*/
|
||||||
|
protected string $action = 'sum'
|
||||||
) {
|
) {
|
||||||
$this->action = $action;
|
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
@@ -30,46 +30,10 @@ use const SORT_NUMERIC;
|
|||||||
|
|
||||||
class ListActivityHelper
|
class ListActivityHelper
|
||||||
{
|
{
|
||||||
public const MSG_KEY = 'export.list.activity.';
|
final public const MSG_KEY = 'export.list.activity.';
|
||||||
|
|
||||||
private ActivityPresenceRepositoryInterface $activityPresenceRepository;
|
public function __construct(private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository, private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly DateTimeHelper $dateTimeHelper, private readonly LabelPersonHelper $labelPersonHelper, private readonly LabelThirdPartyHelper $labelThirdPartyHelper, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, private readonly UserHelper $userHelper)
|
||||||
|
{
|
||||||
private ActivityTypeRepositoryInterface $activityTypeRepository;
|
|
||||||
|
|
||||||
private DateTimeHelper $dateTimeHelper;
|
|
||||||
|
|
||||||
private LabelPersonHelper $labelPersonHelper;
|
|
||||||
|
|
||||||
private LabelThirdPartyHelper $labelThirdPartyHelper;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
private TranslatableStringExportLabelHelper $translatableStringLabelHelper;
|
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
|
||||||
|
|
||||||
private UserHelper $userHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ActivityPresenceRepositoryInterface $activityPresenceRepository,
|
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository,
|
|
||||||
DateTimeHelper $dateTimeHelper,
|
|
||||||
LabelPersonHelper $labelPersonHelper,
|
|
||||||
LabelThirdPartyHelper $labelThirdPartyHelper,
|
|
||||||
TranslatorInterface $translator,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
|
||||||
TranslatableStringExportLabelHelper $translatableStringLabelHelper,
|
|
||||||
UserHelper $userHelper
|
|
||||||
) {
|
|
||||||
$this->activityPresenceRepository = $activityPresenceRepository;
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
$this->dateTimeHelper = $dateTimeHelper;
|
|
||||||
$this->labelPersonHelper = $labelPersonHelper;
|
|
||||||
$this->labelThirdPartyHelper = $labelThirdPartyHelper;
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->translatableStringLabelHelper = $translatableStringLabelHelper;
|
|
||||||
$this->userHelper = $userHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addSelect(QueryBuilder $qb): void
|
public function addSelect(QueryBuilder $qb): void
|
||||||
@@ -115,113 +79,78 @@ class ListActivityHelper
|
|||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
switch ($key) {
|
return match ($key) {
|
||||||
case 'createdAt':
|
'createdAt', 'updatedAt' => $this->dateTimeHelper->getLabel($key),
|
||||||
case 'updatedAt':
|
'createdBy', 'updatedBy' => $this->userHelper->getLabel($key, $values, $key),
|
||||||
return $this->dateTimeHelper->getLabel($key);
|
'date' => $this->dateTimeHelper->getLabel(self::MSG_KEY . $key),
|
||||||
|
'attendeeName' => function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'Attendee';
|
||||||
|
}
|
||||||
|
|
||||||
case 'createdBy':
|
if (null === $value || null === $presence = $this->activityPresenceRepository->find($value)) {
|
||||||
case 'updatedBy':
|
return '';
|
||||||
return $this->userHelper->getLabel($key, $values, $key);
|
}
|
||||||
|
|
||||||
case 'date':
|
return $this->translatableStringHelper->localize($presence->getName());
|
||||||
return $this->dateTimeHelper->getLabel(self::MSG_KEY . $key);
|
},
|
||||||
|
'listReasons' => $this->translatableStringLabelHelper->getLabelMulti($key, $values, 'Activity Reasons'),
|
||||||
|
'typeName' => function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'Activity type';
|
||||||
|
}
|
||||||
|
|
||||||
case 'attendeeName':
|
if (null === $value || null === $type = $this->activityTypeRepository->find($value)) {
|
||||||
return function ($value) {
|
return '';
|
||||||
if ('_header' === $value) {
|
}
|
||||||
return 'Attendee';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value || null === $presence = $this->activityPresenceRepository->find($value)) {
|
return $this->translatableStringHelper->localize($type->getName());
|
||||||
return '';
|
},
|
||||||
}
|
'usersNames' => $this->userHelper->getLabelMulti($key, $values, self::MSG_KEY . 'users name'),
|
||||||
|
'usersIds', 'thirdPartiesIds', 'personsIds' => static function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return match ($key) {
|
||||||
|
'usersIds' => self::MSG_KEY . 'users ids',
|
||||||
|
'thirdPartiesIds' => self::MSG_KEY . 'third parties ids',
|
||||||
|
'personsIds' => self::MSG_KEY . 'persons ids',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize($presence->getName());
|
$decoded = json_decode($value, null, 512, JSON_THROW_ON_ERROR);
|
||||||
};
|
|
||||||
|
|
||||||
case 'listReasons':
|
return implode(
|
||||||
return $this->translatableStringLabelHelper->getLabelMulti($key, $values, 'Activity Reasons');
|
'|',
|
||||||
|
array_unique(
|
||||||
|
array_filter($decoded, static fn (?int $id) => null !== $id),
|
||||||
|
SORT_NUMERIC
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
'personsNames' => $this->labelPersonHelper->getLabelMulti($key, $values, self::MSG_KEY . 'persons name'),
|
||||||
|
'thirdPartiesNames' => $this->labelThirdPartyHelper->getLabelMulti($key, $values, self::MSG_KEY . 'thirds parties'),
|
||||||
|
'sentReceived' => function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return self::MSG_KEY . 'sent received';
|
||||||
|
}
|
||||||
|
|
||||||
case 'typeName':
|
if (null === $value) {
|
||||||
return function ($value) {
|
return '';
|
||||||
if ('_header' === $value) {
|
}
|
||||||
return 'Activity type';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value || null === $type = $this->activityTypeRepository->find($value)) {
|
return $this->translator->trans($value);
|
||||||
return '';
|
},
|
||||||
}
|
default => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return self::MSG_KEY . $key;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize($type->getName());
|
if (null === $value) {
|
||||||
};
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
case 'usersNames':
|
return $this->translator->trans($value);
|
||||||
return $this->userHelper->getLabelMulti($key, $values, self::MSG_KEY . 'users name');
|
},
|
||||||
|
};
|
||||||
case 'usersIds':
|
|
||||||
case 'thirdPartiesIds':
|
|
||||||
case 'personsIds':
|
|
||||||
return static function ($value) use ($key) {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
switch ($key) {
|
|
||||||
case 'usersIds':
|
|
||||||
return self::MSG_KEY . 'users ids';
|
|
||||||
|
|
||||||
case 'thirdPartiesIds':
|
|
||||||
return self::MSG_KEY . 'third parties ids';
|
|
||||||
|
|
||||||
case 'personsIds':
|
|
||||||
return self::MSG_KEY . 'persons ids';
|
|
||||||
|
|
||||||
default:
|
|
||||||
throw new LogicException('key not supported');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$decoded = json_decode($value);
|
|
||||||
|
|
||||||
return implode(
|
|
||||||
'|',
|
|
||||||
array_unique(
|
|
||||||
array_filter($decoded, static fn (?int $id) => null !== $id),
|
|
||||||
SORT_NUMERIC
|
|
||||||
)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
case 'personsNames':
|
|
||||||
return $this->labelPersonHelper->getLabelMulti($key, $values, self::MSG_KEY . 'persons name');
|
|
||||||
|
|
||||||
case 'thirdPartiesNames':
|
|
||||||
return $this->labelThirdPartyHelper->getLabelMulti($key, $values, self::MSG_KEY . 'thirds parties');
|
|
||||||
|
|
||||||
case 'sentReceived':
|
|
||||||
return function ($value) {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
return self::MSG_KEY . 'sent received';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->translator->trans($value);
|
|
||||||
};
|
|
||||||
|
|
||||||
default:
|
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
return self::MSG_KEY . $key;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->translator->trans($value);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
|
@@ -23,16 +23,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityTypeFilter implements FilterInterface
|
class ActivityTypeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private ActivityTypeRepositoryInterface $activityTypeRepository;
|
public function __construct(private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -61,12 +53,9 @@ class ActivityTypeFilter implements FilterInterface
|
|||||||
$builder->add('accepted_activitytypes', EntityType::class, [
|
$builder->add('accepted_activitytypes', EntityType::class, [
|
||||||
'class' => ActivityType::class,
|
'class' => ActivityType::class,
|
||||||
'choices' => $this->activityTypeRepository->findAllActive(),
|
'choices' => $this->activityTypeRepository->findAllActive(),
|
||||||
'choice_label' => function (ActivityType $aty) {
|
'choice_label' => fn (ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '')
|
||||||
return
|
.
|
||||||
($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '')
|
$this->translatableStringHelper->localize($aty->getName()),
|
||||||
.
|
|
||||||
$this->translatableStringHelper->localize($aty->getName());
|
|
||||||
},
|
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
|
@@ -20,11 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ByCreatorFilter implements FilterInterface
|
class ByCreatorFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRender $userRender)
|
||||||
|
|
||||||
public function __construct(UserRender $userRender)
|
|
||||||
{
|
{
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -22,11 +22,8 @@ use function in_array;
|
|||||||
|
|
||||||
class BySocialActionFilter implements FilterInterface
|
class BySocialActionFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private SocialActionRender $actionRender;
|
public function __construct(private readonly SocialActionRender $actionRender)
|
||||||
|
|
||||||
public function __construct(SocialActionRender $actionRender)
|
|
||||||
{
|
{
|
||||||
$this->actionRender = $actionRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -22,11 +22,8 @@ use function in_array;
|
|||||||
|
|
||||||
class BySocialIssueFilter implements FilterInterface
|
class BySocialIssueFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private SocialIssueRender $issueRender;
|
public function __construct(private readonly SocialIssueRender $issueRender)
|
||||||
|
|
||||||
public function __construct(SocialIssueRender $issueRender)
|
|
||||||
{
|
{
|
||||||
$this->issueRender = $issueRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -28,11 +28,8 @@ class EmergencyFilter implements FilterInterface
|
|||||||
|
|
||||||
private const DEFAULT_CHOICE = false;
|
private const DEFAULT_CHOICE = false;
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
public function __construct(private readonly TranslatorInterface $translator)
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator)
|
|
||||||
{
|
{
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -22,11 +22,8 @@ use function in_array;
|
|||||||
|
|
||||||
class LocationTypeFilter implements FilterInterface
|
class LocationTypeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -29,11 +29,8 @@ class SentReceivedFilter implements FilterInterface
|
|||||||
|
|
||||||
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT;
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
public function __construct(private readonly TranslatorInterface $translator)
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator)
|
|
||||||
{
|
{
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -21,11 +21,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class UserFilter implements FilterInterface
|
class UserFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRender $userRender)
|
||||||
|
|
||||||
public function __construct(UserRender $userRender)
|
|
||||||
{
|
{
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -23,11 +23,8 @@ use function in_array;
|
|||||||
|
|
||||||
class UserScopeFilter implements FilterInterface
|
class UserScopeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -64,11 +61,9 @@ class UserScopeFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
$builder->add('accepted_userscope', EntityType::class, [
|
$builder->add('accepted_userscope', EntityType::class, [
|
||||||
'class' => Scope::class,
|
'class' => Scope::class,
|
||||||
'choice_label' => function (Scope $s) {
|
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize(
|
||||||
return $this->translatableStringHelper->localize(
|
$s->getName()
|
||||||
$s->getName()
|
),
|
||||||
);
|
|
||||||
},
|
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
|
@@ -27,16 +27,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class ActivityDateFilter implements FilterInterface
|
class ActivityDateFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
protected TranslatorInterface $translator;
|
public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter)
|
||||||
|
{
|
||||||
private RollingDateConverterInterface $rollingDateConverter;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatorInterface $translator,
|
|
||||||
RollingDateConverterInterface $rollingDateConverter
|
|
||||||
) {
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->rollingDateConverter = $rollingDateConverter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,16 +26,8 @@ use function count;
|
|||||||
|
|
||||||
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
{
|
{
|
||||||
protected ActivityTypeRepositoryInterface $activityTypeRepository;
|
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository)
|
||||||
|
{
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository
|
|
||||||
) {
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
@@ -61,12 +53,9 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
$builder->add('types', EntityType::class, [
|
$builder->add('types', EntityType::class, [
|
||||||
'choices' => $this->activityTypeRepository->findAllActive(),
|
'choices' => $this->activityTypeRepository->findAllActive(),
|
||||||
'class' => ActivityType::class,
|
'class' => ActivityType::class,
|
||||||
'choice_label' => function (ActivityType $aty) {
|
'choice_label' => fn (ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '')
|
||||||
return
|
.
|
||||||
($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '')
|
$this->translatableStringHelper->localize($aty->getName()),
|
||||||
.
|
|
||||||
$this->translatableStringHelper->localize($aty->getName());
|
|
||||||
},
|
|
||||||
'group_by' => function (ActivityType $type) {
|
'group_by' => function (ActivityType $type) {
|
||||||
if (!$type->hasCategory()) {
|
if (!$type->hasCategory()) {
|
||||||
return null;
|
return null;
|
||||||
|
@@ -20,11 +20,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class ActivityUsersFilter implements FilterInterface
|
class ActivityUsersFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
public function __construct(private readonly UserRender $userRender)
|
||||||
|
|
||||||
public function __construct(UserRender $userRender)
|
|
||||||
{
|
{
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -29,16 +29,8 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
|
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
{
|
{
|
||||||
protected ActivityReasonRepository $activityReasonRepository;
|
public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository)
|
||||||
|
{
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatableStringHelper $helper,
|
|
||||||
ActivityReasonRepository $activityReasonRepository
|
|
||||||
) {
|
|
||||||
$this->translatableStringHelper = $helper;
|
|
||||||
$this->activityReasonRepository = $activityReasonRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -37,20 +37,8 @@ use function count;
|
|||||||
|
|
||||||
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
class PersonHavingActivityBetweenDateFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
{
|
{
|
||||||
protected ActivityReasonRepository $activityReasonRepository;
|
public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository, protected TranslatorInterface $translator)
|
||||||
|
{
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
protected TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
|
||||||
ActivityReasonRepository $activityReasonRepository,
|
|
||||||
TranslatorInterface $translator
|
|
||||||
) {
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->activityReasonRepository = $activityReasonRepository;
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -22,11 +22,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class UsersJobFilter implements FilterInterface
|
class UsersJobFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -23,16 +23,8 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
|
|
||||||
class UsersScopeFilter implements FilterInterface
|
class UsersScopeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private ScopeRepositoryInterface $scopeRepository;
|
public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ScopeRepositoryInterface $scopeRepository,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -32,7 +32,7 @@ class ActivityReasonCategoryType extends AbstractType
|
|||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => 'Chill\ActivityBundle\Entity\ActivityReasonCategory',
|
'data_class' => \Chill\ActivityBundle\Entity\ActivityReasonCategory::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,40 +58,22 @@ use function in_array;
|
|||||||
|
|
||||||
class ActivityType extends AbstractType
|
class ActivityType extends AbstractType
|
||||||
{
|
{
|
||||||
protected AuthorizationHelper $authorizationHelper;
|
|
||||||
|
|
||||||
protected ObjectManager $om;
|
|
||||||
|
|
||||||
protected SocialActionRender $socialActionRender;
|
|
||||||
|
|
||||||
protected SocialIssueRender $socialIssueRender;
|
|
||||||
|
|
||||||
protected array $timeChoices;
|
|
||||||
|
|
||||||
protected TranslatableStringHelper $translatableStringHelper;
|
|
||||||
|
|
||||||
protected User $user;
|
protected User $user;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TokenStorageInterface $tokenStorage,
|
TokenStorageInterface $tokenStorage,
|
||||||
AuthorizationHelper $authorizationHelper,
|
protected AuthorizationHelper $authorizationHelper,
|
||||||
ObjectManager $om,
|
protected ObjectManager $om,
|
||||||
TranslatableStringHelper $translatableStringHelper,
|
protected TranslatableStringHelper $translatableStringHelper,
|
||||||
array $timeChoices,
|
protected array $timeChoices,
|
||||||
SocialIssueRender $socialIssueRender,
|
protected SocialIssueRender $socialIssueRender,
|
||||||
SocialActionRender $socialActionRender
|
protected SocialActionRender $socialActionRender
|
||||||
) {
|
) {
|
||||||
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
||||||
throw new RuntimeException('you should have a valid user');
|
throw new RuntimeException('you should have a valid user');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->user = $tokenStorage->getToken()->getUser();
|
$this->user = $tokenStorage->getToken()->getUser();
|
||||||
$this->authorizationHelper = $authorizationHelper;
|
|
||||||
$this->om = $om;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->timeChoices = $timeChoices;
|
|
||||||
$this->socialIssueRender = $socialIssueRender;
|
|
||||||
$this->socialActionRender = $socialActionRender;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
@@ -211,13 +193,9 @@ class ActivityType extends AbstractType
|
|||||||
'required' => $activityType->isRequired('attendee'),
|
'required' => $activityType->isRequired('attendee'),
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'class' => ActivityPresence::class,
|
'class' => ActivityPresence::class,
|
||||||
'choice_label' => function (ActivityPresence $activityPresence) {
|
'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()),
|
||||||
return $this->translatableStringHelper->localize($activityPresence->getName());
|
'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('a')
|
||||||
},
|
->where('a.active = true'),
|
||||||
'query_builder' => static function (EntityRepository $er) {
|
|
||||||
return $er->createQueryBuilder('a')
|
|
||||||
->where('a.active = true');
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,6 +203,7 @@ class ActivityType extends AbstractType
|
|||||||
$builder->add('user', PickUserDynamicType::class, [
|
$builder->add('user', PickUserDynamicType::class, [
|
||||||
'label' => $activityType->getLabel('user'),
|
'label' => $activityType->getLabel('user'),
|
||||||
'required' => $activityType->isRequired('user'),
|
'required' => $activityType->isRequired('user'),
|
||||||
|
'multiple' => false,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,9 +335,7 @@ class ActivityType extends AbstractType
|
|||||||
|
|
||||||
return (string) $location->getId();
|
return (string) $location->getId();
|
||||||
},
|
},
|
||||||
function (?string $id): ?Location {
|
fn (?string $id): ?Location => $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id])
|
||||||
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
|
|
||||||
}
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,9 +377,7 @@ class ActivityType extends AbstractType
|
|||||||
// the datetimetransformer will then handle timezone as GMT
|
// the datetimetransformer will then handle timezone as GMT
|
||||||
$timezoneUTC = new DateTimeZone('GMT');
|
$timezoneUTC = new DateTimeZone('GMT');
|
||||||
/** @var DateTime $data */
|
/** @var DateTime $data */
|
||||||
$data = $formEvent->getData() === null ?
|
$data = $formEvent->getData() ?? DateTime::createFromFormat('U', '300');
|
||||||
DateTime::createFromFormat('U', '300') :
|
|
||||||
$formEvent->getData();
|
|
||||||
$seconds = $data->getTimezone()->getOffset($data);
|
$seconds = $data->getTimezone()->getOffset($data);
|
||||||
$data->setTimeZone($timezoneUTC);
|
$data->setTimeZone($timezoneUTC);
|
||||||
$data->add(new DateInterval('PT' . $seconds . 'S'));
|
$data->add(new DateInterval('PT' . $seconds . 'S'));
|
||||||
|
@@ -25,11 +25,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class ActivityTypeType extends AbstractType
|
class ActivityTypeType extends AbstractType
|
||||||
{
|
{
|
||||||
private TranslatableStringHelper $translatableStringHelper;
|
public function __construct(private readonly TranslatableStringHelper $translatableStringHelper)
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
@@ -45,9 +42,7 @@ class ActivityTypeType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('category', EntityType::class, [
|
->add('category', EntityType::class, [
|
||||||
'class' => ActivityTypeCategory::class,
|
'class' => ActivityTypeCategory::class,
|
||||||
'choice_label' => function (ActivityTypeCategory $activityTypeCategory) {
|
'choice_label' => fn (ActivityTypeCategory $activityTypeCategory) => $this->translatableStringHelper->localize($activityTypeCategory->getName()),
|
||||||
return $this->translatableStringHelper->localize($activityTypeCategory->getName());
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
->add('ordering', NumberType::class, [
|
->add('ordering', NumberType::class, [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
@@ -24,20 +24,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
*/
|
*/
|
||||||
class PickActivityReasonType extends AbstractType
|
class PickActivityReasonType extends AbstractType
|
||||||
{
|
{
|
||||||
private ActivityReasonRepository $activityReasonRepository;
|
public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly ActivityReasonRender $reasonRender, private readonly TranslatableStringHelperInterface $translatableStringHelper)
|
||||||
|
{
|
||||||
private ActivityReasonRender $reasonRender;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ActivityReasonRepository $activityReasonRepository,
|
|
||||||
ActivityReasonRender $reasonRender,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->activityReasonRepository = $activityReasonRepository;
|
|
||||||
$this->reasonRender = $reasonRender;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
@@ -45,9 +33,7 @@ class PickActivityReasonType extends AbstractType
|
|||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
'class' => ActivityReason::class,
|
'class' => ActivityReason::class,
|
||||||
'choice_label' => function (ActivityReason $choice) {
|
'choice_label' => fn (ActivityReason $choice) => $this->reasonRender->renderString($choice, []),
|
||||||
return $this->reasonRender->renderString($choice, []);
|
|
||||||
},
|
|
||||||
'group_by' => function (ActivityReason $choice): ?string {
|
'group_by' => function (ActivityReason $choice): ?string {
|
||||||
if (null !== $category = $choice->getCategory()) {
|
if (null !== $category = $choice->getCategory()) {
|
||||||
return $this->translatableStringHelper->localize($category->getName());
|
return $this->translatableStringHelper->localize($category->getName());
|
||||||
|
@@ -23,14 +23,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
class TranslatableActivityReasonCategoryType extends AbstractType
|
class TranslatableActivityReasonCategoryType extends AbstractType
|
||||||
{
|
{
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator)
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelperInterface $translatableStringHelper, TranslatorInterface $translator)
|
|
||||||
{
|
{
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
@@ -38,10 +32,8 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
|||||||
$resolver->setDefaults(
|
$resolver->setDefaults(
|
||||||
[
|
[
|
||||||
'class' => ActivityReasonCategory::class,
|
'class' => ActivityReasonCategory::class,
|
||||||
'choice_label' => function (ActivityReasonCategory $category) {
|
'choice_label' => fn (ActivityReasonCategory $category) => $this->translatableStringHelper->localize($category->getName())
|
||||||
return $this->translatableStringHelper->localize($category->getName())
|
. (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : ''),
|
||||||
. (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : '');
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -20,16 +20,8 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
|
|
||||||
class TranslatableActivityType extends AbstractType
|
class TranslatableActivityType extends AbstractType
|
||||||
{
|
{
|
||||||
protected ActivityTypeRepositoryInterface $activityTypeRepository;
|
public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository)
|
||||||
|
{
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
TranslatableStringHelperInterface $helper,
|
|
||||||
ActivityTypeRepositoryInterface $activityTypeRepository
|
|
||||||
) {
|
|
||||||
$this->translatableStringHelper = $helper;
|
|
||||||
$this->activityTypeRepository = $activityTypeRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
@@ -39,9 +31,7 @@ class TranslatableActivityType extends AbstractType
|
|||||||
'class' => ActivityType::class,
|
'class' => ActivityType::class,
|
||||||
'active_only' => true,
|
'active_only' => true,
|
||||||
'choices' => $this->activityTypeRepository->findAllActive(),
|
'choices' => $this->activityTypeRepository->findAllActive(),
|
||||||
'choice_label' => function (ActivityType $type) {
|
'choice_label' => fn (ActivityType $type) => $this->translatableStringHelper->localize($type->getName()),
|
||||||
return $this->translatableStringHelper->localize($type->getName());
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -23,16 +23,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
protected Security $security;
|
public function __construct(protected Security $security, protected TranslatorInterface $translator)
|
||||||
|
{
|
||||||
protected TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
Security $security,
|
|
||||||
TranslatorInterface $translator
|
|
||||||
) {
|
|
||||||
$this->security = $security;
|
|
||||||
$this->translator = $translator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
|
@@ -18,13 +18,10 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
/**
|
/**
|
||||||
* @implements LocalMenuBuilderInterface<array>
|
* @implements LocalMenuBuilderInterface<array>
|
||||||
*/
|
*/
|
||||||
final class AdminMenuBuilder implements LocalMenuBuilderInterface
|
final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
private Security $security;
|
public function __construct(private Security $security)
|
||||||
|
|
||||||
public function __construct(Security $security)
|
|
||||||
{
|
{
|
||||||
$this->security = $security;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
|
@@ -23,22 +23,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
*/
|
*/
|
||||||
final class PersonMenuBuilder implements LocalMenuBuilderInterface
|
final class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
/**
|
public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator)
|
||||||
* @var AuthorizationCheckerInterface
|
{
|
||||||
*/
|
|
||||||
protected $authorizationChecker;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var TranslatorInterface
|
|
||||||
*/
|
|
||||||
protected $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
AuthorizationCheckerInterface $authorizationChecker,
|
|
||||||
TranslatorInterface $translator
|
|
||||||
) {
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->authorizationChecker = $authorizationChecker;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
@@ -48,7 +34,7 @@ final class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
|
||||||
$menu->addChild(
|
$menu->addChild(
|
||||||
$this->translator->trans('Activity list'),
|
$this->translator->trans('Activities'),
|
||||||
[
|
[
|
||||||
'route' => 'chill_activity_activity_list',
|
'route' => 'chill_activity_activity_list',
|
||||||
'routeParameters' => ['person_id' => $person->getId()],
|
'routeParameters' => ['person_id' => $person->getId()],
|
||||||
|
@@ -16,13 +16,10 @@ use Chill\ActivityBundle\Repository\ActivityRepository;
|
|||||||
use Chill\MainBundle\Entity\Notification;
|
use Chill\MainBundle\Entity\Notification;
|
||||||
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
use Chill\MainBundle\Notification\NotificationHandlerInterface;
|
||||||
|
|
||||||
final class ActivityNotificationHandler implements NotificationHandlerInterface
|
final readonly class ActivityNotificationHandler implements NotificationHandlerInterface
|
||||||
{
|
{
|
||||||
private ActivityRepository $activityRepository;
|
public function __construct(private ActivityRepository $activityRepository)
|
||||||
|
|
||||||
public function __construct(ActivityRepository $activityRepository)
|
|
||||||
{
|
{
|
||||||
$this->activityRepository = $activityRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTemplate(Notification $notification, array $options = []): string
|
public function getTemplate(Notification $notification, array $options = []): string
|
||||||
|
@@ -33,34 +33,10 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
|
final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface
|
||||||
{
|
{
|
||||||
private AuthorizationHelper $authorizationHelper;
|
public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private TokenStorageInterface $tokenStorage, private ActivityRepository $repository, private EntityManagerInterface $em, private Security $security)
|
||||||
|
{
|
||||||
private CenterResolverDispatcherInterface $centerResolverDispatcher;
|
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
|
||||||
|
|
||||||
private ActivityRepository $repository;
|
|
||||||
|
|
||||||
private Security $security;
|
|
||||||
|
|
||||||
private TokenStorageInterface $tokenStorage;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
AuthorizationHelper $authorizationHelper,
|
|
||||||
CenterResolverDispatcherInterface $centerResolverDispatcher,
|
|
||||||
TokenStorageInterface $tokenStorage,
|
|
||||||
ActivityRepository $repository,
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
Security $security
|
|
||||||
) {
|
|
||||||
$this->authorizationHelper = $authorizationHelper;
|
|
||||||
$this->centerResolverDispatcher = $centerResolverDispatcher;
|
|
||||||
$this->tokenStorage = $tokenStorage;
|
|
||||||
$this->repository = $repository;
|
|
||||||
$this->em = $em;
|
|
||||||
$this->security = $security;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
|
public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = []): array
|
||||||
@@ -254,9 +230,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
|
|||||||
$reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), ActivityVoter::SEE, $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 fn (Scope $scope) => $scope->getId(),
|
||||||
return $scope->getId();
|
|
||||||
},
|
|
||||||
$reachableScopes
|
$reachableScopes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
|
|
||||||
class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
|
class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface
|
||||||
{
|
{
|
||||||
private EntityRepository $repository;
|
private readonly EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $entityManager)
|
public function __construct(EntityManagerInterface $entityManager)
|
||||||
{
|
{
|
||||||
|
@@ -23,15 +23,11 @@ use Symfony\Component\HttpFoundation\RequestStack;
|
|||||||
*/
|
*/
|
||||||
class ActivityReasonRepository extends ServiceEntityRepository
|
class ActivityReasonRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
private RequestStack $requestStack;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ManagerRegistry $registry,
|
ManagerRegistry $registry,
|
||||||
RequestStack $requestStack
|
private readonly RequestStack $requestStack
|
||||||
) {
|
) {
|
||||||
parent::__construct($registry, ActivityReason::class);
|
parent::__construct($registry, ActivityReason::class);
|
||||||
|
|
||||||
$this->requestStack = $requestStack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository;
|
|||||||
|
|
||||||
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
||||||
{
|
{
|
||||||
private EntityRepository $repository;
|
private readonly EntityRepository $repository;
|
||||||
|
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
|
@@ -63,7 +63,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if activity.user and t.userVisible %}
|
{% if activity.user is not null and t.userVisible %}
|
||||||
<div class="wl-row">
|
<div class="wl-row">
|
||||||
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
<div class="wl-col title"><h3>{{ 'Referrer'|trans }}</h3></div>
|
||||||
<div class="wl-col list">
|
<div class="wl-col list">
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
Maybe should we think about abstracting this file a bit more ? Moving it to PersonBundle ?
|
Maybe should we think about abstracting this file a bit more ? Moving it to PersonBundle ?
|
||||||
#}
|
#}
|
||||||
{% if context == 'calendar_accompanyingCourse' %}
|
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' %}
|
||||||
{% import "@ChillCalendar/_invite.html.twig" as invite %}
|
{% import "@ChillCalendar/_invite.html.twig" as invite %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@@ -34,10 +34,12 @@
|
|||||||
|
|
||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<dl class="chill_view_data">
|
<dl class="chill_view_data">
|
||||||
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
{%- if entity.user is not null %}
|
||||||
<dd>
|
<dt class="inline">{{ 'Referrer'|trans|capitalize }}</dt>
|
||||||
<span class="badge-user">{{ entity.user|chill_entity_render_box }}</span>
|
<dd>
|
||||||
</dd>
|
<span class="badge-user">{{ entity.user|chill_entity_render_box }}</span>
|
||||||
|
</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{%- if entity.scope -%}
|
{%- if entity.scope -%}
|
||||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||||
|
@@ -20,9 +20,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
|||||||
|
|
||||||
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface
|
||||||
{
|
{
|
||||||
public const LISTS = 'CHILL_ACTIVITY_LIST';
|
final public const LISTS = 'CHILL_ACTIVITY_LIST';
|
||||||
|
|
||||||
public const STATS = 'CHILL_ACTIVITY_STATS';
|
final public const STATS = 'CHILL_ACTIVITY_STATS';
|
||||||
|
|
||||||
protected VoterHelperInterface $helper;
|
protected VoterHelperInterface $helper;
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
*
|
*
|
||||||
* It is safe for usage in template and controller
|
* It is safe for usage in template and controller
|
||||||
*/
|
*/
|
||||||
public const CREATE = 'CHILL_ACTIVITY_CREATE';
|
final public const CREATE = 'CHILL_ACTIVITY_CREATE';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* role to allow to create an activity associated win an accompanying course.
|
* role to allow to create an activity associated win an accompanying course.
|
||||||
@@ -44,7 +44,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
final public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* role to allow to create an activity associated with a person.
|
* role to allow to create an activity associated with a person.
|
||||||
@@ -53,17 +53,17 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
final public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON';
|
||||||
|
|
||||||
public const DELETE = 'CHILL_ACTIVITY_DELETE';
|
final public const DELETE = 'CHILL_ACTIVITY_DELETE';
|
||||||
|
|
||||||
public const FULL = 'CHILL_ACTIVITY_FULL';
|
final public const FULL = 'CHILL_ACTIVITY_FULL';
|
||||||
|
|
||||||
public const SEE = 'CHILL_ACTIVITY_SEE';
|
final public const SEE = 'CHILL_ACTIVITY_SEE';
|
||||||
|
|
||||||
public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
final public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS';
|
||||||
|
|
||||||
public const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
final public const UPDATE = 'CHILL_ACTIVITY_UPDATE';
|
||||||
|
|
||||||
private const ALL = [
|
private const ALL = [
|
||||||
self::CREATE,
|
self::CREATE,
|
||||||
@@ -74,15 +74,12 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
self::FULL,
|
self::FULL,
|
||||||
];
|
];
|
||||||
|
|
||||||
protected Security $security;
|
|
||||||
|
|
||||||
protected VoterHelperInterface $voterHelper;
|
protected VoterHelperInterface $voterHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Security $security,
|
protected Security $security,
|
||||||
VoterHelperFactoryInterface $voterHelperFactory
|
VoterHelperFactoryInterface $voterHelperFactory
|
||||||
) {
|
) {
|
||||||
$this->security = $security;
|
|
||||||
$this->voterHelper = $voterHelperFactory->generate(self::class)
|
$this->voterHelper = $voterHelperFactory->generate(self::class)
|
||||||
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
||||||
->addCheckFor(AccompanyingPeriod::class, [self::SEE, self::CREATE])
|
->addCheckFor(AccompanyingPeriod::class, [self::SEE, self::CREATE])
|
||||||
|
@@ -39,40 +39,8 @@ class ActivityContext implements
|
|||||||
DocGeneratorContextWithAdminFormInterface,
|
DocGeneratorContextWithAdminFormInterface,
|
||||||
DocGeneratorContextWithPublicFormInterface
|
DocGeneratorContextWithPublicFormInterface
|
||||||
{
|
{
|
||||||
private BaseContextData $baseContextData;
|
public function __construct(private readonly DocumentCategoryRepository $documentCategoryRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly EntityManagerInterface $em, private readonly PersonRenderInterface $personRender, private readonly PersonRepository $personRepository, private readonly TranslatorInterface $translator, private readonly BaseContextData $baseContextData)
|
||||||
|
{
|
||||||
private DocumentCategoryRepository $documentCategoryRepository;
|
|
||||||
|
|
||||||
private EntityManagerInterface $em;
|
|
||||||
|
|
||||||
private NormalizerInterface $normalizer;
|
|
||||||
|
|
||||||
private PersonRenderInterface $personRender;
|
|
||||||
|
|
||||||
private PersonRepository $personRepository;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
DocumentCategoryRepository $documentCategoryRepository,
|
|
||||||
NormalizerInterface $normalizer,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
|
||||||
EntityManagerInterface $em,
|
|
||||||
PersonRenderInterface $personRender,
|
|
||||||
PersonRepository $personRepository,
|
|
||||||
TranslatorInterface $translator,
|
|
||||||
BaseContextData $baseContextData
|
|
||||||
) {
|
|
||||||
$this->documentCategoryRepository = $documentCategoryRepository;
|
|
||||||
$this->normalizer = $normalizer;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->em = $em;
|
|
||||||
$this->personRender = $personRender;
|
|
||||||
$this->personRepository = $personRepository;
|
|
||||||
$this->translator = $translator;
|
|
||||||
$this->baseContextData = $baseContextData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function adminFormReverseTransform(array $data): array
|
public function adminFormReverseTransform(array $data): array
|
||||||
@@ -134,9 +102,7 @@ class ActivityContext implements
|
|||||||
$builder->add($key, EntityType::class, [
|
$builder->add($key, EntityType::class, [
|
||||||
'class' => Person::class,
|
'class' => Person::class,
|
||||||
'choices' => $persons,
|
'choices' => $persons,
|
||||||
'choice_label' => function (Person $p) {
|
'choice_label' => fn (Person $p) => $this->personRender->renderString($p, []),
|
||||||
return $this->personRender->renderString($p, []);
|
|
||||||
},
|
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
@@ -147,6 +113,32 @@ class ActivityContext implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$denormalized = [];
|
||||||
|
|
||||||
|
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
||||||
|
if (null !== ($id = ($data[$k] ?? null))) {
|
||||||
|
$denormalized[$k] = $this->personRepository->find($id);
|
||||||
|
} else {
|
||||||
|
$denormalized[$k] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $denormalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$normalized = [];
|
||||||
|
|
||||||
|
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
||||||
|
$normalized[$k] = null === $data[$k] ? null : $data[$k]->getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $normalized;
|
||||||
|
}
|
||||||
|
|
||||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||||
{
|
{
|
||||||
if (!$entity instanceof Activity) {
|
if (!$entity instanceof Activity) {
|
||||||
@@ -214,32 +206,6 @@ class ActivityContext implements
|
|||||||
return $options['mainPerson'] || $options['person1'] || $options['person2'];
|
return $options['mainPerson'] || $options['person1'] || $options['person2'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
|
||||||
{
|
|
||||||
$normalized = [];
|
|
||||||
|
|
||||||
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
|
||||||
$normalized[$k] = null === $data[$k] ? null : $data[$k]->getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $normalized;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
|
||||||
{
|
|
||||||
$denormalized = [];
|
|
||||||
|
|
||||||
foreach (['mainPerson', 'person1', 'person2'] as $k) {
|
|
||||||
if (null !== ($id = ($data[$k] ?? null))) {
|
|
||||||
$denormalized[$k] = $this->personRepository->find($id);
|
|
||||||
} else {
|
|
||||||
$denormalized[$k] = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $denormalized;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
{
|
{
|
||||||
$storedObject->setTitle($this->translatableStringHelper->localize($template->getName()));
|
$storedObject->setTitle($this->translatableStringHelper->localize($template->getName()));
|
||||||
|
@@ -34,52 +34,22 @@ use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
|||||||
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
|
use Chill\ThirdPartyBundle\Repository\ThirdPartyRepository;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use libphonenumber\PhoneNumber;
|
use libphonenumber\PhoneNumber;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements DocGeneratorContextWithPublicFormInterface<AccompanyingPeriod>
|
||||||
|
* @implements DocGeneratorContextWithAdminFormInterface<AccompanyingPeriod>
|
||||||
|
*/
|
||||||
class ListActivitiesByAccompanyingPeriodContext implements
|
class ListActivitiesByAccompanyingPeriodContext implements
|
||||||
DocGeneratorContextWithAdminFormInterface,
|
DocGeneratorContextWithAdminFormInterface,
|
||||||
DocGeneratorContextWithPublicFormInterface
|
DocGeneratorContextWithPublicFormInterface
|
||||||
{
|
{
|
||||||
private AccompanyingPeriodContext $accompanyingPeriodContext;
|
public function __construct(private readonly AccompanyingPeriodContext $accompanyingPeriodContext, private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository, private readonly NormalizerInterface $normalizer, private readonly PersonRepository $personRepository, private readonly SocialActionRepository $socialActionRepository, private readonly SocialIssueRepository $socialIssueRepository, private readonly ThirdPartyRepository $thirdPartyRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserRepository $userRepository)
|
||||||
|
{
|
||||||
private ActivityACLAwareRepositoryInterface $activityACLAwareRepository;
|
|
||||||
|
|
||||||
private NormalizerInterface $normalizer;
|
|
||||||
|
|
||||||
private PersonRepository $personRepository;
|
|
||||||
|
|
||||||
private SocialActionRepository $socialActionRepository;
|
|
||||||
|
|
||||||
private SocialIssueRepository $socialIssueRepository;
|
|
||||||
|
|
||||||
private ThirdPartyRepository $thirdPartyRepository;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
private UserRepository $userRepository;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
AccompanyingPeriodContext $accompanyingPeriodContext,
|
|
||||||
ActivityACLAwareRepositoryInterface $activityACLAwareRepository,
|
|
||||||
NormalizerInterface $normalizer,
|
|
||||||
PersonRepository $personRepository,
|
|
||||||
SocialActionRepository $socialActionRepository,
|
|
||||||
SocialIssueRepository $socialIssueRepository,
|
|
||||||
ThirdPartyRepository $thirdPartyRepository,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
|
||||||
UserRepository $userRepository
|
|
||||||
) {
|
|
||||||
$this->accompanyingPeriodContext = $accompanyingPeriodContext;
|
|
||||||
$this->activityACLAwareRepository = $activityACLAwareRepository;
|
|
||||||
$this->normalizer = $normalizer;
|
|
||||||
$this->personRepository = $personRepository;
|
|
||||||
$this->socialActionRepository = $socialActionRepository;
|
|
||||||
$this->socialIssueRepository = $socialIssueRepository;
|
|
||||||
$this->thirdPartyRepository = $thirdPartyRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function adminFormReverseTransform(array $data): array
|
public function adminFormReverseTransform(array $data): array
|
||||||
@@ -100,14 +70,81 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||||
{
|
{
|
||||||
$this->accompanyingPeriodContext->buildPublicForm($builder, $template, $entity);
|
$this->accompanyingPeriodContext->buildPublicForm($builder, $template, $entity);
|
||||||
|
|
||||||
|
$builder
|
||||||
|
->add('myActivitiesOnly', CheckboxType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'label' => 'docgen.myActivitiesOnly',
|
||||||
|
])
|
||||||
|
->add('myWorksOnly', CheckboxType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'label' => 'docgen.myWorksOnly',
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$denormalized = $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data);
|
||||||
|
|
||||||
|
foreach (['myActivitiesOnly', 'myWorksOnly'] as $k) {
|
||||||
|
$denormalized[$k] = $data[$k];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $denormalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
||||||
|
{
|
||||||
|
$normalized = $this->accompanyingPeriodContext->contextGenerationDataNormalize($template, $entity, $data);
|
||||||
|
|
||||||
|
foreach (['myActivitiesOnly', 'myWorksOnly'] as $k) {
|
||||||
|
$normalized[$k] = $data[$k] ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $normalized;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function filterActivitiesByUser(array $activities, User $user): array
|
||||||
|
{
|
||||||
|
return array_filter(
|
||||||
|
$activities,
|
||||||
|
function ($activity) use ($user) {
|
||||||
|
$activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []);
|
||||||
|
return in_array($user->getUsername(), $activityUsernames, true);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function filterWorksByUser(array $works, User $user): array
|
||||||
|
{
|
||||||
|
return array_filter(
|
||||||
|
$works,
|
||||||
|
function ($work) use ($user) {
|
||||||
|
$workUsernames = array_map(static fn ($user) => $user['username'], $work['referrers'] ?? []);
|
||||||
|
|
||||||
|
return in_array($user->getUsername(), $workUsernames, true);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getData(DocGeneratorTemplate $template, object $entity, array $contextGenerationData = []): array
|
||||||
{
|
{
|
||||||
$data = $this->accompanyingPeriodContext->getData($template, $entity, $contextGenerationData);
|
$data = $this->accompanyingPeriodContext->getData($template, $entity, $contextGenerationData);
|
||||||
|
|
||||||
$data['activities'] = $this->getActivitiesSimplified($entity);
|
$activities = $this->getActivitiesSimplified($entity);
|
||||||
|
$myActivitiesOnly = $contextGenerationData['myActivitiesOnly'];
|
||||||
|
|
||||||
|
if ($myActivitiesOnly && isset($contextGenerationData['creator'])) {
|
||||||
|
$activities = $this->filterActivitiesByUser($activities, $contextGenerationData['creator']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['activities'] = $activities;
|
||||||
|
|
||||||
|
$myWorksOnly = $contextGenerationData['myWorksOnly'];
|
||||||
|
|
||||||
|
if ($myWorksOnly && isset($contextGenerationData['creator'])) {
|
||||||
|
$data['course']['works'] = $this->filterWorksByUser($data['course']['works'], $contextGenerationData['creator']);
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,17 +180,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
|
|
||||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
||||||
{
|
{
|
||||||
return $this->accompanyingPeriodContext->hasPublicForm($template, $entity);
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
|
||||||
{
|
|
||||||
return $this->accompanyingPeriodContext->contextGenerationDataNormalize($template, $entity, $data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
|
|
||||||
{
|
|
||||||
return $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
|
@@ -76,10 +76,8 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getSecuredPagesUnauthenticated
|
* @dataProvider getSecuredPagesUnauthenticated
|
||||||
*
|
|
||||||
* @param mixed $url
|
|
||||||
*/
|
*/
|
||||||
public function testAccessIsDeniedForUnauthenticated($url)
|
public function testAccessIsDeniedForUnauthenticated(mixed $url)
|
||||||
{
|
{
|
||||||
$client = $this->createClient();
|
$client = $this->createClient();
|
||||||
|
|
||||||
@@ -121,14 +119,14 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
$client->getResponse()->getStatusCode(),
|
$client->getResponse()->getStatusCode(),
|
||||||
'Unexpected HTTP status code for GET /activity/'
|
'Unexpected HTTP status code for GET /activity/'
|
||||||
);
|
);
|
||||||
$crawler = $client->click($crawler->selectLink('Ajouter une nouvelle activité')
|
$crawler = $client->click($crawler->selectLink('Ajouter un nouvel échange')
|
||||||
->link());
|
->link());
|
||||||
|
|
||||||
$reason1 = $this->getRandomActivityReason();
|
$reason1 = $this->getRandomActivityReason();
|
||||||
$reason2 = $this->getRandomActivityReason([$reason1->getId()]);
|
$reason2 = $this->getRandomActivityReason([$reason1->getId()]);
|
||||||
|
|
||||||
// Fill in the form and submit it
|
// Fill in the form and submit it
|
||||||
$form = $crawler->selectButton('Ajouter une nouvelle activité')->form([
|
$form = $crawler->selectButton('Ajouter un nouvel échange')->form([
|
||||||
'chill_activitybundle_activity' => [
|
'chill_activitybundle_activity' => [
|
||||||
'date' => '15-01-2015',
|
'date' => '15-01-2015',
|
||||||
'durationTime' => 600,
|
'durationTime' => 600,
|
||||||
@@ -152,9 +150,9 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Edit the entity
|
// Edit the entity
|
||||||
$crawler = $client->click($crawler->selectLink("Modifier l'activité")->link());
|
$crawler = $client->click($crawler->selectLink("Modifier l'échange")->link());
|
||||||
|
|
||||||
$form = $crawler->selectButton("Sauver l'activité")->form([
|
$form = $crawler->selectButton("Sauver l'échange")->form([
|
||||||
'chill_activitybundle_activity' => [
|
'chill_activitybundle_activity' => [
|
||||||
'date' => '25-01-2015',
|
'date' => '25-01-2015',
|
||||||
// 'remark' => 'Foo'
|
// 'remark' => 'Foo'
|
||||||
@@ -216,7 +214,7 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
->setName('social without activity');
|
->setName('social without activity');
|
||||||
//copy role scopes where ACTIVITY is not present
|
//copy role scopes where ACTIVITY is not present
|
||||||
foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) {
|
foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) {
|
||||||
if (!strpos($roleScope->getRole(), 'ACTIVITY')) {
|
if (!strpos((string) $roleScope->getRole(), 'ACTIVITY')) {
|
||||||
$withoutActivityPermissionGroup->addRoleScope($roleScope);
|
$withoutActivityPermissionGroup->addRoleScope($roleScope);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,11 +260,9 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $username
|
|
||||||
*
|
|
||||||
* @return \Symfony\Component\BrowserKit\Client
|
* @return \Symfony\Component\BrowserKit\Client
|
||||||
*/
|
*/
|
||||||
private function getAuthenticatedClient($username = 'center a_social')
|
private function getAuthenticatedClient(mixed $username = 'center a_social')
|
||||||
{
|
{
|
||||||
return self::createClient([], [
|
return self::createClient([], [
|
||||||
'PHP_AUTH_USER' => $username,
|
'PHP_AUTH_USER' => $username,
|
||||||
@@ -369,12 +365,8 @@ final class ActivityControllerTest extends WebTestCase
|
|||||||
$center
|
$center
|
||||||
);
|
);
|
||||||
$reachableScopesId = array_intersect(
|
$reachableScopesId = array_intersect(
|
||||||
array_map(static function ($s) {
|
array_map(static fn ($s) => $s->getId(), $reachableScopesDelete),
|
||||||
return $s->getId();
|
array_map(static fn ($s) => $s->getId(), $reachableScopesUpdate)
|
||||||
}, $reachableScopesDelete),
|
|
||||||
array_map(static function ($s) {
|
|
||||||
return $s->getId();
|
|
||||||
}, $reachableScopesUpdate)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (count($reachableScopesId) === 0) {
|
if (count($reachableScopesId) === 0) {
|
||||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
final class ActivityReasonCategoryControllerTest extends WebTestCase
|
final class ActivityReasonCategoryControllerTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testToWrite()
|
public function testToWrite(): never
|
||||||
{
|
{
|
||||||
$this->markTestSkipped();
|
$this->markTestSkipped();
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
final class ActivityReasonControllerTest extends WebTestCase
|
final class ActivityReasonControllerTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testToWrite()
|
public function testToWrite(): never
|
||||||
{
|
{
|
||||||
$this->markTestSkipped();
|
$this->markTestSkipped();
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
final class ActivityTypeControllerTest extends WebTestCase
|
final class ActivityTypeControllerTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testToWrite()
|
public function testToWrite(): never
|
||||||
{
|
{
|
||||||
$this->markTestSkipped();
|
$this->markTestSkipped();
|
||||||
}
|
}
|
||||||
|
@@ -112,9 +112,9 @@ final class ActivityTypeTest extends KernelTestCase
|
|||||||
'attendee' => true,
|
'attendee' => true,
|
||||||
]]);
|
]]);
|
||||||
|
|
||||||
// var_dump($form->getErrors()->count()); var_dump($form->isValid());
|
// var_dump($form->getErrors()->count()); var_dump($form->isValid());
|
||||||
// foreach($form->getErrors() as $e) { fwrite(STDOUT, var_dump($e->getMessage())); }
|
// foreach($form->getErrors() as $e) { fwrite(STDOUT, var_dump($e->getMessage())); }
|
||||||
// var_dump($form->getErrors());
|
// var_dump($form->getErrors());
|
||||||
|
|
||||||
$this->assertTrue($form->isSynchronized(), 'Test the form is synchronized');
|
$this->assertTrue($form->isSynchronized(), 'Test the form is synchronized');
|
||||||
$this->assertTrue($form->isValid(), 'test the form is valid');
|
$this->assertTrue($form->isValid(), 'test the form is valid');
|
||||||
@@ -188,9 +188,7 @@ final class ActivityTypeTest extends KernelTestCase
|
|||||||
|
|
||||||
// map all the values in an array
|
// map all the values in an array
|
||||||
$values = array_map(
|
$values = array_map(
|
||||||
static function ($choice) {
|
static fn ($choice) => $choice->value,
|
||||||
return $choice->value;
|
|
||||||
},
|
|
||||||
$view['activity']['durationTime']->vars['choices']
|
$view['activity']['durationTime']->vars['choices']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSimple()
|
public function testSimple(): never
|
||||||
{
|
{
|
||||||
$translatableActivityReasonType = new PickActivityReasonType(
|
$translatableActivityReasonType = new PickActivityReasonType(
|
||||||
$this->getTranslatableStringHelper()
|
$this->getTranslatableStringHelper()
|
||||||
@@ -79,15 +79,13 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
|||||||
$request = $prophet->prophesize();
|
$request = $prophet->prophesize();
|
||||||
$translator = $prophet->prophesize();
|
$translator = $prophet->prophesize();
|
||||||
|
|
||||||
$request->willExtend('Symfony\Component\HttpFoundation\Request');
|
$request->willExtend(\Symfony\Component\HttpFoundation\Request::class);
|
||||||
$request->getLocale()->willReturn($fallbackLocale);
|
$request->getLocale()->willReturn($fallbackLocale);
|
||||||
|
|
||||||
$requestStack->willExtend('Symfony\Component\HttpFoundation\RequestStack');
|
$requestStack->willExtend(\Symfony\Component\HttpFoundation\RequestStack::class);
|
||||||
$requestStack->getCurrentRequest()->will(static function () use ($request) {
|
$requestStack->getCurrentRequest()->will(static fn () => $request);
|
||||||
return $request;
|
|
||||||
});
|
|
||||||
|
|
||||||
$translator->willExtend('Symfony\Component\Translation\Translator');
|
$translator->willExtend(\Symfony\Component\Translation\Translator::class);
|
||||||
$translator->getFallbackLocales()->willReturn($locale);
|
$translator->getFallbackLocales()->willReturn($locale);
|
||||||
|
|
||||||
return new TranslatableStringHelper(
|
return new TranslatableStringHelper(
|
||||||
|
@@ -89,11 +89,9 @@ final class TranslatableActivityTypeTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mixed $active
|
|
||||||
*
|
|
||||||
* @return \Chill\ActivityBundle\Entity\ActivityType
|
* @return \Chill\ActivityBundle\Entity\ActivityType
|
||||||
*/
|
*/
|
||||||
protected function getRandomType($active = true)
|
protected function getRandomType(mixed $active = true)
|
||||||
{
|
{
|
||||||
$types = $this->container->get('doctrine.orm.entity_manager')
|
$types = $this->container->get('doctrine.orm.entity_manager')
|
||||||
->getRepository(ActivityType::class)
|
->getRepository(ActivityType::class)
|
||||||
|
@@ -160,7 +160,7 @@ final class ActivityVoterTest extends KernelTestCase
|
|||||||
{
|
{
|
||||||
$token = $this->prophet->prophesize();
|
$token = $this->prophet->prophesize();
|
||||||
$token
|
$token
|
||||||
->willImplement('\Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
|
->willImplement('\\' . \Symfony\Component\Security\Core\Authentication\Token\TokenInterface::class);
|
||||||
|
|
||||||
if (null === $user) {
|
if (null === $user) {
|
||||||
$token->getUser()->willReturn(null);
|
$token->getUser()->willReturn(null);
|
||||||
|
@@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|||||||
*/
|
*/
|
||||||
final class TimelineProviderTest extends WebTestCase
|
final class TimelineProviderTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testAnActivityIsShownOnTimeline()
|
public function testAnActivityIsShownOnTimeline(): never
|
||||||
{
|
{
|
||||||
$this->markTestSkipped('we have to write fixtures before writing this tests');
|
$this->markTestSkipped('we have to write fixtures before writing this tests');
|
||||||
}
|
}
|
||||||
|
@@ -33,24 +33,14 @@ class TimelineActivityProvider implements TimelineProviderInterface
|
|||||||
{
|
{
|
||||||
private const SUPPORTED_CONTEXTS = ['center', 'person'];
|
private const SUPPORTED_CONTEXTS = ['center', 'person'];
|
||||||
|
|
||||||
protected ActivityACLAwareRepository $aclAwareRepository;
|
|
||||||
|
|
||||||
protected EntityManagerInterface $em;
|
|
||||||
|
|
||||||
protected AuthorizationHelperInterface $helper;
|
|
||||||
|
|
||||||
protected UserInterface $user;
|
protected UserInterface $user;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
protected EntityManagerInterface $em,
|
||||||
AuthorizationHelperInterface $helper,
|
protected AuthorizationHelperInterface $helper,
|
||||||
TokenStorageInterface $storage,
|
TokenStorageInterface $storage,
|
||||||
ActivityACLAwareRepository $aclAwareRepository
|
protected ActivityACLAwareRepository $aclAwareRepository
|
||||||
) {
|
) {
|
||||||
$this->em = $em;
|
|
||||||
$this->helper = $helper;
|
|
||||||
$this->aclAwareRepository = $aclAwareRepository;
|
|
||||||
|
|
||||||
if (!$storage->getToken()->getUser() instanceof User) {
|
if (!$storage->getToken()->getUser() instanceof User) {
|
||||||
throw new RuntimeException('A user should be authenticated !');
|
throw new RuntimeException('A user should be authenticated !');
|
||||||
}
|
}
|
||||||
|
@@ -18,9 +18,9 @@ use Symfony\Component\Validator\Constraint;
|
|||||||
*/
|
*/
|
||||||
class ActivityValidity extends Constraint
|
class ActivityValidity extends Constraint
|
||||||
{
|
{
|
||||||
public const IS_REQUIRED_MESSAGE = ' is required';
|
final public const IS_REQUIRED_MESSAGE = ' is required';
|
||||||
|
|
||||||
public const ROOT_MESSAGE = 'For this type of activity, ';
|
final public const ROOT_MESSAGE = 'For this type of activity, ';
|
||||||
|
|
||||||
public $noPersonsMessage = 'For this type of activity, you must add at least one person';
|
public $noPersonsMessage = 'For this type of activity, you must add at least one person';
|
||||||
|
|
||||||
|
@@ -1,41 +1,41 @@
|
|||||||
#general
|
#general
|
||||||
Show the activity: Voir l'activité
|
Show the activity: Voir l'échange
|
||||||
Edit the activity: Modifier l'activité
|
Edit the activity: Modifier l'échange
|
||||||
Activity: Activité
|
Activity: Échange
|
||||||
Duration time: Durée
|
Duration time: Durée
|
||||||
Duration Time: Durée
|
Duration Time: Durée
|
||||||
durationTime: durée
|
durationTime: durée
|
||||||
Travel time: Durée de déplacement
|
Travel time: Durée de déplacement
|
||||||
Attendee: Présence de la personne
|
Attendee: Présence de l'usager
|
||||||
attendee: présence de la personne
|
attendee: présence de l'usager
|
||||||
list_reasons: liste des sujets
|
list_reasons: liste des sujets
|
||||||
user_username: nom de l'utilisateur
|
user_username: nom de l'utilisateur
|
||||||
circle_name: nom du cercle
|
circle_name: nom du cercle
|
||||||
Remark: Commentaire
|
Remark: Commentaire
|
||||||
No comments: Aucun commentaire
|
No comments: Aucun commentaire
|
||||||
Add a new activity: Ajouter une nouvelle activité
|
Add a new activity: Ajouter une nouvel échange
|
||||||
Activity list: Liste des activités
|
Activity list: Liste des échanges
|
||||||
present: présent
|
present: présent
|
||||||
not present: absent
|
not present: absent
|
||||||
Delete: Supprimer
|
Delete: Supprimer
|
||||||
Update: Mettre à jour
|
Update: Mettre à jour
|
||||||
Update activity: Modifier l'activité
|
Update activity: Modifier l'échange
|
||||||
Scope: Cercle
|
Scope: Cercle
|
||||||
Activity data: Données de l'activité
|
Activity data: Données de l'échange
|
||||||
Activity location: Localisation de l'activité
|
Activity location: Localisation de l'échange
|
||||||
No reason associated: Aucun sujet
|
No reason associated: Aucun sujet
|
||||||
No social issues associated: Aucune problématique sociale
|
No social issues associated: Aucune problématique sociale
|
||||||
No social actions associated: Aucune action d'accompagnement
|
No social actions associated: Aucune action d'accompagnement
|
||||||
There isn't any activities.: Aucune activité enregistrée.
|
There isn't any activities.: Aucun échange enregistré.
|
||||||
type_name: type de l'activité
|
type_name: type de l'échange
|
||||||
person_firstname: prénom
|
person_firstname: prénom
|
||||||
person_lastname: nom de famille
|
person_lastname: nom de famille
|
||||||
person_id: identifiant de la personne
|
person_id: identifiant de l'usager
|
||||||
Type: Type
|
Type: Type
|
||||||
Invisible: Invisible
|
Invisible: Invisible
|
||||||
Optional: Optionnel
|
Optional: Optionnel
|
||||||
Required: Obligatoire
|
Required: Obligatoire
|
||||||
Persons: Personnes
|
Persons: Usagers
|
||||||
Users: Utilisateurs
|
Users: Utilisateurs
|
||||||
Emergency: Urgent
|
Emergency: Urgent
|
||||||
Sent received: Entrant / Sortant
|
Sent received: Entrant / Sortant
|
||||||
@@ -50,10 +50,10 @@ received: Reçu
|
|||||||
|
|
||||||
|
|
||||||
#forms
|
#forms
|
||||||
Activity creation: Nouvelle activité
|
Activity creation: Nouvel échange
|
||||||
Create: Créer
|
Create: Créer
|
||||||
Back to the list: Retour à la liste
|
Back to the list: Retour à la liste
|
||||||
Save activity: Sauver l'activité
|
Save activity: Sauver l'échange
|
||||||
Reset form: Remise à zéro du formulaire
|
Reset form: Remise à zéro du formulaire
|
||||||
Choose the duration: Choisir la durée
|
Choose the duration: Choisir la durée
|
||||||
Choose a type: Choisir un type
|
Choose a type: Choisir un type
|
||||||
@@ -90,47 +90,50 @@ activity:
|
|||||||
No documents: Aucun document
|
No documents: Aucun document
|
||||||
|
|
||||||
#timeline
|
#timeline
|
||||||
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
|
'%user% has done an %activity_type%': '%user% a effectué un échange de type "%activity_type%"'
|
||||||
|
|
||||||
#controller
|
#controller
|
||||||
'Success : activity created!': L'activité a été créée.
|
'Success : activity created!': L'échange a été créé.
|
||||||
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée.
|
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'échange n'a pas été créé.
|
||||||
'Success : activity updated!': L'activité a été mise à jour.
|
'Success : activity updated!': L'échange a été mis à jour.
|
||||||
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
|
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'échange n'a pas été mise à jour.
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
CHILL_ACTIVITY_CREATE: Créer une activité
|
CHILL_ACTIVITY_CREATE: Créer un échange
|
||||||
CHILL_ACTIVITY_UPDATE: Modifier une activité
|
CHILL_ACTIVITY_UPDATE: Modifier un échange
|
||||||
CHILL_ACTIVITY_SEE: Voir une activité
|
CHILL_ACTIVITY_SEE: Voir un échange
|
||||||
CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des activités
|
CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges
|
||||||
CHILL_ACTIVITY_DELETE: Supprimer une activité
|
CHILL_ACTIVITY_DELETE: Supprimer un échange
|
||||||
CHILL_ACTIVITY_STATS: Statistique des activités
|
CHILL_ACTIVITY_STATS: Statistique des échanges
|
||||||
CHILL_ACTIVITY_LIST: Liste des activités
|
CHILL_ACTIVITY_LIST: Liste des échanges
|
||||||
|
CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager
|
||||||
|
CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours
|
||||||
|
CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange
|
||||||
|
|
||||||
# admin
|
# admin
|
||||||
Activities: Activités
|
Activities: Échanges
|
||||||
Activity configuration: Configuration des activités
|
Activity configuration: Configuration des échanges
|
||||||
Activity configuration menu: Configuration des activités
|
Activity configuration menu: Configuration des échanges
|
||||||
Activity types: Types d'activité
|
Activity types: Types d'échange
|
||||||
Activity type configuration: Configuration des categories d'activités
|
Activity type configuration: Configuration des catégories d'échanges
|
||||||
Activity Reasons: Sujets d'une activité
|
Activity Reasons: Sujets d'un échange
|
||||||
Activity Reasons Category: Catégories de sujet d'activités
|
Activity Reasons Category: Catégories de sujet d'échanges
|
||||||
Activity Types Categories: Catégories des types d'activité
|
Activity Types Categories: Catégories des types d'échange
|
||||||
Activity Presences: Presences aux activités
|
Activity Presences: Présences aux échanges
|
||||||
Associated activity reason category is inactive: La catégorie de sujet attachée est inactive
|
Associated activity reason category is inactive: La catégorie de sujet attachée est inactive
|
||||||
|
|
||||||
|
|
||||||
# Crud
|
# Crud
|
||||||
crud:
|
crud:
|
||||||
activity_type:
|
activity_type:
|
||||||
title_new: Nouveau type d'activité
|
title_new: Nouveau type d'échange
|
||||||
title_edit: Edition d'un type d'activité
|
title_edit: Édition d'un type d'échange
|
||||||
activity_type_category:
|
activity_type_category:
|
||||||
title_new: Nouvelle catégorie de type d'activité
|
title_new: Nouvelle catégorie de type d'échange
|
||||||
title_edit: Edition d'une catégorie de type d'activité
|
title_edit: Édition d'une catégorie de type d'échange
|
||||||
activity_presence:
|
activity_presence:
|
||||||
title_new: Nouvelle Présence aux activités
|
title_new: Nouvelle présence aux échanges
|
||||||
title_edit: Edition d'une Présence aux activités
|
title_edit: Édition d'une présence aux échanges
|
||||||
|
|
||||||
# activity reason admin
|
# activity reason admin
|
||||||
ActivityReason list: Liste des sujets
|
ActivityReason list: Liste des sujets
|
||||||
@@ -139,7 +142,7 @@ Active: Actif
|
|||||||
Category: Catégorie
|
Category: Catégorie
|
||||||
ActivityReason creation: Nouveau sujet
|
ActivityReason creation: Nouveau sujet
|
||||||
ActivityReason edit: Modification d'un sujet
|
ActivityReason edit: Modification d'un sujet
|
||||||
ActivityReason: Sujet d'activité
|
ActivityReason: Sujet d'échange
|
||||||
The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé
|
The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé
|
||||||
The entity is active and will be proposed: Le sujet est actif et sera proposé
|
The entity is active and will be proposed: Le sujet est actif et sera proposé
|
||||||
|
|
||||||
@@ -148,19 +151,19 @@ ActivityReasonCategory list: Catégories de sujets
|
|||||||
Create a new activity category reason: Créer une nouvelle catégorie
|
Create a new activity category reason: Créer une nouvelle catégorie
|
||||||
ActivityReasonCategory creation: Nouvelle catégorie de sujet
|
ActivityReasonCategory creation: Nouvelle catégorie de sujet
|
||||||
ActivityReasonCategory edit: Modification d'une catégorie de sujet
|
ActivityReasonCategory edit: Modification d'une catégorie de sujet
|
||||||
ActivityReasonCategory: Catégorie de sujet d'activité
|
ActivityReasonCategory: Catégorie de sujet d'échange
|
||||||
ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée
|
ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée
|
||||||
ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée
|
ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée
|
||||||
|
|
||||||
#activity presence admin
|
#activity presence admin
|
||||||
ActivityPresence list: Liste des Présences aux activités
|
ActivityPresence list: Liste des présences aux échanges
|
||||||
Create a new activity presence: Créer une nouvelle "Présence aux activités"
|
Create a new activity presence: Créer une nouvelle "Présence aux échanges"
|
||||||
|
|
||||||
# activity type type admin
|
# activity type type admin
|
||||||
ActivityType list: Types d'activités
|
ActivityType list: Types d'échanges
|
||||||
Create a new activity type: Créer un nouveau type d'activité
|
Create a new activity type: Créer un nouveau type d'échange
|
||||||
Persons visible: Visibilité du champ Personnes
|
Persons visible: Visibilité du champ Usagers
|
||||||
Persons label: Libellé du champ Personnes
|
Persons label: Libellé du champ Usagers
|
||||||
User visible: Visibilité du champ Utilisateur
|
User visible: Visibilité du champ Utilisateur
|
||||||
User label: Libellé du champ Utilisateur
|
User label: Libellé du champ Utilisateur
|
||||||
Date visible: Visibilité du champ Date
|
Date visible: Visibilité du champ Date
|
||||||
@@ -183,8 +186,8 @@ Private comment visible: Visibilité du champ Commentaire Privé
|
|||||||
Private comment label: Libellé du champ Commentaire Privé
|
Private comment label: Libellé du champ Commentaire Privé
|
||||||
Emergency visible: Visibilité du champ Urgent
|
Emergency visible: Visibilité du champ Urgent
|
||||||
Emergency label: Libellé du champ Urgent
|
Emergency label: Libellé du champ Urgent
|
||||||
Accompanying period visible: Visibilité du champ Période d'accompagnement
|
Accompanying period visible: Visibilité du champ parcours d'accompagnement
|
||||||
Accompanying period label: Libellé du champ Période d'accompagnement
|
Accompanying period label: Libellé du champ parcours d'accompagnement
|
||||||
Social issues visible: Visibilité du champ Problématiques sociales
|
Social issues visible: Visibilité du champ Problématiques sociales
|
||||||
Social issues label: Libellé du champ Problématiques sociales
|
Social issues label: Libellé du champ Problématiques sociales
|
||||||
Social actions visible: Visibilité du champ Action sociale
|
Social actions visible: Visibilité du champ Action sociale
|
||||||
@@ -197,138 +200,140 @@ Documents visible: Visibilité du champ Documents
|
|||||||
Documents label: Libellé du champ Documents
|
Documents label: Libellé du champ Documents
|
||||||
|
|
||||||
# activity type category admin
|
# activity type category admin
|
||||||
ActivityTypeCategory list: Liste des catégories des types d'activité
|
ActivityTypeCategory list: Liste des catégories des types d'échange
|
||||||
Create a new activity type category: Créer une nouvelle catégorie de type d'activité
|
Create a new activity type category: Créer une nouvelle catégorie de type d'échange
|
||||||
|
|
||||||
# activity delete
|
# activity delete
|
||||||
Remove activity: Supprimer une activité
|
Remove activity: Supprimer un échange
|
||||||
Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité qui concerne "%name%" ?
|
Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer un échange qui concerne "%name%" ?
|
||||||
The activity has been successfully removed.: L'activité a été supprimée.
|
The activity has been successfully removed.: L'échange a été supprimé.
|
||||||
|
|
||||||
# exports
|
# exports
|
||||||
Exports of activities linked to a person: Exports des activités liées à une personne
|
Exports of activities linked to a person: Exports des échanges liés à un usager
|
||||||
Number of activities linked to a person: Nombre d'activités liées à une personne
|
Number of activities linked to a person: Nombre d'échanges liés à un usager
|
||||||
Count activities linked to a person: Nombre d'activités
|
Count activities linked to a person: Nombre d'échanges
|
||||||
Count activities linked to a person by various parameters.: Compte le nombre d'activités enregistrées et liées à une personne en fonction de différents paramètres.
|
Count activities linked to a person by various parameters.: Compte le nombre d'échanges enregistrés et liés à un usager en fonction de différents paramètres.
|
||||||
Sum activity linked to a person duration: Durée des activités
|
Sum activity linked to a person duration: Durée des échanges
|
||||||
Sum activities linked to a person duration: Durée des activités liés à un usager
|
Sum activities linked to a person duration: Durée des échanges liés à un usager
|
||||||
Sum activities linked to a person duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres.
|
Sum activities linked to a person duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres.
|
||||||
List activity linked to a person: Liste les activités
|
List activity linked to a person: Liste les échanges
|
||||||
List activities linked to a person: Liste des activités liés à un usager
|
List activities linked to a person: Liste des échanges liés à un usager
|
||||||
List activities linked to a person description: Crée la liste des activités en fonction de différents paramètres.
|
List activities linked to a person description: Crée la liste des échanges en fonction de différents paramètres.
|
||||||
|
|
||||||
Exports of activities linked to an accompanying period: Exports des activités liées à un parcours
|
Exports of activities linked to an accompanying period: Exports des échanges liés à un parcours
|
||||||
Number of activities linked to an accompanying period: Nombre d'activités liées à un parcours
|
Number of activities linked to an accompanying period: Nombre d'échanges liés à un parcours
|
||||||
Count activities linked to an accompanying period: Nombre d'activités
|
Count activities linked to an accompanying period: Nombre d'échanges
|
||||||
Count activities linked to an accompanying period by various parameters.: Compte le nombre d'activités enregistrées et liées à un parcours en fonction de différents paramètres.
|
Count activities linked to an accompanying period by various parameters.: Compte le nombre d'échanges enregistrés et liées à un parcours en fonction de différents paramètres.
|
||||||
Sum activity linked to an accompanying period duration: Somme de la durée des activités
|
Sum activity linked to an accompanying period duration: Somme de la durée des échanges
|
||||||
Sum activities linked to an accompanying period duration: Somme de la durée des activités liées à un parcours
|
Sum activities linked to an accompanying period duration: Somme de la durée des échanges liés à un parcours
|
||||||
Sum activities linked to an accompanying period duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres.
|
Sum activities linked to an accompanying period duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres.
|
||||||
Sum activity linked to an accompanying period visit duration: Somme de la durée de déplacement des activités
|
Sum activity linked to an accompanying period visit duration: Somme de la durée de déplacement des échanges
|
||||||
Sum activities linked to an accompanying period visit duration: Somme de la durée de déplacement des activités liées à un parcours
|
Sum activities linked to an accompanying period visit duration: Somme de la durée de déplacement des échanges liés à un parcours
|
||||||
Sum activities linked to an accompanying period visit duration by various parameters.: Additionne la durée de déplacement des activités en fonction de différents paramètres.
|
Sum activities linked to an accompanying period visit duration by various parameters.: Additionne la durée de déplacement des échanges en fonction de différents paramètres.
|
||||||
Average activity linked to an accompanying period duration: Moyenne de la durée des activités
|
Average activity linked to an accompanying period duration: Moyenne de la durée des échanges
|
||||||
Average activities linked to an accompanying period duration: Moyenne de la durée des activités liées à un parcours
|
Average activities linked to an accompanying period duration: Moyenne de la durée des échanges liés à un parcours
|
||||||
Average activities linked to an accompanying period duration by various parameters.: Moyenne de la durée des activités en fonction de différents paramètres.
|
Average activities linked to an accompanying period duration by various parameters.: Moyenne de la durée des échanges en fonction de différents paramètres.
|
||||||
Average activity linked to an accompanying period visit duration: Moyenne de la durée de déplacement des activités
|
Average activity linked to an accompanying period visit duration: Moyenne de la durée de déplacement des échanges
|
||||||
Average activities linked to an accompanying period visit duration: Moyenne de la durée de déplacement des activités liées à un parcours
|
Average activities linked to an accompanying period visit duration: Moyenne de la durée de déplacement des échanges liés à un parcours
|
||||||
Average activities linked to an accompanying period visit duration by various parameters.: Moyenne de la durée de déplacement des activités en fonction de différents paramètres.
|
Average activities linked to an accompanying period visit duration by various parameters.: Moyenne de la durée de déplacement des échanges en fonction de différents paramètres.
|
||||||
|
|
||||||
#filters
|
#filters
|
||||||
Filter by reason: Filtrer les activités par sujet
|
Filter by reason: Filtrer les échanges par sujet
|
||||||
'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%'
|
'Filtered by reasons: only %list%': 'Filtré par sujet: seulement %list%'
|
||||||
'Filtered by activity type: only %list%': "Filtré par type d'activité: uniquement %list%"
|
'Filtered by activity type: only %list%': "Filtré par type d'échange: uniquement %list%"
|
||||||
Filtered by date activity: Filtrer les activités par date
|
Filtered by date activity: Filtrer les échanges par date
|
||||||
Activities after this date: Activités après cette date
|
Activities after this date: Échanges après cette date
|
||||||
Activities before this date: Activités avant cette date
|
Activities before this date: Échanges avant cette date
|
||||||
"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'activité: uniquement entre %date_from% et %date_to%"
|
"Filtered by date of activity: only between %date_from% and %date_to%": "Filtré par date de l'échange: uniquement entre %date_from% et %date_to%"
|
||||||
This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "activités après cette date"
|
This date should be after the date given in "Implied in an activity after this date" field: Cette date devrait être postérieure à la date donnée dans le champ "échanges après cette date"
|
||||||
|
|
||||||
Filtered by person having an activity in a period: Uniquement les personnes ayant eu une activité dans la période donnée
|
Filtered by person having an activity in a period: Uniquement les usagers ayant eu un échange dans la période donnée
|
||||||
Implied in an activity after this date: Impliqué dans une activité après cette date
|
Implied in an activity after this date: Impliqué dans un échange après cette date
|
||||||
Implied in an activity before this date: Impliqué dans une activité avant cette date
|
Implied in an activity before this date: Impliqué dans un échange avant cette date
|
||||||
Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par personnes associées à une activité entre %date_from% et %date_to% avec les sujets %reasons_name%
|
Filtered by person having an activity between %date_from% and %date_to% with reasons %reasons_name%: Filtré par usager associées à un échange entre %date_from% et %date_to% avec les sujets %reasons_name%
|
||||||
Activity reasons for those activities: Sujets de ces activités
|
Activity reasons for those activities: Sujets de ces échanges
|
||||||
|
|
||||||
Filter by activity type: Filtrer les activités par type
|
Filter by activity type: Filtrer les échanges par type
|
||||||
|
|
||||||
Filter activity by location: Filtrer les activités par localisation
|
Filter activity by location: Filtrer les échanges par localisation
|
||||||
'Filtered activity by location: only %locations%': "Filtré par localisation: uniquement %locations%"
|
'Filtered activity by location: only %locations%': "Filtré par localisation: uniquement %locations%"
|
||||||
Filter activity by locationtype: Filtrer les activités par type de localisation
|
Filter activity by locationtype: Filtrer les échanges par type de localisation
|
||||||
'Filtered activity by locationtype: only %types%': "Filtré par type de localisation: uniquement %types%"
|
'Filtered activity by locationtype: only %types%': "Filtré par type de localisation: uniquement %types%"
|
||||||
Accepted locationtype: Types de localisation
|
Accepted locationtype: Types de localisation
|
||||||
Accepted users: TMS(s)
|
Accepted users: TMS(s)
|
||||||
Filter activity by emergency: Filtrer les activités par urgence
|
Filter activity by emergency: Filtrer les échanges par urgence
|
||||||
'Filtered activity by emergency: only %emergency%': "Filtré par urgence: uniquement si %emergency%"
|
'Filtered activity by emergency: only %emergency%': "Filtré par urgence: uniquement si %emergency%"
|
||||||
activity is emergency: l'activité est urgente
|
activity is emergency: l'échange est urgent
|
||||||
activity is not emergency: l'activité n'est pas urgente
|
activity is not emergency: l'échange n'est pas urgent
|
||||||
Filter activity by sentreceived: Filtrer les activités par envoyé/reçu
|
Filter activity by sentreceived: Filtrer les échanges par envoyé/reçu
|
||||||
'Filtered activity by sentreceived: only %sentreceived%': "Filtré par envoyé/reçu: uniquement %sentreceived%"
|
'Filtered activity by sentreceived: only %sentreceived%': "Filtré par envoyé/reçu: uniquement %sentreceived%"
|
||||||
Accepted sentreceived: ''
|
Accepted sentreceived: ''
|
||||||
Filter activity by linked socialaction: Filtrer les activités par action liée
|
Filter activity by linked socialaction: Filtrer les échanges par action liée
|
||||||
'Filtered activity by linked socialaction: only %actions%': "Filtré par action liée: uniquement %actions%"
|
'Filtered activity by linked socialaction: only %actions%': "Filtré par action liée: uniquement %actions%"
|
||||||
Filter activity by linked socialissue: Filtrer les activités par problématique liée
|
Filter activity by linked socialissue: Filtrer les échanges par problématique liée
|
||||||
'Filtered activity by linked socialissue: only %issues%': "Filtré par problématique liée: uniquement %issues%"
|
'Filtered activity by linked socialissue: only %issues%': "Filtré par problématique liée: uniquement %issues%"
|
||||||
Filter activity by user: Filtrer les activités par créateur
|
Filter activity by user: Filtrer les échanges par créateur
|
||||||
Filter activity by users: Filtrer les activités par utilisateur participant
|
Filter activity by users: Filtrer les échanges par utilisateur participant
|
||||||
Filter activity by creator: Filtrer les activités par créateur de l'échange
|
Filter activity by creator: Filtrer les échanges par créateur de l'échange
|
||||||
'Filtered activity by user: only %users%': "Filtré par référent: uniquement %users%"
|
'Filtered activity by user: only %users%': "Filtré par référent: uniquement %users%"
|
||||||
'Filtered activity by users: only %users%': "Filtré par utilisateurs participants: uniquement %users%"
|
'Filtered activity by users: only %users%': "Filtré par utilisateurs participants: uniquement %users%"
|
||||||
'Filtered activity by creator: only %users%': "Filtré par créateur: uniquement %users%"
|
'Filtered activity by creator: only %users%': "Filtré par créateur: uniquement %users%"
|
||||||
Creators: Créateurs
|
Creators: Créateurs
|
||||||
Filter activity by userscope: Filtrer les activités par service du créateur
|
Filter activity by userscope: Filtrer les échanges par service du créateur
|
||||||
'Filtered activity by userscope: only %scopes%': "Filtré par service du créateur: uniquement %scopes%"
|
'Filtered activity by userscope: only %scopes%': "Filtré par service du créateur: uniquement %scopes%"
|
||||||
Accepted userscope: Services
|
Accepted userscope: Services
|
||||||
|
|
||||||
Filter acp which has no activity: Filtrer les parcours qui n’ont pas d’activité
|
Filter acp which has no activity: Filtrer les parcours qui n’ont pas d’échange
|
||||||
Filtered acp which has no activities: Filtrer les parcours sans activité associée
|
Filtered acp which has no activities: Filtrer les parcours sans échange associé
|
||||||
Group acp by activity number: Grouper les parcours par nombre d’activité
|
Group acp by activity number: Grouper les parcours par nombre d’échange
|
||||||
|
|
||||||
#aggregators
|
#aggregators
|
||||||
Activity type: Type d'activité
|
Activity type: Type d'échange
|
||||||
Activity user: Utilisateur lié à l'activité
|
Activity user: Utilisateur lié à l'échange
|
||||||
By reason: Par sujet
|
By reason: Par sujet
|
||||||
By category of reason: Par catégorie de sujet
|
By category of reason: Par catégorie de sujet
|
||||||
Reason's level: Niveau du sujet
|
Reason's level: Niveau du sujet
|
||||||
Group by reasons: Sujet d'activité
|
Group by reasons: Sujet d'échange
|
||||||
Aggregate by activity user: Grouper les activités par référent
|
Aggregate by activity user: Grouper les échanges par référent
|
||||||
Aggregate by activity users: Grouper les activités par utilisateurs participants
|
Aggregate by activity users: Grouper les échanges par utilisateurs participants
|
||||||
Aggregate by activity type: Grouper les activités par type
|
Aggregate by activity type: Grouper les échanges par type
|
||||||
Aggregate by activity reason: Grouper les activités par sujet
|
Aggregate by activity reason: Grouper les échanges par sujet
|
||||||
Aggregate by users scope: Grouper les activités par service principal de l'utilisateur
|
Aggregate by users scope: Grouper les échanges par service principal de l'utilisateur
|
||||||
Users 's scope: Service principal des utilisateurs participants à l'activité
|
Users 's scope: Service principal des utilisateurs participants à l'échange
|
||||||
Aggregate by users job: Grouper les activités par métier des utilisateurs participants
|
Aggregate by users job: Grouper les échanges par métier des utilisateurs participants
|
||||||
Users 's job: Métier des utilisateurs participants à l'activité
|
Users 's job: Métier des utilisateurs participants à l'échange
|
||||||
|
|
||||||
Group activity by locationtype: Grouper les activités par type de localisation
|
Group activity by locationtype: Grouper les échanges par type de localisation
|
||||||
Group activity by date: Grouper les activités par date
|
Group activity by date: Grouper les échanges par date
|
||||||
Frequency: Fréquence
|
Frequency: Fréquence
|
||||||
by month: Par mois
|
by month: Par mois
|
||||||
by week: Par semaine
|
by week: Par semaine
|
||||||
for week: Semaine
|
for week: Semaine
|
||||||
by year: Par année
|
by year: Par année
|
||||||
in year: En
|
in year: En
|
||||||
Group activity by creator: Grouper les activités par créateur de l'échange
|
Group activity by creator: Grouper les échanges par créateur de l'échange
|
||||||
Group activity by creator scope: Grouper les activités par service du créateur de l'échange
|
Group activity by creator scope: Grouper les échanges par service du créateur de l'échange
|
||||||
Group activity by linked thirdparties: Grouper les activités par tiers impliqué
|
Group activity by linked thirdparties: Grouper les échanges par tiers impliqué
|
||||||
Accepted thirdparty: Tiers impliqué
|
Accepted thirdparty: Tiers impliqué
|
||||||
Group activity by linked socialaction: Grouper les activités par action liée
|
Group activity by linked socialaction: Grouper les échanges par action liée
|
||||||
Group activity by linked socialissue: Grouper les activités par problématique liée
|
Group activity by linked socialissue: Grouper les échanges par problématique liée
|
||||||
Group activity by userscope: Grouper les activités par service du créateur
|
Group activity by userscope: Grouper les échanges par service du créateur
|
||||||
|
|
||||||
Last activities: Les dernières activités
|
Last activities: Les derniers échanges
|
||||||
|
|
||||||
See activity in accompanying course context: Voir l'activité dans le contexte du parcours d'accompagnement
|
See activity in accompanying course context: Voir l'échange dans le contexte du parcours d'accompagnement
|
||||||
|
|
||||||
You get notified of an activity which does not exists any more: Cette notification ne correspond pas à une activité valide.
|
You get notified of an activity which does not exists any more: Cette notification ne correspond pas à un échange valide.
|
||||||
you are not allowed to see it details: La notification fait référence à une activité à laquelle vous n'avez pas accès.
|
you are not allowed to see it details: La notification fait référence à un échange auquel vous n'avez pas accès.
|
||||||
This is the minimal activity data: Activité n°
|
This is the minimal activity data: Échange n°
|
||||||
|
|
||||||
docgen:
|
docgen:
|
||||||
Activity basic: Echange
|
Activity basic: Échange
|
||||||
A basic context for activity: Contexte pour les activités
|
A basic context for activity: Contexte pour les échanges
|
||||||
Accompanying period with a list of activities: Parcours d'accompagnement avec liste des activités
|
Accompanying period with a list of activities: Parcours d'accompagnement avec liste des échanges
|
||||||
Accompanying period with a list of activities description: Ce contexte reprend les informations du parcours, et tous les activités pour un parcours. Les activités ne sont pas filtrés.
|
Accompanying period with a list of activities description: Ce contexte reprend les informations du parcours, et tous les échanges pour un parcours. Les échanges ne sont pas filtrés.
|
||||||
|
myActivitiesOnly: Prendre en compte uniquement les échanges dans lesquels je suis intervenu
|
||||||
|
myWorksOnly: Prendre en compte uniquement les actions d'accompagnement dont je suis référent
|
||||||
|
|
||||||
export:
|
export:
|
||||||
list:
|
list:
|
||||||
@@ -336,10 +341,10 @@ export:
|
|||||||
users name: Nom des utilisateurs
|
users name: Nom des utilisateurs
|
||||||
users ids: Identifiant des utilisateurs
|
users ids: Identifiant des utilisateurs
|
||||||
third parties ids: Identifiant des tiers
|
third parties ids: Identifiant des tiers
|
||||||
persons ids: Identifiant des personnes
|
persons ids: Identifiant des usagers
|
||||||
persons name: Nom des personnes
|
persons name: Nom des usagers
|
||||||
thirds parties: Tiers
|
thirds parties: Tiers
|
||||||
date: Date de l'activité
|
date: Date de l'échange
|
||||||
locationName: Localisation
|
locationName: Localisation
|
||||||
sent received: Envoyé ou reçu
|
sent received: Envoyé ou reçu
|
||||||
emergency: Urgence
|
emergency: Urgence
|
||||||
@@ -348,17 +353,17 @@ export:
|
|||||||
travelTime: Durée de déplacement
|
travelTime: Durée de déplacement
|
||||||
durationTime: Durée
|
durationTime: Durée
|
||||||
id: Identifiant
|
id: Identifiant
|
||||||
List activities linked to an accompanying course: Liste les activités liées à un parcours en fonction de différents filtres.
|
List activities linked to an accompanying course: Liste les échanges liés à un parcours en fonction de différents filtres.
|
||||||
List activity linked to a course: Liste des activités liées à un parcours
|
List activity linked to a course: Liste des échanges liés à un parcours
|
||||||
|
|
||||||
|
|
||||||
filter:
|
filter:
|
||||||
activity:
|
activity:
|
||||||
by_usersjob:
|
by_usersjob:
|
||||||
Filter by users job: Filtrer les activités par métier d'au moins un utilisateur participant
|
Filter by users job: Filtrer les échanges par métier d'au moins un utilisateur participant
|
||||||
'Filtered activity by users job: only %jobs%': 'Filtré par métier d''au moins un utilisateur participant: seulement %jobs%'
|
'Filtered activity by users job: only %jobs%': 'Filtré par métier d''au moins un utilisateur participant: seulement %jobs%'
|
||||||
by_usersscope:
|
by_usersscope:
|
||||||
Filter by users scope: Filtrer les activités par services d'au moins un utilisateur participant
|
Filter by users scope: Filtrer les échanges par services d'au moins un utilisateur participant
|
||||||
'Filtered activity by users scope: only %scopes%': 'Filtré par service d''au moins un utilisateur participant: seulement %scopes%'
|
'Filtered activity by users scope: only %scopes%': 'Filtré par service d''au moins un utilisateur participant: seulement %scopes%'
|
||||||
aggregator:
|
aggregator:
|
||||||
activity:
|
activity:
|
||||||
@@ -366,4 +371,4 @@ export:
|
|||||||
Sent or received: Envoyé ou reçu
|
Sent or received: Envoyé ou reçu
|
||||||
is sent: envoyé
|
is sent: envoyé
|
||||||
is received: reçu
|
is received: reçu
|
||||||
Group activity by sentreceived: Grouper les activités par envoyé / reçu
|
Group activity by sentreceived: Grouper les échanges par envoyé / reçu
|
||||||
|
@@ -47,10 +47,10 @@ Reasons: Onderwerpen
|
|||||||
|
|
||||||
|
|
||||||
#forms
|
#forms
|
||||||
Activity creation: Nouvelle activité
|
Activity creation: Nouvel échange
|
||||||
Create: Créer
|
Create: Créer
|
||||||
Back to the list: Retour à la liste
|
Back to the list: Retour à la liste
|
||||||
Save activity: Sauver l'activité
|
Save activity: Sauver l'échange
|
||||||
Reset form: Remise à zéro du formulaire
|
Reset form: Remise à zéro du formulaire
|
||||||
Choose the duration: Choisir la durée
|
Choose the duration: Choisir la durée
|
||||||
Choose a type: Choisir un type
|
Choose a type: Choisir un type
|
||||||
@@ -79,43 +79,43 @@ activity:
|
|||||||
No documents: Aucun document
|
No documents: Aucun document
|
||||||
|
|
||||||
#timeline
|
#timeline
|
||||||
'%user% has done an %activity_type%': '%user% a effectué une activité de type "%activity_type%"'
|
'%user% has done an %activity_type%': '%user% a effectué un échange de type "%activity_type%"'
|
||||||
|
|
||||||
#controller
|
#controller
|
||||||
'Success : activity created!': L'activité a été créée.
|
'Success : activity created!': L'échange a été créé.
|
||||||
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée.
|
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'échange n'a pas été créé.
|
||||||
'Success : activity updated!': L'activité a été mise à jour.
|
'Success : activity updated!': L'échange a été mis à jour.
|
||||||
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
|
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'échange n'a pas été mis à jour.
|
||||||
|
|
||||||
# ROLES
|
# ROLES
|
||||||
CHILL_ACTIVITY_CREATE: Créer une activité
|
CHILL_ACTIVITY_CREATE: Créer un échange
|
||||||
CHILL_ACTIVITY_UPDATE: Modifier une activité
|
CHILL_ACTIVITY_UPDATE: Modifier un échange
|
||||||
CHILL_ACTIVITY_SEE: Voir une activité
|
CHILL_ACTIVITY_SEE: Voir un échange
|
||||||
CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des activités
|
CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges
|
||||||
CHILL_ACTIVITY_DELETE: Supprimer une activité
|
CHILL_ACTIVITY_DELETE: Supprimer un échange
|
||||||
CHILL_ACTIVITY_STATS: Statistique des activités
|
CHILL_ACTIVITY_STATS: Statistique des échanges
|
||||||
CHILL_ACTIVITY_LIST: Liste des activités
|
CHILL_ACTIVITY_LIST: Liste des échanges
|
||||||
|
|
||||||
# admin
|
# admin
|
||||||
Activities: Activités
|
Activities: Échanges
|
||||||
Activity configuration: Configuration des activités
|
Activity configuration: Configuration des échanges
|
||||||
Activity configuration menu: Configuration des activités
|
Activity configuration menu: Configuration des échanges
|
||||||
Activity types: Types d'activité
|
Activity types: Types d'échange
|
||||||
Activity type configuration: Configuration des categories d'activités
|
Activity type configuration: Configuration des categories d'échanges
|
||||||
Activity Reasons: Sujets d'une activité
|
Activity Reasons: Sujets d'un échange
|
||||||
Activity Reasons Category: Catégories de sujet d'activités
|
Activity Reasons Category: Catégories de sujet d'échanges
|
||||||
Activity Types Categories: Catégories des types d'activité
|
Activity Types Categories: Catégories des types d'échanges
|
||||||
Activity Presences: Presences des activités
|
Activity Presences: Presences des échanges
|
||||||
|
|
||||||
|
|
||||||
# Crud
|
# Crud
|
||||||
crud:
|
crud:
|
||||||
activity_type:
|
activity_type:
|
||||||
title_new: Nouveau type d'activité
|
title_new: Nouveau type d'échange
|
||||||
title_edit: Edition d'un type d'activité
|
title_edit: Edition d'un type d'échange
|
||||||
activity_type_category:
|
activity_type_category:
|
||||||
title_new: Nouvelle catégorie de type d'activité
|
title_new: Nouvelle catégorie de type d'échange
|
||||||
title_edit: Edition d'une catégorie de type d'activité
|
title_edit: Edition d'une catégorie de type d'échange
|
||||||
|
|
||||||
# activity reason admin
|
# activity reason admin
|
||||||
ActivityReason list: Liste des sujets
|
ActivityReason list: Liste des sujets
|
||||||
@@ -124,7 +124,7 @@ Active: Actif
|
|||||||
Category: Catégorie
|
Category: Catégorie
|
||||||
ActivityReason creation: Nouveau sujet
|
ActivityReason creation: Nouveau sujet
|
||||||
ActivityReason edit: Modification d'un sujet
|
ActivityReason edit: Modification d'un sujet
|
||||||
ActivityReason: Sujet d'activité
|
ActivityReason: Sujet d'échange
|
||||||
The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé
|
The entity is inactive and won't be proposed: Le sujet est inactif et ne sera pas proposé
|
||||||
The entity is active and will be proposed: Le sujet est actif et sera proposé
|
The entity is active and will be proposed: Le sujet est actif et sera proposé
|
||||||
|
|
||||||
@@ -133,13 +133,13 @@ ActivityReasonCategory list: Catégories de sujets
|
|||||||
Create a new activity category reason: Créer une nouvelle catégorie
|
Create a new activity category reason: Créer une nouvelle catégorie
|
||||||
ActivityReasonCategory creation: Nouvelle catégorie de sujet
|
ActivityReasonCategory creation: Nouvelle catégorie de sujet
|
||||||
ActivityReasonCategory edit: Modification d'une catégorie de sujet
|
ActivityReasonCategory edit: Modification d'une catégorie de sujet
|
||||||
ActivityReasonCategory: Catégorie de sujet d'activité
|
ActivityReasonCategory: Catégorie de sujet d'échange
|
||||||
ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée
|
ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée
|
||||||
ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée
|
ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée
|
||||||
|
|
||||||
# activity type type admin
|
# activity type type admin
|
||||||
ActivityType list: Types d'activités
|
ActivityType list: Types d'échanges
|
||||||
Create a new activity type: Créer un nouveau type d'activité
|
Create a new activity type: Créer un nouveau type d'échange
|
||||||
Persons visible: Visibilité du champ Personnes
|
Persons visible: Visibilité du champ Personnes
|
||||||
Persons label: Libellé du champ Personnes
|
Persons label: Libellé du champ Personnes
|
||||||
User visible: Visibilité du champ Utilisateur
|
User visible: Visibilité du champ Utilisateur
|
||||||
@@ -177,20 +177,20 @@ Documents label: Libellé du champ Documents
|
|||||||
|
|
||||||
# activity type category admin
|
# activity type category admin
|
||||||
ActivityTypeCategory list: Liste des catégories des types d'activité
|
ActivityTypeCategory list: Liste des catégories des types d'activité
|
||||||
Create a new activity type category: Créer une nouvelle catégorie de type d'activité
|
Create a new activity type category: Créer une nouvelle catégorie de type d'échange
|
||||||
|
|
||||||
# activity delete
|
# activity delete
|
||||||
Remove activity: Supprimer une activité
|
Remove activity: Supprimer un échange
|
||||||
Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer une activité qui concerne "%name%" ?
|
Are you sure you want to remove the activity about "%name%" ?: Êtes-vous sûr de vouloir supprimer un échange qui concerne "%name%" ?
|
||||||
The activity has been successfully removed.: L'activité a été supprimée.
|
The activity has been successfully removed.: L'échange a été supprimée.
|
||||||
|
|
||||||
# exports
|
# exports
|
||||||
Count activities: Nombre d'activités
|
Count activities: Nombre d'échanges
|
||||||
Count activities by various parameters.: Compte le nombre d'activités enregistrées en fonction de différents paramètres.
|
Count activities by various parameters.: Compte le nombre d'échanges enregistrées en fonction de différents paramètres.
|
||||||
Sum activity duration: Total de la durée des activités
|
Sum activity duration: Total de la durée des échanges
|
||||||
Sum activities duration by various parameters.: Additionne la durée des activités en fonction de différents paramètres.
|
Sum activities duration by various parameters.: Additionne la durée des échanges en fonction de différents paramètres.
|
||||||
List activities: Liste les activités
|
List activities: Liste les échanges
|
||||||
Number of activities: Nombre d'activités
|
Number of activities: Nombre d'échanges
|
||||||
|
|
||||||
#filters
|
#filters
|
||||||
Filter by reason: Filtrer par sujet d'activité
|
Filter by reason: Filtrer par sujet d'activité
|
||||||
|
@@ -1,22 +1,22 @@
|
|||||||
The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide
|
The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide
|
||||||
At least one reason must be choosen: Au moins un sujet doit être choisi
|
At least one reason must be choosen: Au moins un sujet doit être choisi
|
||||||
For this type of activity, you must add at least one person: Pour ce type d'activité, vous devez ajouter au moins un usager
|
For this type of activity, you must add at least one person: Pour ce type d'échange, vous devez ajouter au moins un usager
|
||||||
For this type of activity, you must add at least one user: Pour ce type d'activité, vous devez ajouter au moins un utilisateur
|
For this type of activity, you must add at least one user: Pour ce type d'échange, vous devez ajouter au moins un utilisateur
|
||||||
For this type of activity, you must add at least one third party: Pour ce type d'activité, vous devez ajouter au moins un tiers
|
For this type of activity, you must add at least one third party: Pour ce type d'échange, vous devez ajouter au moins un tiers
|
||||||
For this type of activity, user is required: Pour ce type d'activité, l'utilisateur est requis
|
For this type of activity, user is required: Pour ce type d'échange, l'utilisateur est requis
|
||||||
For this type of activity, date is required: Pour ce type d'activité, la date est requise
|
For this type of activity, date is required: Pour ce type d'échange, la date est requise
|
||||||
For this type of activity, location is required: Pour ce type d'activité, la localisation est requise
|
For this type of activity, location is required: Pour ce type d'échange, la localisation est requise
|
||||||
For this type of activity, attendee is required: Pour ce type d'activité, le champ "Présence de la personne" est requis
|
For this type of activity, attendee is required: Pour ce type d'échange, le champ "Présence de l'usager" est requis
|
||||||
For this type of activity, duration time is required: Pour ce type d'activité, la durée est requise
|
For this type of activity, duration time is required: Pour ce type d'échange, la durée est requise
|
||||||
For this type of activity, travel time is required: Pour ce type d'activité, la durée du trajet est requise
|
For this type of activity, travel time is required: Pour ce type d'échange, la durée du trajet est requise
|
||||||
For this type of activity, reasons is required: Pour ce type d'activité, le champ "sujet" est requis
|
For this type of activity, reasons is required: Pour ce type d'échange, le champ "sujet" est requis
|
||||||
For this type of activity, comment is required: Pour ce type d'activité, un commentaire est requis
|
For this type of activity, comment is required: Pour ce type d'échange, un commentaire est requis
|
||||||
For this type of activity, sent/received is required: Pour ce type d'activité, le champ Entrant/Sortant est requis
|
For this type of activity, sent/received is required: Pour ce type d'échange, le champ Entrant/Sortant est requis
|
||||||
For this type of activity, document is required: Pour ce type d'activité, un document est requis
|
For this type of activity, document is required: Pour ce type d'échange, un document est requis
|
||||||
For this type of activity, emergency is required: Pour ce type d'activité, le champ "Urgent" est requis
|
For this type of activity, emergency is required: Pour ce type d'échange, le champ "Urgent" est requis
|
||||||
For this type of activity, accompanying period is required: Pour ce type d'activité, le parcours d'accompagnement est requis
|
For this type of activity, accompanying period is required: Pour ce type d'échange, le parcours d'accompagnement est requis
|
||||||
For this type of activity, you must add at least one social issue: Pour ce type d'activité, vous devez ajouter au moins une problématique sociale
|
For this type of activity, you must add at least one social issue: Pour ce type d'échange, vous devez ajouter au moins une problématique sociale
|
||||||
For this type of activity, you must add at least one social action: Pour ce type d'activité, vous devez indiquer au moins une action sociale
|
For this type of activity, you must add at least one social action: Pour ce type d'échange, vous devez indiquer au moins une action sociale
|
||||||
|
|
||||||
# admin
|
# admin
|
||||||
This parameter must be equal to social issue parameter: Ce paramètre doit être égal au paramètre "Visibilité du champs Problématiques sociales"
|
This parameter must be equal to social issue parameter: Ce paramètre doit être égal au paramètre "Visibilité du champs Problématiques sociales"
|
||||||
|
@@ -21,11 +21,8 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
|
|
||||||
final class AsideActivityController extends CRUDController
|
final class AsideActivityController extends CRUDController
|
||||||
{
|
{
|
||||||
private AsideActivityCategoryRepository $categoryRepository;
|
public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository)
|
||||||
|
|
||||||
public function __construct(AsideActivityCategoryRepository $categoryRepository)
|
|
||||||
{
|
{
|
||||||
$this->categoryRepository = $categoryRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createEntity(string $action, Request $request): object
|
public function createEntity(string $action, Request $request): object
|
||||||
|
@@ -24,11 +24,8 @@ use function random_int;
|
|||||||
|
|
||||||
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
class LoadAsideActivity extends Fixture implements DependentFixtureInterface
|
||||||
{
|
{
|
||||||
private UserRepository $userRepository;
|
public function __construct(private readonly UserRepository $userRepository)
|
||||||
|
|
||||||
public function __construct(UserRepository $userRepository)
|
|
||||||
{
|
{
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDependencies(): array
|
public function getDependencies(): array
|
||||||
|
@@ -22,7 +22,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('chill_aside_activity');
|
$treeBuilder = new TreeBuilder('chill_aside_activity');
|
||||||
|
|
||||||
$treeBuilder->getRootNode('chill_aside_activity')
|
$treeBuilder->getRootNode()
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('form')
|
->arrayNode('form')
|
||||||
->canBeEnabled()
|
->canBeEnabled()
|
||||||
@@ -132,9 +132,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->info('The number of seconds of this duration. Must be an integer.')
|
->info('The number of seconds of this duration. Must be an integer.')
|
||||||
->cannotBeEmpty()
|
->cannotBeEmpty()
|
||||||
->validate()
|
->validate()
|
||||||
->ifTrue(static function ($data) {
|
->ifTrue(static fn ($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer')
|
||||||
return !is_int($data);
|
|
||||||
})->thenInvalid('The value %s is not a valid integer')
|
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->scalarNode('label')
|
->scalarNode('label')
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user