mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 18:39:43 +00:00
Compare commits
38 Commits
fix-calend
...
chill_amli
Author | SHA1 | Date | |
---|---|---|---|
32187cfe06 | |||
fdd537b18e | |||
1786fa838f | |||
7fe8d0837f | |||
753d6ea481 | |||
8cf25415ab | |||
743e0b9403 | |||
97d6f35605 | |||
6c0715669e | |||
58ec294023 | |||
5af492b2db | |||
70c631b612 | |||
02b53e23e5 | |||
bd45fbc85c | |||
e488d6dadf | |||
e550d64fd4 | |||
4aaf75a1a4 | |||
9db43f1de3 | |||
674629e2bf | |||
e42d6c2d77 | |||
0d35dfc303 | |||
0784b00793 | |||
b1bfb2dd95 | |||
e42355c0d1 | |||
941d7b0352 | |||
0a06118ac3 | |||
3782cf35ff | |||
68c1833584 | |||
191b8ecf81 | |||
e7ba42de1f | |||
8b145ebc11 | |||
54ffa999d8 | |||
034269b87c | |||
8844e3e64a | |||
e2634b0b0f | |||
ad63df85c7 | |||
f987a6b5e0 | |||
3c685d50dd |
@@ -1,14 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/** @var \drupol\PhpCsFixerConfigsPhp\Config\Php73 $config */
|
||||||
$config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php73/php_cs_fixer.config.php';
|
$config = require __DIR__ . '/tests/app/vendor/drupol/php-conventions/config/php73/php_cs_fixer.config.php';
|
||||||
|
|
||||||
$config
|
$config
|
||||||
|
@@ -16,8 +16,6 @@ and this project adheres to
|
|||||||
* [activity][export] DX/Feature: use of an `ActivityTypeRepositoryInterface` instead of the old-style EntityRepository
|
* [activity][export] DX/Feature: use of an `ActivityTypeRepositoryInterface` instead of the old-style EntityRepository
|
||||||
* [person][export] Fixed: some inconsistency with date filter on accompanying courses
|
* [person][export] Fixed: some inconsistency with date filter on accompanying courses
|
||||||
* [person][export] Fixed: use left join for related entities in accompanying course aggregators
|
* [person][export] Fixed: use left join for related entities in accompanying course aggregators
|
||||||
* [workflow] Feature: allow user to copy and send manually the access link for the workflow
|
|
||||||
* [workflow] Feature: show the email addresses that received an access link for the workflow
|
|
||||||
|
|
||||||
## Test releases
|
## Test releases
|
||||||
|
|
||||||
@@ -34,12 +32,8 @@ and this project adheres to
|
|||||||
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty
|
||||||
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
* [search]: Order of birthdate fields changed in advanced search to avoid confusion.
|
||||||
* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675)
|
* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675)
|
||||||
* [social_action]: only show active objectives (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/625)
|
|
||||||
* [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620)
|
* [household]: Reposition and cut button for enfant hors menage have been deleted (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/620)
|
||||||
* [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611)
|
* [admin]: Add crud for composition type in admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/611)
|
||||||
* [social_action]: only show active objectives (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/625)
|
|
||||||
|
|
||||||
## Test releases
|
|
||||||
|
|
||||||
### 2022-05-30
|
### 2022-05-30
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Filter;
|
namespace Chill\PersonBundle\Export\Filter;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\PersonBundle\Export\Export;
|
namespace Chill\PersonBundle\Export\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
@@ -18,6 +18,7 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
class CountPerson implements ExportInterface
|
class CountPerson implements ExportInterface
|
||||||
{
|
{
|
||||||
@@ -72,9 +73,9 @@ class CountPerson implements ExportInterface
|
|||||||
return ['export_result'];
|
return ['export_result'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
@@ -105,9 +106,9 @@ class CountPerson implements ExportInterface
|
|||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requiredRole(): string
|
public function requiredRole()
|
||||||
{
|
{
|
||||||
return PersonVoter::STATS;
|
return new Role(PersonVoter::STATS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MyBundle\Controller;
|
namespace Chill\MyBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\HealthBundle\Controller;
|
namespace Chill\HealthBundle\Controller;
|
||||||
|
|
||||||
use Chill\HealthBundle\Security\Authorization\ConsultationVoter;
|
use Chill\HealthBundle\Security\Authorization\ConsultationVoter;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\DependencyInjection;
|
namespace Chill\MainBundle\DependencyInjection;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\MainBundle\DependencyInjection;
|
namespace Chill\MainBundle\DependencyInjection;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\PersonBundle\Widget;
|
namespace Chill\PersonBundle\Widget;
|
||||||
|
|
||||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;
|
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\PersonBundle\Widget;
|
namespace Chill\PersonBundle\Widget;
|
||||||
|
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\PersonBundle\DependencyInjection;
|
namespace Chill\PersonBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
@@ -28,33 +28,25 @@ Requirements
|
|||||||
- This project use `docker <https://docker.com>`_ to be run. As a developer, use `docker-compose <https://docs.docker.com/compose/overview/>`_ to bootstrap a dev environment in a glance. You do not need any other dependencies ;
|
- This project use `docker <https://docker.com>`_ to be run. As a developer, use `docker-compose <https://docs.docker.com/compose/overview/>`_ to bootstrap a dev environment in a glance. You do not need any other dependencies ;
|
||||||
- Make is used to automate scripts.
|
- Make is used to automate scripts.
|
||||||
|
|
||||||
Installation
|
Installation in development mode
|
||||||
************
|
********************************
|
||||||
|
|
||||||
If you plan to run chill in production:
|
|
||||||
|
|
||||||
1. install it locally first, and check if everything is ok on your local machine;
|
|
||||||
2. once ready, build the image from your local machine, and deploy them.
|
|
||||||
|
|
||||||
If you want to develop some bundles, the first step is sufficient (until you deploy on production).
|
|
||||||
|
|
||||||
|
|
||||||
1. Get the code
|
1. Get the code
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Clone or download the chill-skeleton project and `cd` into the main directory.
|
Clone or download the chill-app project and `cd` into the main directory.
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
git clone https://gitlab.com/Chill-Projet/chill-skeleton-basic.git
|
git clone https://gitlab.com/Chill-Projet/chill-app.git
|
||||||
cd chill-app
|
cd chill-app
|
||||||
|
|
||||||
|
|
||||||
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
As a developer, the code will stay on your computer and will be executed in docker container. To avoid permission problem, the code should be run with the same uid/gid from your current user. This is why we get your current user id with the command ``id -u`` in each following scripts.
|
||||||
|
|
||||||
2. Prepare composer to download the sources
|
2. Prepare composer download of sources
|
||||||
===========================================
|
=======================================
|
||||||
|
|
||||||
As you are running in dev, you must configure an auth token for getting the source code.
|
As you are running in dev, you must configure an auth token for getting the source code.
|
||||||
|
|
||||||
@@ -63,7 +55,7 @@ As you are running in dev, you must configure an auth token for getting the sour
|
|||||||
If you skip this part, the code will be downloaded from dist instead of source (with git repository). You will probably replace the source manually, but the next time you will run ```composer update```, your repository will be replaced and you might loose something.
|
If you skip this part, the code will be downloaded from dist instead of source (with git repository). You will probably replace the source manually, but the next time you will run ```composer update```, your repository will be replaced and you might loose something.
|
||||||
|
|
||||||
1. Create a personal access token from https://gitlab.com/-/profile/personal_access_tokens, with the `read_api` scope.
|
1. Create a personal access token from https://gitlab.com/-/profile/personal_access_tokens, with the `read_api` scope.
|
||||||
2. add a file called ```.composer/auth.json``` with this content:
|
2. add a file called ```.composer/auth.json```:
|
||||||
|
|
||||||
.. code-block:: json
|
.. code-block:: json
|
||||||
|
|
||||||
@@ -82,19 +74,7 @@ Copy ```docker-compose.override.dev.yml``` into ```docker-compose.override.yml``
|
|||||||
|
|
||||||
cp docker-compose.override.dev.template.yml docker-compose.override.yml
|
cp docker-compose.override.dev.template.yml docker-compose.override.yml
|
||||||
|
|
||||||
2. Prepare your variables and docker-compose
|
Configure your environment variables, by creating a .env.local file and override the desired variables.
|
||||||
============================================
|
|
||||||
|
|
||||||
Have a look at the variable in ``.env`` and check if you need to adapt them. If they do not adapt with your need, or if some are missing:
|
|
||||||
|
|
||||||
1. copy the file as ``.env.local``: ``cp .env .env.local``
|
|
||||||
2. you may replace some variables inside ``.env``
|
|
||||||
|
|
||||||
Prepare also you docker-compose installation, and adapt it to your needs:
|
|
||||||
|
|
||||||
1. If you plan to deploy on dev, copy the file ``docker-compose.override.dev.template.yml`` to ``docker-compose.override.yml``.
|
|
||||||
2. adapt to your needs.
|
|
||||||
|
|
||||||
|
|
||||||
**Note**: If you intend to use the bundle ``Chill-Doc-Store``, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure `secret keys <https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html#secret-keys>`_.
|
**Note**: If you intend to use the bundle ``Chill-Doc-Store``, you will need to configure and install an openstack object storage container with temporary url middleware. You will have to configure `secret keys <https://docs.openstack.org/swift/latest/api/temporary_url_middleware.html#secret-keys>`_.
|
||||||
|
|
||||||
@@ -114,17 +94,6 @@ This script will :
|
|||||||
3. install the php dependencies
|
3. install the php dependencies
|
||||||
4. build assets
|
4. build assets
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
The script will work only if the binary ``docker-compose`` is located into your ``PATH``. If you use ``compose`` as a docker plugin,
|
|
||||||
you can simulate this binary by creating this file at (for instance), ``/usr/local/bin/docker-compose`` (and run ``chmod +x /usr/local/bin/docker-compose``):
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
/usr/bin/docker compose "$@"
|
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -148,20 +117,13 @@ This script will :
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# mount into to container
|
make migrate
|
||||||
./docker-php.sh
|
|
||||||
# and load fixtures
|
|
||||||
bin/console doctrine:migrations:migrate
|
|
||||||
|
|
||||||
|
|
||||||
Chill will be available at ``http://localhost:8001.`` Currently, there isn't any user or data. To add fixtures, run
|
Chill will be available at ``http://localhost:8001.`` Currently, there isn't any user or data. To add fixtures, run
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# mount into to container
|
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load --purge-with-truncate
|
||||||
./docker-php.sh
|
|
||||||
# and load fixtures
|
|
||||||
bin/console doctrine:fixtures:load --purge-with-truncate
|
|
||||||
|
|
||||||
There are several users available:
|
There are several users available:
|
||||||
|
|
||||||
@@ -172,6 +134,28 @@ The password is always ``password``.
|
|||||||
|
|
||||||
Now, read `Operations` below.
|
Now, read `Operations` below.
|
||||||
|
|
||||||
|
Prepare for development
|
||||||
|
***********************
|
||||||
|
|
||||||
|
Add a Gitlab token to ensure that you get always the source code:
|
||||||
|
|
||||||
|
1. generate a gitlab token there: https://gitlab.com/oauth/token
|
||||||
|
2. run this command (in php container, at the app's root): :code:`composer config gitlab-token.gitlab.com <your token>`
|
||||||
|
|
||||||
|
The auth token should appears now in the directory :code:`.composer`:
|
||||||
|
|
||||||
|
.. code-block: bash
|
||||||
|
|
||||||
|
$ cat .composer/auth.json
|
||||||
|
{
|
||||||
|
"gitlab-token": {
|
||||||
|
"gitlab.com": "<your token>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
See also "how to switch branch and get new dependencies".
|
||||||
|
|
||||||
|
|
||||||
Operations
|
Operations
|
||||||
**********
|
**********
|
||||||
@@ -191,7 +175,7 @@ How to execute the console ?
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# if a container is running
|
# if a container is running
|
||||||
./docker-php.sh
|
docker-compose exec --user $(id -u) php bin/console
|
||||||
# if not
|
# if not
|
||||||
docker-compose run --user $(id -u) php bin/console
|
docker-compose run --user $(id -u) php bin/console
|
||||||
|
|
||||||
@@ -201,8 +185,7 @@ How to create the database schema (= run migrations) ?
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# if a container is running
|
# if a container is running
|
||||||
./docker-php.sh
|
docker-compose exec --user $(id -u) php bin/console doctrine:migrations:migrate
|
||||||
bin/console doctrine:migrations:migrate
|
|
||||||
# if not
|
# if not
|
||||||
docker-compose run --user $(id -u) php bin/console doctrine:migrations:migrate
|
docker-compose run --user $(id -u) php bin/console doctrine:migrations:migrate
|
||||||
|
|
||||||
@@ -220,8 +203,7 @@ How to load fixtures ? (development mode only)
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# if a container is running
|
# if a container is running
|
||||||
./docker-php.sh
|
docker-compose exec --user $(id -u) php bin/console doctrine:fixtures:load
|
||||||
bin/console doctrine:fixtures:load
|
|
||||||
# if not
|
# if not
|
||||||
docker-compose run --user $(id -u) php bin/console doctrine:fixtures:load
|
docker-compose run --user $(id -u) php bin/console doctrine:fixtures:load
|
||||||
|
|
||||||
@@ -231,7 +213,7 @@ How to open a terminal in the project
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# if a container is running
|
# if a container is running
|
||||||
./docker-php.sh
|
docker-compose exec --user $(id -u) php /bin/bash
|
||||||
# if not
|
# if not
|
||||||
docker-compose run --user $(id -u) php /bin/bash
|
docker-compose run --user $(id -u) php /bin/bash
|
||||||
|
|
||||||
@@ -241,22 +223,21 @@ How to run composer ?
|
|||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# if a container is running
|
# if a container is running
|
||||||
./docker-php.sh
|
docker-compose exec --user $(id -u) php ./composer.phar
|
||||||
composer
|
|
||||||
# if not
|
# if not
|
||||||
docker-compose run --user $(id -u) php composer
|
docker-compose run --user $(id -u) php ./composer.phar
|
||||||
|
|
||||||
How to access to PGADMIN ?
|
How to access to PGADMIN ?
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
Pgadmin is installed with docker-compose, and is available **only if you uncomment the appropriate lines into ``docker-compose.override.yml``.
|
Pgadmin is installed with docker-compose.
|
||||||
|
|
||||||
You can access it at ``http://localhost:8002``.
|
You can access it at ``http://localhost:8002``.
|
||||||
|
|
||||||
Credentials:
|
Credentials:
|
||||||
|
|
||||||
- login: from the variable you set into ``docker-composer.override.yml``
|
- login: admin@chill.social
|
||||||
- password: same :-)
|
- password: password
|
||||||
|
|
||||||
How to run tests ?
|
How to run tests ?
|
||||||
==================
|
==================
|
||||||
@@ -265,44 +246,18 @@ Tests reside inside the installed bundles. You must `cd` into that directory, do
|
|||||||
|
|
||||||
**Note**: some bundle require the fixture to be executed. See the dedicated _how-tos_.
|
**Note**: some bundle require the fixture to be executed. See the dedicated _how-tos_.
|
||||||
|
|
||||||
Exemple, for running unit test inside `main` bundle:
|
Exemple, for running test inside `main` bundle:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# mount into the php image
|
# mount into the php image
|
||||||
./docker-php.sh
|
docker-compose run --user $(id -u) php /bin/bash
|
||||||
# cd into main directory
|
# cd into main directory
|
||||||
cd vendor/chill-project/chill-bundles
|
cd vendor/chill-project/main
|
||||||
# download deps
|
# download deps
|
||||||
git submodule init
|
php ../../../composer.phar install
|
||||||
git submodule update
|
|
||||||
composer install
|
|
||||||
# run tests
|
# run tests
|
||||||
bin/phpunit src/Bundle/path/to/your/test
|
/vendor/bin/phpunit
|
||||||
|
|
||||||
Or for running tests to check code style and php conventions with csfixer and phpstan:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
# run code style fixer
|
|
||||||
bin/grumphp run --tasks=phpcsfixer
|
|
||||||
# run phpstan
|
|
||||||
bin/grumphp run --tasks=phpstan
|
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
To avoid phpstan block your commits:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
git commit -n ...
|
|
||||||
|
|
||||||
To avoid phpstan block your commits permanently:
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
./bin/grumphp git:deinit
|
|
||||||
|
|
||||||
How to run webpack interactively
|
How to run webpack interactively
|
||||||
================================
|
================================
|
||||||
@@ -314,14 +269,10 @@ How to switch the branch for chill-bundles, and get new dependencies
|
|||||||
|
|
||||||
During development, you will switch to new branches for chill-bundles. As long as the dependencies are equals, this does not cause any problem. But sometimes, a new branch introduces a new dependency, and you must download it.
|
During development, you will switch to new branches for chill-bundles. As long as the dependencies are equals, this does not cause any problem. But sometimes, a new branch introduces a new dependency, and you must download it.
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
Ensure that you have gitlab-token ready before updating your branches. See above.
|
|
||||||
|
|
||||||
In order to do that without pain, use those steps:
|
In order to do that without pain, use those steps:
|
||||||
|
|
||||||
0. Ensuire you have a token, set
|
0. Ensuire you have a token, set
|
||||||
1. at the app's root, update the ``composer.json`` to your current branch:
|
1. at the app's root, update the `composer.json` to your current branch:
|
||||||
|
|
||||||
.. code-block:: json
|
.. code-block:: json
|
||||||
|
|
||||||
@@ -330,7 +281,14 @@ In order to do that without pain, use those steps:
|
|||||||
"chill-bundles": "dev-<my-branch>@dev"
|
"chill-bundles": "dev-<my-branch>@dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
2. mount into the php container (``./docker-php.sh``), and run ``composer update``
|
2. mount into the php container, and run `composer update`
|
||||||
|
|
||||||
|
Build the documentation API
|
||||||
|
===========================
|
||||||
|
|
||||||
|
A basic configuration of `sami <https://github.com/FriendsOfPhp/Sami>`_ is embedded within the project.
|
||||||
|
|
||||||
|
A configuration file for `phpDocumentor <https://www.phpdoc.org>`_ is present.
|
||||||
|
|
||||||
Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
|
Error `An exception has been thrown during the rendering of a template ("Asset manifest file "/var/www/app/web/build/manifest.json" does not exist.").` on first run
|
||||||
====================================================================================================================================================================
|
====================================================================================================================================================================
|
||||||
@@ -345,8 +303,7 @@ Currently, to run this software in production, the *state of the art* is the fol
|
|||||||
1. Run the software locally and tweak the configuration to your needs ;
|
1. Run the software locally and tweak the configuration to your needs ;
|
||||||
2. Build the image and store them into a private container registry. This can be done using :code:`make build-and-push-image`.
|
2. Build the image and store them into a private container registry. This can be done using :code:`make build-and-push-image`.
|
||||||
|
|
||||||
To be sure to target the correct container registry, you have to adapt the image names into your ``docker-compose.override.yml`` file.
|
To be sure to target the correct container registry, you have to adapt the values ``IMAGE_NGINX`` and ``IMAGE_PHP`` date in the ``.env`` file.
|
||||||
3. Push the image on your registry, or upload them to the destination machine using ``docker image save`` and ``docker image load``.
|
|
||||||
3. Run the image on your production server, using docker-compose or eventually docker stack. You have to customize the variable set in docker-compose.
|
3. Run the image on your production server, using docker-compose or eventually docker stack. You have to customize the variable set in docker-compose.
|
||||||
|
|
||||||
See also the :ref:`running-production-tips-and-tricks` below.
|
See also the :ref:`running-production-tips-and-tricks` below.
|
||||||
@@ -378,7 +335,7 @@ It is worth having an eye on the configuration of logstash container.
|
|||||||
Design principles
|
Design principles
|
||||||
*****************
|
*****************
|
||||||
|
|
||||||
Why the DB URL is also set in environment, and not in .env file ?
|
Why the DB URL is set in environment, and not in parameters.yml ?
|
||||||
=================================================================
|
=================================================================
|
||||||
|
|
||||||
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running ``entrypoint.sh``. For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).
|
Because, at startup, a script does check the db is up and, if not, wait for a couple of seconds before running ``entrypoint.sh``. For avoiding double configuration, the configuration of the PHP app takes his configuration from environment also (and it will be standard in future releases, with symfony 4.0).
|
||||||
|
@@ -17,13 +17,12 @@ These are alias conventions :
|
|||||||
| | Scope::class | acp.scopes | acpscope |
|
| | Scope::class | acp.scopes | acpscope |
|
||||||
| | SocialIssue::class | acp.socialIssues | acpsocialissue |
|
| | SocialIssue::class | acp.socialIssues | acpsocialissue |
|
||||||
| | User::class | acp.user | acpuser |
|
| | User::class | acp.user | acpuser |
|
||||||
| | AccompanyingPeriopStepHistory::class | acp.stepHistories | acpstephistories |
|
|
||||||
| AccompanyingPeriodWork::class | | | acpw |
|
| AccompanyingPeriodWork::class | | | acpw |
|
||||||
| | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval |
|
| | AccompanyingPeriodWorkEvaluation::class | acpw.accompanyingPeriodWorkEvaluations | workeval |
|
||||||
| | User::class | acpw.referrers | acpwuser |
|
| | User::class | acpw.referrers | acpwuser |
|
||||||
| | SocialAction::class | acpw.socialAction | acpwsocialaction |
|
| | SocialAction::class | acpw.socialAction | acpwsocialaction |
|
||||||
| | Goal::class | acpw.goals | goal |
|
| | Goal::class | acpw.goals | goal |
|
||||||
| | Result::class | acpw.results | result |
|
| | Result::class | acpw.results | result |
|
||||||
| AccompanyingPeriodParticipation::class | | | acppart |
|
| AccompanyingPeriodParticipation::class | | | acppart |
|
||||||
| | Person::class | acppart.person | partperson |
|
| | Person::class | acppart.person | partperson |
|
||||||
| AccompanyingPeriodWorkEvaluation::class | | | workeval |
|
| AccompanyingPeriodWorkEvaluation::class | | | workeval |
|
||||||
@@ -48,7 +47,7 @@ These are alias conventions :
|
|||||||
| | HouseholdComposition::class | household.compositions | composition |
|
| | HouseholdComposition::class | household.compositions | composition |
|
||||||
| Activity::class | | | activity |
|
| Activity::class | | | activity |
|
||||||
| | Person::class | activity.person | actperson |
|
| | Person::class | activity.person | actperson |
|
||||||
| | AccompanyingPeriod::class | activity.accompanyingPeriod | acp |
|
| | AccompanyingPeriod::class | activity.accompanyingPeriod | acp |
|
||||||
| | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity |
|
| | Person::class | activity\_person\_having\_activity.person | person\_person\_having\_activity |
|
||||||
| | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity |
|
| | ActivityReason::class | activity\_person\_having\_activity.reasons | reasons\_person\_having\_activity |
|
||||||
| | ActivityType::class | activity.activityType | acttype |
|
| | ActivityType::class | activity.activityType | acttype |
|
||||||
@@ -60,7 +59,6 @@ These are alias conventions :
|
|||||||
| | User::class | activity.users | actusers |
|
| | User::class | activity.users | actusers |
|
||||||
| | ActivityReason::class | activity.reasons | actreasons |
|
| | ActivityReason::class | activity.reasons | actreasons |
|
||||||
| | Center::class | actperson.center | actcenter |
|
| | Center::class | actperson.center | actcenter |
|
||||||
| | Person::class | activity.createdBy | actcreator |
|
|
||||||
| ActivityReason::class | | | actreasons |
|
| ActivityReason::class | | | actreasons |
|
||||||
| | ActivityReasonCategory::class | actreason.category | actreasoncat |
|
| | ActivityReasonCategory::class | actreason.category | actreasoncat |
|
||||||
| Calendar::class | | | cal |
|
| Calendar::class | | | cal |
|
||||||
|
@@ -23,6 +23,150 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
|
path: src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityReasonAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityTypeAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Aggregator\\\\ActivityUserAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/CountActivity.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\CountActivity\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/CountActivity.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\ListActivity\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/ListActivity.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Export\\\\StatActivityDuration\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Export/StatActivityDuration.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityReasonFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityReasonFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\ActivityTypeFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ActivityBundle\\\\Export\\\\Filter\\\\PersonHavingActivityBetweenDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Export/Filter/PersonHavingActivityBetweenDateFilter.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Fetching class constant class of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -31,6 +175,13 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
path: src/Bundle/ChillActivityBundle/Form/ActivityType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
@@ -143,6 +294,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
|
path: src/Bundle/ChillEventBundle/Form/Type/PickEventType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillEventBundle/Search/EventSearch.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -215,6 +374,38 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Entity/User.php
|
path: src/Bundle/ChillMainBundle/Entity/User.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\MainBundle\\\\Export\\\\DirectExportInterface\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/DirectExportInterface.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\MainBundle\\\\Export\\\\ExportInterface\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/ExportInterface.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/ExportManager.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\MainBundle\\\\Export\\\\ModifierInterface\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/ModifierInterface.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
#^Class Chill\\\\MainBundle\\\\Form\\\\Event\\\\CustomizeFormEvent extends deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event\\:
|
||||||
@@ -374,6 +565,142 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
path: src/Bundle/ChillPersonBundle/Entity/Person.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\AgeAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Aggregator/AgeAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\CountryOfBirthAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Aggregator/CountryOfBirthAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\GenderAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Aggregator/GenderAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Aggregator\\\\NationalityAggregator\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Aggregator/NationalityAggregator.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\CountPerson\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPerson\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method execute\\(\\) of class Doctrine\\\\DBAL\\\\Statement\\:
|
||||||
|
Statement\\:\\:execute\\(\\) is deprecated, use Statement\\:\\:executeQuery\\(\\) or executeStatement\\(\\) instead$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Export\\\\ListPersonDuplicate\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodClosingFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodClosingFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\AccompanyingPeriodOpeningFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodOpeningFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\BirthdateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/BirthdateFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\GenderFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/GenderFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\PersonBundle\\\\Export\\\\Filter\\\\NationalityFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillPersonBundle/Export/Filter/NationalityFilter.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -427,6 +754,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
|
path: src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -435,6 +770,37 @@ parameters:
|
|||||||
count: 3
|
count: 3
|
||||||
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
path: src/Bundle/ChillReportBundle/Controller/ReportController.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Export\\\\ReportList\\:\\:requiredRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Export/Export/ReportList.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Return type of method Chill\\\\ReportBundle\\\\Export\\\\Filter\\\\ReportDateFilter\\:\\:addRole\\(\\) has typehint with deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
since Symfony 4\\.3, to be removed in 5\\.0\\. Use strings as roles instead\\.$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Form/ReportType.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
@@ -444,6 +810,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillReportBundle/Form/ReportType.php
|
path: src/Bundle/ChillReportBundle/Form/ReportType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
@@ -452,6 +826,13 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
|
path: src/Bundle/ChillReportBundle/Search/ReportSearch.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Call to deprecated method getReachableScopes\\(\\) of class Chill\\\\MainBundle\\\\Security\\\\Authorization\\\\AuthorizationHelper\\:
|
||||||
|
Use getReachableCircles$#
|
||||||
|
"""
|
||||||
|
count: 2
|
||||||
|
path: src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
@@ -517,6 +898,14 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
|
path: src/Bundle/ChillTaskBundle/Form/SingleTaskType.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: """
|
||||||
|
#^Parameter \\$centerResolverDispatcher of method Chill\\\\TaskBundle\\\\Repository\\\\SingleTaskAclAwareRepository\\:\\:__construct\\(\\) has typehint with deprecated interface Chill\\\\MainBundle\\\\Security\\\\Resolver\\\\CenterResolverDispatcherInterface\\:
|
||||||
|
Use CenterResolverManager and its interface CenterResolverManagerInterface$#
|
||||||
|
"""
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: """
|
message: """
|
||||||
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
#^Instantiation of deprecated class Symfony\\\\Component\\\\Security\\\\Core\\\\Role\\\\Role\\:
|
||||||
|
@@ -245,6 +245,11 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillMainBundle/Entity/User.php
|
path: src/Bundle/ChillMainBundle/Entity/User.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle;
|
namespace Chill\ActivityBundle;
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -42,6 +42,7 @@ 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\Security\Core\Role\Role;
|
||||||
|
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
use function array_key_exists;
|
use function array_key_exists;
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Controller;
|
namespace Chill\ActivityBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
namespace Chill\ActivityBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DependencyInjection;
|
namespace Chill\ActivityBundle\DependencyInjection;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\DependencyInjection;
|
namespace Chill\ActivityBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
|
@@ -1,22 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;
|
use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;
|
||||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
|
||||||
use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
|
|
||||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
|
||||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
|
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||||
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
|
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
|
||||||
@@ -59,12 +55,8 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||||||
* getUserFunction="getUser",
|
* getUserFunction="getUser",
|
||||||
* path="scope")
|
* path="scope")
|
||||||
*/
|
*/
|
||||||
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface, TrackCreationInterface, TrackUpdateInterface
|
class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface, HasCentersInterface, HasScopesInterface
|
||||||
{
|
{
|
||||||
use TrackCreationTrait;
|
|
||||||
|
|
||||||
use TrackUpdateTrait;
|
|
||||||
|
|
||||||
public const SENTRECEIVED_RECEIVED = 'received';
|
public const SENTRECEIVED_RECEIVED = 'received';
|
||||||
|
|
||||||
public const SENTRECEIVED_SENT = 'sent';
|
public const SENTRECEIVED_SENT = 'sent';
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Entity;
|
namespace Chill\ActivityBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\EntityListener;
|
namespace Chill\ActivityBundle\EntityListener;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
@@ -1,31 +1,32 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\AggregatorInterface;
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
use Chill\MainBundle\Repository\UserRepository;
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
class ByCreatorAggregator implements AggregatorInterface
|
class ByUserAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
private UserRender $userRender;
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
private UserRepository $userRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
UserRepositoryInterface $userRepository,
|
UserRepository $userRepository,
|
||||||
UserRender $userRender
|
UserRender $userRender
|
||||||
) {
|
) {
|
||||||
$this->userRepository = $userRepository;
|
$this->userRepository = $userRepository;
|
||||||
@@ -39,8 +40,12 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator');
|
if (!in_array('actusers', $qb->getAllAliases(), true)) {
|
||||||
$qb->addGroupBy('creator_aggregator');
|
$qb->leftJoin('activity.users', 'actusers');
|
||||||
|
}
|
||||||
|
|
||||||
|
$qb->addSelect('actusers.id AS users_aggregator');
|
||||||
|
$qb->addGroupBy('users_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -57,7 +62,7 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
return function ($value): string {
|
return function ($value): string {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'Created by';
|
return 'Accepted users';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $value) {
|
if (null === $value) {
|
||||||
@@ -72,11 +77,11 @@ class ByCreatorAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['creator_aggregator'];
|
return ['users_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by creator';
|
return 'Group activity by linked users';
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,18 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\AggregatorInterface;
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
|
use DateTime;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
@@ -49,17 +50,14 @@ class DateAggregator implements AggregatorInterface
|
|||||||
switch ($data['frequency']) {
|
switch ($data['frequency']) {
|
||||||
case 'month':
|
case 'month':
|
||||||
$fmt = 'YYYY-MM';
|
$fmt = 'YYYY-MM';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'week':
|
case 'week':
|
||||||
$fmt = 'YYYY-IW';
|
$fmt = 'YYYY-IW';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
$fmt = 'YYYY'; $order = 'DESC';
|
$fmt = 'YYYY'; $order = 'DESC';
|
||||||
|
|
||||||
break; // order DESC does not works !
|
break; // order DESC does not works !
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -100,6 +98,7 @@ class DateAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
switch ($data['frequency']) {
|
switch ($data['frequency']) {
|
||||||
case 'month':
|
case 'month':
|
||||||
|
|
||||||
case 'week':
|
case 'week':
|
||||||
//return $this->translator->trans('for week') .' '. $value ;
|
//return $this->translator->trans('for week') .' '. $value ;
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\ACPAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
class CreatorScopeAggregator implements AggregatorInterface
|
class UserScopeAggregator implements AggregatorInterface
|
||||||
{
|
{
|
||||||
private ScopeRepository $scopeRepository;
|
private ScopeRepository $scopeRepository;
|
||||||
|
|
||||||
@@ -40,12 +40,12 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
if (!in_array('actcreator', $qb->getAllAliases(), true)) {
|
if (!in_array('actuser', $qb->getAllAliases(), true)) {
|
||||||
$qb->leftJoin('activity.createdBy', 'actcreator');
|
$qb->leftJoin('activity.user', 'actuser');
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->addSelect('IDENTITY(actcreator.mainScope) AS creatorscope_aggregator');
|
$qb->addSelect('IDENTITY(actuser.mainScope) AS userscope_aggregator');
|
||||||
$qb->addGroupBy('creatorscope_aggregator');
|
$qb->addGroupBy('userscope_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -79,11 +79,11 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getQueryKeys($data): array
|
public function getQueryKeys($data): array
|
||||||
{
|
{
|
||||||
return ['creatorscope_aggregator'];
|
return ['userscope_aggregator'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Group activity by creator scope';
|
return 'Group activity by userscope';
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -16,6 +16,7 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
|||||||
use Chill\MainBundle\Export\AggregatorInterface;
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
namespace Chill\ActivityBundle\Export\Aggregator;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -61,7 +61,7 @@ class ActivityUserAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function getLabels($key, $values, $data): Closure
|
public function getLabels($key, $values, $data): Closure
|
||||||
{
|
{
|
||||||
return function ($value) {
|
return function ($value) {
|
||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return 'Activity user';
|
return 'Activity user';
|
||||||
}
|
}
|
||||||
|
@@ -1,86 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Export\AggregatorInterface;
|
|
||||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityUsersAggregator implements AggregatorInterface
|
|
||||||
{
|
|
||||||
private UserRender $userRender;
|
|
||||||
|
|
||||||
private UserRepositoryInterface $userRepository;
|
|
||||||
|
|
||||||
public function __construct(UserRepositoryInterface $userRepository, UserRender $userRender)
|
|
||||||
{
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
if (!in_array('actusers', $qb->getAllAliases(), true)) {
|
|
||||||
$qb->leftJoin('activity.users', 'actusers');
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb
|
|
||||||
->addSelect('actusers.id AS activity_users_aggregator')
|
|
||||||
->addGroupBy('activity_users_aggregator');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn(): string
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
// nothing to add on the form
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
|
||||||
{
|
|
||||||
return function ($value) {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
return 'Activity users';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$u = $this->userRepository->find($value);
|
|
||||||
|
|
||||||
return $this->userRender->renderString($u, []);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getQueryKeys($data)
|
|
||||||
{
|
|
||||||
return ['activity_users_aggregator'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'Aggregate by activity users';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,87 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
|
||||||
{
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
private UserJobRepositoryInterface $userJobRepository;
|
|
||||||
|
|
||||||
public function __construct(UserJobRepositoryInterface $userJobRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
|
||||||
$this->userJobRepository = $userJobRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
if (!in_array('actusers', $qb->getAllAliases(), true)) {
|
|
||||||
$qb->leftJoin('activity.users', 'actusers');
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb
|
|
||||||
->addSelect('IDENTITY(actusers.userJob) AS activity_users_job_aggregator')
|
|
||||||
->addGroupBy('activity_users_job_aggregator');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn()
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
// nothing to add in the form
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
|
||||||
{
|
|
||||||
return function ($value): string {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
return 'Users \'s job';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$j = $this->userJobRepository->find($value);
|
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize(
|
|
||||||
$j->getLabel()
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getQueryKeys($data): array
|
|
||||||
{
|
|
||||||
return ['activity_users_job_aggregator'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'Aggregate by users job';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,87 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\AggregatorInterface
|
|
||||||
{
|
|
||||||
private ScopeRepositoryInterface $scopeRepository;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(ScopeRepositoryInterface $scopeRepository, TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
if (!in_array('actusers', $qb->getAllAliases(), true)) {
|
|
||||||
$qb->leftJoin('activity.users', 'actusers');
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb
|
|
||||||
->addSelect('IDENTITY(actusers.mainScope) AS activity_users_main_scope_aggregator')
|
|
||||||
->addGroupBy('activity_users_main_scope_aggregator');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn()
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
// nothing to add in the form
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLabels($key, array $values, $data)
|
|
||||||
{
|
|
||||||
return function ($value): string {
|
|
||||||
if ('_header' === $value) {
|
|
||||||
return 'Users \'s scope';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $value) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$s = $this->scopeRepository->find($value);
|
|
||||||
|
|
||||||
return $this->translatableStringHelper->localize(
|
|
||||||
$s->getName()
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getQueryKeys($data): array
|
|
||||||
{
|
|
||||||
return ['activity_users_main_scope_aggregator'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'Aggregate by users scope';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Aggregator\PersonAggregators;
|
namespace Chill\ActivityBundle\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -25,8 +25,8 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
$qb->addSelect($elem . ' as ' . $alias);
|
$qb->addSelect($elem . ' as ' . $alias);
|
||||||
|
|
||||||
// make a jointure only if needed
|
// make a jointure only if needed
|
||||||
if (!in_array('actreasons', $qb->getAllAliases(), true)) {
|
if (!in_array( 'actreasons', $qb->getAllAliases(), true)) {
|
||||||
$qb->innerJoin('activity.reasons', 'actreasons');
|
$qb->innerJoin('activity.reasons', 'actreasons');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export;
|
namespace Chill\ActivityBundle\Export;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -17,13 +17,10 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
@@ -58,7 +55,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_avg_activity_duration' !== $key) {
|
if ('export_avg_activity_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value;
|
||||||
@@ -69,9 +66,9 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return ['export_avg_activity_duration'];
|
return ['export_avg_activity_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
@@ -86,10 +83,6 @@ 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) {
|
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository->createQueryBuilder('activity');
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
@@ -97,17 +90,6 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
->select('AVG(activity.durationTime) as export_avg_activity_duration')
|
->select('AVG(activity.durationTime) as export_avg_activity_duration')
|
||||||
->andWhere($qb->expr()->isNotNull('activity.durationTime'));
|
->andWhere($qb->expr()->isNotNull('activity.durationTime'));
|
||||||
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
|
|
||||||
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -17,13 +17,10 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterface
|
class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterface
|
||||||
@@ -59,7 +56,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_avg_activity_visit_duration' !== $key) {
|
if ('export_avg_activity_visit_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value;
|
||||||
@@ -70,9 +67,9 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return ['export_avg_activity_visit_duration'];
|
return ['export_avg_activity_visit_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
@@ -87,27 +84,13 @@ 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) {
|
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository->createQueryBuilder('activity');
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->join('activity.accompanyingPeriod', 'acp')
|
->join('activity.accompanyingPeriod', 'acp')
|
||||||
->select('AVG(activity.travelTime) as export_avg_activity_visit_duration')
|
->select('AVG(activity.travelTime) as export_avg_activity_visit_duration')
|
||||||
->andWhere($qb->expr()->isNotNull('activity.travelTime'));
|
->andWhere($qb->expr()->isNotNull('activity.travelTime'))
|
||||||
|
;
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
|
|
||||||
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -17,8 +17,6 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
@@ -69,9 +67,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
@@ -86,24 +84,11 @@ 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) {
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
if (!in_array('acp', $qb->getAllAliases(), true)) {
|
||||||
->createQueryBuilder('activity')
|
$qb->join('activity.accompanyingPeriod', 'acp');
|
||||||
->join('activity.accompanyingPeriod', 'acp');
|
}
|
||||||
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
|
|
||||||
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
|
|
||||||
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');
|
$qb->select('COUNT(DISTINCT activity.id) as export_count_activity');
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -17,13 +17,10 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
||||||
@@ -59,7 +56,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_duration' !== $key) {
|
if ('export_sum_activity_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
||||||
@@ -70,9 +67,9 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return ['export_sum_activity_duration'];
|
return ['export_sum_activity_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
@@ -87,28 +84,15 @@ 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) {
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
if (!in_array('acp', $qb->getAllAliases(), true)) {
|
||||||
->createQueryBuilder('activity')
|
$qb->join('activity.accompanyingPeriod', 'acp');
|
||||||
->join('activity.accompanyingPeriod', 'acp');
|
}
|
||||||
|
|
||||||
$qb->select('SUM(activity.durationTime) as export_sum_activity_duration')
|
$qb->select('SUM(activity.durationTime) as export_sum_activity_duration')
|
||||||
->andWhere($qb->expr()->isNotNull('activity.durationTime'));
|
->andWhere($qb->expr()->isNotNull('activity.durationTime'));
|
||||||
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
|
|
||||||
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToACP;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -17,13 +17,10 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
|
||||||
use Chill\PersonBundle\Entity\Person\PersonCenterHistory;
|
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use LogicException;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class SumActivityVisitDuration implements ExportInterface, GroupedExportInterface
|
class SumActivityVisitDuration implements ExportInterface, GroupedExportInterface
|
||||||
@@ -59,7 +56,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_visit_duration' !== $key) {
|
if ('export_sum_activity_visit_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
||||||
@@ -70,9 +67,9 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
return ['export_sum_activity_visit_duration'];
|
return ['export_sum_activity_visit_duration'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
@@ -87,28 +84,15 @@ 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) {
|
$qb = $this->repository->createQueryBuilder('activity');
|
||||||
return $el['center'];
|
|
||||||
}, $acl);
|
|
||||||
|
|
||||||
$qb = $this->repository
|
if (!in_array('acp', $qb->getAllAliases(), true)) {
|
||||||
->createQueryBuilder('activity')
|
$qb->join('activity.accompanyingPeriod', 'acp');
|
||||||
->join('activity.accompanyingPeriod', 'acp');
|
}
|
||||||
|
|
||||||
$qb->select('SUM(activity.travelTime) as export_sum_activity_visit_duration')
|
$qb->select('SUM(activity.travelTime) as export_sum_activity_visit_duration')
|
||||||
->andWhere($qb->expr()->isNotNull('activity.travelTime'));
|
->andWhere($qb->expr()->isNotNull('activity.travelTime'));
|
||||||
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . AccompanyingPeriodParticipation::class . ' acl_count_part
|
|
||||||
JOIN ' . PersonCenterHistory::class . ' acl_count_person_history WITH IDENTITY(acl_count_person_history.person) = IDENTITY(acl_count_part.person)
|
|
||||||
WHERE acl_count_part.accompanyingPeriod = acp.id AND acl_count_person_history.center IN (:authorized_centers)
|
|
||||||
'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('authorized_centers', $centers);
|
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -65,9 +65,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
return ['export_count_activity'];
|
return ['export_count_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
@@ -84,24 +84,16 @@ class CountActivity implements ExportInterface, GroupedExportInterface
|
|||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
|
|
||||||
$qb = $this->activityRepository
|
$qb = $this->activityRepository->createQueryBuilder('activity');
|
||||||
->createQueryBuilder('activity')
|
|
||||||
->join('activity.person', 'person')
|
if (!in_array('person', $qb->getAllAliases(), true)) {
|
||||||
->join('person.centerHistory', 'centerHistory');
|
$qb->join('activity.person', 'person');
|
||||||
|
}
|
||||||
|
|
||||||
$qb->select('COUNT(activity.id) as export_count_activity');
|
$qb->select('COUNT(activity.id) as export_count_activity');
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->where(
|
->where($qb->expr()->in('person.center', ':centers'))
|
||||||
$qb->expr()->andX(
|
|
||||||
$qb->expr()->lte('centerHistory.startDate', 'activity.date'),
|
|
||||||
$qb->expr()->orX(
|
|
||||||
$qb->expr()->isNull('centerHistory.endDate'),
|
|
||||||
$qb->expr()->gt('centerHistory.endDate', 'activity.date')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->andWhere($qb->expr()->in('centerHistory.center', ':centers'))
|
|
||||||
->setParameter('centers', $centers);
|
->setParameter('centers', $centers);
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
namespace Chill\ActivityBundle\Export\Export\LinkedToPerson;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -64,8 +64,6 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
if (self::SUM === $this->action) {
|
if (self::SUM === $this->action) {
|
||||||
return 'Sum activities linked to a person duration by various parameters.';
|
return 'Sum activities linked to a person duration by various parameters.';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new LogicException('this action is not supported: ' . $this->action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGroup(): string
|
public function getGroup(): string
|
||||||
@@ -89,9 +87,9 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
return ['export_stat_activity'];
|
return ['export_stat_activity'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getResult($query, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
return $query->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
return $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
@@ -99,8 +97,6 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
if (self::SUM === $this->action) {
|
if (self::SUM === $this->action) {
|
||||||
return 'Sum activity linked to a person duration';
|
return 'Sum activity linked to a person duration';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new LogicException('This action is not supported: ' . $this->action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
@@ -123,24 +119,11 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$select = 'SUM(activity.durationTime) AS export_stat_activity';
|
$select = 'SUM(activity.durationTime) AS export_stat_activity';
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->select($select)
|
return $qb->select($select)
|
||||||
->join('activity.person', 'person')
|
->join('activity.person', 'person')
|
||||||
->join('person.centerHistory', 'centerHistory');
|
->join('actperson.center', 'actcenter')
|
||||||
|
->where($qb->expr()->in('actcenter', ':centers'))
|
||||||
$qb
|
->setParameter(':centers', $centers);
|
||||||
->where(
|
|
||||||
$qb->expr()->andX(
|
|
||||||
$qb->expr()->lte('centerHistory.startDate', 'activity.date'),
|
|
||||||
$qb->expr()->orX(
|
|
||||||
$qb->expr()->isNull('centerHistory.endDate'),
|
|
||||||
$qb->expr()->gt('centerHistory.endDate', 'activity.date')
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->andWhere($qb->expr()->in('centerHistory.center', ':centers'))
|
|
||||||
->setParameter('centers', $centers);
|
|
||||||
|
|
||||||
return $qb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requiredRole(): string
|
public function requiredRole(): string
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
@@ -18,10 +18,10 @@ use Chill\MainBundle\Export\FilterInterface;
|
|||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Chill\PersonBundle\Export\Declarations;
|
use Chill\PersonBundle\Export\Declarations;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityTypeFilter implements FilterInterface
|
class ActivityTypeFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
use Chill\PersonBundle\Form\Type\PickSocialActionType;
|
|
||||||
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
use Chill\PersonBundle\Templating\Entity\SocialActionRender;
|
||||||
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@@ -36,17 +37,22 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
|
$where = $qb->getDQLPart('where');
|
||||||
|
|
||||||
if (!in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
if (!in_array('actsocialaction', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.socialActions', 'actsocialaction');
|
$qb->join('activity.socialActions', 'actsocialaction');
|
||||||
}
|
}
|
||||||
|
|
||||||
$clause = $qb->expr()->in('actsocialaction.id', ':socialactions');
|
$clause = $qb->expr()->in('actsocialaction.id', ':socialactions');
|
||||||
|
|
||||||
$qb->andWhere($clause)
|
if ($where instanceof Andx) {
|
||||||
->setParameter(
|
$where->add($clause);
|
||||||
'socialactions',
|
} else {
|
||||||
SocialAction::getDescendantsWithThisForActions($data['accepted_socialactions'])
|
$where = $qb->expr()->andX($clause);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
$qb->add('where', $where);
|
||||||
|
$qb->setParameter('socialactions', $data['accepted_socialactions']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -56,8 +62,13 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialactions', PickSocialActionType::class, [
|
$builder->add('accepted_socialactions', EntityType::class, [
|
||||||
|
'class' => SocialAction::class,
|
||||||
|
'choice_label' => function (SocialAction $sa) {
|
||||||
|
return $this->actionRender->renderString($sa, []);
|
||||||
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,14 +76,12 @@ class BySocialActionFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
$actions = [];
|
$actions = [];
|
||||||
|
|
||||||
foreach ($data['accepted_socialactions'] as $action) {
|
foreach ($data['accepted_socialactions'] as $sa) {
|
||||||
$actions[] = $this->actionRender->renderString($action, [
|
$actions[] = $this->actionRender->renderString($sa, []);
|
||||||
'show_and_children' => true,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by linked socialaction: only %actions%', [
|
return ['Filtered activity by linked socialaction: only %actions%', [
|
||||||
'%actions%' => implode(', ', $actions),
|
'%actions%' => implode(', ou ', $actions),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||||
use Chill\PersonBundle\Form\Type\PickSocialIssueType;
|
|
||||||
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
use Chill\PersonBundle\Templating\Entity\SocialIssueRender;
|
||||||
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@@ -36,17 +37,22 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
|
$where = $qb->getDQLPart('where');
|
||||||
|
|
||||||
if (!in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
if (!in_array('actsocialissue', $qb->getAllAliases(), true)) {
|
||||||
$qb->join('activity.socialIssues', 'actsocialissue');
|
$qb->join('activity.socialIssues', 'actsocialissue');
|
||||||
}
|
}
|
||||||
|
|
||||||
$clause = $qb->expr()->in('actsocialissue.id', ':socialissues');
|
$clause = $qb->expr()->in('actsocialissue.id', ':socialissues');
|
||||||
|
|
||||||
$qb->andWhere($clause)
|
if ($where instanceof Andx) {
|
||||||
->setParameter(
|
$where->add($clause);
|
||||||
'socialissues',
|
} else {
|
||||||
SocialIssue::getDescendantsWithThisForIssues($data['accepted_socialissues'])
|
$where = $qb->expr()->andX($clause);
|
||||||
);
|
}
|
||||||
|
|
||||||
|
$qb->add('where', $where);
|
||||||
|
$qb->setParameter('socialissues', $data['accepted_socialissues']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -56,8 +62,13 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_socialissues', PickSocialIssueType::class, [
|
$builder->add('accepted_socialissues', EntityType::class, [
|
||||||
|
'class' => SocialIssue::class,
|
||||||
|
'choice_label' => function (SocialIssue $si) {
|
||||||
|
return $this->issueRender->renderString($si, []);
|
||||||
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,14 +76,12 @@ class BySocialIssueFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
$issues = [];
|
$issues = [];
|
||||||
|
|
||||||
foreach ($data['accepted_socialissues'] as $issue) {
|
foreach ($data['accepted_socialissues'] as $si) {
|
||||||
$issues[] = $this->issueRender->renderString($issue, [
|
$issues[] = $this->issueRender->renderString($si, []);
|
||||||
'show_and_children' => true,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by linked socialissue: only %issues%', [
|
return ['Filtered activity by linked socialissue: only %issues%', [
|
||||||
'%issues%' => implode(', ', $issues),
|
'%issues%' => implode(', ou ', $issues),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,24 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use function in_array;
|
||||||
|
|
||||||
class ByCreatorFilter implements FilterInterface
|
class ByUserFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
private UserRender $userRender;
|
private UserRender $userRender;
|
||||||
|
|
||||||
@@ -34,11 +37,22 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$where = $qb->getDQLPart('where');
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->in('activity.createdBy', ':users')
|
if (!in_array('actusers', $qb->getAllAliases(), true)) {
|
||||||
)
|
$qb->join('activity.users', 'actusers');
|
||||||
->setParameter('users', $data['accepted_users']);
|
}
|
||||||
|
|
||||||
|
$clause = $qb->expr()->in('actusers.id', ':users');
|
||||||
|
|
||||||
|
if ($where instanceof Andx) {
|
||||||
|
$where->add($clause);
|
||||||
|
} else {
|
||||||
|
$where = $qb->expr()->andX($clause);
|
||||||
|
}
|
||||||
|
|
||||||
|
$qb->add('where', $where);
|
||||||
|
$qb->setParameter('users', $data['accepted_users']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@@ -48,8 +62,13 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', EntityType::class, [
|
||||||
|
'class' => User::class,
|
||||||
|
'choice_label' => function (User $u) {
|
||||||
|
return $this->userRender->renderString($u, []);
|
||||||
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,13 +80,13 @@ class ByCreatorFilter implements FilterInterface
|
|||||||
$users[] = $this->userRender->renderString($u, []);
|
$users[] = $this->userRender->renderString($u, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by creator: only %users%', [
|
return ['Filtered activity by linked users: only %users%', [
|
||||||
'%users%' => implode(', ', $users),
|
'%users%' => implode(', ou ', $users),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'Filter activity by creator';
|
return 'Filter activity by linked users';
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -74,13 +74,15 @@ class EmergencyFilter implements FilterInterface
|
|||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return [
|
foreach (self::CHOICES as $k => $v) {
|
||||||
'Filtered by emergency: only %emergency%', [
|
if ($v === $data['accepted_emergency']) {
|
||||||
'%emergency%' => $this->translator->trans(
|
$choice = $k;
|
||||||
$data['accepted_emergency'] ? 'is emergency' : 'is not emergency'
|
}
|
||||||
),
|
}
|
||||||
],
|
|
||||||
];
|
return ['Filtered activity by emergency: only %emergency%', [
|
||||||
|
'%emergency%' => $this->translator->trans($choice),
|
||||||
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Entity\LocationType;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickLocationTypeType;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Doctrine\ORM\Query\Expr\Andx;
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use function in_array;
|
use function in_array;
|
||||||
|
|
||||||
@@ -60,9 +61,13 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_locationtype', PickLocationTypeType::class, [
|
$builder->add('accepted_locationtype', EntityType::class, [
|
||||||
|
'class' => LocationType::class,
|
||||||
|
'choice_label' => function (LocationType $type) {
|
||||||
|
return $this->translatableStringHelper->localize($type->getTitle());
|
||||||
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
//'label' => false,
|
'expanded' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +82,7 @@ class LocationTypeFilter implements FilterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by locationtype: only %types%', [
|
return ['Filtered activity by locationtype: only %types%', [
|
||||||
'%types%' => implode(', ', $types),
|
'%types%' => implode(', ou ', $types),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
use Chill\MainBundle\Templating\Entity\UserRender;
|
||||||
use Doctrine\ORM\Query\Expr\Andx;
|
use Doctrine\ORM\Query\Expr\Andx;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
class UserFilter implements FilterInterface
|
class UserFilter implements FilterInterface
|
||||||
@@ -56,8 +57,13 @@ class UserFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
$builder->add('accepted_users', EntityType::class, [
|
||||||
|
'class' => User::class,
|
||||||
|
'choice_label' => function (User $u) {
|
||||||
|
return $this->userRender->renderString($u, []);
|
||||||
|
},
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
'expanded' => true,
|
||||||
'label' => 'Creators',
|
'label' => 'Creators',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@@ -71,7 +77,7 @@ class UserFilter implements FilterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by user: only %users%', [
|
return ['Filtered activity by user: only %users%', [
|
||||||
'%users%' => implode(', ', $users),
|
'%users%' => implode(', ou ', $users),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
namespace Chill\ActivityBundle\Export\Filter\ACPFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
@@ -85,7 +85,7 @@ class UserScopeFilter implements FilterInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ['Filtered activity by userscope: only %scopes%', [
|
return ['Filtered activity by userscope: only %scopes%', [
|
||||||
'%scopes%' => implode(', ', $scopes),
|
'%scopes%' => implode(', ou ', $scopes),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter;
|
namespace Chill\ActivityBundle\Export\Filter;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
@@ -17,6 +17,8 @@ use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
|||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
use Chill\MainBundle\Export\FilterInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\ORM\Query\Expr;
|
||||||
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
@@ -77,8 +79,8 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => false,
|
'expanded' => false,
|
||||||
'attr' => [
|
'attr' => [
|
||||||
'class' => 'select2',
|
'class' => 'select2'
|
||||||
],
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +93,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
);
|
);
|
||||||
|
|
||||||
return ['Filtered by activity type: only %list%', [
|
return ['Filtered by activity type: only %list%', [
|
||||||
'%list%' => implode(', ', $reasonsNames),
|
'%list%' => implode(', ou ', $reasonsNames),
|
||||||
]];
|
]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,77 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
|
||||||
use Chill\MainBundle\Form\Type\PickUserDynamicType;
|
|
||||||
use Chill\MainBundle\Templating\Entity\UserRender;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
|
|
||||||
class ActivityUsersFilter implements FilterInterface
|
|
||||||
{
|
|
||||||
private UserRender $userRender;
|
|
||||||
|
|
||||||
public function __construct(UserRender $userRender)
|
|
||||||
{
|
|
||||||
$this->userRender = $userRender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
$orX = $qb->expr()->orX();
|
|
||||||
|
|
||||||
foreach ($data['accepted_users'] as $key => $user) {
|
|
||||||
$orX->add($qb->expr()->isMemberOf(':activity_users_filter_u' . $key, 'activity.users'));
|
|
||||||
$qb->setParameter('activity_users_filter_u' . $key, $user);
|
|
||||||
}
|
|
||||||
|
|
||||||
$qb->andWhere($orX);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn()
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
$builder->add('accepted_users', PickUserDynamicType::class, [
|
|
||||||
'multiple' => true,
|
|
||||||
'label' => 'Users',
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string')
|
|
||||||
{
|
|
||||||
$users = [];
|
|
||||||
|
|
||||||
foreach ($data['accepted_users'] as $u) {
|
|
||||||
$users[] = $this->userRender->renderString($u, []);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ['Filtered activity by users: only %users%', [
|
|
||||||
'%users%' => implode(', ', $users),
|
|
||||||
]];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle(): string
|
|
||||||
{
|
|
||||||
return 'Filter activity by users';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\PersonFilters;
|
namespace Chill\ActivityBundle\Export\Filter\PersonFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
@@ -19,13 +19,14 @@ use Chill\MainBundle\Export\FilterInterface;
|
|||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
use Doctrine\ORM\Query\Expr;
|
use Doctrine\ORM\Query\Expr;
|
||||||
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
|
use function array_key_exists;
|
||||||
use function count;
|
use function count;
|
||||||
use function in_array;
|
|
||||||
|
|
||||||
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
|
class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface
|
||||||
{
|
{
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter\PersonFilters;
|
namespace Chill\ActivityBundle\Export\Filter\PersonFilters;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,81 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Entity\UserJob;
|
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
|
|
||||||
class UsersJobFilter implements FilterInterface
|
|
||||||
{
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(TranslatableStringHelperInterface $translatableStringHelper)
|
|
||||||
{
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . Activity::class . ' activity_users_job_filter_act
|
|
||||||
JOIN activity_users_job_filter_act.users users WHERE users.userJob IN (:activity_users_job_filter_jobs) AND activity_users_job_filter_act = activity '
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('activity_users_job_filter_jobs', $data['jobs']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn()
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
$builder->add('jobs', EntityType::class, [
|
|
||||||
'class' => UserJob::class,
|
|
||||||
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
|
|
||||||
'multiple' => true,
|
|
||||||
'expanded' => true,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string')
|
|
||||||
{
|
|
||||||
return ['export.filter.activity.by_usersjob.Filtered activity by users job: only %jobs%', [
|
|
||||||
'%jobs%' => implode(
|
|
||||||
', ',
|
|
||||||
array_map(
|
|
||||||
fn (UserJob $job) => $this->translatableStringHelper->localize($job->getLabel()),
|
|
||||||
$data['jobs']->toArray()
|
|
||||||
)
|
|
||||||
),
|
|
||||||
]];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'export.filter.activity.by_usersjob.Filter by users job';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,88 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Export\Filter;
|
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Chill\ActivityBundle\Export\Declarations;
|
|
||||||
use Chill\MainBundle\Entity\Scope;
|
|
||||||
use Chill\MainBundle\Export\FilterInterface;
|
|
||||||
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
|
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
|
||||||
use Doctrine\ORM\QueryBuilder;
|
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
|
||||||
|
|
||||||
class UsersScopeFilter implements FilterInterface
|
|
||||||
{
|
|
||||||
private ScopeRepositoryInterface $scopeRepository;
|
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
ScopeRepositoryInterface $scopeRepository,
|
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
|
||||||
) {
|
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addRole(): ?string
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
|
||||||
{
|
|
||||||
$qb
|
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->exists(
|
|
||||||
'SELECT 1 FROM ' . Activity::class . ' activity_users_scope_filter_act
|
|
||||||
JOIN activity_users_scope_filter_act.users users WHERE users.mainScope IN (:activity_users_scope_filter_scopes) AND activity_users_scope_filter_act = activity '
|
|
||||||
)
|
|
||||||
)
|
|
||||||
->setParameter('activity_users_scope_filter_scopes', $data['scopes']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function applyOn()
|
|
||||||
{
|
|
||||||
return Declarations::ACTIVITY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
|
||||||
{
|
|
||||||
$builder->add('scopes', EntityType::class, [
|
|
||||||
'class' => Scope::class,
|
|
||||||
'choices' => $this->scopeRepository->findAllActive(),
|
|
||||||
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
|
||||||
'multiple' => true,
|
|
||||||
'expanded' => true,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string')
|
|
||||||
{
|
|
||||||
return ['export.filter.activity.by_usersscope.Filtered activity by users scope: only %scopes%', [
|
|
||||||
'%scopes%' => implode(
|
|
||||||
', ',
|
|
||||||
array_map(
|
|
||||||
fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
|
|
||||||
$data['scopes']->toArray()
|
|
||||||
)
|
|
||||||
),
|
|
||||||
]];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getTitle()
|
|
||||||
{
|
|
||||||
return 'export.filter.activity.by_usersscope.Filter by users scope';
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityPresence;
|
use Chill\ActivityBundle\Entity\ActivityPresence;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;
|
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form;
|
namespace Chill\ActivityBundle\Form;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form\Type;
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form\Type;
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form\Type;
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
@@ -1,21 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Form\Type;
|
namespace Chill\ActivityBundle\Form\Type;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
use Chill\ActivityBundle\Repository\ActivityTypeRepositoryInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
class TranslatableActivityType extends AbstractType
|
class TranslatableActivityType extends AbstractType
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Menu;
|
namespace Chill\ActivityBundle\Menu;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Menu;
|
namespace Chill\ActivityBundle\Menu;
|
||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Menu;
|
namespace Chill\ActivityBundle\Menu;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Notification;
|
namespace Chill\ActivityBundle\Notification;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
use Chill\ActivityBundle\Entity\ActivityReasonCategory;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityReason;
|
use Chill\ActivityBundle\Entity\ActivityReason;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
use Chill\ActivityBundle\Entity\ActivityTypeCategory;
|
||||||
|
@@ -1,19 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
/**
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
* Chill is a software for social workers
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view
|
* For the full copyright and license information, please view
|
||||||
* the LICENSE file that was distributed with this source code.
|
* the LICENSE file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
use UnexpectedValueException;
|
||||||
|
|
||||||
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
||||||
{
|
{
|
||||||
@@ -21,7 +24,15 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
|||||||
|
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$this->repository = $em->getRepository(ActivityType::class);
|
$this->repository = $em->getRepository(ActivityType::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array|ActivityType[]
|
||||||
|
*/
|
||||||
|
public function findAllActive(): array
|
||||||
|
{
|
||||||
|
return $this->findBy(['active' => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function find($id): ?ActivityType
|
public function find($id): ?ActivityType
|
||||||
@@ -37,14 +48,6 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
|||||||
return $this->repository->findAll();
|
return $this->repository->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array|ActivityType[]
|
|
||||||
*/
|
|
||||||
public function findAllActive(): array
|
|
||||||
{
|
|
||||||
return $this->findBy(['active' => true]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array|ActivityType[]
|
* @return array|ActivityType[]
|
||||||
*/
|
*/
|
||||||
@@ -62,4 +65,6 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface
|
|||||||
{
|
{
|
||||||
return ActivityType::class;
|
return ActivityType::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Chill is a software for social workers
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view
|
|
||||||
* the LICENSE file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\ActivityBundle\Repository;
|
namespace Chill\ActivityBundle\Repository;
|
||||||
|
|
||||||
use Chill\ActivityBundle\Entity\ActivityType;
|
use Chill\ActivityBundle\Entity\ActivityType;
|
||||||
@@ -20,4 +11,5 @@ interface ActivityTypeRepositoryInterface extends ObjectRepository
|
|||||||
* @return array|ActivityType[]
|
* @return array|ActivityType[]
|
||||||
*/
|
*/
|
||||||
public function findAllActive(): array;
|
public function findAllActive(): array;
|
||||||
|
|
||||||
}
|
}
|
@@ -29,7 +29,7 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% set blocks = [] %}
|
{% set blocks = [] %}
|
||||||
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.personsVisible %}
|
{% if context == 'calendar_accompanyingCourse' or entity.activityType.personsVisible %}
|
||||||
{% if context == 'person' %}
|
{% if context == 'person' %}
|
||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Others persons'|trans,
|
'title': 'Others persons'|trans,
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.thirdPartiesVisible %}
|
{% if context == 'calendar_accompanyingCourse' or entity.activityType.thirdPartiesVisible %}
|
||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Third parties'|trans,
|
'title': 'Third parties'|trans,
|
||||||
'items': entity.thirdParties,
|
'items': entity.thirdParties,
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
'key' : 'id',
|
'key' : 'id',
|
||||||
}]) %}
|
}]) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if context == 'calendar_accompanyingCourse' or context == 'calendar_person' or entity.activityType.usersVisible %}
|
{% if context == 'calendar_accompanyingCourse' or entity.activityType.usersVisible %}
|
||||||
{% set blocks = blocks|merge([{
|
{% set blocks = blocks|merge([{
|
||||||
'title': 'Users concerned'|trans,
|
'title': 'Users concerned'|trans,
|
||||||
'items': entity.users,
|
'items': entity.users,
|
||||||
@@ -143,7 +143,7 @@
|
|||||||
{% if bloc.type == 'user' %}
|
{% if bloc.type == 'user' %}
|
||||||
<span class="badge-user">
|
<span class="badge-user">
|
||||||
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
|
{{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }}
|
||||||
{%- if context == 'calendar_accompanyingCourse' or context == 'calendar_person' %}
|
{%- if context == 'calendar_accompanyingCourse' %}
|
||||||
{% set invite = entity.inviteForUser(item) %}
|
{% set invite = entity.inviteForUser(item) %}
|
||||||
{% if invite is not null %}
|
{% if invite is not null %}
|
||||||
{{ invite.invite_span(invite) }}
|
{{ invite.invite_span(invite) }}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user