mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-07 16:29:51 +00:00
rector rules for upgrade to php 8.2 and symfony 5.4 applied + php cs fixer
This commit is contained in:
parent
00756a3bde
commit
8e3322f578
@ -36,12 +36,8 @@ return static function (RectorConfig $rectorConfig): void {
|
|||||||
|
|
||||||
//define sets of rules
|
//define sets of rules
|
||||||
$rectorConfig->sets([
|
$rectorConfig->sets([
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
|
\Rector\Set\ValueObject\LevelSetList::UP_TO_PHP_82,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES,
|
\Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_54,
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_51,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_52,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_53,
|
|
||||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_54,
|
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
||||||
\Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
\Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
||||||
]);
|
]);
|
||||||
|
@ -47,7 +47,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
|
|||||||
private ?Scope $circle = null;
|
private ?Scope $circle = null;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
||||||
private ?\DateTime $date;
|
private ?\DateTime $date = null;
|
||||||
|
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||||
|
@ -1,31 +1,27 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\ApiHelper;
|
namespace Chill\ChillFranceTravailApiBundle\ApiHelper;
|
||||||
|
|
||||||
use Chill\MainBundle\Redis\ChillRedis;
|
use Chill\MainBundle\Redis\ChillRedis;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Psr7\Request;
|
|
||||||
use GuzzleHttp\Exception\ClientException;
|
use GuzzleHttp\Exception\ClientException;
|
||||||
use GuzzleHttp\Psr7;
|
use GuzzleHttp\Psr7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps the pole emploi api
|
* Wraps the pole emploi api.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class ApiWrapper
|
class ApiWrapper
|
||||||
{
|
{
|
||||||
private $clientId;
|
|
||||||
|
|
||||||
private $clientSecret;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var ChillRedis
|
|
||||||
*/
|
|
||||||
private $redis;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var Client
|
* @var Client
|
||||||
*/
|
*/
|
||||||
private $client;
|
private $client;
|
||||||
@ -35,15 +31,12 @@ class ApiWrapper
|
|||||||
*
|
*
|
||||||
* This bearer is shared across users
|
* This bearer is shared across users
|
||||||
*/
|
*/
|
||||||
const UNPERSONAL_BEARER = 'api_pemploi_bear_';
|
public const UNPERSONAL_BEARER = 'api_pemploi_bear_';
|
||||||
|
|
||||||
public function __construct($clientId, $clientSecret, ChillRedis $redis)
|
public function __construct(private $clientId, private $clientSecret, private readonly ChillRedis $redis)
|
||||||
{
|
{
|
||||||
$this->clientId = $clientId;
|
|
||||||
$this->clientSecret = $clientSecret;
|
|
||||||
$this->redis = $redis;
|
|
||||||
$this->client = new Client([
|
$this->client = new Client([
|
||||||
'base_uri' => 'https://entreprise.pole-emploi.fr/connexion/oauth2/access_token'
|
'base_uri' => 'https://entreprise.pole-emploi.fr/connexion/oauth2/access_token',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,28 +54,29 @@ class ApiWrapper
|
|||||||
$response = $this->client->post('', [
|
$response = $this->client->post('', [
|
||||||
'query' => ['realm' => '/partenaire'],
|
'query' => ['realm' => '/partenaire'],
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Content-Type' => 'application/x-www-form-urlencoded'
|
'Content-Type' => 'application/x-www-form-urlencoded',
|
||||||
],
|
],
|
||||||
//'body' => 'grant_type=client_credentials&client_id=PAR_chillcsconnectesdev_0e20082886f1bc5d8ff4f8b34868603e2bcc7ed6bc5963e648e3709c639aced9&client_secret=4e626fa3123bcf4d299591c09731fa3242a7e75bbc003955f903aebc33cdd022&scope=api_romev1%20nomenclatureRome%20application_PAR_chillcsconnectesdev_0e20082886f1bc5d8ff4f8b34868603e2bcc7ed6bc5963e648e3709c639aced9'
|
// 'body' => 'grant_type=client_credentials&client_id=PAR_chillcsconnectesdev_0e20082886f1bc5d8ff4f8b34868603e2bcc7ed6bc5963e648e3709c639aced9&client_secret=4e626fa3123bcf4d299591c09731fa3242a7e75bbc003955f903aebc33cdd022&scope=api_romev1%20nomenclatureRome%20application_PAR_chillcsconnectesdev_0e20082886f1bc5d8ff4f8b34868603e2bcc7ed6bc5963e648e3709c639aced9'
|
||||||
'form_params' => [
|
'form_params' => [
|
||||||
'grant_type' => 'client_credentials',
|
'grant_type' => 'client_credentials',
|
||||||
'client_id' => $this->clientId,
|
'client_id' => $this->clientId,
|
||||||
'client_secret' => $this->clientSecret,
|
'client_secret' => $this->clientSecret,
|
||||||
'scope' => \implode(' ', \array_merge($scopes, [ 'application_'.$this->clientId ])),
|
'scope' => \implode(' ', \array_merge($scopes, ['application_'.$this->clientId])),
|
||||||
]
|
],
|
||||||
//]);
|
// ]);
|
||||||
]);
|
]);
|
||||||
//
|
} catch (ClientException $e) {
|
||||||
}
|
|
||||||
catch (ClientException $e) {
|
|
||||||
dump(Psr7\str($e->getRequest()));
|
dump(Psr7\str($e->getRequest()));
|
||||||
dump( Psr7\str($e->getResponse()));
|
dump(Psr7\str($e->getResponse()));
|
||||||
}
|
}
|
||||||
$data = \json_decode((string) $response->getBody());
|
$data = \json_decode((string) $response->getBody());
|
||||||
|
|
||||||
// set the key with an expiry time
|
// set the key with an expiry time
|
||||||
$this->redis->setEx($cacheKey, $data->expires_in - 2,
|
$this->redis->setEx(
|
||||||
\serialize($data));
|
$cacheKey,
|
||||||
|
$data->expires_in - 2,
|
||||||
|
\serialize($data)
|
||||||
|
);
|
||||||
|
|
||||||
return $data->access_token;
|
return $data->access_token;
|
||||||
}
|
}
|
||||||
@ -91,5 +85,4 @@ class ApiWrapper
|
|||||||
{
|
{
|
||||||
return self::UNPERSONAL_BEARER.implode('', $scopes);
|
return self::UNPERSONAL_BEARER.implode('', $scopes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\ApiHelper;
|
namespace Chill\ChillFranceTravailApiBundle\ApiHelper;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use GuzzleHttp\Exception\ClientException;
|
|
||||||
use GuzzleHttp\Exception\BadResponseException;
|
|
||||||
use GuzzleHttp\Psr7;
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queries for ROME partenaires api
|
* Queries for ROME partenaires api.
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class PartenaireRomeAppellation
|
class PartenaireRomeAppellation
|
||||||
{
|
{
|
||||||
|
use ProcessRequestTrait;
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var ApiWrapper
|
* @var ApiWrapper
|
||||||
*/
|
*/
|
||||||
protected $wrapper;
|
protected $wrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Client
|
* @var Client
|
||||||
*/
|
*/
|
||||||
protected $client;
|
protected $client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var LoggerInterface
|
* @var LoggerInterface
|
||||||
*/
|
*/
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
|
||||||
use ProcessRequestTrait;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ApiWrapper $wrapper,
|
ApiWrapper $wrapper,
|
||||||
LoggerInterface $logger
|
LoggerInterface $logger
|
||||||
@ -43,7 +43,7 @@ class PartenaireRomeAppellation
|
|||||||
$this->wrapper = $wrapper;
|
$this->wrapper = $wrapper;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->client = new Client([
|
$this->client = new Client([
|
||||||
'base_uri' => 'https://api.emploi-store.fr/partenaire/rome/v1/'
|
'base_uri' => 'https://api.emploi-store.fr/partenaire/rome/v1/',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,11 +52,10 @@ class PartenaireRomeAppellation
|
|||||||
return $this->wrapper->getPublicBearer([
|
return $this->wrapper->getPublicBearer([
|
||||||
'api_romev1',
|
'api_romev1',
|
||||||
'nomenclatureRome',
|
'nomenclatureRome',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param string $search
|
* @param string $search
|
||||||
*/
|
*/
|
||||||
public function getListeAppellation($search)
|
public function getListeAppellation($search)
|
||||||
@ -65,16 +64,20 @@ class PartenaireRomeAppellation
|
|||||||
|
|
||||||
$request = new Request('GET', 'appellation');
|
$request = new Request('GET', 'appellation');
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'query' => [
|
'query' => [
|
||||||
'q' => $search,
|
'q' => $search,
|
||||||
'qf' => 'libelle'
|
'qf' => 'libelle',
|
||||||
],
|
],
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Authorization' => 'Bearer '.$bearer
|
'Authorization' => 'Bearer '.$bearer,
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
$response = $this->handleRequest($request, $parameters, $this->client,
|
$response = $this->handleRequest(
|
||||||
$this->logger);
|
$request,
|
||||||
|
$parameters,
|
||||||
|
$this->client,
|
||||||
|
$this->logger
|
||||||
|
);
|
||||||
|
|
||||||
return \GuzzleHttp\json_decode((string) $response->getBody());
|
return \GuzzleHttp\json_decode((string) $response->getBody());
|
||||||
}
|
}
|
||||||
@ -86,15 +89,19 @@ class PartenaireRomeAppellation
|
|||||||
$request = new Request('GET', sprintf('appellation/%s', $code));
|
$request = new Request('GET', sprintf('appellation/%s', $code));
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'headers' => [
|
'headers' => [
|
||||||
'Authorization' => 'Bearer '.$bearer
|
'Authorization' => 'Bearer '.$bearer,
|
||||||
],
|
],
|
||||||
'query' => [
|
'query' => [
|
||||||
'champs' => 'code,libelle,metier(code,libelle)'
|
'champs' => 'code,libelle,metier(code,libelle)',
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = $this->handleRequest($request, $parameters, $this->client,
|
$response = $this->handleRequest(
|
||||||
$this->logger);
|
$request,
|
||||||
|
$parameters,
|
||||||
|
$this->client,
|
||||||
|
$this->logger
|
||||||
|
);
|
||||||
|
|
||||||
return \GuzzleHttp\json_decode((string) $response->getBody());
|
return \GuzzleHttp\json_decode((string) $response->getBody());
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\ApiHelper;
|
namespace Chill\ChillFranceTravailApiBundle\ApiHelper;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
@ -12,18 +20,16 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Methods to process request against the api, and handle the
|
* Methods to process request against the api, and handle the
|
||||||
* Exceptions
|
* Exceptions.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
trait ProcessRequestTrait
|
trait ProcessRequestTrait
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Handle a request and 429 errors
|
* Handle a request and 429 errors.
|
||||||
|
*
|
||||||
|
* @param Request $request the request
|
||||||
|
* @param array $parameters the requests parameters
|
||||||
*
|
*
|
||||||
* @param Request $request the request
|
|
||||||
* @param array $parameters the requests parameters
|
|
||||||
* @param Client $client
|
|
||||||
* @param LoggerInterface $logger
|
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
protected function handleRequest(
|
protected function handleRequest(
|
||||||
@ -32,19 +38,21 @@ trait ProcessRequestTrait
|
|||||||
Client $client,
|
Client $client,
|
||||||
LoggerInterface $logger
|
LoggerInterface $logger
|
||||||
) {
|
) {
|
||||||
return $this->handleRequestRecursive($request, $parameters,
|
return $this->handleRequestRecursive(
|
||||||
$client, $logger);
|
$request,
|
||||||
|
$parameters,
|
||||||
|
$client,
|
||||||
|
$logger
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* internal method to handle recursive requests
|
* internal method to handle recursive requests.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
* @param array $parameters
|
|
||||||
* @param Client $client
|
|
||||||
* @param LoggerInterface $logger
|
|
||||||
* @param type $counter
|
* @param type $counter
|
||||||
|
*
|
||||||
* @return type
|
* @return type
|
||||||
|
*
|
||||||
* @throws BadResponseException
|
* @throws BadResponseException
|
||||||
*/
|
*/
|
||||||
private function handleRequestRecursive(
|
private function handleRequestRecursive(
|
||||||
@ -54,21 +62,17 @@ trait ProcessRequestTrait
|
|||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
$counter = 0
|
$counter = 0
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
return $client->send($request, $parameters);
|
return $client->send($request, $parameters);
|
||||||
|
|
||||||
} catch (BadResponseException $e) {
|
} catch (BadResponseException $e) {
|
||||||
if (
|
if (
|
||||||
// get 429 exceptions
|
// get 429 exceptions
|
||||||
$e instanceof ClientException
|
$e instanceof ClientException
|
||||||
&&
|
&& 429 === $e->getResponse()->getStatusCode()
|
||||||
$e->getResponse()->getStatusCode() === 429
|
&& count($e->getResponse()->getHeader('Retry-After')) > 0) {
|
||||||
&&
|
|
||||||
count($e->getResponse()->getHeader('Retry-After')) > 0) {
|
|
||||||
|
|
||||||
if ($counter > 5) {
|
if ($counter > 5) {
|
||||||
$logger->error("too much 429 response", [
|
$logger->error('too much 429 response', [
|
||||||
'request' => Psr7\str($e->getRequest())
|
'request' => Psr7\str($e->getRequest()),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
throw $e;
|
throw $e;
|
||||||
@ -79,12 +83,17 @@ trait ProcessRequestTrait
|
|||||||
|
|
||||||
sleep($delay);
|
sleep($delay);
|
||||||
|
|
||||||
return $this->handleRequestRecursive($request, $parameters,
|
return $this->handleRequestRecursive(
|
||||||
$client, $logger, $counter + 1);
|
$request,
|
||||||
|
$parameters,
|
||||||
|
$client,
|
||||||
|
$logger,
|
||||||
|
$counter + 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// handling other errors
|
// handling other errors
|
||||||
$logger->error("Error while querying ROME api", [
|
$logger->error('Error while querying ROME api', [
|
||||||
'status_code' => $e->getResponse()->getStatusCode(),
|
'status_code' => $e->getResponse()->getStatusCode(),
|
||||||
'part' => 'appellation',
|
'part' => 'appellation',
|
||||||
'request' => Psr7\str($e->getRequest()),
|
'request' => Psr7\str($e->getRequest()),
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
<?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\ChillFranceTravailApiBundle;
|
namespace Chill\ChillFranceTravailApiBundle;
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
class ChillFranceTravailApiBundle extends Bundle
|
class ChillFranceTravailApiBundle extends Bundle {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\Controller;
|
namespace Chill\ChillFranceTravailApiBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
@ -10,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
|||||||
|
|
||||||
class RomeController extends Controller
|
class RomeController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var PartenaireRomeAppellation
|
* @var PartenaireRomeAppellation
|
||||||
*/
|
*/
|
||||||
@ -29,7 +37,7 @@ class RomeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function appellationSearchAction(Request $request)
|
public function appellationSearchAction(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->query->has('q') === FALSE) {
|
if (false === $request->query->has('q')) {
|
||||||
return new JsonResponse([]);
|
return new JsonResponse([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,5 +58,4 @@ class RomeController extends Controller
|
|||||||
|
|
||||||
return new JsonResponse($computed);
|
return new JsonResponse($computed);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\DependencyInjection;
|
namespace Chill\ChillFranceTravailApiBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
@ -10,13 +19,10 @@ use Symfony\Component\DependencyInjection\Loader;
|
|||||||
/**
|
/**
|
||||||
* This is the class that loads and manages your bundle configuration.
|
* This is the class that loads and manages your bundle configuration.
|
||||||
*
|
*
|
||||||
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
|
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||||
*/
|
*/
|
||||||
class ChillFranceTravailApiExtension extends Extension
|
class ChillFranceTravailApiExtension extends Extension
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\DependencyInjection;
|
namespace Chill\ChillFranceTravailApiBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
@ -12,9 +21,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|||||||
*/
|
*/
|
||||||
class Configuration implements ConfigurationInterface
|
class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder();
|
||||||
|
@ -1,14 +1,25 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\Tests\ApiHelper;
|
namespace Chill\ChillFranceTravailApiBundle\Tests\ApiHelper;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||||
use Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation;
|
use Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
*/
|
*/
|
||||||
class PartenaireRomeAppellationTest extends KernelTestCase
|
class PartenaireRomeAppellationTest extends KernelTestCase
|
||||||
{
|
{
|
||||||
@ -25,7 +36,7 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
|||||||
$appellations = self::$kernel
|
$appellations = self::$kernel
|
||||||
->getContainer()
|
->getContainer()
|
||||||
->get(PartenaireRomeAppellation::class)
|
->get(PartenaireRomeAppellation::class)
|
||||||
;
|
;
|
||||||
|
|
||||||
$data = $appellations->getListeAppellation('arb');
|
$data = $appellations->getListeAppellation('arb');
|
||||||
|
|
||||||
@ -40,7 +51,7 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
|||||||
$appellations = self::$kernel
|
$appellations = self::$kernel
|
||||||
->getContainer()
|
->getContainer()
|
||||||
->get(PartenaireRomeAppellation::class)
|
->get(PartenaireRomeAppellation::class)
|
||||||
;
|
;
|
||||||
|
|
||||||
$appellations->getListeAppellation('arb');
|
$appellations->getListeAppellation('arb');
|
||||||
$appellations->getListeAppellation('ing');
|
$appellations->getListeAppellation('ing');
|
||||||
@ -48,8 +59,10 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
|||||||
$appellations->getListeAppellation('chori');
|
$appellations->getListeAppellation('chori');
|
||||||
$data = $appellations->getListeAppellation('camion');
|
$data = $appellations->getListeAppellation('camion');
|
||||||
|
|
||||||
$this->assertTrue($data[0] instanceof \stdClass,
|
$this->assertTrue(
|
||||||
'assert that first index of data is an instance of stdClass');
|
$data[0] instanceof \stdClass,
|
||||||
|
'assert that first index of data is an instance of stdClass'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetAppellation()
|
public function testGetAppellation()
|
||||||
@ -58,18 +71,23 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
|||||||
$appellations = self::$kernel
|
$appellations = self::$kernel
|
||||||
->getContainer()
|
->getContainer()
|
||||||
->get(PartenaireRomeAppellation::class)
|
->get(PartenaireRomeAppellation::class)
|
||||||
;
|
;
|
||||||
|
|
||||||
$a = $appellations->getListeAppellation('arb');
|
$a = $appellations->getListeAppellation('arb');
|
||||||
|
|
||||||
$full = $appellations->getAppellation($a[0]->code);
|
$full = $appellations->getAppellation($a[0]->code);
|
||||||
|
|
||||||
$this->assertNotNull($full->libelle,
|
$this->assertNotNull(
|
||||||
'assert that libelle is not null');
|
$full->libelle,
|
||||||
$this->assertTrue($full->metier instanceof \stdClass,
|
'assert that libelle is not null'
|
||||||
'assert that metier is returned');
|
);
|
||||||
$this->assertNotNull($full->metier->libelle,
|
$this->assertTrue(
|
||||||
'assert that metier->libelle is not null');
|
$full->metier instanceof \stdClass,
|
||||||
|
'assert that metier is returned'
|
||||||
|
);
|
||||||
|
$this->assertNotNull(
|
||||||
|
$full->metier->libelle,
|
||||||
|
'assert that metier->libelle is not null'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,23 @@
|
|||||||
<?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\ChillFranceTravailApiBundle\Tests\Controller;
|
namespace Chill\ChillFranceTravailApiBundle\Tests\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
class RomeControllerTest extends WebTestCase
|
class RomeControllerTest extends WebTestCase
|
||||||
{
|
{
|
||||||
public function testAppellationsearch()
|
public function testAppellationsearch()
|
||||||
@ -12,5 +26,4 @@ class RomeControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$crawler = $client->request('GET', '/{_locale}/pole-emploi/appellation/search');
|
$crawler = $client->request('GET', '/{_locale}/pole-emploi/appellation/search');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
<?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\ChillJobBundle;
|
namespace Chill\ChillJobBundle;
|
||||||
|
|
||||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
class ChillJobBundle extends Bundle
|
class ChillJobBundle extends Bundle {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Controller;
|
namespace Chill\ChillJobBundle\Controller;
|
||||||
|
|
||||||
use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController;
|
use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController;
|
||||||
@ -8,51 +17,48 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Chill\ChillJobBundle\Entity\Immersion;
|
use Chill\ChillJobBundle\Entity\Immersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CRUD Controller for reports (Frein, ...)
|
* CRUD Controller for reports (Frein, ...).
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class CSCrudReportController extends EntityPersonCRUDController
|
class CSCrudReportController extends EntityPersonCRUDController
|
||||||
{
|
{
|
||||||
|
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||||
|
|
||||||
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
||||||
{
|
{
|
||||||
$next = $request->request->get("submit", "save-and-close");
|
$next = $request->request->get('submit', 'save-and-close');
|
||||||
|
|
||||||
switch ($next) {
|
return match ($next) {
|
||||||
case "save-and-close":
|
'save-and-close', 'delete-and-close' => $this->redirectToRoute('chill_csconnectes_csreport_index', [
|
||||||
case "delete-and-close":
|
'person' => $entity->getPerson()->getId(),
|
||||||
return $this->redirectToRoute('chill_csconnectes_csreport_index', [
|
]),
|
||||||
'person' => $entity->getPerson()->getId()
|
default => parent::onBeforeRedirectAfterSubmission($action, $entity, $form, $request),
|
||||||
]);
|
};
|
||||||
default:
|
|
||||||
return parent::onBeforeRedirectAfterSubmission($action, $entity, $form, $request);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function duplicateEntity(string $action, Request $request)
|
protected function duplicateEntity(string $action, Request $request)
|
||||||
{
|
{
|
||||||
|
if ('cscv' === $this->getCrudName()) {
|
||||||
if ($this->getCrudName() === 'cscv') {
|
|
||||||
$id = $request->query->get('duplicate_id', 0);
|
$id = $request->query->get('duplicate_id', 0);
|
||||||
/** @var \Chill\ChillJobBundle\Entity\CV $cv */
|
/** @var \Chill\ChillJobBundle\Entity\CV $cv */
|
||||||
$cv = $this->getEntity($action, $id, $request);
|
$cv = $this->getEntity($action, $id, $request);
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
|
|
||||||
$em->detach($cv);
|
$em->detach($cv);
|
||||||
|
|
||||||
foreach($cv->getExperiences() as $experience) {
|
foreach ($cv->getExperiences() as $experience) {
|
||||||
$cv->removeExperience($experience);
|
$cv->removeExperience($experience);
|
||||||
$em->detach($experience);
|
$em->detach($experience);
|
||||||
$cv->addExperience($experience);
|
$cv->addExperience($experience);
|
||||||
}
|
}
|
||||||
foreach($cv->getFormations() as $formation) {
|
foreach ($cv->getFormations() as $formation) {
|
||||||
$cv->removeFormation($formation);
|
$cv->removeFormation($formation);
|
||||||
$em->detach($formation);
|
$em->detach($formation);
|
||||||
$cv->addFormation($formation);
|
$cv->addFormation($formation);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $cv;
|
return $cv;
|
||||||
} elseif ($this->getCrudName() === 'projet_prof') {
|
}
|
||||||
|
if ('projet_prof' === $this->getCrudName()) {
|
||||||
$id = $request->query->get('duplicate_id', 0);
|
$id = $request->query->get('duplicate_id', 0);
|
||||||
/** @var \Chill\ChillJobBundle\Entity\ProjetProfessionnel $original */
|
/** @var \Chill\ChillJobBundle\Entity\ProjetProfessionnel $original */
|
||||||
$original = $this->getEntity($action, $id, $request);
|
$original = $this->getEntity($action, $id, $request);
|
||||||
@ -72,23 +78,24 @@ class CSCrudReportController extends EntityPersonCRUDController
|
|||||||
return parent::duplicateEntity($action, $request);
|
return parent::duplicateEntity($action, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface
|
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
|
||||||
{
|
{
|
||||||
if ($entity instanceof Immersion) {
|
if ($entity instanceof Immersion) {
|
||||||
if ('edit' === $action || 'new' === $action) {
|
if ('edit' === $action || 'new' === $action) {
|
||||||
return parent::createFormFor($action, $entity, $formClass, [
|
return parent::createFormFor($action, $entity, $formClass, [
|
||||||
'center' => $entity->getPerson()->getCenter()
|
'center' => $entity->getPerson()->getCenter(),
|
||||||
]);
|
]);
|
||||||
} elseif ('bilan' === $action) {
|
}
|
||||||
|
if ('bilan' === $action) {
|
||||||
return parent::createFormFor($action, $entity, $formClass, [
|
return parent::createFormFor($action, $entity, $formClass, [
|
||||||
'center' => $entity->getPerson()->getCenter(),
|
'center' => $entity->getPerson()->getCenter(),
|
||||||
'step' => 'bilan'
|
'step' => 'bilan',
|
||||||
]);
|
]);
|
||||||
} elseif ($action === 'delete') {
|
|
||||||
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
|
||||||
} else {
|
|
||||||
throw new \LogicException("this step $action is not supported");
|
|
||||||
}
|
}
|
||||||
|
if ('delete' === $action) {
|
||||||
|
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
||||||
|
}
|
||||||
|
throw new \LogicException("this step {$action} is not supported");
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
||||||
@ -105,20 +112,13 @@ class CSCrudReportController extends EntityPersonCRUDController
|
|||||||
parent::onPreFlush($action, $entity, $form, $request);
|
parent::onPreFlush($action, $entity, $form, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit immersion bilan
|
* Edit immersion bilan.
|
||||||
*
|
*
|
||||||
* @param Request $request
|
|
||||||
* @param type $id
|
* @param type $id
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
public function editBilan(Request $request, $id): \Symfony\Component\HttpFoundation\Response
|
public function editBilan(Request $request, $id): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
return $this->formEditAction('bilan', $request, $id);
|
return $this->formEditAction('bilan', $request, $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
<?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\ChillJobBundle\Controller;
|
namespace Chill\ChillJobBundle\Controller;
|
||||||
|
|
||||||
use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController;
|
use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Chill\ChillJobBundle\Form\CSPersonPersonalSituationType;
|
use Chill\ChillJobBundle\Form\CSPersonPersonalSituationType;
|
||||||
use Chill\ChillJobBundle\Form\CSPersonDispositifsType;
|
use Chill\ChillJobBundle\Form\CSPersonDispositifsType;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class CSPersonController extends OneToOneEntityPersonCRUDController
|
class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||||
@ -21,7 +28,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
$request,
|
$request,
|
||||||
$id,
|
$id,
|
||||||
CSPersonPersonalSituationType::class
|
CSPersonPersonalSituationType::class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function dispositifsEdit(Request $request, $id)
|
public function dispositifsEdit(Request $request, $id)
|
||||||
@ -31,7 +38,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
$request,
|
$request,
|
||||||
$id,
|
$id,
|
||||||
CSPersonDispositifsType::class
|
CSPersonDispositifsType::class
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function personalSituationView(Request $request, $id): Response
|
public function personalSituationView(Request $request, $id): Response
|
||||||
@ -46,7 +53,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
|
|
||||||
protected function generateRedirectOnCreateRoute($action, Request $request, $entity)
|
protected function generateRedirectOnCreateRoute($action, Request $request, $entity)
|
||||||
{
|
{
|
||||||
switch($action) {
|
switch ($action) {
|
||||||
case 'ps_situation_view':
|
case 'ps_situation_view':
|
||||||
$route = 'chill_crud_csperson_personal_situation_edit';
|
$route = 'chill_crud_csperson_personal_situation_edit';
|
||||||
break;
|
break;
|
||||||
@ -62,36 +69,32 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
|
|
||||||
protected function checkACL($action, $entity)
|
protected function checkACL($action, $entity)
|
||||||
{
|
{
|
||||||
switch($action) {
|
match ($action) {
|
||||||
case 'ps_situation_edit':
|
'ps_situation_edit', 'dispositifs_edit' => $this->denyAccessUnlessGranted(
|
||||||
case 'dispositifs_edit':
|
PersonVoter::UPDATE,
|
||||||
$this->denyAccessUnlessGranted(PersonVoter::UPDATE,
|
$entity->getPerson()
|
||||||
$entity->getPerson());
|
),
|
||||||
break;
|
'ps_situation_view', 'dispositifs_view' => $this->denyAccessUnlessGranted(
|
||||||
case 'ps_situation_view':
|
PersonVoter::SEE,
|
||||||
case 'dispositifs_view':
|
$entity->getPerson()
|
||||||
$this->denyAccessUnlessGranted(PersonVoter::SEE,
|
),
|
||||||
$entity->getPerson());
|
default => parent::checkACL($action, $entity),
|
||||||
break;
|
};
|
||||||
default:
|
|
||||||
parent::checkACL($action, $entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
||||||
{
|
{
|
||||||
switch($action) {
|
return match ($action) {
|
||||||
case 'ps_situation_edit':
|
'ps_situation_edit' => $this->redirectToRoute(
|
||||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_personal_situation_view',
|
'chill_crud_'.$this->getCrudName().'_personal_situation_view',
|
||||||
['id' => $entity->getId()]);
|
['id' => $entity->getId()]
|
||||||
|
),
|
||||||
case 'dispositifs_edit':
|
'dispositifs_edit' => $this->redirectToRoute(
|
||||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_dispositifs_view',
|
'chill_crud_'.$this->getCrudName().'_dispositifs_view',
|
||||||
['id' => $entity->getId()]);
|
['id' => $entity->getId()]
|
||||||
|
),
|
||||||
default:
|
default => null,
|
||||||
return null;
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getTemplateFor($action, $entity, Request $request)
|
protected function getTemplateFor($action, $entity, Request $request)
|
||||||
@ -110,22 +113,26 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface
|
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
|
||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'dispositifs_edit':
|
case 'dispositifs_edit':
|
||||||
$form = $this->createForm($formClass, $entity, \array_merge(
|
$form = $this->createForm($formClass, $entity, \array_merge(
|
||||||
$formOptions, [ 'center' => $entity->getPerson()->getCenter() ]));
|
$formOptions,
|
||||||
$this->customizeForm($action, $form);
|
['center' => $entity->getPerson()->getCenter()]
|
||||||
|
));
|
||||||
|
$this->customizeForm($action, $form);
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
|
||||||
case 'ps_situation_edit':
|
case 'ps_situation_edit':
|
||||||
$form = $this->createForm($formClass, $entity, \array_merge(
|
$form = $this->createForm($formClass, $entity, \array_merge(
|
||||||
$formOptions, [ 'center' => $entity->getPerson()->getCenter() ]));
|
$formOptions,
|
||||||
$this->customizeForm($action, $form);
|
['center' => $entity->getPerson()->getCenter()]
|
||||||
|
));
|
||||||
|
$this->customizeForm($action, $form);
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
return parent::createFormFor($action, $entity, $formClass, $formOptions);
|
||||||
@ -134,18 +141,16 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
|||||||
|
|
||||||
protected function generateLabelForButton($action, $formName, $form)
|
protected function generateLabelForButton($action, $formName, $form)
|
||||||
{
|
{
|
||||||
switch($action):
|
switch ($action) {
|
||||||
case 'ps_situation_edit':
|
case 'ps_situation_edit':
|
||||||
case 'dispositifs_edit':
|
case 'dispositifs_edit':
|
||||||
if ($formName === 'submit') {
|
if ('submit' === $formName) {
|
||||||
return 'Enregistrer';
|
return 'Enregistrer';
|
||||||
} else {
|
|
||||||
throw new \LogicException("this formName is not supported: $formName");
|
|
||||||
}
|
}
|
||||||
|
throw new \LogicException("this formName is not supported: {$formName}");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return parent::generateLabelForButton($action, $formName, $form);
|
return parent::generateLabelForButton($action, $formName, $form);
|
||||||
endswitch;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Controller;
|
namespace Chill\ChillJobBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
@ -16,22 +25,20 @@ use Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter;
|
|||||||
class CSReportController extends Controller
|
class CSReportController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @Route("{_locale}/csconnectes/person/{person}/report",
|
* @Route("{_locale}/csconnectes/person/{person}/report",
|
||||||
* name="chill_csconnectes_csreport_index"
|
* name="chill_csconnectes_csreport_index"
|
||||||
* )
|
* )
|
||||||
* @param Person $person
|
|
||||||
*/
|
*/
|
||||||
public function index(Person $person): Response
|
public function index(Person $person): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person, "The access to "
|
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person, 'The access to '
|
||||||
. "person is denied");
|
.'person is denied');
|
||||||
|
|
||||||
$reports = $this->getReports($person);
|
$reports = $this->getReports($person);
|
||||||
|
|
||||||
return $this->render('@CSConnectesSP/Report/index.html.twig', \array_merge([
|
return $this->render('@CSConnectesSP/Report/index.html.twig', \array_merge([
|
||||||
'person' => $person,
|
'person' => $person,
|
||||||
], $reports));
|
], $reports));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getReports(Person $person)
|
protected function getReports(Person $person)
|
||||||
@ -54,14 +61,10 @@ class CSReportController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($kinds as $key => $className) {
|
foreach ($kinds as $key => $className) {
|
||||||
switch ($key) {
|
$ordering = match ($key) {
|
||||||
case 'immersions':
|
'immersions' => ['debutDate' => 'DESC'],
|
||||||
$ordering = [ 'debutDate' => 'DESC' ];
|
default => ['reportDate' => 'DESC'],
|
||||||
break;
|
};
|
||||||
default:
|
|
||||||
$ordering = [ 'reportDate' => 'DESC' ];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$results[$key] = $this->getDoctrine()->getManager()
|
$results[$key] = $this->getDoctrine()->getManager()
|
||||||
->getRepository($className)
|
->getRepository($className)
|
||||||
->findByPerson($person, $ordering);
|
->findByPerson($person, $ordering);
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\DependencyInjection;
|
namespace Chill\ChillJobBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
@ -10,13 +19,10 @@ use Symfony\Component\DependencyInjection\Loader;
|
|||||||
/**
|
/**
|
||||||
* This is the class that loads and manages your bundle configuration.
|
* This is the class that loads and manages your bundle configuration.
|
||||||
*
|
*
|
||||||
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
|
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||||
*/
|
*/
|
||||||
class ChillJobExtension extends Extension
|
class ChillJobExtension extends Extension
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
@ -26,6 +32,6 @@ class ChillJobExtension extends Extension
|
|||||||
$loader->load('services.yml');
|
$loader->load('services.yml');
|
||||||
|
|
||||||
// exports: list_CSperson override list_person
|
// exports: list_CSperson override list_person
|
||||||
$container->setAlias('chill.person.export.list_person','Chill\ChillJobBundle\Export\ListCSPerson');
|
$container->setAlias('chill.person.export.list_person', \Chill\ChillJobBundle\Export\ListCSPerson::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\DependencyInjection;
|
namespace Chill\ChillJobBundle\DependencyInjection;
|
||||||
|
|
||||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||||
@ -12,9 +21,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|||||||
*/
|
*/
|
||||||
class Configuration implements ConfigurationInterface
|
class Configuration implements ConfigurationInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder();
|
$treeBuilder = new TreeBuilder();
|
||||||
|
@ -13,31 +13,27 @@ use ChampsLibres\AsyncUploaderBundle\Validator\Constraints\AsyncFileExists;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CSPerson
|
* CSPerson
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.cs_person")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CSPersonRepository")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Table(name: 'chill_csconnectes.cs_person')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CSPersonRepository::class)]
|
||||||
class CSPerson
|
class CSPerson
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
|
||||||
* @ORM\Column(name="id", type="integer")
|
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="NONE")
|
|
||||||
*/
|
*/
|
||||||
private $id;
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue(strategy: 'NONE')]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var Person
|
* @var Person
|
||||||
*
|
|
||||||
* @ORM\OneToOne(
|
|
||||||
* targetEntity="Chill\PersonBundle\Entity\Person")
|
|
||||||
*/
|
*/
|
||||||
private $person;
|
#[ORM\OneToOne(targetEntity: \Chill\PersonBundle\Entity\Person::class)]
|
||||||
|
private ?\Chill\PersonBundle\Entity\Person $person = null;
|
||||||
|
|
||||||
const SITUATIONS_LOGEMENTS = [
|
public const SITUATIONS_LOGEMENTS = [
|
||||||
'proprietaire',
|
'proprietaire',
|
||||||
'locataire',
|
'locataire',
|
||||||
'heberge_chez_tiers',
|
'heberge_chez_tiers',
|
||||||
@ -48,74 +44,68 @@ class CSPerson
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="situationLogement", type="string", length=255, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $situationLogement;
|
#[ORM\Column(name: 'situationLogement', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $situationLogement = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="situationLogementPrecision", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $situationLogementPrecision;
|
#[ORM\Column(name: 'situationLogementPrecision', type: 'text', nullable: true)]
|
||||||
|
private ?string $situationLogementPrecision = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int|null
|
* @var int|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="enfantACharge", type="integer", nullable=true)
|
|
||||||
* @Assert\GreaterThanOrEqual(0)
|
* @Assert\GreaterThanOrEqual(0)
|
||||||
*/
|
*/
|
||||||
private $enfantACharge;
|
#[ORM\Column(name: 'enfantACharge', type: 'integer', nullable: true)]
|
||||||
|
private ?int $enfantACharge = null;
|
||||||
|
|
||||||
const NIVEAU_MAITRISE_LANGUE = [
|
public const NIVEAU_MAITRISE_LANGUE = [
|
||||||
'lu', 'ecrit', 'parle', 'aucun'
|
'lu', 'ecrit', 'parle', 'aucun'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="niveauMaitriseLangue", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'niveauMaitriseLangue', type: 'json', nullable: true)]
|
||||||
private $niveauMaitriseLangue;
|
private $niveauMaitriseLangue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool|null
|
* @var bool|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="vehiculePersonnel", type="boolean", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $vehiculePersonnel;
|
#[ORM\Column(name: 'vehiculePersonnel', type: 'boolean', nullable: true)]
|
||||||
|
private ?bool $vehiculePersonnel = null;
|
||||||
|
|
||||||
const PERMIS_CONDUIRE = [
|
public const PERMIS_CONDUIRE = [
|
||||||
'a', 'b', 'c', 'd', 'e', 'caces', 'en_cours', 'pas_de_permis'
|
'a', 'b', 'c', 'd', 'e', 'caces', 'en_cours', 'pas_de_permis'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="permisConduire", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'permisConduire', type: 'json', nullable: true)]
|
||||||
private $permisConduire;
|
private $permisConduire;
|
||||||
|
|
||||||
const SITUATION_PROFESSIONNELLE = [
|
public const SITUATION_PROFESSIONNELLE = [
|
||||||
'sans_emploi', 'en_activite', 'etudiant', 'etudiant_descolarise'
|
'sans_emploi', 'en_activite', 'etudiant', 'etudiant_descolarise'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="situationProfessionnelle", type="string", length=255, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $situationProfessionnelle;
|
#[ORM\Column(name: 'situationProfessionnelle', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $situationProfessionnelle = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="dateFinDernierEmploi", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $dateFinDernierEmploi;
|
#[ORM\Column(name: 'dateFinDernierEmploi', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $dateFinDernierEmploi = null;
|
||||||
|
|
||||||
const TYPE_CONTRAT = [
|
public const TYPE_CONTRAT = [
|
||||||
'cdd',
|
'cdd',
|
||||||
'cdi',
|
'cdi',
|
||||||
'contrat_interim',
|
'contrat_interim',
|
||||||
@ -127,19 +117,18 @@ class CSPerson
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="typeContrat", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'typeContrat', type: 'json', nullable: true)]
|
||||||
private $typeContrat;
|
private $typeContrat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="typeContratAide", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $typeContratAide;
|
#[ORM\Column(name: 'typeContratAide', type: 'text', nullable: true)]
|
||||||
|
private ?string $typeContratAide = null;
|
||||||
|
|
||||||
const RESSOURCES = [
|
public const RESSOURCES = [
|
||||||
'salaires',
|
'salaires',
|
||||||
'ARE',
|
'ARE',
|
||||||
'ASS',
|
'ASS',
|
||||||
@ -150,42 +139,36 @@ class CSPerson
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="ressources", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'ressources', type: 'json', nullable: true)]
|
||||||
private $ressources;
|
private $ressources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="ressourcesComment", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $ressourcesComment;
|
#[ORM\Column(name: 'ressourcesComment', type: 'text', nullable: true)]
|
||||||
|
private ?string $ressourcesComment = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="ressourceDate1Versement", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $ressourceDate1Versement;
|
#[ORM\Column(name: 'ressourceDate1Versement', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $ressourceDate1Versement = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var double
|
* @var double
|
||||||
*
|
|
||||||
* @ORM\Column(name="CPFMontant", type="decimal", nullable=true, precision=10, scale=2)
|
|
||||||
* Assert\GreaterOrEqualThan(0)
|
|
||||||
*/
|
*/
|
||||||
private $cPFMontant;
|
#[ORM\Column(name: 'CPFMontant', type: 'decimal', nullable: true, precision: 10, scale: 2)] // Assert\GreaterOrEqualThan(0)
|
||||||
|
private ?string $cPFMontant = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var double
|
* @var double
|
||||||
* @ORM\Column(name="acomptedif", type="decimal", nullable=true, precision=10, scale=2)
|
|
||||||
* Assert\GreaterOrEqualThan(0)
|
|
||||||
*/
|
*/
|
||||||
private $acompteDIF;
|
#[ORM\Column(name: 'acomptedif', type: 'decimal', nullable: true, precision: 10, scale: 2)] // Assert\GreaterOrEqualThan(0)
|
||||||
|
private ?string $acompteDIF = null;
|
||||||
|
|
||||||
const ACCOMPAGNEMENTS = [
|
public const ACCOMPAGNEMENTS = [
|
||||||
'plie',
|
'plie',
|
||||||
'pole_emploi',
|
'pole_emploi',
|
||||||
'referent_RSA',
|
'referent_RSA',
|
||||||
@ -196,82 +179,73 @@ class CSPerson
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="accompagnement", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'accompagnement', type: 'json', nullable: true)]
|
||||||
private $accompagnement;
|
private $accompagnement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="accompagnementRQTHDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $accompagnementRQTHDate;
|
#[ORM\Column(name: 'accompagnementRQTHDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $accompagnementRQTHDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="accompagnementComment", type="string", length=255, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $accompagnementComment;
|
#[ORM\Column(name: 'accompagnementComment', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $accompagnementComment = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="poleEmploiId", type="string", length=255, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $poleEmploiId;
|
#[ORM\Column(name: 'poleEmploiId', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $poleEmploiId = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="poleEmploiInscriptionDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $poleEmploiInscriptionDate;
|
#[ORM\Column(name: 'poleEmploiInscriptionDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $poleEmploiInscriptionDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="cafId", type="string", length=255, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $cafId;
|
#[ORM\Column(name: 'cafId', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $cafId = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="cafInscriptionDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $cafInscriptionDate;
|
#[ORM\Column(name: 'cafInscriptionDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $cafInscriptionDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="CERInscriptionDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $cERInscriptionDate;
|
#[ORM\Column(name: 'CERInscriptionDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $cERInscriptionDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="PPAEInscriptionDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $pPAEInscriptionDate;
|
#[ORM\Column(name: 'PPAEInscriptionDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $pPAEInscriptionDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="CERSignataire", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $cERSignataire;
|
#[ORM\Column(name: 'CERSignataire', type: 'text', nullable: true)]
|
||||||
|
private ?string $cERSignataire = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="PPAESignataire", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $pPAESignataire;
|
#[ORM\Column(name: 'PPAESignataire', type: 'text', nullable: true)]
|
||||||
|
private ?string $pPAESignataire = null;
|
||||||
|
|
||||||
const NEET_ELIGIBILITY = [
|
public const NEET_ELIGIBILITY = [
|
||||||
'oui',
|
'oui',
|
||||||
'non',
|
'non',
|
||||||
'en_attente'
|
'en_attente'
|
||||||
@ -279,64 +253,60 @@ class CSPerson
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var bool
|
* @var bool
|
||||||
*
|
|
||||||
* @ORM\Column(name="NEETEligibilite", type="string", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $nEETEligibilite;
|
#[ORM\Column(name: 'NEETEligibilite', type: 'string', nullable: true)]
|
||||||
|
private ?string $nEETEligibilite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
*
|
|
||||||
* @ORM\Column(name="NEETCommissionDate", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $nEETCommissionDate;
|
#[ORM\Column(name: 'NEETCommissionDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $nEETCommissionDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="FSEMaDemarcheCode", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $fSEMaDemarcheCode;
|
#[ORM\Column(name: 'FSEMaDemarcheCode', type: 'text', nullable: true)]
|
||||||
|
private ?string $fSEMaDemarcheCode = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
* @ORM\Column(name="datecontratIEJ", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $dateContratIEJ;
|
#[ORM\Column(name: 'datecontratIEJ', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $dateContratIEJ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var \DateTime
|
* @var \DateTimeInterface
|
||||||
* @ORM\Column(name="dateavenantIEJ", type="date", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $dateAvenantIEJ;
|
#[ORM\Column(name: 'dateavenantIEJ', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $dateAvenantIEJ = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="dispositifs_notes", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $dispositifsNotes;
|
#[ORM\Column(name: 'dispositifs_notes', type: 'text', nullable: true)]
|
||||||
|
private ?string $dispositifsNotes = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
* @ORM\Column(name="handicap", type="boolean", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $handicapIs;
|
#[ORM\Column(name: 'handicap', type: 'boolean', nullable: true)]
|
||||||
|
private ?bool $handicapIs = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="handicapnotes", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $handicapNotes;
|
#[ORM\Column(name: 'handicapnotes', type: 'text', nullable: true)]
|
||||||
|
private ?string $handicapNotes = null;
|
||||||
|
|
||||||
const HANDICAP_RECOMMANDATIONS = [
|
public const HANDICAP_RECOMMANDATIONS = [
|
||||||
'travail_esat',
|
'travail_esat',
|
||||||
'milieu_ordinaire',
|
'milieu_ordinaire',
|
||||||
'entreprise_adaptee'
|
'entreprise_adaptee'
|
||||||
@ -345,21 +315,19 @@ class CSPerson
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="handicapRecommandation", type="string", length=50, nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $handicapRecommandation;
|
#[ORM\Column(name: 'handicapRecommandation', type: 'string', length: 50, nullable: true)]
|
||||||
|
private ?string $handicapRecommandation = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var ThirdParty
|
* @var ThirdParty
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\ThirdPartyBundle\Entity\ThirdParty"
|
|
||||||
* )
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private $handicapAccompagnement;
|
#[ORM\ManyToOne(targetEntity: \\Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
|
||||||
|
private ?\Chill\ThirdPartyBundle\Entity\ThirdParty $handicapAccompagnement = null;
|
||||||
|
|
||||||
const MOBILITE_MOYEN_TRANSPORT = [
|
public const MOBILITE_MOYEN_TRANSPORT = [
|
||||||
'transport_commun',
|
'transport_commun',
|
||||||
'scooter',
|
'scooter',
|
||||||
'velo',
|
'velo',
|
||||||
@ -370,179 +338,133 @@ class CSPerson
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string[]
|
* @var string[]
|
||||||
* @ORM\Column(name="mobilitemoyentransport", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'mobilitemoyentransport', type: 'json', nullable: true)]
|
||||||
private $mobiliteMoyenDeTransport;
|
private $mobiliteMoyenDeTransport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="mobilitenotes", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $mobiliteNotes;
|
#[ORM\Column(name: 'mobilitenotes', type: 'text', nullable: true)]
|
||||||
|
private ?string $mobiliteNotes = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var StoredObject|null
|
||||||
|
*/
|
||||||
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentCV = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $documentCV;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var StoredObject|null
|
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAgrementIAE;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAgrementIAE = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentRQTH;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentRQTH = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAttestationNEET;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationNEET = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentCI;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentCI = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentTitreSejour;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentTitreSejour = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAttestationFiscale;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationFiscale = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentPermis;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentPermis = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAttestationCAAF;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationCAAF = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentContraTravail;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentContraTravail = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAttestationFormation;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationFormation = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentQuittanceLoyer;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentQuittanceLoyer = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentFactureElectricite;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentFactureElectricite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var StoredObject|null
|
* @var StoredObject|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
|
||||||
* cascade={ "persist" }
|
|
||||||
* )
|
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
private $documentAttestationSecuriteSociale;
|
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||||
|
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationSecuriteSociale = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ThirdParty|null
|
* @var ThirdParty|null
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\ThirdPartyBundle\Entity\ThirdParty"
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
private $prescripteur;
|
#[ORM\ManyToOne(targetEntity: \\Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
|
||||||
|
private ?\Chill\ThirdPartyBundle\Entity\ThirdParty $prescripteur = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
@ -636,7 +558,6 @@ class CSPerson
|
|||||||
/**
|
/**
|
||||||
* Valide niveauMaitriseLangue
|
* Valide niveauMaitriseLangue
|
||||||
*
|
*
|
||||||
* @param ExecutionContextInterface $context
|
|
||||||
* @Assert\Callback()
|
* @Assert\Callback()
|
||||||
*/
|
*/
|
||||||
public function validateNiveauMatriseLangue(ExecutionContextInterface $context)
|
public function validateNiveauMatriseLangue(ExecutionContextInterface $context)
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Entity;
|
namespace Chill\ChillJobBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -9,31 +18,24 @@ use Doctrine\Common\Collections\Collection;
|
|||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CV
|
* CV.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.cv")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CVRepository")
|
|
||||||
*/
|
*/
|
||||||
class CV
|
#[ORM\Table(name: 'chill_csconnectes.cv')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CVRepository::class)]
|
||||||
|
class CV implements \Stringable
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="reportDate", type="date")
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $reportDate;
|
#[ORM\Column(name: 'reportDate', type: 'date')]
|
||||||
|
private ?\DateTimeInterface $reportDate = null;
|
||||||
|
|
||||||
const FORMATION_LEVEL = [
|
public const FORMATION_LEVEL = [
|
||||||
'sans_diplome',
|
'sans_diplome',
|
||||||
'BEP_CAP',
|
'BEP_CAP',
|
||||||
'BAC',
|
'BAC',
|
||||||
@ -41,79 +43,48 @@ class CV
|
|||||||
'BAC+3',
|
'BAC+3',
|
||||||
'BAC+4',
|
'BAC+4',
|
||||||
'BAC+5',
|
'BAC+5',
|
||||||
'BAC+8'
|
'BAC+8',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="formationLevel", type="string", length=255, nullable=true)
|
|
||||||
* @Assert\NotBlank()
|
* @Assert\NotBlank()
|
||||||
*/
|
*/
|
||||||
private $formationLevel;
|
#[ORM\Column(name: 'formationLevel', type: 'string', length: 255, nullable: true)]
|
||||||
|
private ?string $formationLevel = null;
|
||||||
|
|
||||||
const FORMATION_TYPE = [
|
public const FORMATION_TYPE = [
|
||||||
'formation_initiale',
|
'formation_initiale',
|
||||||
'formation_continue'
|
'formation_continue',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'formationType', type: 'string', length: 255, nullable: true)]
|
||||||
* @var string
|
private ?string $formationType = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="formationType", type="string", length=255, nullable=true)
|
|
||||||
*/
|
|
||||||
private $formationType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]|null
|
* @var string[]|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="spokenLanguages", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'spokenLanguages', type: 'json', nullable: true)]
|
||||||
private $spokenLanguages;
|
private $spokenLanguages;
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $notes = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $notes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Collection
|
|
||||||
* @ORM\OneToMany(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\CV\Formation",
|
|
||||||
* mappedBy="CV",
|
|
||||||
* cascade={"persist", "remove", "detach"},
|
|
||||||
* orphanRemoval=true
|
|
||||||
* )
|
|
||||||
* @ORM\OrderBy({"startDate"= "DESC", "endDate"= "DESC"})
|
|
||||||
* @Assert\Valid(traverse=true)
|
* @Assert\Valid(traverse=true)
|
||||||
*/
|
*/
|
||||||
private $formations;
|
#[ORM\OneToMany(targetEntity: CV\Formation::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)]
|
||||||
|
#[ORM\OrderBy(['startDate' => 'DESC', 'endDate' => 'DESC'])]
|
||||||
|
private Collection $formations;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Collection
|
|
||||||
* @ORM\OneToMany(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\CV\Experience",
|
|
||||||
* mappedBy="CV",
|
|
||||||
* cascade={"persist", "remove", "detach"},
|
|
||||||
* orphanRemoval=true
|
|
||||||
* )
|
|
||||||
* @ORM\OrderBy({"startDate"= "DESC", "endDate"="DESC"})
|
|
||||||
* @Assert\Valid(traverse=true)
|
* @Assert\Valid(traverse=true)
|
||||||
*/
|
*/
|
||||||
private $experiences;
|
#[ORM\OneToMany(targetEntity: CV\Experience::class, mappedBy: 'CV', cascade: ['persist', 'remove', 'detach'], orphanRemoval: true)]
|
||||||
|
#[ORM\OrderBy(['startDate' => 'DESC', 'endDate' => 'DESC'])]
|
||||||
|
private Collection $experiences;
|
||||||
|
|
||||||
/**
|
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||||
*
|
private ?Person $person = null;
|
||||||
* @var \Chill\PersonBundle\Entity\Person
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="Chill\PersonBundle\Entity\Person"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $person;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -122,7 +93,7 @@ class CV
|
|||||||
$this->reportDate = new \DateTime('now');
|
$this->reportDate = new \DateTime('now');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
@ -265,7 +236,7 @@ class CV
|
|||||||
public function setFormations(Collection $formations)
|
public function setFormations(Collection $formations)
|
||||||
{
|
{
|
||||||
foreach ($formations as $formation) {
|
foreach ($formations as $formation) {
|
||||||
/** @var CV\Formation $formation */
|
/* @var CV\Formation $formation */
|
||||||
$formation->setCV($this);
|
$formation->setCV($this);
|
||||||
}
|
}
|
||||||
$this->formations = $formations;
|
$this->formations = $formations;
|
||||||
@ -287,7 +258,7 @@ class CV
|
|||||||
|
|
||||||
public function removeFormation(CV\Formation $formation)
|
public function removeFormation(CV\Formation $formation)
|
||||||
{
|
{
|
||||||
if (FALSE === $this->formations->contains($formation)) {
|
if (false === $this->formations->contains($formation)) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +271,7 @@ class CV
|
|||||||
public function setExperiences(Collection $experiences)
|
public function setExperiences(Collection $experiences)
|
||||||
{
|
{
|
||||||
foreach ($experiences as $experience) {
|
foreach ($experiences as $experience) {
|
||||||
/** @var CV\Experience $experience */
|
/* @var CV\Experience $experience */
|
||||||
$experience->setCV($this);
|
$experience->setCV($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +294,7 @@ class CV
|
|||||||
|
|
||||||
public function removeExperience(CV\Experience $experience)
|
public function removeExperience(CV\Experience $experience)
|
||||||
{
|
{
|
||||||
if (FALSE === $this->experiences->contains($experience)) {
|
if (false === $this->experiences->contains($experience)) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,13 +312,13 @@ class CV
|
|||||||
public function setPerson(Person $person)
|
public function setPerson(Person $person)
|
||||||
{
|
{
|
||||||
$this->person = $person;
|
$this->person = $person;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'CV de '.$this->getPerson().' daté du '.
|
return 'CV de '.$this->getPerson().' daté du '.
|
||||||
$this->getReportDate()->format('d-m-Y');
|
$this->getReportDate()->format('d-m-Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Entity\CV;
|
namespace Chill\ChillJobBundle\Entity\CV;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -7,52 +16,33 @@ use Chill\ChillJobBundle\Entity\CV;
|
|||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Experience
|
* Experience.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.cv_experience")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CV\ExperienceRepository")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Table(name: 'chill_csconnectes.cv_experience')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CV\ExperienceRepository::class)]
|
||||||
class Experience
|
class Experience
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
#[ORM\Column(name: 'poste', type: 'text', nullable: true)]
|
||||||
*/
|
private ?string $poste = null;
|
||||||
private $id;
|
|
||||||
|
#[ORM\Column(name: 'structure', type: 'text', nullable: true)]
|
||||||
|
private ?string $structure = null;
|
||||||
|
|
||||||
|
#[ORM\Column(name: 'startDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $startDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="poste", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $poste;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="structure", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $structure;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \DateTime|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="startDate", type="date", nullable=true)
|
|
||||||
*/
|
|
||||||
private $startDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \DateTime|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="endDate", type="date", nullable=true)
|
|
||||||
* @Assert\GreaterThan(propertyPath="startDate", message="La date de fin doit être postérieure à la date de début")
|
* @Assert\GreaterThan(propertyPath="startDate", message="La date de fin doit être postérieure à la date de début")
|
||||||
*/
|
*/
|
||||||
private $endDate;
|
#[ORM\Column(name: 'endDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $endDate = null;
|
||||||
|
|
||||||
const CONTRAT_TYPE = [
|
public const CONTRAT_TYPE = [
|
||||||
'cddi',
|
'cddi',
|
||||||
'cdd-6mois',
|
'cdd-6mois',
|
||||||
'cdd+6mois',
|
'cdd+6mois',
|
||||||
@ -65,33 +55,17 @@ class Experience
|
|||||||
'stage',
|
'stage',
|
||||||
'volontariat',
|
'volontariat',
|
||||||
'benevolat',
|
'benevolat',
|
||||||
'autres'
|
'autres',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'contratType', type: 'string', length: 100)]
|
||||||
* @var string
|
private ?string $contratType = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="contratType", type="string", length=100)
|
|
||||||
*/
|
|
||||||
private $contratType;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
|
||||||
* @var string
|
private ?string $notes = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $notes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var CV
|
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\CV",
|
|
||||||
* inversedBy="experiences"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $CV;
|
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: CV::class, inversedBy: 'experiences')]
|
||||||
|
private ?CV $CV = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
@ -258,6 +232,4 @@ class Experience
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Entity\CV;
|
namespace Chill\ChillJobBundle\Entity\CV;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -7,86 +16,53 @@ use Chill\ChillJobBundle\Entity\CV;
|
|||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Formation
|
* Formation.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.cv_formation")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CV\FormationRepository")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Table(name: 'chill_csconnectes.cv_formation')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CV\FormationRepository::class)]
|
||||||
class Formation
|
class Formation
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="title", type="text")
|
|
||||||
* @Assert\Length(min=3)
|
* @Assert\Length(min=3)
|
||||||
|
*
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $title;
|
#[ORM\Column(name: 'title', type: 'text')]
|
||||||
|
private ?string $title = null;
|
||||||
|
|
||||||
|
#[ORM\Column(name: 'startDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $startDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="startDate", type="date", nullable=true)
|
|
||||||
*/
|
|
||||||
private $startDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \DateTime|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="endDate", type="date", nullable=true)
|
|
||||||
* @Assert\GreaterThan(propertyPath="startDate", message="La date de fin doit être postérieure à la date de début")
|
* @Assert\GreaterThan(propertyPath="startDate", message="La date de fin doit être postérieure à la date de début")
|
||||||
*/
|
*/
|
||||||
private $endDate;
|
#[ORM\Column(name: 'endDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $endDate = null;
|
||||||
|
|
||||||
const DIPLOMA_OBTAINED = [
|
public const DIPLOMA_OBTAINED = [
|
||||||
'fr', 'non-fr', 'aucun'
|
'fr', 'non-fr', 'aucun',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'diplomaObtained', type: 'string', nullable: true)]
|
||||||
* @var string|null
|
private ?string $diplomaObtained = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="diplomaObtained", type="string", nullable=true)
|
|
||||||
*/
|
|
||||||
private $diplomaObtained;
|
|
||||||
|
|
||||||
const DIPLOMA_RECONNU = [
|
public const DIPLOMA_RECONNU = [
|
||||||
'oui', 'non', 'nsp'
|
'oui', 'non', 'nsp',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'diplomaReconnue', type: 'string', length: 50, nullable: true)]
|
||||||
* @var string|null
|
private ?string $diplomaReconnue = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="diplomaReconnue", type="string", length=50, nullable=true)
|
|
||||||
*/
|
|
||||||
private $diplomaReconnue;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="organisme", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $organisme;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var CV
|
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\CV",
|
|
||||||
* inversedBy="formations"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $CV;
|
|
||||||
|
|
||||||
|
#[ORM\Column(name: 'organisme', type: 'text', nullable: true)]
|
||||||
|
private ?string $organisme = null;
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: CV::class, inversedBy: 'formations')]
|
||||||
|
private ?CV $CV = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
@ -253,6 +229,4 @@ class Formation
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Entity;
|
namespace Chill\ChillJobBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -8,97 +17,82 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frein
|
* Frein.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.frein")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\FreinRepository")
|
|
||||||
*/
|
*/
|
||||||
class Frein implements HasPerson
|
#[ORM\Table(name: 'chill_csconnectes.frein')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\FreinRepository::class)]
|
||||||
|
class Frein implements HasPerson, \Stringable
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="reportDate", type="date")
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
|
*
|
||||||
* @Assert\Date()
|
* @Assert\Date()
|
||||||
|
*
|
||||||
* @Assert\GreaterThan("5 years ago",
|
* @Assert\GreaterThan("5 years ago",
|
||||||
* message="La date du rapport ne peut pas être plus de cinq ans dans le passé"
|
* message="La date du rapport ne peut pas être plus de cinq ans dans le passé"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
private $reportDate;
|
#[ORM\Column(name: 'reportDate', type: 'date')]
|
||||||
|
private ?\DateTimeInterface $reportDate = null;
|
||||||
|
|
||||||
const FREINS_PERSO = [
|
public const FREINS_PERSO = [
|
||||||
'situation_administrative',
|
'situation_administrative',
|
||||||
'situation_personnelle_et_familiale',
|
'situation_personnelle_et_familiale',
|
||||||
'comportement',
|
'comportement',
|
||||||
'etat_de_sante',
|
'etat_de_sante',
|
||||||
'precarite_situation_materielle',
|
'precarite_situation_materielle',
|
||||||
'condition_ou_absence_logement',
|
'condition_ou_absence_logement',
|
||||||
'autres'
|
'autres',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*
|
|
||||||
* @ORM\Column(name="freinsPerso", type="json")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'freinsPerso', type: 'json')]
|
||||||
private $freinsPerso = [];
|
private $freinsPerso = [];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'notesPerso', type: 'text')]
|
||||||
* @var string
|
private ?string $notesPerso = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="notesPerso", type="text")
|
|
||||||
*/
|
|
||||||
private $notesPerso = '';
|
|
||||||
|
|
||||||
const FREINS_EMPLOI = [
|
public const FREINS_EMPLOI = [
|
||||||
'garde_d_enfants',
|
'garde_d_enfants',
|
||||||
'sante',
|
'sante',
|
||||||
'famille',
|
'famille',
|
||||||
'finances',
|
'finances',
|
||||||
'maitrise_de_la_langue',
|
'maitrise_de_la_langue',
|
||||||
'autres'
|
'autres',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*
|
|
||||||
* @ORM\Column(name="freinsEmploi", type="json")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'freinsEmploi', type: 'json')]
|
||||||
private $freinsEmploi = [];
|
private $freinsEmploi = [];
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'notesEmploi', type: 'text')]
|
||||||
* @var string
|
private ?string $notesEmploi = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="notesEmploi", type="text")
|
|
||||||
*/
|
|
||||||
private $notesEmploi = '';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Person
|
* @var Person
|
||||||
*
|
*
|
||||||
* @ORM\ManytoOne(
|
* @ORM\ManytoOne(
|
||||||
* targetEntity="Chill\PersonBundle\Entity\Person")
|
* targetEntity="Chill\PersonBundle\Entity\Person")
|
||||||
|
*
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $person;
|
private $person;
|
||||||
|
|
||||||
function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->reportDate = new \DateTime('today');
|
$this->reportDate = new \DateTime('today');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
@ -159,11 +153,9 @@ class Frein implements HasPerson
|
|||||||
/**
|
/**
|
||||||
* Set notesPerso.
|
* Set notesPerso.
|
||||||
*
|
*
|
||||||
* @param string $notesPerso
|
|
||||||
*
|
|
||||||
* @return Frein
|
* @return Frein
|
||||||
*/
|
*/
|
||||||
public function setNotesPerso(string $notesPerso = null)
|
public function setNotesPerso(?string $notesPerso = null)
|
||||||
{
|
{
|
||||||
$this->notesPerso = (string) $notesPerso;
|
$this->notesPerso = (string) $notesPerso;
|
||||||
|
|
||||||
@ -207,11 +199,9 @@ class Frein implements HasPerson
|
|||||||
/**
|
/**
|
||||||
* Set notesEmploi.
|
* Set notesEmploi.
|
||||||
*
|
*
|
||||||
* @param string $notesEmploi
|
|
||||||
*
|
|
||||||
* @return Frein
|
* @return Frein
|
||||||
*/
|
*/
|
||||||
public function setNotesEmploi(string $notesEmploi = null)
|
public function setNotesEmploi(?string $notesEmploi = null)
|
||||||
{
|
{
|
||||||
$this->notesEmploi = (string) $notesEmploi;
|
$this->notesEmploi = (string) $notesEmploi;
|
||||||
|
|
||||||
@ -233,7 +223,7 @@ class Frein implements HasPerson
|
|||||||
return $this->person;
|
return $this->person;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPerson(\Chill\PersonBundle\Entity\Person $person = null): HasPerson
|
public function setPerson(?\Chill\PersonBundle\Entity\Person $person = null): HasPerson
|
||||||
{
|
{
|
||||||
$this->person = $person;
|
$this->person = $person;
|
||||||
|
|
||||||
@ -241,19 +231,19 @@ class Frein implements HasPerson
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vérifie qu'au moins un frein a été coché parmi les freins perso + emploi
|
* Vérifie qu'au moins un frein a été coché parmi les freins perso + emploi.
|
||||||
*
|
*
|
||||||
* @param ExecutionContextInterface $context
|
|
||||||
* @param array $payload
|
* @param array $payload
|
||||||
|
*
|
||||||
* @Assert\Callback()
|
* @Assert\Callback()
|
||||||
*/
|
*/
|
||||||
public function validateFreinsCount(ExecutionContextInterface $context, $payload)
|
public function validateFreinsCount(ExecutionContextInterface $context, $payload)
|
||||||
{
|
{
|
||||||
$nb = count($this->getFreinsEmploi()) + count($this->getFreinsPerso());
|
$nb = count($this->getFreinsEmploi()) + count($this->getFreinsPerso());
|
||||||
|
|
||||||
if ($nb === 0) {
|
if (0 === $nb) {
|
||||||
$msg = "Indiquez au moins un frein parmi les freins "
|
$msg = 'Indiquez au moins un frein parmi les freins '
|
||||||
. "liés à l'emploi et les freins liés à la situation personnelle.";
|
."liés à l'emploi et les freins liés à la situation personnelle.";
|
||||||
$context->buildViolation($msg)
|
$context->buildViolation($msg)
|
||||||
->atPath('freinsEmploi')
|
->atPath('freinsEmploi')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
@ -264,7 +254,7 @@ class Frein implements HasPerson
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'Rapport "frein" de '.$this->getPerson().' daté du '.
|
return 'Rapport "frein" de '.$this->getPerson().' daté du '.
|
||||||
$this->getReportDate()->format('d-m-Y');
|
$this->getReportDate()->format('d-m-Y');
|
||||||
|
@ -12,13 +12,12 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Immersion
|
* Immersion
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.immersion")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\ImmersionRepository")
|
|
||||||
*/
|
*/
|
||||||
class Immersion
|
#[ORM\Table(name: 'chill_csconnectes.immersion')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\ImmersionRepository::class)]
|
||||||
|
class Immersion implements \Stringable
|
||||||
{
|
{
|
||||||
const YES_NO_NSP = [
|
public const YES_NO_NSP = [
|
||||||
'oui',
|
'oui',
|
||||||
'non',
|
'non',
|
||||||
'nsp'
|
'nsp'
|
||||||
@ -26,12 +25,11 @@ class Immersion
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*
|
|
||||||
* @ORM\Column(name="id", type="integer")
|
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
*/
|
||||||
private $id;
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -47,144 +45,134 @@ class Immersion
|
|||||||
/**
|
/**
|
||||||
* @var ThirdParty|null
|
* @var ThirdParty|null
|
||||||
*
|
*
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\ThirdPartyBundle\Entity\ThirdParty"
|
|
||||||
* )
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $entreprise;
|
#[ORM\ManyToOne(targetEntity: \\Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
|
||||||
|
private ?\Chill\ThirdPartyBundle\Entity\ThirdParty $entreprise = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var User|null
|
* @var User|null
|
||||||
*
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="\Chill\MainBundle\Entity\User"
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
private $referent;
|
#[ORM\ManyToOne(targetEntity: \\Chill\MainBundle\Entity\User::class)]
|
||||||
|
private ?\Chill\MainBundle\Entity\User $referent = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="domaineActivite", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $domaineActivite;
|
#[ORM\Column(name: 'domaineActivite', type: 'text', nullable: true)]
|
||||||
|
private ?string $domaineActivite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="tuteurName", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $tuteurName;
|
#[ORM\Column(name: 'tuteurName', type: 'text', nullable: true)]
|
||||||
|
private ?string $tuteurName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="tuteurFonction", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $tuteurFonction;
|
#[ORM\Column(name: 'tuteurFonction', type: 'text', nullable: true)]
|
||||||
|
private ?string $tuteurFonction = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="tuteurPhoneNumber", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\NotBlank()
|
* @Assert\NotBlank()
|
||||||
* @PhonenumberConstraint(type="any")
|
|
||||||
*/
|
*/
|
||||||
private $tuteurPhoneNumber;
|
#[ORM\Column(name: 'tuteurPhoneNumber', type: 'text', nullable: true)]
|
||||||
|
#[PhonenumberConstraint(type: 'any')]
|
||||||
|
private ?string $tuteurPhoneNumber = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="structureAccName", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $structureAccName;
|
#[ORM\Column(name: 'structureAccName', type: 'text', nullable: true)]
|
||||||
|
private ?string $structureAccName = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="structureAccPhonenumber", type="text", nullable=true)
|
|
||||||
* @PhonenumberConstraint(type="any")
|
|
||||||
*/
|
*/
|
||||||
private $structureAccPhonenumber;
|
#[ORM\Column(name: 'structureAccPhonenumber', type: 'text', nullable: true)]
|
||||||
|
#[PhonenumberConstraint(type: 'any')]
|
||||||
|
private ?string $structureAccPhonenumber = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="structureAccEmail", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $structureAccEmail;
|
#[ORM\Column(name: 'structureAccEmail', type: 'text', nullable: true)]
|
||||||
|
private ?string $structureAccEmail = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var Address|null
|
* @var Address|null
|
||||||
* @ORM\ManyToOne(targetEntity="\Chill\MainBundle\Entity\Address",
|
|
||||||
* cascade={"persist", "remove"})
|
|
||||||
*/
|
*/
|
||||||
private $structureAccAddress;
|
#[ORM\ManyToOne(targetEntity: \\Chill\MainBundle\Entity\Address::class, cascade: ['persist', 'remove'])]
|
||||||
|
private ?\Chill\MainBundle\Entity\Address $structureAccAddress = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string|null
|
||||||
|
*/
|
||||||
|
#[ORM\Column(name: 'posteDescriptif', type: 'text', nullable: true)]
|
||||||
|
private ?string $posteDescriptif = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="posteDescriptif", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $posteDescriptif;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="posteTitle", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $posteTitle;
|
#[ORM\Column(name: 'posteTitle', type: 'text', nullable: true)]
|
||||||
|
private ?string $posteTitle = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="posteLieu", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $posteLieu;
|
#[ORM\Column(name: 'posteLieu', type: 'text', nullable: true)]
|
||||||
|
private ?string $posteLieu = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime|null
|
* @var \DateTimeInterface|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="debutDate", type="date", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $debutDate;
|
#[ORM\Column(name: 'debutDate', type: 'date', nullable: true)]
|
||||||
|
private ?\DateTimeInterface $debutDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="duration", type="dateinterval", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'duration', type: 'dateinterval', nullable: true)]
|
||||||
private $duration;
|
private $duration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="horaire", type="text", nullable=true)
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
* @Assert\Length(min=2)
|
* @Assert\Length(min=2)
|
||||||
*/
|
*/
|
||||||
private $horaire;
|
#[ORM\Column(name: 'horaire', type: 'text', nullable: true)]
|
||||||
|
private ?string $horaire = null;
|
||||||
|
|
||||||
const OBJECTIFS = [
|
public const OBJECTIFS = [
|
||||||
'decouvrir_metier',
|
'decouvrir_metier',
|
||||||
'confirmer_projet_prof',
|
'confirmer_projet_prof',
|
||||||
'acquerir_experience',
|
'acquerir_experience',
|
||||||
@ -195,26 +183,25 @@ class Immersion
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array|null
|
* @var array|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="objectifs", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'objectifs', type: 'json', nullable: true)]
|
||||||
private $objectifs;
|
private $objectifs;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="objectifsAutre", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $objectifsAutre;
|
#[ORM\Column(name: 'objectifsAutre', type: 'text', nullable: true)]
|
||||||
|
private ?string $objectifsAutre = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
* @ORM\Column(name="is_bilan_fullfilled", type="boolean", options={"default"=false})
|
|
||||||
*/
|
*/
|
||||||
private $isBilanFullfilled = false;
|
#[ORM\Column(name: 'is_bilan_fullfilled', type: 'boolean', options: ['default' => false])]
|
||||||
|
private ?bool $isBilanFullfilled = false;
|
||||||
|
|
||||||
const SAVOIR_ETRE = [
|
public const SAVOIR_ETRE = [
|
||||||
'assiduite',
|
'assiduite',
|
||||||
'ponctualite',
|
'ponctualite',
|
||||||
'respect_consigne_securite',
|
'respect_consigne_securite',
|
||||||
@ -225,54 +212,48 @@ class Immersion
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array|null
|
* @var array|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="savoirEtre", type="json", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'savoirEtre', type: 'json', nullable: true)]
|
||||||
private $savoirEtre;
|
private $savoirEtre;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
* @ORM\Column(name="savoirEtreNote", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $savoirEtreNote;
|
#[ORM\Column(name: 'savoirEtreNote', type: 'text', nullable: true)]
|
||||||
|
private ?string $savoirEtreNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
|
||||||
* @ORM\Column(name="noteimmersion", type="text")
|
|
||||||
*/
|
*/
|
||||||
private $noteImmersion = '';
|
#[ORM\Column(name: 'noteimmersion', type: 'text')]
|
||||||
|
private ?string $noteImmersion = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="principalesActivites", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $principalesActivites;
|
#[ORM\Column(name: 'principalesActivites', type: 'text', nullable: true)]
|
||||||
|
private ?string $principalesActivites = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="competencesAcquises", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $competencesAcquises;
|
#[ORM\Column(name: 'competencesAcquises', type: 'text', nullable: true)]
|
||||||
|
private ?string $competencesAcquises = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="competencesADevelopper", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $competencesADevelopper;
|
#[ORM\Column(name: 'competencesADevelopper', type: 'text', nullable: true)]
|
||||||
|
private ?string $competencesADevelopper = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*
|
|
||||||
* @ORM\Column(name="noteBilan", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $noteBilan;
|
#[ORM\Column(name: 'noteBilan', type: 'text', nullable: true)]
|
||||||
|
private ?string $noteBilan = null;
|
||||||
|
|
||||||
const PONCTUALITE_SALARIE = [
|
public const PONCTUALITE_SALARIE = [
|
||||||
'aucun',
|
'aucun',
|
||||||
'un',
|
'un',
|
||||||
'plusieurs'
|
'plusieurs'
|
||||||
@ -281,18 +262,18 @@ class Immersion
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="ponctualite_salarie", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $ponctualiteSalarie;
|
#[ORM\Column(name: 'ponctualite_salarie', type: 'text', nullable: true)]
|
||||||
|
private ?string $ponctualiteSalarie = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="ponctualite_salarie_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $ponctualiteSalarieNote;
|
#[ORM\Column(name: 'ponctualite_salarie_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $ponctualiteSalarieNote = null;
|
||||||
|
|
||||||
const ASSIDUITE = [
|
public const ASSIDUITE = [
|
||||||
'aucun',
|
'aucun',
|
||||||
'un',
|
'un',
|
||||||
'plusieurs'
|
'plusieurs'
|
||||||
@ -301,32 +282,32 @@ class Immersion
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="assiduite", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $assiduite;
|
#[ORM\Column(name: 'assiduite', type: 'text', nullable: true)]
|
||||||
|
private ?string $assiduite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="assiduite_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $assiduiteNote;
|
#[ORM\Column(name: 'assiduite_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $assiduiteNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="interet_activite", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $interetActivite;
|
#[ORM\Column(name: 'interet_activite', type: 'text', nullable: true)]
|
||||||
|
private ?string $interetActivite = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="interet_activite_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $interetActiviteNote;
|
#[ORM\Column(name: 'interet_activite_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $interetActiviteNote = null;
|
||||||
|
|
||||||
const INTEGRE_REGLE = [
|
public const INTEGRE_REGLE = [
|
||||||
'1_temps',
|
'1_temps',
|
||||||
'rapidement',
|
'rapidement',
|
||||||
'pas_encore'
|
'pas_encore'
|
||||||
@ -335,114 +316,114 @@ class Immersion
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="integre_regle", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $integreRegle;
|
#[ORM\Column(name: 'integre_regle', type: 'text', nullable: true)]
|
||||||
|
private ?string $integreRegle = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="integre_regle_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $integreRegleNote;
|
#[ORM\Column(name: 'integre_regle_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $integreRegleNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="esprit_initiative", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $espritInitiative;
|
#[ORM\Column(name: 'esprit_initiative', type: 'text', nullable: true)]
|
||||||
|
private ?string $espritInitiative = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="esprit_initiative_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $espritInitiativeNote;
|
#[ORM\Column(name: 'esprit_initiative_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $espritInitiativeNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="organisation", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $organisation;
|
#[ORM\Column(name: 'organisation', type: 'text', nullable: true)]
|
||||||
|
private ?string $organisation = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="organisation_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $organisationNote;
|
#[ORM\Column(name: 'organisation_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $organisationNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="capacite_travail_equipe", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $capaciteTravailEquipe;
|
#[ORM\Column(name: 'capacite_travail_equipe', type: 'text', nullable: true)]
|
||||||
|
private ?string $capaciteTravailEquipe = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="capacite_travail_equipe_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $capaciteTravailEquipeNote;
|
#[ORM\Column(name: 'capacite_travail_equipe_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $capaciteTravailEquipeNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="style_vestimentaire", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $styleVestimentaire;
|
#[ORM\Column(name: 'style_vestimentaire', type: 'text', nullable: true)]
|
||||||
|
private ?string $styleVestimentaire = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="style_vestimentaire_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $styleVestimentaireNote;
|
#[ORM\Column(name: 'style_vestimentaire_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $styleVestimentaireNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="langage_prof", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $langageProf;
|
#[ORM\Column(name: 'langage_prof', type: 'text', nullable: true)]
|
||||||
|
private ?string $langageProf = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="langage_prof_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $langageProfNote;
|
#[ORM\Column(name: 'langage_prof_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $langageProfNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="applique_consigne", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $appliqueConsigne;
|
#[ORM\Column(name: 'applique_consigne', type: 'text', nullable: true)]
|
||||||
|
private ?string $appliqueConsigne = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="applique_consigne_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $appliqueConsigneNote;
|
#[ORM\Column(name: 'applique_consigne_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $appliqueConsigneNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="respect_hierarchie", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $respectHierarchie;
|
#[ORM\Column(name: 'respect_hierarchie', type: 'text', nullable: true)]
|
||||||
|
private ?string $respectHierarchie = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
* @ORM\Column(name="respect_hierarchie_note", type="text", nullable=true)
|
|
||||||
*/
|
*/
|
||||||
private $respectHierarchieNote;
|
#[ORM\Column(name: 'respect_hierarchie_note', type: 'text', nullable: true)]
|
||||||
|
private ?string $respectHierarchieNote = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
@ -1248,7 +1229,7 @@ class Immersion
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'Rapport "immersion" de '.$this->getPerson();
|
return 'Rapport "immersion" de '.$this->getPerson();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Entity;
|
namespace Chill\ChillJobBundle\Entity;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -10,149 +19,91 @@ use Chill\PersonBundle\Entity\Person;
|
|||||||
use Chill\ChillJobBundle\Entity\Rome\Appellation;
|
use Chill\ChillJobBundle\Entity\Rome\Appellation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjetProfessionnel
|
* ProjetProfessionnel.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.projet_professionnel")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\ProjetProfessionnelRepository")
|
|
||||||
*/
|
*/
|
||||||
class ProjetProfessionnel
|
#[ORM\Table(name: 'chill_csconnectes.projet_professionnel')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\ProjetProfessionnelRepository::class)]
|
||||||
|
class ProjetProfessionnel implements \Stringable
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Person
|
* @var Person
|
||||||
*
|
*
|
||||||
* @ORM\ManytoOne(
|
* @ORM\ManytoOne(
|
||||||
* targetEntity="Chill\PersonBundle\Entity\Person")
|
* targetEntity="Chill\PersonBundle\Entity\Person")
|
||||||
|
*
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $person;
|
private $person;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \DateTime
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="reportDate", type="date")
|
|
||||||
* @Assert\NotNull()
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $reportDate;
|
#[ORM\Column(name: 'reportDate', type: 'date')]
|
||||||
|
private ?\DateTimeInterface $reportDate = null;
|
||||||
|
|
||||||
/**
|
#[ORM\JoinTable(name: 'chill_csconnectes.projetprofessionnel_souhait')]
|
||||||
*
|
#[ORM\ManyToMany(targetEntity: Appellation::class, cascade: ['persist'])]
|
||||||
* @var Collection
|
private Collection $souhait;
|
||||||
* @ORM\ManyToMany(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
|
|
||||||
* cascade={"persist"}
|
|
||||||
* )
|
|
||||||
* @ORM\JoinTable(
|
|
||||||
* name="chill_csconnectes.projetprofessionnel_souhait"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $souhait;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'domaineActiviteSouhait', type: 'text', nullable: true)]
|
||||||
*
|
private ?string $domaineActiviteSouhait = null;
|
||||||
* @var string
|
|
||||||
* @ORM\Column(name="domaineActiviteSouhait", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $domaineActiviteSouhait;
|
|
||||||
|
|
||||||
const TYPE_CONTRAT = [
|
public const TYPE_CONTRAT = [
|
||||||
'cdd', 'cdi', 'contrat_insertion',
|
'cdd', 'cdi', 'contrat_insertion',
|
||||||
'interim', 'indifferent', 'apprentissage',
|
'interim', 'indifferent', 'apprentissage',
|
||||||
'personnalisation', 'creation_entreprise'
|
'personnalisation', 'creation_entreprise',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array|null
|
* @var array|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="typeContrat", type="json", nullable=true)
|
|
||||||
* @Assert\Count(min=1, minMessage="Indiquez au moins un type de contrat")
|
* @Assert\Count(min=1, minMessage="Indiquez au moins un type de contrat")
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'typeContrat', type: 'json', nullable: true)]
|
||||||
private $typeContrat;
|
private $typeContrat;
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'typeContratNotes', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $typeContratNotes = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="typeContratNotes", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $typeContratNotes;
|
|
||||||
|
|
||||||
const VOLUME_HORAIRES = [
|
public const VOLUME_HORAIRES = [
|
||||||
'temps_plein',
|
'temps_plein',
|
||||||
'temps_partiel'
|
'temps_partiel',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array|null
|
* @var array|null
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="volumeHoraire", type="json", nullable=true)
|
|
||||||
* @Assert\Count(min=1, minMessage="Indiquez un volume horaire souhaité")
|
* @Assert\Count(min=1, minMessage="Indiquez un volume horaire souhaité")
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Column(name: 'volumeHoraire', type: 'json', nullable: true)]
|
||||||
private $volumeHoraire;
|
private $volumeHoraire;
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'volumeHoraireNotes', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $volumeHoraireNotes = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="volumeHoraireNotes", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $volumeHoraireNotes;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'idee', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $idee = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="idee", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $idee;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'enCoursConstruction', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $enCoursConstruction = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="enCoursConstruction", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $enCoursConstruction;
|
|
||||||
|
|
||||||
/**
|
#[ORM\JoinTable(name: 'chill_csconnectes.projetprofessionnel_valide')]
|
||||||
*
|
#[ORM\ManyToMany(targetEntity: Appellation::class)]
|
||||||
* @var Collection
|
private Collection $valide;
|
||||||
* @ORM\ManyToMany(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation"
|
|
||||||
* )
|
|
||||||
* @ORM\JoinTable(
|
|
||||||
* name="chill_csconnectes.projetprofessionnel_valide"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $valide;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'domaineActiviteValide', type: 'text', nullable: true)]
|
||||||
*
|
private ?string $domaineActiviteValide = null;
|
||||||
* @var string
|
|
||||||
* @ORM\Column(name="domaineActiviteValide", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $domaineActiviteValide;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'valideNotes', type: 'text', nullable: true)]
|
||||||
* @var string|null
|
private ?string $valideNotes = null;
|
||||||
*
|
|
||||||
* @ORM\Column(name="valideNotes", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $valideNotes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var string|null
|
|
||||||
*
|
|
||||||
* @ORM\Column(name="projetProfessionnelNote", type="text", nullable=true)
|
|
||||||
*/
|
|
||||||
private $projetProfessionnelNote;
|
|
||||||
|
|
||||||
|
#[ORM\Column(name: 'projetProfessionnelNote', type: 'text', nullable: true)]
|
||||||
|
private ?string $projetProfessionnelNote = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -446,21 +397,21 @@ class ProjetProfessionnel
|
|||||||
return $this->domaineActiviteValide;
|
return $this->domaineActiviteValide;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDomaineActiviteSouhait(string $domaineActiviteSouhait = null)
|
public function setDomaineActiviteSouhait(?string $domaineActiviteSouhait = null)
|
||||||
{
|
{
|
||||||
$this->domaineActiviteSouhait = $domaineActiviteSouhait;
|
$this->domaineActiviteSouhait = $domaineActiviteSouhait;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDomaineActiviteValide(string $domaineActiviteValide = null)
|
public function setDomaineActiviteValide(?string $domaineActiviteValide = null)
|
||||||
{
|
{
|
||||||
$this->domaineActiviteValide = $domaineActiviteValide;
|
$this->domaineActiviteValide = $domaineActiviteValide;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __toString()
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return 'Rapport "projet professionnel" de '.$this->getPerson().' daté du '.
|
return 'Rapport "projet professionnel" de '.$this->getPerson().' daté du '.
|
||||||
$this->getReportDate()->format('d-m-Y');
|
$this->getReportDate()->format('d-m-Y');
|
||||||
|
@ -1,51 +1,38 @@
|
|||||||
<?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\ChillJobBundle\Entity\Rome;
|
namespace Chill\ChillJobBundle\Entity\Rome;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appellation
|
* Appellation.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.rome_appellation")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\Rome\AppellationRepository")
|
|
||||||
*/
|
*/
|
||||||
class Appellation
|
#[ORM\Table(name: 'chill_csconnectes.rome_appellation')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\Rome\AppellationRepository::class)]
|
||||||
|
class Appellation implements \Stringable
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'code', type: 'string', length: 40, unique: true)]
|
||||||
* @var string
|
private ?string $code = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="code", type="string", length=40, unique=true)
|
|
||||||
*/
|
|
||||||
private $code = '';
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'libelle', type: 'text')]
|
||||||
* @var string
|
private ?string $libelle = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="libelle", type="text")
|
|
||||||
*/
|
|
||||||
private $libelle = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var Metier
|
|
||||||
* @ORM\ManyToOne(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Metier",
|
|
||||||
* inversedBy="appellations",
|
|
||||||
* cascade={"persist"}
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $metier;
|
|
||||||
|
|
||||||
|
#[ORM\ManyToOne(targetEntity: Metier::class, inversedBy: 'appellations', cascade: ['persist'])]
|
||||||
|
private ?Metier $metier = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
@ -117,8 +104,7 @@ class Appellation
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __toString(): string
|
||||||
public function __toString()
|
|
||||||
{
|
{
|
||||||
return $this->libelle;
|
return $this->libelle;
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,46 @@
|
|||||||
<?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\ChillJobBundle\Entity\Rome;
|
namespace Chill\ChillJobBundle\Entity\Rome;
|
||||||
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Metier
|
* Metier.
|
||||||
*
|
|
||||||
* @ORM\Table(name="chill_csconnectes.rome_metier")
|
|
||||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\Rome\MetierRepository")
|
|
||||||
*/
|
*/
|
||||||
|
#[ORM\Table(name: 'chill_csconnectes.rome_metier')]
|
||||||
|
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\Rome\MetierRepository::class)]
|
||||||
class Metier
|
class Metier
|
||||||
{
|
{
|
||||||
/**
|
#[ORM\Column(name: 'id', type: 'integer')]
|
||||||
* @var int
|
#[ORM\Id]
|
||||||
*
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
* @ORM\Column(name="id", type="integer")
|
private ?int $id = null;
|
||||||
* @ORM\Id
|
|
||||||
* @ORM\GeneratedValue(strategy="AUTO")
|
|
||||||
*/
|
|
||||||
private $id;
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'libelle', type: 'text')]
|
||||||
* @var string
|
private ?string $libelle = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="libelle", type="text")
|
|
||||||
*/
|
|
||||||
private $libelle = '';
|
|
||||||
|
|
||||||
/**
|
#[ORM\Column(name: 'code', type: 'string', length: 20, unique: true)]
|
||||||
* @var string
|
private ?string $code = '';
|
||||||
*
|
|
||||||
* @ORM\Column(name="code", type="string", length=20, unique=true)
|
|
||||||
*/
|
|
||||||
private $code = '';
|
|
||||||
|
|
||||||
/**
|
#[ORM\OneToMany(targetEntity: Appellation::class, mappedBy: 'metier')]
|
||||||
*
|
private readonly \Doctrine\Common\Collections\Collection $appellations;
|
||||||
* @var \Doctrine\Common\Collections\Collection
|
|
||||||
* @ORM\OneToMany(
|
|
||||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
|
|
||||||
* mappedBy="metier"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
private $appellations;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->appellations = new ArrayCollection();
|
||||||
$this->appellation = new ArrayCollection();
|
$this->appellation = new ArrayCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get id.
|
* Get id.
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
<?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\ChillJobBundle\Export;
|
namespace Chill\ChillJobBundle\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
use Chill\PersonBundle\Export\Export\ListPerson;
|
use Chill\PersonBundle\Export\Export\ListPerson;
|
||||||
@ -16,25 +26,23 @@ use Symfony\Component\Validator\Constraints\Callback;
|
|||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ListCSPerson
|
* Class ListCSPerson.
|
||||||
*
|
*
|
||||||
* @package Chill\ChillJobBundle\Export
|
|
||||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||||
*/
|
*/
|
||||||
class ListCSPerson extends ListPerson implements ListInterface, ExportElementValidatedInterface
|
class ListCSPerson extends ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const CSPERSON = [
|
public const CSPERSON = [
|
||||||
'ressource__label' => CSPerson::RESSOURCES,
|
'ressource__label' => CSPerson::RESSOURCES,
|
||||||
'moyen_transport__label' => CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
'moyen_transport__label' => CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
||||||
'type_contrat__label' => CSPerson::TYPE_CONTRAT,
|
'type_contrat__label' => CSPerson::TYPE_CONTRAT,
|
||||||
'permis_conduire__label' => CSPerson::PERMIS_CONDUIRE,
|
'permis_conduire__label' => CSPerson::PERMIS_CONDUIRE,
|
||||||
'accompagnement__label' => CSPerson::ACCOMPAGNEMENTS,
|
'accompagnement__label' => CSPerson::ACCOMPAGNEMENTS,
|
||||||
'situation_professionnelle__label' => CSPerson::SITUATION_PROFESSIONNELLE,
|
'situation_professionnelle__label' => CSPerson::SITUATION_PROFESSIONNELLE,
|
||||||
'neet_eligibility__label' => CSPerson::NEET_ELIGIBILITY
|
'neet_eligibility__label' => CSPerson::NEET_ELIGIBILITY,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +70,7 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Rebuild fields array, combining parent ListPerson and ListCSPerson,
|
* Rebuild fields array, combining parent ListPerson and ListCSPerson,
|
||||||
* adding query type as value
|
* adding query type as value.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -89,7 +97,7 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
'address_postcode_label' => 'string',
|
'address_postcode_label' => 'string',
|
||||||
'address_country_name' => 'string',
|
'address_country_name' => 'string',
|
||||||
'address_country_code' => 'string',
|
'address_country_code' => 'string',
|
||||||
'address_isnoaddress' => 'boolean'
|
'address_isnoaddress' => 'boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
$CSfields = [
|
$CSfields = [
|
||||||
@ -119,14 +127,14 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
'datefindernieremploi' => 'date',
|
'datefindernieremploi' => 'date',
|
||||||
'type_contrat__label' => 'json',
|
'type_contrat__label' => 'json',
|
||||||
'ressource__label' => 'json',
|
'ressource__label' => 'json',
|
||||||
'moyen_transport__label' => 'json'
|
'moyen_transport__label' => 'json',
|
||||||
];
|
];
|
||||||
|
|
||||||
return array_merge($fields, $CSfields);
|
return array_merge($fields, $CSfields);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array FIELDS keys only
|
* Return array FIELDS keys only.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -137,12 +145,13 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* give the list of keys the current export added to the queryBuilder in
|
* give the list of keys the current export added to the queryBuilder in
|
||||||
* self::initiateQuery
|
* self::initiateQuery.
|
||||||
*
|
*
|
||||||
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
||||||
* this function will return `array('count_id')`.
|
* this function will return `array('count_id')`.
|
||||||
*
|
*
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
@ -152,7 +161,6 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
$fields = [];
|
$fields = [];
|
||||||
foreach ($data['fields'] as $key) {
|
foreach ($data['fields'] as $key) {
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
|
|
||||||
case 'ressource__label':
|
case 'ressource__label':
|
||||||
case 'moyen_transport__label':
|
case 'moyen_transport__label':
|
||||||
foreach ($csperson[$key] as $item) {
|
foreach ($csperson[$key] as $item) {
|
||||||
@ -164,27 +172,28 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
case 'prescripteur__name':
|
case 'prescripteur__name':
|
||||||
case 'prescripteur__email':
|
case 'prescripteur__email':
|
||||||
case 'prescripteur__phone':
|
case 'prescripteur__phone':
|
||||||
$key = str_replace('__', '.', $key);
|
$key = str_replace('__', '.', (string) $key);
|
||||||
|
|
||||||
|
// no break
|
||||||
case 'situation_professionnelle__label':
|
case 'situation_professionnelle__label':
|
||||||
case 'neet_eligibility__label':
|
case 'neet_eligibility__label':
|
||||||
|
|
||||||
case 'accompagnement__label':
|
case 'accompagnement__label':
|
||||||
case 'permis_conduire__label':
|
case 'permis_conduire__label':
|
||||||
case 'type_contrat__label':
|
case 'type_contrat__label':
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$fields[] = $key;
|
$fields[] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some fields values are arrays that have to be splitted in columns.
|
* Some fields values are arrays that have to be splitted in columns.
|
||||||
* This function split theses fields
|
* This function split theses fields.
|
||||||
*
|
*
|
||||||
* @param array $rows
|
* @param array $rows
|
||||||
|
*
|
||||||
* @return array|\Closure
|
* @return array|\Closure
|
||||||
*/
|
*/
|
||||||
private function splitArrayToColumns($rows)
|
private function splitArrayToColumns($rows)
|
||||||
@ -196,21 +205,17 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
*/
|
*/
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $key
|
* @var string $key
|
||||||
* @var mixed $value
|
|
||||||
*/
|
*/
|
||||||
$res = [];
|
$res = [];
|
||||||
foreach ($row as $key => $value) {
|
foreach ($row as $key => $value) {
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'ressource__label':
|
case 'ressource__label':
|
||||||
case 'moyen_transport__label':
|
case 'moyen_transport__label':
|
||||||
|
|
||||||
foreach ($csperson[$key] as $item) {
|
foreach ($csperson[$key] as $item) {
|
||||||
$this->translationCompatKey($item, $key);
|
$this->translationCompatKey($item, $key);
|
||||||
if (($value === null)||(count($value) === 0)) {
|
if ((null === $value) || (0 === count($value))) {
|
||||||
$res[$item] = '';
|
$res[$item] = '';
|
||||||
} else {
|
} else {
|
||||||
foreach ($value as $v) {
|
foreach ($value as $v) {
|
||||||
@ -219,25 +224,22 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
if ($item === $v) {
|
if ($item === $v) {
|
||||||
$res[$item] = 'x';
|
$res[$item] = 'x';
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
$res[$item] = '';
|
|
||||||
}
|
}
|
||||||
|
$res[$item] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'situation_professionnelle__label':
|
case 'situation_professionnelle__label':
|
||||||
|
|
||||||
$f = false;
|
$f = false;
|
||||||
if ($value === 'en_activite') {
|
if ('en_activite' === $value) {
|
||||||
$f = true;
|
$f = true;
|
||||||
}
|
}
|
||||||
$res[$key] = $value;
|
$res[$key] = $value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'type_contrat__label':
|
case 'type_contrat__label':
|
||||||
|
|
||||||
if (! empty($value)) {
|
if (! empty($value)) {
|
||||||
$res[$key] = ($f) ? $value : null;
|
$res[$key] = ($f) ? $value : null;
|
||||||
} else {
|
} else {
|
||||||
@ -248,25 +250,25 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
case 'prescripteur__name':
|
case 'prescripteur__name':
|
||||||
case 'prescripteur__email':
|
case 'prescripteur__email':
|
||||||
case 'prescripteur__phone':
|
case 'prescripteur__phone':
|
||||||
|
$key = str_replace('__', '.', (string) $key);
|
||||||
|
|
||||||
$key = str_replace('__', '.', $key);
|
// no break
|
||||||
|
|
||||||
case 'neet_eligibility__label':
|
case 'neet_eligibility__label':
|
||||||
case 'accompagnement__label':
|
case 'accompagnement__label':
|
||||||
case 'permis_conduire__label':
|
case 'permis_conduire__label':
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$res[$key] = $value;
|
$res[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$results[] = $res;
|
$results[] = $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make item compatible with YAML messages ids
|
* Make item compatible with YAML messages ids
|
||||||
* for fields that are splitted in columns (with field key to replace)
|
* for fields that are splitted in columns (with field key to replace).
|
||||||
*
|
*
|
||||||
* AVANT
|
* AVANT
|
||||||
* key: projet_prof__volume_horaire__label
|
* key: projet_prof__volume_horaire__label
|
||||||
@ -274,7 +276,7 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
* APRES
|
* APRES
|
||||||
* item: projet_prof.volume_horaire.temps_plein
|
* item: projet_prof.volume_horaire.temps_plein
|
||||||
*
|
*
|
||||||
* @param string $item (&) passed by reference
|
* @param string $item (&) passed by reference
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*/
|
*/
|
||||||
private function translationCompatKey(&$item, $key)
|
private function translationCompatKey(&$item, $key)
|
||||||
@ -284,73 +286,64 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
$item = $key;
|
$item = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param FormBuilderInterface $builder
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
parent::buildForm($builder); // ajouter un '?' dans la query
|
parent::buildForm($builder); // ajouter un '?' dans la query
|
||||||
|
|
||||||
$choices = array_combine($this->getFields(), $this->getFields());
|
$choices = array_combine($this->getFields(), $this->getFields());
|
||||||
|
|
||||||
$builder->add('fields', ChoiceType::class, array(
|
$builder->add('fields', ChoiceType::class, [
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
'data' => $choices, //les checkbox cochés !!
|
'data' => $choices,
|
||||||
|
// les checkbox cochés !!
|
||||||
'choices_as_values' => true,
|
'choices_as_values' => true,
|
||||||
'label' => 'Fields to include in export',
|
'label' => 'Fields to include in export',
|
||||||
'choice_label' => function ($key) {
|
'choice_label' => fn ($key) => str_replace('__', '.', (string) $key),
|
||||||
return str_replace('__', '.', $key);
|
'choice_attr' => function ($val) {
|
||||||
},
|
if (str_starts_with($val, 'address_')) {
|
||||||
'choice_attr' => function($val) {
|
|
||||||
if (substr($val, 0, 8) === 'address_') {
|
|
||||||
return ['data-display-target' => 'address_date'];
|
return ['data-display-target' => 'address_date'];
|
||||||
} else {
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
},
|
},
|
||||||
'constraints' => [new Callback(array(
|
'constraints' => [new Callback(['callback' => function ($selected, ExecutionContextInterface $context) {
|
||||||
'callback' => function($selected, ExecutionContextInterface $context) {
|
if (0 === count($selected)) {
|
||||||
if (count($selected) === 0) {
|
$context->buildViolation('You must select at least one element')
|
||||||
$context->buildViolation('You must select at least one element')
|
->atPath('fields')
|
||||||
->atPath('fields')
|
->addViolation();
|
||||||
->addViolation();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
))]
|
}])],
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $requiredModifiers
|
|
||||||
* @param array $acl
|
|
||||||
* @param array $data
|
|
||||||
* @return \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder
|
* @return \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder
|
||||||
|
*
|
||||||
* @throws \Doctrine\DBAL\Exception\InvalidArgumentException
|
* @throws \Doctrine\DBAL\Exception\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
$centers = array_map(function($el) { return $el['center']; }, $acl);
|
$centers = array_map(fn ($el) => $el['center'], $acl);
|
||||||
|
|
||||||
// throw an error if any fields are present
|
// throw an error if any fields are present
|
||||||
if (!\array_key_exists('fields', $data)) {
|
if (!\array_key_exists('fields', $data)) {
|
||||||
throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields "
|
throw new \Doctrine\DBAL\Exception\InvalidArgumentException('any fields have been checked');
|
||||||
. "have been checked");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder()
|
return $this->entityManager->createQueryBuilder()
|
||||||
->from('ChillPersonBundle:Person', 'person')
|
->from('ChillPersonBundle:Person', 'person')
|
||||||
->join('person.center', 'center')
|
->join('person.center', 'center')
|
||||||
->andWhere('center IN (:authorized_centers)')
|
->andWhere('center IN (:authorized_centers)')
|
||||||
->setParameter('authorized_centers', $centers)
|
->setParameter('authorized_centers', $centers)
|
||||||
;
|
;
|
||||||
return $qb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder $qb
|
* @param \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder $qb
|
||||||
* @param mixed[] $data
|
* @param mixed[] $data
|
||||||
|
*
|
||||||
* @return mixed|mixed[]
|
* @return mixed|mixed[]
|
||||||
*/
|
*/
|
||||||
public function getResult($qb, $data)
|
public function getResult($qb, $data)
|
||||||
@ -358,14 +351,13 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
$qb->select('person.id');
|
$qb->select('person.id');
|
||||||
|
|
||||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||||
|
|
||||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||||
|
|
||||||
$rsm = new Query\ResultSetMapping();
|
$rsm = new Query\ResultSetMapping();
|
||||||
|
|
||||||
|
|
||||||
foreach ($this->allFields() as $name => $type) {
|
foreach ($this->allFields() as $name => $type) {
|
||||||
if ($data['fields'][$name]) {
|
if ($data['fields'][$name]) {
|
||||||
$rsm->addScalarResult(strtolower($name), $name, $type);
|
$rsm->addScalarResult(strtolower($name), $name, $type);
|
||||||
@ -375,13 +367,13 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||||
|
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
for ($i=1; $i<=8; $i++) {
|
for ($i = 1; $i <= 8; ++$i) {
|
||||||
$idx++;
|
++$idx;
|
||||||
$nq->setParameter($idx, $data['address_date'], 'date');
|
$nq->setParameter($idx, $data['address_date'], 'date');
|
||||||
}
|
}
|
||||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||||
$idx++;
|
++$idx;
|
||||||
$nq->setParameter($idx, $this->personIds[$i-1]);
|
$nq->setParameter($idx, $this->personIds[$i - 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->splitArrayToColumns(
|
return $this->splitArrayToColumns(
|
||||||
@ -390,9 +382,9 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $key The column key, as added in the query
|
* @param string $key The column key, as added in the query
|
||||||
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
||||||
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
||||||
*
|
*
|
||||||
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
||||||
*/
|
*/
|
||||||
@ -400,92 +392,89 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
|||||||
{
|
{
|
||||||
$csperson = self::CSPERSON;
|
$csperson = self::CSPERSON;
|
||||||
|
|
||||||
switch ($key) {
|
return match ($key) {
|
||||||
case 'countryOfBirth':
|
'countryOfBirth', 'situation_familiale', 'closingmotive', 'nationality' => function ($value) use ($key) {
|
||||||
case 'situation_familiale':
|
if ('_header' === $value) {
|
||||||
case 'closingmotive':
|
return $key;
|
||||||
case 'nationality':
|
}
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') { return $key; }
|
|
||||||
return $value['fr'];
|
|
||||||
};
|
|
||||||
case 'accompagnement__label':
|
|
||||||
case 'permis_conduire__label':
|
|
||||||
case 'type_contrat__label':
|
|
||||||
return function ($value) use ($key, $csperson) {
|
|
||||||
if ($value === '_header') {
|
|
||||||
return $this->translator->trans(
|
|
||||||
str_replace('__', '.', $key)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
$arr = [];
|
|
||||||
foreach ($value as $v) {
|
|
||||||
$this->translationCompatKey($v, $key);
|
|
||||||
$arr[] = $this->translator->trans($v);
|
|
||||||
}
|
|
||||||
return implode(', ', $arr);
|
|
||||||
};
|
|
||||||
case 'situation_professionnelle__label':
|
|
||||||
case 'neet_eligibility__label':
|
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') {
|
|
||||||
return $this->translator->trans(
|
|
||||||
str_replace('__', '.', $key)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
$this->translationCompatKey($value, $key);
|
|
||||||
return $this->translator->trans($value);
|
|
||||||
};
|
|
||||||
case 'birthdate':
|
|
||||||
case 'address_valid_from':
|
|
||||||
case 'recentopeningdate':
|
|
||||||
case 'recentclosingdate':
|
|
||||||
case 'findernieremploidate':
|
|
||||||
case 'cafinscriptiondate':
|
|
||||||
case 'contratiejdate':
|
|
||||||
case 'cerinscriptiondate':
|
|
||||||
case 'ppaeinscriptiondate':
|
|
||||||
case 'neetcommissiondate':
|
|
||||||
case 'datefindernieremploi':
|
|
||||||
/** @var \DateTime $value */
|
|
||||||
return function($value) use ($key) {
|
|
||||||
if ($value === '_header') { return $key; }
|
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
return $value->format('d-m-Y');
|
|
||||||
};
|
|
||||||
|
|
||||||
// remplace les getLabels de ListPerson
|
return $value['fr'];
|
||||||
// (pas possible d'utiliser parent qui appelle une méthode private pour les customfields)
|
},
|
||||||
case 'gender' :
|
'accompagnement__label', 'permis_conduire__label', 'type_contrat__label' => function ($value) use ($key) {
|
||||||
return function ($value) {
|
if ('_header' === $value) {
|
||||||
if ($value === '_header') { return 'gender'; }
|
return $this->translator->trans(
|
||||||
return $this->translator->trans($value);
|
str_replace('__', '.', $key)
|
||||||
};
|
);
|
||||||
case 'address_country_name':
|
}
|
||||||
return function ($value) use ($key) {
|
if (empty($value)) {
|
||||||
if ($value === '_header') { return \strtolower($key); }
|
return '';
|
||||||
if ($value === null) { return ''; }
|
}
|
||||||
return $this->translatableStringHelper->localize(json_decode($value, true));
|
$arr = [];
|
||||||
};
|
foreach ($value as $v) {
|
||||||
case 'address_isnoaddress':
|
$this->translationCompatKey($v, $key);
|
||||||
return parent::getLabels($key, $values, $data);
|
$arr[] = $this->translator->trans($v);
|
||||||
default:
|
}
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') {
|
return implode(', ', $arr);
|
||||||
return $key;
|
},
|
||||||
}
|
'situation_professionnelle__label', 'neet_eligibility__label' => function ($value) use ($key) {
|
||||||
if (empty($value)) { return ''; }
|
if ('_header' === $value) {
|
||||||
return $value;
|
return $this->translator->trans(
|
||||||
};
|
str_replace('__', '.', $key)
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
$this->translationCompatKey($value, $key);
|
||||||
|
|
||||||
|
return $this->translator->trans($value);
|
||||||
|
},
|
||||||
|
'birthdate', 'address_valid_from', 'recentopeningdate', 'recentclosingdate', 'findernieremploidate', 'cafinscriptiondate', 'contratiejdate', 'cerinscriptiondate', 'ppaeinscriptiondate', 'neetcommissiondate', 'datefindernieremploi' => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value->format('d-m-Y');
|
||||||
|
},
|
||||||
|
'gender' => function ($value) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'gender';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->translator->trans($value);
|
||||||
|
},
|
||||||
|
'address_country_name' => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return \strtolower($key);
|
||||||
|
}
|
||||||
|
if (null === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->translatableStringHelper->localize(json_decode($value, true));
|
||||||
|
},
|
||||||
|
'address_isnoaddress' => parent::getLabels($key, $values, $data),
|
||||||
|
default => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native Query SQL
|
* Native Query SQL.
|
||||||
*/
|
*/
|
||||||
const QUERY = <<<SQL
|
public const QUERY = <<<'SQL'
|
||||||
|
|
||||||
WITH accompagning AS (
|
WITH accompagning AS (
|
||||||
|
|
||||||
@ -650,4 +639,3 @@ ORDER BY p.id ASC
|
|||||||
|
|
||||||
SQL;
|
SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,21 @@
|
|||||||
<?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\ChillJobBundle\Export;
|
namespace Chill\ChillJobBundle\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\ChillJobBundle\Entity\CV;
|
|
||||||
use Chill\ChillJobBundle\Security\Authorization\ExportsVoter;
|
use Chill\ChillJobBundle\Security\Authorization\ExportsVoter;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
@ -18,18 +27,16 @@ use Symfony\Component\Validator\Constraints\Callback;
|
|||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ListCV
|
* Class ListCV.
|
||||||
*
|
*
|
||||||
* @package Chill\ChillJobBundle\Export
|
|
||||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||||
*/
|
*/
|
||||||
class ListCV implements ListInterface, ExportElementValidatedInterface
|
class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const FIELDS = [
|
public const FIELDS = [
|
||||||
'id' => 'integer',
|
'id' => 'integer',
|
||||||
'firstname' => 'string',
|
'firstname' => 'string',
|
||||||
'lastname' => 'string',
|
'lastname' => 'string',
|
||||||
@ -52,8 +59,6 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ListAcquisition constructor.
|
* ListAcquisition constructor.
|
||||||
*
|
|
||||||
* @param EntityManagerInterface $em
|
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
@ -65,24 +70,21 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
* violation on the data.
|
* violation on the data.
|
||||||
*
|
*
|
||||||
* @param mixed $data the data, as returned by the user
|
* @param mixed $data the data, as returned by the user
|
||||||
* @param ExecutionContextInterface $context
|
|
||||||
*/
|
*/
|
||||||
public function validateForm($data, ExecutionContextInterface $context) {}
|
public function validateForm($data, ExecutionContextInterface $context) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a title, which will be used in UI (and translated)
|
* get a title, which will be used in UI (and translated).
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return "Liste des CVs par personne";
|
return 'Liste des CVs par personne';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a form to collect data from the user.
|
* Add a form to collect data from the user.
|
||||||
*
|
|
||||||
* @param FormBuilderInterface $builder
|
|
||||||
*/
|
*/
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
@ -98,34 +100,34 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
'attr' => ['class' => ''],
|
'attr' => ['class' => ''],
|
||||||
'constraints' => [new Callback([
|
'constraints' => [new Callback([
|
||||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||||
if (count($selected) === 0) {
|
if (0 === count($selected)) {
|
||||||
$context
|
$context
|
||||||
->buildViolation('You must select at least one element')
|
->buildViolation('You must select at least one element')
|
||||||
->atPath('fields')
|
->atPath('fields')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
])]
|
])],
|
||||||
])
|
])
|
||||||
->add('reportdate_min', ChillDateType::class, [
|
->add('reportdate_min', ChillDateType::class, [
|
||||||
'label' => 'Date du rapport après le',
|
'label' => 'Date du rapport après le',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label_attr' => [
|
'label_attr' => [
|
||||||
'class' => 'reportdate_range'
|
'class' => 'reportdate_range',
|
||||||
],
|
],
|
||||||
'attr' => [
|
'attr' => [
|
||||||
'class' => 'reportdate_range'
|
'class' => 'reportdate_range',
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->add('reportdate_max', ChillDateType::class, [
|
->add('reportdate_max', ChillDateType::class, [
|
||||||
'label' => 'Date du rapport avant le',
|
'label' => 'Date du rapport avant le',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label_attr' => [
|
'label_attr' => [
|
||||||
'class' => 'report_date_range'
|
'class' => 'report_date_range',
|
||||||
],
|
],
|
||||||
'attr' => [
|
'attr' => [
|
||||||
'class' => 'report_date_range'
|
'class' => 'report_date_range',
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@ -151,7 +153,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return "Crée une liste des CVs en fonction de différents paramètres.";
|
return 'Crée une liste des CVs en fonction de différents paramètres.';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,12 +166,12 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
*
|
*
|
||||||
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
||||||
*
|
*
|
||||||
* @param array $requiredModifiers
|
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
||||||
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
|
||||||
* @param array $data the data from the form, if any
|
* @param array $data the data from the form, if any
|
||||||
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute.
|
*
|
||||||
|
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute
|
||||||
*/
|
*/
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
return $this->entityManager->createQueryBuilder()
|
return $this->entityManager->createQueryBuilder()
|
||||||
->from('ChillPersonBundle:Person', 'person');
|
->from('ChillPersonBundle:Person', 'person');
|
||||||
@ -184,14 +186,13 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [ 'cv', 'person' ];
|
return ['cv', 'person'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the required Role to execute the Export.
|
* Return the required Role to execute the Export.
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\Security\Core\Role\Role
|
* @return Role
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function requiredRole()
|
public function requiredRole()
|
||||||
{
|
{
|
||||||
@ -205,17 +206,18 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [ FormatterInterface::TYPE_LIST ];
|
return [FormatterInterface::TYPE_LIST];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* give the list of keys the current export added to the queryBuilder in
|
* give the list of keys the current export added to the queryBuilder in
|
||||||
* self::initiateQuery
|
* self::initiateQuery.
|
||||||
*
|
*
|
||||||
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
||||||
* this function will return `array('count_id')`.
|
* this function will return `array('count_id')`.
|
||||||
*
|
*
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
@ -224,7 +226,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array FIELDS keys only
|
* Return array FIELDS keys only.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -237,7 +239,8 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
* Return the results of the query builder.
|
* Return the results of the query builder.
|
||||||
*
|
*
|
||||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return mixed[] an array of results
|
* @return mixed[] an array of results
|
||||||
*/
|
*/
|
||||||
public function getResult($qb, $data)
|
public function getResult($qb, $data)
|
||||||
@ -245,8 +248,8 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
$qb->select('person.id');
|
$qb->select('person.id');
|
||||||
|
|
||||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||||
|
|
||||||
$rsm = new Query\ResultSetMapping();
|
$rsm = new Query\ResultSetMapping();
|
||||||
@ -260,12 +263,12 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||||
|
|
||||||
$idx = 1;
|
$idx = 1;
|
||||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||||
$idx++;
|
++$idx;
|
||||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||||
}
|
}
|
||||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||||
|
|
||||||
return $nq->getResult();
|
return $nq->getResult();
|
||||||
}
|
}
|
||||||
@ -309,56 +312,57 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
|||||||
* which do not need to be translated, or value already translated in
|
* which do not need to be translated, or value already translated in
|
||||||
* database. But the header must be, in every case, translated.
|
* database. But the header must be, in every case, translated.
|
||||||
*
|
*
|
||||||
*
|
* @param string $key The column key, as added in the query
|
||||||
* @param string $key The column key, as added in the query
|
|
||||||
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
||||||
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
||||||
|
*
|
||||||
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
||||||
*/
|
*/
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
|
return match ($key) {
|
||||||
|
'birthdate' => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
switch ($key) {
|
return $value->format('d-m-Y');
|
||||||
case 'birthdate':
|
},
|
||||||
/** @var \DateTime $value */
|
'countryofbirth' => function ($value) use ($key) {
|
||||||
return function($value) use ($key) {
|
if ('_header' === $value) {
|
||||||
if ($value === '_header') { return $key; }
|
return $key;
|
||||||
if (empty($value)) { return ''; }
|
}
|
||||||
return $value->format('d-m-Y');
|
|
||||||
};
|
return $value['fr'];
|
||||||
case 'countryofbirth':
|
},
|
||||||
return function ($value) use ($key) {
|
'gender' => function ($value) use ($key) {
|
||||||
if ($value === '_header') {
|
$gend_array = ['man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé'];
|
||||||
return $key;
|
if ('_header' === $value) {
|
||||||
}
|
return $key;
|
||||||
return $value['fr'];
|
}
|
||||||
};
|
if (empty($value)) {
|
||||||
case 'gender':
|
return '';
|
||||||
return function ($value) use ($key) {
|
}
|
||||||
$gend_array = [ 'man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé' ];
|
|
||||||
if ($value === '_header') { return $key; }
|
return $gend_array[$value];
|
||||||
if (empty($value)) { return ''; }
|
},
|
||||||
return $gend_array[$value];
|
default => function ($value) use ($key) {
|
||||||
};
|
if ('_header' === $value) {
|
||||||
case 'id':
|
return $key;
|
||||||
case 'firstname':
|
}
|
||||||
case 'lastname':
|
|
||||||
case 'placeofbirth':
|
return $value;
|
||||||
case 'formationlevel':
|
},
|
||||||
default:
|
};
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') {
|
|
||||||
return $key;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native Query SQL
|
* Native Query SQL.
|
||||||
*/
|
*/
|
||||||
const QUERY = <<<SQL
|
public const QUERY = <<<'SQL'
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
p.id as id,
|
p.id as id,
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Export;
|
namespace Chill\ChillJobBundle\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
@ -19,18 +28,16 @@ use Symfony\Component\Validator\Constraints\Callback;
|
|||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ListFrein
|
* Class ListFrein.
|
||||||
*
|
*
|
||||||
* @package Chill\ChillJobBundle\Export
|
|
||||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||||
*/
|
*/
|
||||||
class ListFrein implements ListInterface, ExportElementValidatedInterface
|
class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const FREINS = [
|
public const FREINS = [
|
||||||
'freinsperso' => Frein::FREINS_PERSO,
|
'freinsperso' => Frein::FREINS_PERSO,
|
||||||
'freinsemploi' => Frein::FREINS_EMPLOI,
|
'freinsemploi' => Frein::FREINS_EMPLOI,
|
||||||
];
|
];
|
||||||
@ -38,7 +45,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const FIELDS = [
|
public const FIELDS = [
|
||||||
'id' => 'integer',
|
'id' => 'integer',
|
||||||
'firstname' => 'string',
|
'firstname' => 'string',
|
||||||
'lastname' => 'string',
|
'lastname' => 'string',
|
||||||
@ -58,8 +65,6 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
protected $personIds = [];
|
protected $personIds = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var EntityManagerInterface
|
* @var EntityManagerInterface
|
||||||
*/
|
*/
|
||||||
@ -67,8 +72,6 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ListAcquisition constructor.
|
* ListAcquisition constructor.
|
||||||
*
|
|
||||||
* @param EntityManagerInterface $em
|
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
@ -80,24 +83,21 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
* violation on the data.
|
* violation on the data.
|
||||||
*
|
*
|
||||||
* @param mixed $data the data, as returned by the user
|
* @param mixed $data the data, as returned by the user
|
||||||
* @param ExecutionContextInterface $context
|
|
||||||
*/
|
*/
|
||||||
public function validateForm($data, ExecutionContextInterface $context) {}
|
public function validateForm($data, ExecutionContextInterface $context) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a title, which will be used in UI (and translated)
|
* get a title, which will be used in UI (and translated).
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return "Liste des freins identifiés par personne";
|
return 'Liste des freins identifiés par personne';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a form to collect data from the user.
|
* Add a form to collect data from the user.
|
||||||
*
|
|
||||||
* @param FormBuilderInterface $builder
|
|
||||||
*/
|
*/
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
'attr' => ['class' => ''],
|
'attr' => ['class' => ''],
|
||||||
'constraints' => [new Callback([
|
'constraints' => [new Callback([
|
||||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||||
if (count($selected) === 0) {
|
if (0 === count($selected)) {
|
||||||
$context
|
$context
|
||||||
->buildViolation('You must select at least one element')
|
->buildViolation('You must select at least one element')
|
||||||
->atPath('fields')
|
->atPath('fields')
|
||||||
@ -166,7 +166,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return "Crée une liste des personnes et de leurs freins identifiés en fonction de différents paramètres.";
|
return 'Crée une liste des personnes et de leurs freins identifiés en fonction de différents paramètres.';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -179,15 +179,15 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*
|
*
|
||||||
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
||||||
*
|
*
|
||||||
* @param array $requiredModifiers
|
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
||||||
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
|
||||||
* @param array $data the data from the form, if any
|
* @param array $data the data from the form, if any
|
||||||
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute.
|
*
|
||||||
|
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute
|
||||||
*/
|
*/
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
return $this->entityManager->createQueryBuilder()
|
return $this->entityManager->createQueryBuilder()
|
||||||
->from('ChillPersonBundle:Person', 'person');
|
->from('ChillPersonBundle:Person', 'person');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -199,14 +199,13 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [ 'frein', 'person' ];
|
return ['frein', 'person'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the required Role to execute the Export.
|
* Return the required Role to execute the Export.
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\Security\Core\Role\Role
|
* @return Role
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function requiredRole()
|
public function requiredRole()
|
||||||
{
|
{
|
||||||
@ -220,11 +219,11 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [ FormatterInterface::TYPE_LIST ];
|
return [FormatterInterface::TYPE_LIST];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array FIELDS keys only
|
* Return array FIELDS keys only.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -235,12 +234,13 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* give the list of keys the current export added to the queryBuilder in
|
* give the list of keys the current export added to the queryBuilder in
|
||||||
* self::initiateQuery
|
* self::initiateQuery.
|
||||||
*
|
*
|
||||||
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
||||||
* this function will return `array('count_id')`.
|
* this function will return `array('count_id')`.
|
||||||
*
|
*
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
@ -248,11 +248,9 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
$freins = self::FREINS;
|
$freins = self::FREINS;
|
||||||
$fields = [];
|
$fields = [];
|
||||||
foreach ($data['fields'] as $key) {
|
foreach ($data['fields'] as $key) {
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'freinsperso':
|
case 'freinsperso':
|
||||||
case 'freinsemploi':
|
case 'freinsemploi':
|
||||||
|
|
||||||
foreach ($freins[$key] as $item) {
|
foreach ($freins[$key] as $item) {
|
||||||
$this->translationCompatKey($item, $key);
|
$this->translationCompatKey($item, $key);
|
||||||
$fields[] = $item;
|
$fields[] = $item;
|
||||||
@ -263,27 +261,29 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
$fields[] = $key;
|
$fields[] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make key compatible with YAML messages ids
|
* Make key compatible with YAML messages ids
|
||||||
* for fields that are splitted in columns
|
* for fields that are splitted in columns.
|
||||||
*
|
*
|
||||||
* @param string $item (&) passed by reference
|
* @param string $item (&) passed by reference
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*/
|
*/
|
||||||
private function translationCompatKey(&$item, $key)
|
private function translationCompatKey(&$item, $key)
|
||||||
{
|
{
|
||||||
$prefix = substr_replace($key, 'freins_', 0, 6);
|
$prefix = substr_replace($key, 'freins_', 0, 6);
|
||||||
$item = $prefix .'.'. $item;
|
$item = $prefix.'.'.$item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Some fields values are arrays that have to be splitted in columns.
|
* Some fields values are arrays that have to be splitted in columns.
|
||||||
* This function split theses fields
|
* This function split theses fields.
|
||||||
*
|
*
|
||||||
* @param array $rows
|
* @param array $rows
|
||||||
|
*
|
||||||
* @return array|\Closure
|
* @return array|\Closure
|
||||||
*/
|
*/
|
||||||
private function splitArrayToColumns($rows)
|
private function splitArrayToColumns($rows)
|
||||||
@ -295,34 +295,27 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
*/
|
*/
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $key
|
* @var string $key
|
||||||
* @var mixed $value
|
|
||||||
*/
|
*/
|
||||||
$res = [];
|
$res = [];
|
||||||
foreach ($row as $key => $value) {
|
foreach ($row as $key => $value) {
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'freinsperso':
|
case 'freinsperso':
|
||||||
case 'freinsemploi':
|
case 'freinsemploi':
|
||||||
|
|
||||||
foreach ($freins[$key] as $item) {
|
foreach ($freins[$key] as $item) {
|
||||||
$this->translationCompatKey($item, $key);
|
$this->translationCompatKey($item, $key);
|
||||||
|
|
||||||
if (count($value) === 0) {
|
if (0 === count($value)) {
|
||||||
$res[$item] = '';
|
$res[$item] = '';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
foreach ($value as $v) {
|
foreach ($value as $v) {
|
||||||
|
|
||||||
$this->translationCompatKey($v, $key);
|
$this->translationCompatKey($v, $key);
|
||||||
if ($item === $v) {
|
if ($item === $v) {
|
||||||
$res[$item] = 'x';
|
$res[$item] = 'x';
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
$res[$item] = '';
|
|
||||||
}
|
}
|
||||||
|
$res[$item] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,6 +327,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
}
|
}
|
||||||
$results[] = $res;
|
$results[] = $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +335,8 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
* Return the results of the query builder.
|
* Return the results of the query builder.
|
||||||
*
|
*
|
||||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return mixed[]|\closure an array of results
|
* @return mixed[]|\closure an array of results
|
||||||
*/
|
*/
|
||||||
public function getResult($qb, $data)
|
public function getResult($qb, $data)
|
||||||
@ -349,8 +344,8 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
$qb->select('person.id');
|
$qb->select('person.id');
|
||||||
|
|
||||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||||
|
|
||||||
$rsm = new Query\ResultSetMapping();
|
$rsm = new Query\ResultSetMapping();
|
||||||
@ -364,12 +359,12 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||||
|
|
||||||
$idx = 1;
|
$idx = 1;
|
||||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||||
$idx++;
|
++$idx;
|
||||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||||
}
|
}
|
||||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||||
|
|
||||||
return $this->splitArrayToColumns(
|
return $this->splitArrayToColumns(
|
||||||
$nq->getResult()
|
$nq->getResult()
|
||||||
@ -415,60 +410,60 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
|||||||
* which do not need to be translated, or value already translated in
|
* which do not need to be translated, or value already translated in
|
||||||
* database. But the header must be, in every case, translated.
|
* database. But the header must be, in every case, translated.
|
||||||
*
|
*
|
||||||
*
|
* @param string $key The column key, as added in the query
|
||||||
* @param string $key The column key, as added in the query
|
|
||||||
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
||||||
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
||||||
|
*
|
||||||
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
||||||
*/
|
*/
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
|
return match ($key) {
|
||||||
|
'reportdate', 'birthdate' => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
switch ($key) {
|
return $value->format('d-m-Y');
|
||||||
case 'reportdate':
|
},
|
||||||
case 'birthdate':
|
'countryofbirth' => function ($value) use ($key) {
|
||||||
/** @var \DateTime $value */
|
if ('_header' === $value) {
|
||||||
return function($value) use ($key) {
|
return $key;
|
||||||
if ($value === '_header') { return $key; }
|
}
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
return $value->format('d-m-Y');
|
return $value['fr'];
|
||||||
};
|
},
|
||||||
case 'countryofbirth':
|
'gender' => function ($value) use ($key) {
|
||||||
return function ($value) use ($key) {
|
$gend_array = ['man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé'];
|
||||||
if ($value === '_header') {
|
if ('_header' === $value) {
|
||||||
return $key;
|
return $key;
|
||||||
}
|
}
|
||||||
return $value['fr'];
|
if (empty($value)) {
|
||||||
};
|
return '';
|
||||||
case 'gender':
|
}
|
||||||
return function ($value) use ($key) {
|
|
||||||
$gend_array = [ 'man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé' ];
|
return $gend_array[$value];
|
||||||
if ($value === '_header') { return $key; }
|
},
|
||||||
if (empty($value)) { return ''; }
|
default => function ($value) use ($key) {
|
||||||
return $gend_array[$value];
|
if ('_header' === $value) {
|
||||||
};
|
return $key;
|
||||||
case 'id':
|
}
|
||||||
case 'firstname':
|
if (empty($value)) {
|
||||||
case 'lastname':
|
return '';
|
||||||
case 'placeofbirth':
|
}
|
||||||
case 'notesperso':
|
|
||||||
case 'notesemploi':
|
return $value;
|
||||||
default:
|
},
|
||||||
return function ($value) use ($key) {
|
};
|
||||||
if ($value === '_header') {
|
|
||||||
return $key;
|
|
||||||
}
|
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
return $value;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native Query SQL
|
* Native Query SQL.
|
||||||
*/
|
*/
|
||||||
const QUERY = <<<SQL
|
public const QUERY = <<<'SQL'
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
p.id as id,
|
p.id as id,
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Export;
|
namespace Chill\ChillJobBundle\Export;
|
||||||
|
|
||||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||||
@ -19,26 +28,24 @@ use Symfony\Component\Validator\Constraints\Callback;
|
|||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ListProjetProfessionnel
|
* Class ListProjetProfessionnel.
|
||||||
*
|
*
|
||||||
* @package Chill\ChillJobBundle\Export
|
|
||||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||||
*/
|
*/
|
||||||
class ListProjetProfessionnel implements ListInterface, ExportElementValidatedInterface
|
class ListProjetProfessionnel implements ListInterface, ExportElementValidatedInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const PPROF = [
|
public const PPROF = [
|
||||||
'projet_prof__type_contrat__label' => ProjetProfessionnel::TYPE_CONTRAT,
|
'projet_prof__type_contrat__label' => ProjetProfessionnel::TYPE_CONTRAT,
|
||||||
'projet_prof__volume_horaire__label' => ProjetProfessionnel::VOLUME_HORAIRES
|
'projet_prof__volume_horaire__label' => ProjetProfessionnel::VOLUME_HORAIRES,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
const FIELDS = [
|
public const FIELDS = [
|
||||||
'id' => 'integer',
|
'id' => 'integer',
|
||||||
'firstname' => 'string',
|
'firstname' => 'string',
|
||||||
'lastname' => 'string',
|
'lastname' => 'string',
|
||||||
@ -70,8 +77,6 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* ListAcquisition constructor.
|
* ListAcquisition constructor.
|
||||||
*
|
|
||||||
* @param EntityManagerInterface $em
|
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityManagerInterface $em)
|
public function __construct(EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
@ -83,24 +88,21 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
* violation on the data.
|
* violation on the data.
|
||||||
*
|
*
|
||||||
* @param mixed $data the data, as returned by the user
|
* @param mixed $data the data, as returned by the user
|
||||||
* @param ExecutionContextInterface $context
|
|
||||||
*/
|
*/
|
||||||
public function validateForm($data, ExecutionContextInterface $context) {}
|
public function validateForm($data, ExecutionContextInterface $context) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a title, which will be used in UI (and translated)
|
* get a title, which will be used in UI (and translated).
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
{
|
{
|
||||||
return "Liste des projets professionnels par personne";
|
return 'Liste des projets professionnels par personne';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a form to collect data from the user.
|
* Add a form to collect data from the user.
|
||||||
*
|
|
||||||
* @param FormBuilderInterface $builder
|
|
||||||
*/
|
*/
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
@ -110,16 +112,14 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices_as_values' => true,
|
'choices_as_values' => true,
|
||||||
'label' => 'Fields to include in export',
|
'label' => 'Fields to include in export',
|
||||||
'choice_label' => function ($key) {
|
'choice_label' => fn ($key) => str_replace('__', '.', (string) $key),
|
||||||
return str_replace('__', '.', $key);
|
|
||||||
},
|
|
||||||
'choices' => array_combine($this->getFields(), $this->getFields()),
|
'choices' => array_combine($this->getFields(), $this->getFields()),
|
||||||
'data' => array_combine($this->getFields(), $this->getFields()),
|
'data' => array_combine($this->getFields(), $this->getFields()),
|
||||||
'choice_attr' => [],
|
'choice_attr' => [],
|
||||||
'attr' => ['class' => ''],
|
'attr' => ['class' => ''],
|
||||||
'constraints' => [new Callback([
|
'constraints' => [new Callback([
|
||||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||||
if (count($selected) === 0) {
|
if (0 === count($selected)) {
|
||||||
$context
|
$context
|
||||||
->buildViolation('You must select at least one element')
|
->buildViolation('You must select at least one element')
|
||||||
->atPath('fields')
|
->atPath('fields')
|
||||||
@ -172,7 +172,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
*/
|
*/
|
||||||
public function getDescription()
|
public function getDescription()
|
||||||
{
|
{
|
||||||
return "Crée une liste des personnes et de leur projet professionnel en fonction de différents paramètres.";
|
return 'Crée une liste des personnes et de leur projet professionnel en fonction de différents paramètres.';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,12 +185,12 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
*
|
*
|
||||||
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
* The returned object should be an instance of QueryBuilder or NativeQuery.
|
||||||
*
|
*
|
||||||
* @param array $requiredModifiers
|
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
||||||
* @param array $acl an array where each row has a `center` key containing the Chill\MainBundle\Entity\Center, and `circles` keys containing the reachable circles. Example: `array( array('center' => $centerA, 'circles' => array($circleA, $circleB) ) )`
|
|
||||||
* @param array $data the data from the form, if any
|
* @param array $data the data from the form, if any
|
||||||
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute.
|
*
|
||||||
|
* @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute
|
||||||
*/
|
*/
|
||||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
|
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||||
{
|
{
|
||||||
return $this->entityManager->createQueryBuilder()
|
return $this->entityManager->createQueryBuilder()
|
||||||
->from('ChillPersonBundle:Person', 'person');
|
->from('ChillPersonBundle:Person', 'person');
|
||||||
@ -205,14 +205,13 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
*/
|
*/
|
||||||
public function supportsModifiers()
|
public function supportsModifiers()
|
||||||
{
|
{
|
||||||
return [ 'projetprofessionnel', 'person' ];
|
return ['projetprofessionnel', 'person'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the required Role to execute the Export.
|
* Return the required Role to execute the Export.
|
||||||
*
|
*
|
||||||
* @return \Symfony\Component\Security\Core\Role\Role
|
* @return Role
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function requiredRole()
|
public function requiredRole()
|
||||||
{
|
{
|
||||||
@ -226,11 +225,11 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
*/
|
*/
|
||||||
public function getAllowedFormattersTypes()
|
public function getAllowedFormattersTypes()
|
||||||
{
|
{
|
||||||
return [ FormatterInterface::TYPE_LIST ];
|
return [FormatterInterface::TYPE_LIST];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return array FIELDS keys only
|
* Return array FIELDS keys only.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
@ -241,12 +240,13 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* give the list of keys the current export added to the queryBuilder in
|
* give the list of keys the current export added to the queryBuilder in
|
||||||
* self::initiateQuery
|
* self::initiateQuery.
|
||||||
*
|
*
|
||||||
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
||||||
* this function will return `array('count_id')`.
|
* this function will return `array('count_id')`.
|
||||||
*
|
*
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getQueryKeys($data)
|
public function getQueryKeys($data)
|
||||||
@ -255,37 +255,37 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
|
|
||||||
$fields = [];
|
$fields = [];
|
||||||
foreach ($data['fields'] as $key) {
|
foreach ($data['fields'] as $key) {
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'projet_prof__type_contrat__label':
|
case 'projet_prof__type_contrat__label':
|
||||||
case 'projet_prof__volume_horaire__label':
|
case 'projet_prof__volume_horaire__label':
|
||||||
|
|
||||||
foreach ($projet_professionnel[$key] as $item) {
|
foreach ($projet_professionnel[$key] as $item) {
|
||||||
$this->translationCompatKey($item, $key);
|
$this->translationCompatKey($item, $key);
|
||||||
$fields[] = $item;
|
$fields[] = $item;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "projet_prof__souhait__code":
|
case 'projet_prof__souhait__code':
|
||||||
case "projet_prof__type_contrat__note":
|
case 'projet_prof__type_contrat__note':
|
||||||
case "projet_prof__volume_horaire__note":
|
case 'projet_prof__volume_horaire__note':
|
||||||
case "projet_prof__idee":
|
case 'projet_prof__idee':
|
||||||
case "projet_prof__encoursdeconstruction":
|
case 'projet_prof__encoursdeconstruction':
|
||||||
case "projet_prof__valide__note":
|
case 'projet_prof__valide__note':
|
||||||
case "projet_prof__valide__code":
|
case 'projet_prof__valide__code':
|
||||||
case "projet_prof__note":
|
case 'projet_prof__note':
|
||||||
$key = str_replace('__', '.', $key);
|
$key = str_replace('__', '.', (string) $key);
|
||||||
|
|
||||||
|
// no break
|
||||||
default:
|
default:
|
||||||
$fields[] = $key;
|
$fields[] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make item compatible with YAML messages ids
|
* Make item compatible with YAML messages ids
|
||||||
* for fields that are splitted in columns (with field key to replace)
|
* for fields that are splitted in columns (with field key to replace).
|
||||||
*
|
*
|
||||||
* AVANT
|
* AVANT
|
||||||
* key: projet_prof__volume_horaire__label
|
* key: projet_prof__volume_horaire__label
|
||||||
@ -293,7 +293,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
* APRES
|
* APRES
|
||||||
* item: projet_prof.volume_horaire.temps_plein
|
* item: projet_prof.volume_horaire.temps_plein
|
||||||
*
|
*
|
||||||
* @param string $item (&) passed by reference
|
* @param string $item (&) passed by reference
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*/
|
*/
|
||||||
private function translationCompatKey(&$item, $key)
|
private function translationCompatKey(&$item, $key)
|
||||||
@ -305,9 +305,10 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Some fields values are arrays that have to be splitted in columns.
|
* Some fields values are arrays that have to be splitted in columns.
|
||||||
* This function split theses fields
|
* This function split theses fields.
|
||||||
*
|
*
|
||||||
* @param array $rows
|
* @param array $rows
|
||||||
|
*
|
||||||
* @return array|\Closure
|
* @return array|\Closure
|
||||||
*/
|
*/
|
||||||
private function splitArrayToColumns($rows)
|
private function splitArrayToColumns($rows)
|
||||||
@ -319,24 +320,19 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
*/
|
*/
|
||||||
$results = [];
|
$results = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string $key
|
* @var string $key
|
||||||
* @var mixed $value
|
|
||||||
*/
|
*/
|
||||||
$res = [];
|
$res = [];
|
||||||
foreach ($row as $key => $value) {
|
foreach ($row as $key => $value) {
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'projet_prof__type_contrat__label':
|
case 'projet_prof__type_contrat__label':
|
||||||
case 'projet_prof__volume_horaire__label':
|
case 'projet_prof__volume_horaire__label':
|
||||||
|
|
||||||
foreach ($projet_professionnel[$key] as $item) {
|
foreach ($projet_professionnel[$key] as $item) {
|
||||||
$this->translationCompatKey($item, $key);
|
$this->translationCompatKey($item, $key);
|
||||||
|
|
||||||
if (count($value) === 0) {
|
if (0 === count($value)) {
|
||||||
$res[$item] = '';
|
$res[$item] = '';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
foreach ($value as $v) {
|
foreach ($value as $v) {
|
||||||
$this->translationCompatKey($v, $key);
|
$this->translationCompatKey($v, $key);
|
||||||
@ -344,30 +340,31 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
if ($item === $v) {
|
if ($item === $v) {
|
||||||
$res[$item] = 'x';
|
$res[$item] = 'x';
|
||||||
break;
|
break;
|
||||||
} else {
|
|
||||||
$res[$item] = '';
|
|
||||||
}
|
}
|
||||||
|
$res[$item] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "projet_prof__souhait__code":
|
case 'projet_prof__souhait__code':
|
||||||
case "projet_prof__type_contrat__note":
|
case 'projet_prof__type_contrat__note':
|
||||||
case "projet_prof__volume_horaire__note":
|
case 'projet_prof__volume_horaire__note':
|
||||||
case "projet_prof__idee":
|
case 'projet_prof__idee':
|
||||||
case "projet_prof__encoursdeconstruction":
|
case 'projet_prof__encoursdeconstruction':
|
||||||
case "projet_prof__valide__note":
|
case 'projet_prof__valide__note':
|
||||||
case "projet_prof__valide__code":
|
case 'projet_prof__valide__code':
|
||||||
case "projet_prof__note":
|
case 'projet_prof__note':
|
||||||
$key = str_replace('__', '.', $key);
|
$key = str_replace('__', '.', (string) $key);
|
||||||
|
|
||||||
|
// no break
|
||||||
default:
|
default:
|
||||||
$res[$key] = $value;
|
$res[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$results[] = $res;
|
$results[] = $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,16 +372,17 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
* Return the results of the query builder.
|
* Return the results of the query builder.
|
||||||
*
|
*
|
||||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||||
|
*
|
||||||
* @return mixed[] an array of results
|
* @return mixed[] an array of results
|
||||||
*/
|
*/
|
||||||
public function getResult($qb, $data)
|
public function getResult($qb, $data)
|
||||||
{
|
{
|
||||||
$qb->select('person.id');
|
$qb->select('person.id');
|
||||||
|
|
||||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||||
|
|
||||||
$rsm = new Query\ResultSetMapping();
|
$rsm = new Query\ResultSetMapping();
|
||||||
@ -398,12 +396,12 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||||
|
|
||||||
$idx = 1;
|
$idx = 1;
|
||||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||||
$idx++;
|
++$idx;
|
||||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||||
}
|
}
|
||||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||||
|
|
||||||
return $this->splitArrayToColumns(
|
return $this->splitArrayToColumns(
|
||||||
$nq->getResult()
|
$nq->getResult()
|
||||||
@ -449,63 +447,70 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
|||||||
* which do not need to be translated, or value already translated in
|
* which do not need to be translated, or value already translated in
|
||||||
* database. But the header must be, in every case, translated.
|
* database. But the header must be, in every case, translated.
|
||||||
*
|
*
|
||||||
*
|
* @param string $key The column key, as added in the query
|
||||||
* @param string $key The column key, as added in the query
|
|
||||||
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
* @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR')
|
||||||
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
* @param mixed $data The data from the export's form (as defined in `buildForm`
|
||||||
|
*
|
||||||
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
* @return \Closure where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }`
|
||||||
*/
|
*/
|
||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
switch ($key) {
|
return match ($key) {
|
||||||
case 'birthdate':
|
'birthdate' => function ($value) use ($key) {
|
||||||
/** @var \DateTime $value */
|
if ('_header' === $value) {
|
||||||
return function($value) use ($key) {
|
return $key;
|
||||||
if ($value === '_header') { return $key; }
|
}
|
||||||
if (empty($value)) { return ''; }
|
if (empty($value)) {
|
||||||
return $value->format('d-m-Y');
|
return '';
|
||||||
};
|
}
|
||||||
case 'countryofbirth':
|
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') {
|
|
||||||
return $key;
|
|
||||||
}
|
|
||||||
return $value['fr'];
|
|
||||||
};
|
|
||||||
case 'projet_prof.valide.code':
|
|
||||||
case 'projet_prof.souhait.code':
|
|
||||||
return function ($value) use ($key) {
|
|
||||||
if ($value === '_header') { return $key; }
|
|
||||||
if ($value === '{NULL}') { return ''; }
|
|
||||||
return str_replace(['{','}'], '', $value);
|
|
||||||
};
|
|
||||||
case 'gender':
|
|
||||||
return function ($value) use ($key) {
|
|
||||||
$gend_array = [ 'man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé' ];
|
|
||||||
if ($value === '_header') { return $key; }
|
|
||||||
if (empty($value)) { return ''; }
|
|
||||||
return $gend_array[$value];
|
|
||||||
};
|
|
||||||
case 'id':
|
|
||||||
case 'firstname':
|
|
||||||
case 'lastname':
|
|
||||||
case 'placeofbirth':
|
|
||||||
|
|
||||||
default:
|
return $value->format('d-m-Y');
|
||||||
return function ($value) use ($key) {
|
},
|
||||||
if ($value === '_header') {
|
'countryofbirth' => function ($value) use ($key) {
|
||||||
return $key;
|
if ('_header' === $value) {
|
||||||
}
|
return $key;
|
||||||
if (empty($value)) { return ''; }
|
}
|
||||||
return $value;
|
|
||||||
};
|
return $value['fr'];
|
||||||
}
|
},
|
||||||
|
'projet_prof.valide.code', 'projet_prof.souhait.code' => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if ('{NULL}' === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return str_replace(['{', '}'], '', $value);
|
||||||
|
},
|
||||||
|
'gender' => function ($value) use ($key) {
|
||||||
|
$gend_array = ['man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé'];
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $gend_array[$value];
|
||||||
|
},
|
||||||
|
default => function ($value) use ($key) {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return $key;
|
||||||
|
}
|
||||||
|
if (empty($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $value;
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Native Query SQL
|
* Native Query SQL.
|
||||||
*/
|
*/
|
||||||
const QUERY = <<<SQL
|
public const QUERY = <<<'SQL'
|
||||||
|
|
||||||
WITH projet_professionnel AS (
|
WITH projet_professionnel AS (
|
||||||
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -11,13 +20,9 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyType;
|
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
||||||
|
|
||||||
class CSPersonDispositifsType extends AbstractType
|
class CSPersonDispositifsType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@ -27,104 +32,94 @@ class CSPersonDispositifsType extends AbstractType
|
|||||||
'label' => 'Accompagnement',
|
'label' => 'Accompagnement',
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choice_label' => function($k) { return 'accompagnement.'.$k; }
|
'choice_label' => fn ($k) => 'accompagnement.'.$k,
|
||||||
])
|
])
|
||||||
->add('accompagnementRQTHDate', ChillDateType::class, [
|
->add('accompagnementRQTHDate', ChillDateType::class, [
|
||||||
'label' => "Date d'accompagnement RQTH",
|
'label' => "Date d'accompagnement RQTH",
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
])
|
||||||
])
|
->add('accompagnementComment', TextareaType::class, [
|
||||||
->add('accompagnementComment', TextAreaType::class, [
|
'label' => 'Accompagnement autre: précisions',
|
||||||
'label' => "Accompagnement autre: précisions",
|
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
|
||||||
])
|
])
|
||||||
->add('poleEmploiId', TextType::class, [
|
->add('poleEmploiId', TextType::class, [
|
||||||
'label' => "Identifiant pôle emploi",
|
'label' => 'Identifiant pôle emploi',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('poleEmploiInscriptionDate', ChillDateType::class, [
|
->add('poleEmploiInscriptionDate', ChillDateType::class, [
|
||||||
'label' => "Date d'inscription Pôle emploi",
|
'label' => "Date d'inscription Pôle emploi",
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('cafId', TextType::class, [
|
->add('cafId', TextType::class, [
|
||||||
'label' => "Numéro allocataire CAF",
|
'label' => 'Numéro allocataire CAF',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('cafInscriptionDate', ChillDateType::class, [
|
->add('cafInscriptionDate', ChillDateType::class, [
|
||||||
'label' => "Date d'inscription à la CAF",
|
'label' => "Date d'inscription à la CAF",
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('cERInscriptionDate', ChillDateType::class, [
|
->add('cERInscriptionDate', ChillDateType::class, [
|
||||||
'label' => "Date CER",
|
'label' => 'Date CER',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('pPAEInscriptionDate', ChillDateType::class, [
|
->add('pPAEInscriptionDate', ChillDateType::class, [
|
||||||
'label' => "Date PPAE",
|
'label' => 'Date PPAE',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('nEETEligibilite', ChoiceType::class, [
|
->add('nEETEligibilite', ChoiceType::class, [
|
||||||
'label' => "Éligibilité NEET",
|
'label' => 'Éligibilité NEET',
|
||||||
'choices' => \array_combine(CSPerson::NEET_ELIGIBILITY, CSPerson::NEET_ELIGIBILITY),
|
'choices' => \array_combine(CSPerson::NEET_ELIGIBILITY, CSPerson::NEET_ELIGIBILITY),
|
||||||
'choice_label' => function($k) { return 'neet_eligibility.'.$k; },
|
'choice_label' => fn ($k) => 'neet_eligibility.'.$k,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('cERSignataire', TextType::class, [
|
->add('cERSignataire', TextType::class, [
|
||||||
'label' => "Signataire CER",
|
'label' => 'Signataire CER',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('pPAESignataire', TextType::class, [
|
->add('pPAESignataire', TextType::class, [
|
||||||
'label' => "Signataire PPAE",
|
'label' => 'Signataire PPAE',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('nEETCommissionDate', ChillDateType::class, [
|
->add('nEETCommissionDate', ChillDateType::class, [
|
||||||
'label' => "Date commission NEET",
|
'label' => 'Date commission NEET',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('fSEMaDemarcheCode', TextType::class, [
|
->add('fSEMaDemarcheCode', TextType::class, [
|
||||||
'label' => 'Code "Ma démarche FSE"',
|
'label' => 'Code "Ma démarche FSE"',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('prescripteur', PickThirdPartyType::class, [
|
->add('prescripteur', PickThirdPartyType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'types' => ['prescripteur'],
|
'types' => ['prescripteur'],
|
||||||
'label' => 'Prescripteur',
|
'label' => 'Prescripteur',
|
||||||
'center' => $options['center']
|
'center' => $options['center'],
|
||||||
])
|
])
|
||||||
->add('dispositifsNotes', TextareaType::class, [
|
->add('dispositifsNotes', TextareaType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Notes"
|
'label' => 'Notes',
|
||||||
])
|
])
|
||||||
->add('dateContratIEJ', ChillDateType::class, [
|
->add('dateContratIEJ', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => " Date du contrat d’engagement IEJ"
|
'label' => ' Date du contrat d’engagement IEJ',
|
||||||
])
|
])
|
||||||
->add('dateAvenantIEJ', ChillDateType::class, [
|
->add('dateAvenantIEJ', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => " Date de l'avenant IEJ"
|
'label' => " Date de l'avenant IEJ",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(['data_class' => CSPerson::class]);
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\CSPerson'
|
|
||||||
));
|
|
||||||
|
|
||||||
$resolver
|
$resolver
|
||||||
->setDefined('center')
|
->setDefined('center')
|
||||||
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class])
|
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_csperson';
|
return 'csconnectes_spbundle_csperson';
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -18,73 +27,69 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
|||||||
|
|
||||||
class CSPersonPersonalSituationType extends AbstractType
|
class CSPersonPersonalSituationType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
// quick and dirty way to handle marital status...
|
// quick and dirty way to handle marital status...
|
||||||
->add('personMaritalStatus', Select2MaritalStatusType::class, array(
|
->add('personMaritalStatus', Select2MaritalStatusType::class, ['required' => false, 'label' => 'État civil'])
|
||||||
'required' => false,
|
|
||||||
'label' => 'État civil'
|
|
||||||
))
|
|
||||||
->add('situationLogement', ChoiceType::class, [
|
->add('situationLogement', ChoiceType::class, [
|
||||||
'choices' => \array_combine(
|
'choices' => \array_combine(
|
||||||
CSPerson::SITUATIONS_LOGEMENTS,
|
CSPerson::SITUATIONS_LOGEMENTS,
|
||||||
CSPerson::SITUATIONS_LOGEMENTS),
|
CSPerson::SITUATIONS_LOGEMENTS
|
||||||
'choice_label' => function($k) { return 'situation_logement.'.$k; },
|
),
|
||||||
|
'choice_label' => fn ($k) => 'situation_logement.'.$k,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => 'Situation de logement',
|
'label' => 'Situation de logement',
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true
|
'expanded' => true,
|
||||||
])
|
])
|
||||||
->add('situationLogementPrecision', TextareaType::class, [
|
->add('situationLogementPrecision', TextareaType::class, [
|
||||||
'label' => 'Précisions',
|
'label' => 'Précisions',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('enfantACharge', IntegerType::class, [
|
->add('enfantACharge', IntegerType::class, [
|
||||||
'label' => 'Enfants à charge',
|
'label' => 'Enfants à charge',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('niveauMaitriseLangue', ChoiceType::class, [
|
->add('niveauMaitriseLangue', ChoiceType::class, [
|
||||||
'choices' => \array_combine(
|
'choices' => \array_combine(
|
||||||
CSPerson::NIVEAU_MAITRISE_LANGUE,
|
CSPerson::NIVEAU_MAITRISE_LANGUE,
|
||||||
CSPerson::NIVEAU_MAITRISE_LANGUE),
|
CSPerson::NIVEAU_MAITRISE_LANGUE
|
||||||
'choice_label' => function($k) { return 'niveau_maitrise_langue.'.$k; },
|
),
|
||||||
|
'choice_label' => fn ($k) => 'niveau_maitrise_langue.'.$k,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'label' => 'Maitrise de la langue française'
|
'label' => 'Maitrise de la langue française',
|
||||||
])
|
])
|
||||||
->add('vehiculePersonnel', ChoiceType::class, [
|
->add('vehiculePersonnel', ChoiceType::class, [
|
||||||
'choices' => [
|
'choices' => [
|
||||||
'Oui' => true,
|
'Oui' => true,
|
||||||
'Non' => false
|
'Non' => false,
|
||||||
],
|
],
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false
|
'multiple' => false,
|
||||||
])
|
])
|
||||||
->add('permisConduire', ChoiceType::class, [
|
->add('permisConduire', ChoiceType::class, [
|
||||||
'choices' => [
|
'choices' => [
|
||||||
\array_combine(CSPerson::PERMIS_CONDUIRE, CSPerson::PERMIS_CONDUIRE)
|
\array_combine(CSPerson::PERMIS_CONDUIRE, CSPerson::PERMIS_CONDUIRE),
|
||||||
],
|
],
|
||||||
'label' => 'Permis de conduire',
|
'label' => 'Permis de conduire',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choice_label' => function($k) { return 'permis_conduire.'.$k; }
|
'choice_label' => fn ($k) => 'permis_conduire.'.$k,
|
||||||
])
|
])
|
||||||
->add('situationProfessionnelle', ChoiceType::class, [
|
->add('situationProfessionnelle', ChoiceType::class, [
|
||||||
'choices' => \array_combine(CSPerson::SITUATION_PROFESSIONNELLE, CSPerson::SITUATION_PROFESSIONNELLE),
|
'choices' => \array_combine(CSPerson::SITUATION_PROFESSIONNELLE, CSPerson::SITUATION_PROFESSIONNELLE),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choice_label' => function($k) { return 'situation_professionnelle.'.$k; }
|
'choice_label' => fn ($k) => 'situation_professionnelle.'.$k,
|
||||||
])
|
])
|
||||||
->add('dateFinDernierEmploi', ChillDateType::class, [
|
->add('dateFinDernierEmploi', ChillDateType::class, [
|
||||||
'label' => 'Date de la fin du dernier emploi',
|
'label' => 'Date de la fin du dernier emploi',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('typeContrat', ChoiceType::class, [
|
->add('typeContrat', ChoiceType::class, [
|
||||||
'choices' => \array_combine(CSPerson::TYPE_CONTRAT, CSPerson::TYPE_CONTRAT),
|
'choices' => \array_combine(CSPerson::TYPE_CONTRAT, CSPerson::TYPE_CONTRAT),
|
||||||
@ -92,33 +97,33 @@ class CSPersonPersonalSituationType extends AbstractType
|
|||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choice_label' => function($k) { return 'type_contrat.'.$k; }
|
'choice_label' => fn ($k) => 'type_contrat.'.$k,
|
||||||
])
|
])
|
||||||
->add('typeContratAide', TextType::class, [
|
->add('typeContratAide', TextType::class, [
|
||||||
'label' => "Type de contrat aidé",
|
'label' => 'Type de contrat aidé',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('ressources', ChoiceType::class, [
|
->add('ressources', ChoiceType::class, [
|
||||||
'choices' => \array_combine(CSPerson::RESSOURCES, CSPerson::RESSOURCES),
|
'choices' => \array_combine(CSPerson::RESSOURCES, CSPerson::RESSOURCES),
|
||||||
'choice_label' => function($k) { return 'ressource.'.$k; },
|
'choice_label' => fn ($k) => 'ressource.'.$k,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
])
|
])
|
||||||
->add('ressourcesComment', TextareaType::class, [
|
->add('ressourcesComment', TextareaType::class, [
|
||||||
'label' => 'Information autre ressource',
|
'label' => 'Information autre ressource',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('ressourceDate1Versement', ChillDateType::class, [
|
->add('ressourceDate1Versement', ChillDateType::class, [
|
||||||
'label' => "Date du premier versement (si bénéficiaire d'une aide)",
|
'label' => "Date du premier versement (si bénéficiaire d'une aide)",
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('cPFMontant', MoneyType::class, [
|
->add('cPFMontant', MoneyType::class, [
|
||||||
'label' => "Montant CPF",
|
'label' => 'Montant CPF',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('acompteDIF', MoneyType::class, [
|
->add('acompteDIF', MoneyType::class, [
|
||||||
'label' => "Compte DIF",
|
'label' => 'Compte DIF',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('handicapIs', ChoiceType::class, [
|
->add('handicapIs', ChoiceType::class, [
|
||||||
@ -126,7 +131,7 @@ class CSPersonPersonalSituationType extends AbstractType
|
|||||||
'required' => false,
|
'required' => false,
|
||||||
'choices' => [
|
'choices' => [
|
||||||
'Oui' => true,
|
'Oui' => true,
|
||||||
'Non' => false
|
'Non' => false,
|
||||||
],
|
],
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
@ -141,123 +146,113 @@ class CSPersonPersonalSituationType extends AbstractType
|
|||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(CSPerson::HANDICAP_RECOMMANDATIONS, CSPerson::HANDICAP_RECOMMANDATIONS),
|
'choices' => \array_combine(CSPerson::HANDICAP_RECOMMANDATIONS, CSPerson::HANDICAP_RECOMMANDATIONS),
|
||||||
'choice_label' => function($k) { return 'handicap_recommandation.'.$k; }
|
'choice_label' => fn ($k) => 'handicap_recommandation.'.$k,
|
||||||
])
|
])
|
||||||
->add('handicapAccompagnement', PickThirdPartyType::class, [
|
->add('handicapAccompagnement', PickThirdPartyType::class, [
|
||||||
'center' => $options['center'],
|
'center' => $options['center'],
|
||||||
'types' => [ 'prescripteur' ],
|
'types' => ['prescripteur'],
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false
|
'multiple' => false,
|
||||||
])
|
])
|
||||||
->add('mobiliteMoyenDeTransport', ChoiceType::class, [
|
->add('mobiliteMoyenDeTransport', ChoiceType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'label' => "Moyens de transports accessibles",
|
'label' => 'Moyens de transports accessibles',
|
||||||
'choices' => \array_combine(
|
'choices' => \array_combine(
|
||||||
CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
||||||
CSPerson::MOBILITE_MOYEN_TRANSPORT),
|
CSPerson::MOBILITE_MOYEN_TRANSPORT
|
||||||
'choice_label' => function($k) {
|
),
|
||||||
return 'moyen_transport.'.$k;
|
'choice_label' => fn ($k) => 'moyen_transport.'.$k,
|
||||||
}
|
|
||||||
])
|
])
|
||||||
->add('mobiliteNotes', TextareaType::class, [
|
->add('mobiliteNotes', TextareaType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Notes concernant la mobilité"
|
'label' => 'Notes concernant la mobilité',
|
||||||
])
|
])
|
||||||
->add('documentCV', StoredObjectType::class, [
|
->add('documentCV', StoredObjectType::class, [
|
||||||
'label' => 'CV',
|
'label' => 'CV',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAgrementIAE', StoredObjectType::class, [
|
->add('documentAgrementIAE', StoredObjectType::class, [
|
||||||
'label' => 'Document Agrément IAE',
|
'label' => 'Document Agrément IAE',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentRQTH', StoredObjectType::class, [
|
->add('documentRQTH', StoredObjectType::class, [
|
||||||
'label' => 'Document RQTH',
|
'label' => 'Document RQTH',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAttestationNEET', StoredObjectType::class, [
|
->add('documentAttestationNEET', StoredObjectType::class, [
|
||||||
'label' => 'Attestation NEET',
|
'label' => 'Attestation NEET',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentCI', StoredObjectType::class, [
|
->add('documentCI', StoredObjectType::class, [
|
||||||
'label' => 'Carte d\'identité',
|
'label' => 'Carte d\'identité',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentTitreSejour', StoredObjectType::class, [
|
->add('documentTitreSejour', StoredObjectType::class, [
|
||||||
'label' => 'Titre de séjour',
|
'label' => 'Titre de séjour',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAttestationFiscale', StoredObjectType::class, [
|
->add('documentAttestationFiscale', StoredObjectType::class, [
|
||||||
'label' => 'Attestation fiscale',
|
'label' => 'Attestation fiscale',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentPermis', StoredObjectType::class, [
|
->add('documentPermis', StoredObjectType::class, [
|
||||||
'label' => 'Permis',
|
'label' => 'Permis',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAttestationCAAF', StoredObjectType::class, [
|
->add('documentAttestationCAAF', StoredObjectType::class, [
|
||||||
'label' => 'Attestation CAF',
|
'label' => 'Attestation CAF',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentContraTravail', StoredObjectType::class, [
|
->add('documentContraTravail', StoredObjectType::class, [
|
||||||
'label' => 'Contrat de travail',
|
'label' => 'Contrat de travail',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAttestationFormation', StoredObjectType::class, [
|
->add('documentAttestationFormation', StoredObjectType::class, [
|
||||||
'label' => 'Attestation formation',
|
'label' => 'Attestation formation',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentQuittanceLoyer', StoredObjectType::class, [
|
->add('documentQuittanceLoyer', StoredObjectType::class, [
|
||||||
'label' => 'Quittance de loyer',
|
'label' => 'Quittance de loyer',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentFactureElectricite', StoredObjectType::class, [
|
->add('documentFactureElectricite', StoredObjectType::class, [
|
||||||
'label' => 'Facture d\'électricité',
|
'label' => 'Facture d\'électricité',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
->add('documentAttestationSecuriteSociale', StoredObjectType::class, [
|
->add('documentAttestationSecuriteSociale', StoredObjectType::class, [
|
||||||
'label' => 'Attestation de sécurité sociale',
|
'label' => 'Attestation de sécurité sociale',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'error_bubbling' => false
|
'error_bubbling' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
|
}
|
||||||
}/**
|
|
||||||
* {@inheritdoc}
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
*/
|
{
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
$resolver->setDefaults(['data_class' => CSPerson::class]);
|
||||||
{
|
|
||||||
$resolver->setDefaults(array(
|
$resolver->setRequired('center')
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\CSPerson'
|
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class])
|
||||||
));
|
;
|
||||||
|
|
||||||
$resolver->setRequired('center')
|
|
||||||
->setAllowedTypes('center', [ \Chill\MainBundle\Entity\Center::class ])
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_csperson';
|
return 'csconnectes_spbundle_csperson';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form\CV;
|
namespace Chill\ChillJobBundle\Form\CV;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -13,9 +22,6 @@ use Chill\ChillJobBundle\Entity\CV\Experience;
|
|||||||
|
|
||||||
class ExperienceType extends AbstractType
|
class ExperienceType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@ -23,50 +29,42 @@ class ExperienceType extends AbstractType
|
|||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => 'Poste',
|
'label' => 'Poste',
|
||||||
'label_attr' => [
|
'label_attr' => [
|
||||||
'class' => 'required '
|
'class' => 'required ',
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->add('structure', TextType::class, [
|
->add('structure', TextType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Nom de la structure"
|
'label' => 'Nom de la structure',
|
||||||
])
|
])
|
||||||
->add('startDate', ChillDateType::class, [
|
->add('startDate', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => 'Date de début'
|
'label' => 'Date de début',
|
||||||
])
|
])
|
||||||
->add('endDate', ChillDateType::class, [
|
->add('endDate', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Date de fin"
|
'label' => 'Date de fin',
|
||||||
])
|
])
|
||||||
->add('contratType', ChoiceType::class, [
|
->add('contratType', ChoiceType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'choices' => \array_combine(Experience::CONTRAT_TYPE, Experience::CONTRAT_TYPE),
|
'choices' => \array_combine(Experience::CONTRAT_TYPE, Experience::CONTRAT_TYPE),
|
||||||
'choice_label' => function($k) { return 'xp_contrat_type.'.$k; }
|
'choice_label' => fn ($k) => 'xp_contrat_type.'.$k,
|
||||||
])
|
])
|
||||||
->add('notes', TextareaType::class, [
|
->add('notes', TextareaType::class, [
|
||||||
'label' => 'Notes',
|
'label' => 'Notes',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}/**
|
}
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
{
|
||||||
{
|
$resolver->setDefaults(['data_class' => Experience::class]);
|
||||||
$resolver->setDefaults(array(
|
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Experience'
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_cv_experience';
|
return 'csconnectes_spbundle_cv_experience';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form\CV;
|
namespace Chill\ChillJobBundle\Form\CV;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -12,66 +21,55 @@ use Chill\ChillJobBundle\Entity\CV\Formation as F;
|
|||||||
|
|
||||||
class FormationType extends AbstractType
|
class FormationType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('title', TextType::class, [
|
->add('title', TextType::class, [
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'label' => "Nom de la formation",
|
'label' => 'Nom de la formation',
|
||||||
'label_attr' => [
|
'label_attr' => [
|
||||||
'class' => 'required '
|
'class' => 'required ',
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->add('organisme', TextType::class, [
|
->add('organisme', TextType::class, [
|
||||||
'label' => 'Organisme',
|
'label' => 'Organisme',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('startDate', ChillDateType::class, [
|
->add('startDate', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Date de début"
|
'label' => 'Date de début',
|
||||||
])
|
])
|
||||||
->add('endDate', ChillDateType::class, [
|
->add('endDate', ChillDateType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'label' => "Date de fin"
|
'label' => 'Date de fin',
|
||||||
])
|
])
|
||||||
->add('diplomaObtained', ChoiceType::class, [
|
->add('diplomaObtained', ChoiceType::class, [
|
||||||
'label' => "Diplôme obtenu ?",
|
'label' => 'Diplôme obtenu ?',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(F::DIPLOMA_OBTAINED, F::DIPLOMA_OBTAINED),
|
'choices' => \array_combine(F::DIPLOMA_OBTAINED, F::DIPLOMA_OBTAINED),
|
||||||
'choice_label' => function($k) { return 'diploma_obtained.'.$k; }
|
'choice_label' => fn ($k) => 'diploma_obtained.'.$k,
|
||||||
])
|
])
|
||||||
->add('diplomaReconnue', ChoiceType::class, [
|
->add('diplomaReconnue', ChoiceType::class, [
|
||||||
'label' => "Diplôme reconnu en France ?",
|
'label' => 'Diplôme reconnu en France ?',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(F::DIPLOMA_RECONNU, F::DIPLOMA_RECONNU),
|
'choices' => \array_combine(F::DIPLOMA_RECONNU, F::DIPLOMA_RECONNU),
|
||||||
'choice_label' => function($k) { return 'diploma_reconnu.'.$k; }
|
'choice_label' => fn ($k) => 'diploma_reconnu.'.$k,
|
||||||
])
|
])
|
||||||
|
|
||||||
;
|
;
|
||||||
}/**
|
}
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
{
|
||||||
{
|
$resolver->setDefaults(['data_class' => F::class]);
|
||||||
$resolver->setDefaults(array(
|
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Formation'
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_cv_formation';
|
return 'csconnectes_spbundle_cv_formation';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -16,9 +25,6 @@ use Chill\MainBundle\Form\Type\Select2LanguageType;
|
|||||||
|
|
||||||
class CVType extends AbstractType
|
class CVType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@ -31,27 +37,26 @@ class CVType extends AbstractType
|
|||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(CV::FORMATION_LEVEL, CV::FORMATION_LEVEL),
|
'choices' => \array_combine(CV::FORMATION_LEVEL, CV::FORMATION_LEVEL),
|
||||||
'choice_label' => function($k) { return 'formation_level.'.$k; }
|
'choice_label' => fn ($k) => 'formation_level.'.$k,
|
||||||
])
|
])
|
||||||
->add('formationType', ChoiceType::class, [
|
->add('formationType', ChoiceType::class, [
|
||||||
'label' => "Type de formation",
|
'label' => 'Type de formation',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(CV::FORMATION_TYPE, CV::FORMATION_TYPE),
|
'choices' => \array_combine(CV::FORMATION_TYPE, CV::FORMATION_TYPE),
|
||||||
'choice_label' => function($k) { return 'formation_type.'.$k; }
|
'choice_label' => fn ($k) => 'formation_type.'.$k,
|
||||||
])
|
])
|
||||||
->add('spokenLanguages', Select2LanguageType::class, [
|
->add('spokenLanguages', Select2LanguageType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
|
||||||
])
|
])
|
||||||
->add('notes', TextareaType::class, [
|
->add('notes', TextareaType::class, [
|
||||||
'label' => "Note",
|
'label' => 'Note',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('formations', ChillCollectionType::class, [
|
->add('formations', ChillCollectionType::class, [
|
||||||
'label' => "Formations",
|
'label' => 'Formations',
|
||||||
'entry_type' => FormationType::class,
|
'entry_type' => FormationType::class,
|
||||||
'allow_add' => true,
|
'allow_add' => true,
|
||||||
'allow_delete' => true,
|
'allow_delete' => true,
|
||||||
@ -59,36 +64,28 @@ class CVType extends AbstractType
|
|||||||
'button_remove_label' => 'Retirer cette formation',
|
'button_remove_label' => 'Retirer cette formation',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'by_reference' => false,
|
'by_reference' => false,
|
||||||
'block_name' => 'formation_list'
|
'block_name' => 'formation_list',
|
||||||
])
|
])
|
||||||
->add('experiences', ChillCollectionType::class, [
|
->add('experiences', ChillCollectionType::class, [
|
||||||
'label' => "Expériences",
|
'label' => 'Expériences',
|
||||||
'entry_type' => ExperienceType::class,
|
'entry_type' => ExperienceType::class,
|
||||||
'allow_add' => true,
|
'allow_add' => true,
|
||||||
'allow_delete' => true,
|
'allow_delete' => true,
|
||||||
'button_add_label' => 'Ajouter une expérience',
|
'button_add_label' => 'Ajouter une expérience',
|
||||||
'button_remove_label' => 'Retirer cette expérience',
|
'button_remove_label' => 'Retirer cette expérience',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'by_reference' => false
|
'by_reference' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}/**
|
}
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
{
|
||||||
{
|
$resolver->setDefaults(['data_class' => CV::class]);
|
||||||
$resolver->setDefaults(array(
|
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV'
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_cv';
|
return 'csconnectes_spbundle_cv';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form\ChoiceLoader;
|
namespace Chill\ChillJobBundle\Form\ChoiceLoader;
|
||||||
|
|
||||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||||
@ -14,45 +22,36 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Lazy load third parties.
|
* Lazy load third parties.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var Appellation[]
|
* @var Appellation[]
|
||||||
*/
|
*/
|
||||||
protected $lazyLoadedAppellations = [];
|
protected $lazyLoadedAppellations = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var EntityManagerInterface
|
* @var EntityManagerInterface
|
||||||
*/
|
*/
|
||||||
protected $em;
|
protected $em;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var \Chill\ChillJobBundle\Repository\Rome\AppellationRepository
|
* @var \Chill\ChillJobBundle\Repository\Rome\AppellationRepository
|
||||||
*/
|
*/
|
||||||
protected $appellationRepository;
|
protected $appellationRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var PartenaireRomeAppellation;
|
* @var PartenaireRomeAppellation;
|
||||||
*/
|
*/
|
||||||
protected $apiAppellation;
|
protected $apiAppellation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ValidatorInterface $validator
|
* @var ValidatorInterface
|
||||||
*/
|
*/
|
||||||
protected $validator;
|
protected $validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RomeAppellationChoiceLoader constructor.
|
* RomeAppellationChoiceLoader constructor.
|
||||||
*
|
|
||||||
* @param EntityManagerInterface $em
|
|
||||||
* @param PartenaireRomeAppellation $apiAppellation
|
|
||||||
* @param ValidatorInterface $validator
|
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
@ -65,7 +64,6 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function loadChoiceList($value = null): ChoiceListInterface
|
public function loadChoiceList($value = null): ChoiceListInterface
|
||||||
{
|
{
|
||||||
return new ArrayChoiceList($this->lazyLoadedAppellations, $value);
|
return new ArrayChoiceList($this->lazyLoadedAppellations, $value);
|
||||||
@ -73,16 +71,15 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
|
|
||||||
public function loadChoicesForValues($values, $value = null)
|
public function loadChoicesForValues($values, $value = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
$choices = [];
|
$choices = [];
|
||||||
|
|
||||||
foreach($values as $v) {
|
foreach ($values as $v) {
|
||||||
if (empty($v)) {
|
if (empty($v)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// start with "original-" ? then we load from api
|
// start with "original-" ? then we load from api
|
||||||
if (\substr($v, 0, \strlen('original-')) === 'original-') {
|
if (str_starts_with($v, 'original-')) {
|
||||||
$code = \substr($v, \strlen('original-'));
|
$code = \substr($v, \strlen('original-'));
|
||||||
$appellation = $this->appellationRepository->findOneByCode($code);
|
$appellation = $this->appellationRepository->findOneByCode($code);
|
||||||
} else {
|
} else {
|
||||||
@ -90,17 +87,17 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
$appellation = $this->appellationRepository->find($id);
|
$appellation = $this->appellationRepository->find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL === $appellation) {
|
if (null === $appellation) {
|
||||||
$def = $this->apiAppellation->getAppellation($code);
|
$def = $this->apiAppellation->getAppellation($code);
|
||||||
$metier = $this->em->getRepository(Metier::class)
|
$metier = $this->em->getRepository(Metier::class)
|
||||||
->findOneByCode($def->metier->code)
|
->findOneByCode($def->metier->code)
|
||||||
;
|
;
|
||||||
|
|
||||||
if ($metier === NULL) {
|
if (null === $metier) {
|
||||||
$metier = (new Metier())
|
$metier = (new Metier())
|
||||||
->setCode($def->metier->code)
|
->setCode($def->metier->code)
|
||||||
->setLibelle($def->metier->libelle)
|
->setLibelle($def->metier->libelle)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
$appellation = new Appellation();
|
$appellation = new Appellation();
|
||||||
@ -109,16 +106,14 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
->setCode($def->code)
|
->setCode($def->code)
|
||||||
->setLibelle($def->libelle)
|
->setLibelle($def->libelle)
|
||||||
->setMetier($metier)
|
->setMetier($metier)
|
||||||
;
|
;
|
||||||
|
|
||||||
if ($this->validator->validate($appellation) && $this->validator->validate($metier))
|
if ($this->validator->validate($appellation) && $this->validator->validate($metier)) {
|
||||||
{
|
|
||||||
$this->em->persist($appellation);
|
$this->em->persist($appellation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->em->contains($metier) and $this->em->contains($appellation))
|
if ($this->em->contains($metier) and $this->em->contains($appellation)) {
|
||||||
{
|
|
||||||
$choices[] = $appellation;
|
$choices[] = $appellation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,7 +124,7 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
|||||||
public function loadValuesForChoices(array $choices, $value = null)
|
public function loadValuesForChoices(array $choices, $value = null)
|
||||||
{
|
{
|
||||||
foreach ($choices as $choice) {
|
foreach ($choices as $choice) {
|
||||||
if (NULL === $choice) {
|
if (null === $choice) {
|
||||||
$values[] = null;
|
$values[] = null;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -12,19 +21,16 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|||||||
|
|
||||||
class FreinType extends AbstractType
|
class FreinType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('reportDate', ChillDateType::class, [
|
->add('reportDate', ChillDateType::class, [
|
||||||
'label' => 'Date du rapport'
|
'label' => 'Date du rapport',
|
||||||
])
|
])
|
||||||
->add('freinsPerso', ChoiceType::class, [
|
->add('freinsPerso', ChoiceType::class, [
|
||||||
'label' => 'Freins identifiés liés à la situation personnelle',
|
'label' => 'Freins identifiés liés à la situation personnelle',
|
||||||
'choices' => \array_combine(Frein::FREINS_PERSO, Frein::FREINS_PERSO),
|
'choices' => \array_combine(Frein::FREINS_PERSO, Frein::FREINS_PERSO),
|
||||||
'choice_label' => function($k) { return 'freins_perso.'.$k; },
|
'choice_label' => fn ($k) => 'freins_perso.'.$k,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
@ -32,37 +38,29 @@ class FreinType extends AbstractType
|
|||||||
->add('freinsEmploi', ChoiceType::class, [
|
->add('freinsEmploi', ChoiceType::class, [
|
||||||
'label' => 'Freins identifiés liés à la situation professionnelle',
|
'label' => 'Freins identifiés liés à la situation professionnelle',
|
||||||
'choices' => \array_combine(Frein::FREINS_EMPLOI, Frein::FREINS_EMPLOI),
|
'choices' => \array_combine(Frein::FREINS_EMPLOI, Frein::FREINS_EMPLOI),
|
||||||
'choice_label' => function($k) { return 'freins_emploi.'.$k; },
|
'choice_label' => fn ($k) => 'freins_emploi.'.$k,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
])
|
])
|
||||||
->add('notesPerso', TextareaType::class, [
|
->add('notesPerso', TextareaType::class, [
|
||||||
'label' => 'Notes concernant la situation personnelle',
|
'label' => 'Notes concernant la situation personnelle',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('notesEmploi', TextareaType::class, [
|
->add('notesEmploi', TextareaType::class, [
|
||||||
'label' => 'Notes concernant l\'accès à l\'emploi',
|
'label' => 'Notes concernant l\'accès à l\'emploi',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}/**
|
}
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
{
|
||||||
{
|
$resolver->setDefaults(['data_class' => Frein::class]);
|
||||||
$resolver->setDefaults(array(
|
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\Frein'
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_frein';
|
return 'csconnectes_spbundle_frein';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -15,147 +24,141 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||||||
use Chill\ChillJobBundle\Entity\Immersion;
|
use Chill\ChillJobBundle\Entity\Immersion;
|
||||||
use Chill\MainBundle\Form\Type\AddressType;
|
use Chill\MainBundle\Form\Type\AddressType;
|
||||||
|
|
||||||
|
|
||||||
class ImmersionType extends AbstractType
|
class ImmersionType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
if ($options['step'] === 'immersion') {
|
if ('immersion' === $options['step']) {
|
||||||
$builder
|
$builder
|
||||||
->add('entreprise', PickThirdPartyType::class, [
|
->add('entreprise', PickThirdPartyType::class, [
|
||||||
'center' => $options['center'],
|
'center' => $options['center'],
|
||||||
'types' => [ 'entreprise' ],
|
'types' => ['entreprise'],
|
||||||
'label' => "Identité de l'entreprise",
|
'label' => "Identité de l'entreprise",
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'multiple' => false
|
'multiple' => false,
|
||||||
])
|
])
|
||||||
->add('domaineActivite', TextType::class, [
|
->add('domaineActivite', TextType::class, [
|
||||||
'label' => "Domaine d'activité",
|
'label' => "Domaine d'activité",
|
||||||
'required' => true,
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('tuteurName', TextType::class, [
|
->add('tuteurName', TextType::class, [
|
||||||
'label' => "Nom du tuteur",
|
'label' => 'Nom du tuteur',
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('tuteurFonction', TextType::class, [
|
->add('tuteurFonction', TextType::class, [
|
||||||
'label' => "Fonction du tuteur",
|
'label' => 'Fonction du tuteur',
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('tuteurPhoneNumber', TextType::class, [
|
->add('tuteurPhoneNumber', TextType::class, [
|
||||||
'label' => "Téléphone du tuteur",
|
'label' => 'Téléphone du tuteur',
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('structureAccName', TextType::class, [
|
->add('structureAccName', TextType::class, [
|
||||||
'label' => "Nom de la structure",
|
'label' => 'Nom de la structure',
|
||||||
"required" => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('structureAccPhonenumber', TextType::class, [
|
->add('structureAccPhonenumber', TextType::class, [
|
||||||
'label' => "Téléphone de la structure",
|
'label' => 'Téléphone de la structure',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('structureAccEmail', EmailType::class, [
|
->add('structureAccEmail', EmailType::class, [
|
||||||
'label' => 'Email de la structure',
|
'label' => 'Email de la structure',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('structureAccAddress', AddressType::class, [
|
->add('structureAccAddress', AddressType::class, [
|
||||||
'label' => 'Addresse de la structure d\'accompagnement',
|
'label' => 'Addresse de la structure d\'accompagnement',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'has_valid_from' => false,
|
'has_valid_from' => false,
|
||||||
'null_if_empty' => true
|
'null_if_empty' => true,
|
||||||
])
|
])
|
||||||
->add('posteTitle', TextType::class, [
|
->add('posteTitle', TextType::class, [
|
||||||
'label' => 'Intitulé du poste',
|
'label' => 'Intitulé du poste',
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('posteLieu', TextType::class, [
|
->add('posteLieu', TextType::class, [
|
||||||
'label' => "Lieu d'exercice",
|
'label' => "Lieu d'exercice",
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('debutDate', ChillDateType::class, [
|
->add('debutDate', ChillDateType::class, [
|
||||||
'label' => "Date de début de l'immersion",
|
'label' => "Date de début de l'immersion",
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('duration', DateIntervalType::class, [
|
->add('duration', DateIntervalType::class, [
|
||||||
'unit_choices' => [
|
'unit_choices' => [
|
||||||
"Weeks" => 'W',
|
'Weeks' => 'W',
|
||||||
"Months" => 'M',
|
'Months' => 'M',
|
||||||
"Days" => 'D'
|
'Days' => 'D',
|
||||||
],
|
],
|
||||||
'label' => "Durée de l'immersion",
|
'label' => "Durée de l'immersion",
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('horaire', TextareaType::class, [
|
->add('horaire', TextareaType::class, [
|
||||||
'label' => "Horaire du stagiaire",
|
'label' => 'Horaire du stagiaire',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('objectifs', ChoiceType::class, [
|
->add('objectifs', ChoiceType::class, [
|
||||||
'label' => "Objectifs",
|
'label' => 'Objectifs',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(Immersion::OBJECTIFS, Immersion::OBJECTIFS),
|
'choices' => \array_combine(Immersion::OBJECTIFS, Immersion::OBJECTIFS),
|
||||||
'choice_label' => function($k) { return 'immersion_objectif.'.$k; }
|
'choice_label' => fn ($k) => 'immersion_objectif.'.$k,
|
||||||
])
|
])
|
||||||
->add('objectifsAutre', TextareaType::class, [
|
->add('objectifsAutre', TextareaType::class, [
|
||||||
'label' => 'Précision sur les objectifs',
|
'label' => 'Précision sur les objectifs',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('noteImmersion', TextareaType::class, [
|
->add('noteImmersion', TextareaType::class, [
|
||||||
'label' => "Note",
|
'label' => 'Note',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
} elseif ($options['step'] === 'bilan') {
|
} elseif ('bilan' === $options['step']) {
|
||||||
$builder
|
$builder
|
||||||
->add('savoirEtre', ChoiceType::class, [
|
->add('savoirEtre', ChoiceType::class, [
|
||||||
'label' => "Savoir-être du jeune",
|
'label' => 'Savoir-être du jeune',
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(Immersion::SAVOIR_ETRE, Immersion::SAVOIR_ETRE),
|
'choices' => \array_combine(Immersion::SAVOIR_ETRE, Immersion::SAVOIR_ETRE),
|
||||||
'choice_label' => function($k) { return 'immersion_savoir_etre.'.$k; }
|
'choice_label' => fn ($k) => 'immersion_savoir_etre.'.$k,
|
||||||
])
|
])
|
||||||
->add('savoirEtreNote', TextareaType::class, [
|
->add('savoirEtreNote', TextareaType::class, [
|
||||||
'label' => "Note",
|
'label' => 'Note',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('principalesActivites', TextareaType::class, [
|
->add('principalesActivites', TextareaType::class, [
|
||||||
'label' => "Principales activités",
|
'label' => 'Principales activités',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('competencesAcquises', TextareaType::class, [
|
->add('competencesAcquises', TextareaType::class, [
|
||||||
'label' => "Compétences acquises",
|
'label' => 'Compétences acquises',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('competencesADevelopper', TextareaType::class, [
|
->add('competencesADevelopper', TextareaType::class, [
|
||||||
'label' => "Compétences à développer",
|
'label' => 'Compétences à développer',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('noteBilan', TextareaType::class, [
|
->add('noteBilan', TextareaType::class, [
|
||||||
'label' => "Notes sur le bilan",
|
'label' => 'Notes sur le bilan',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
foreach ([
|
foreach ([
|
||||||
['ponctualiteSalarie', Immersion::PONCTUALITE_SALARIE, "Ponctualité du salarié"],
|
['ponctualiteSalarie', Immersion::PONCTUALITE_SALARIE, 'Ponctualité du salarié'],
|
||||||
['assiduite', Immersion::ASSIDUITE, "Assiduité"],
|
['assiduite', Immersion::ASSIDUITE, 'Assiduité'],
|
||||||
['interetActivite', Immersion::YES_NO_NSP, "La personne s’intéresse à l’ensemble des activités et membres de l’entreprise"],
|
['interetActivite', Immersion::YES_NO_NSP, 'La personne s’intéresse à l’ensemble des activités et membres de l’entreprise'],
|
||||||
['integreRegle', Immersion::INTEGRE_REGLE, "La personne a intégré les règles (les principes) de l’entreprise"],
|
['integreRegle', Immersion::INTEGRE_REGLE, 'La personne a intégré les règles (les principes) de l’entreprise'],
|
||||||
['espritInitiative', Immersion::YES_NO_NSP, "La personne fait preuve d’esprit d’initiative"],
|
['espritInitiative', Immersion::YES_NO_NSP, 'La personne fait preuve d’esprit d’initiative'],
|
||||||
['organisation', Immersion::YES_NO_NSP, "La personne a fait preuve d’organisation"],
|
['organisation', Immersion::YES_NO_NSP, 'La personne a fait preuve d’organisation'],
|
||||||
['capaciteTravailEquipe', Immersion::YES_NO_NSP, "Sa capacité à travailler en équipe"],
|
['capaciteTravailEquipe', Immersion::YES_NO_NSP, 'Sa capacité à travailler en équipe'],
|
||||||
['styleVestimentaire', Immersion::YES_NO_NSP, "Style vestimentaire adapté"],
|
['styleVestimentaire', Immersion::YES_NO_NSP, 'Style vestimentaire adapté'],
|
||||||
['langageProf', Immersion::YES_NO_NSP, "Langage professionnel"],
|
['langageProf', Immersion::YES_NO_NSP, 'Langage professionnel'],
|
||||||
['appliqueConsigne', Immersion::YES_NO_NSP, "Applique les consignes"],
|
['appliqueConsigne', Immersion::YES_NO_NSP, 'Applique les consignes'],
|
||||||
['respectHierarchie', Immersion::YES_NO_NSP, "Respecte les niveaux hiérarchiques"],
|
['respectHierarchie', Immersion::YES_NO_NSP, 'Respecte les niveaux hiérarchiques'],
|
||||||
|
] as [$name, $choices, $label]) {
|
||||||
] as list($name, $choices, $label)) {
|
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add($name, ChoiceType::class, [
|
->add($name, ChoiceType::class, [
|
||||||
'label' => $label,
|
'label' => $label,
|
||||||
@ -163,47 +166,35 @@ class ImmersionType extends AbstractType
|
|||||||
'required' => false,
|
'required' => false,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
'choice_label' => function($el) use ($choices, $name) {
|
'choice_label' => function ($el) use ($choices, $name) {
|
||||||
if ($choices === Immersion::YES_NO_NSP) {
|
if (Immersion::YES_NO_NSP === $choices) {
|
||||||
return 'immersion_nsp.'.$el;
|
return 'immersion_nsp.'.$el;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'immersion_'.$name.'.'.$el;
|
return 'immersion_'.$name.'.'.$el;
|
||||||
}
|
},
|
||||||
])
|
])
|
||||||
->add($name.'Note', TextareaType::class, [
|
->add($name.'Note', TextareaType::class, [
|
||||||
'label' => "Notes",
|
'label' => 'Notes',
|
||||||
'required' => false
|
'required' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(['data_class' => Immersion::class, 'step' => 'immersion']);
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\Immersion',
|
|
||||||
'step' => 'immersion'
|
|
||||||
));
|
|
||||||
|
|
||||||
$resolver
|
$resolver
|
||||||
->setAllowedValues('step', ['immersion', 'bilan'])
|
->setAllowedValues('step', ['immersion', 'bilan'])
|
||||||
->setRequired('center')
|
->setRequired('center')
|
||||||
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
|
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_immersion';
|
return 'csconnectes_spbundle_immersion';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form;
|
namespace Chill\ChillJobBundle\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -7,16 +16,12 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
||||||
use Chill\ChillJobBundle\Form\Type\PickRomeAppellationType;
|
use Chill\ChillJobBundle\Form\Type\PickRomeAppellationType;
|
||||||
|
|
||||||
class ProjetProfessionnelType extends AbstractType
|
class ProjetProfessionnelType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
@ -27,19 +32,21 @@ class ProjetProfessionnelType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('domaineActiviteSouhait', TextareaType::class, [
|
->add('domaineActiviteSouhait', TextareaType::class, [
|
||||||
'label' => "Domaine d'activité souhaité",
|
'label' => "Domaine d'activité souhaité",
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('reportDate', ChillDateType::class, [
|
->add('reportDate', ChillDateType::class, [
|
||||||
'label' => 'Date',
|
'label' => 'Date',
|
||||||
'required' => true
|
'required' => true,
|
||||||
])
|
])
|
||||||
->add('typeContrat', ChoiceType::class, [
|
->add('typeContrat', ChoiceType::class, [
|
||||||
'label' => 'Type de contrat recherché',
|
'label' => 'Type de contrat recherché',
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'choices' => \array_combine(ProjetProfessionnel::TYPE_CONTRAT,
|
'choices' => \array_combine(
|
||||||
ProjetProfessionnel::TYPE_CONTRAT),
|
ProjetProfessionnel::TYPE_CONTRAT,
|
||||||
'choice_label' => function($k) { return 'projet_prof.type_contrat.'.$k; }
|
ProjetProfessionnel::TYPE_CONTRAT
|
||||||
|
),
|
||||||
|
'choice_label' => fn ($k) => 'projet_prof.type_contrat.'.$k,
|
||||||
])
|
])
|
||||||
->add('typeContratNotes', TextareaType::class, [
|
->add('typeContratNotes', TextareaType::class, [
|
||||||
'label' => 'Notes concernant le contrat recherché',
|
'label' => 'Notes concernant le contrat recherché',
|
||||||
@ -50,13 +57,15 @@ class ProjetProfessionnelType extends AbstractType
|
|||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'choices' => \array_combine(ProjetProfessionnel::VOLUME_HORAIRES,
|
'choices' => \array_combine(
|
||||||
ProjetProfessionnel::VOLUME_HORAIRES),
|
ProjetProfessionnel::VOLUME_HORAIRES,
|
||||||
'choice_label' => function($k) { return 'projet_prof.volume_horaire.'.$k; }
|
ProjetProfessionnel::VOLUME_HORAIRES
|
||||||
|
),
|
||||||
|
'choice_label' => fn ($k) => 'projet_prof.volume_horaire.'.$k,
|
||||||
])
|
])
|
||||||
->add('volumeHoraireNotes', TextareaType::class, [
|
->add('volumeHoraireNotes', TextareaType::class, [
|
||||||
'label' => 'Notes concernant le volume horaire',
|
'label' => 'Notes concernant le volume horaire',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('idee', TextareaType::class, [
|
->add('idee', TextareaType::class, [
|
||||||
'label' => 'Idée',
|
'label' => 'Idée',
|
||||||
@ -74,7 +83,7 @@ class ProjetProfessionnelType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('domaineActiviteValide', TextareaType::class, [
|
->add('domaineActiviteValide', TextareaType::class, [
|
||||||
'label' => "Domaine d'activité validé",
|
'label' => "Domaine d'activité validé",
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
->add('valideNotes', TextareaType::class, [
|
->add('valideNotes', TextareaType::class, [
|
||||||
'label' => 'Validé (notes)',
|
'label' => 'Validé (notes)',
|
||||||
@ -82,28 +91,18 @@ class ProjetProfessionnelType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('projetProfessionnelNote', TextareaType::class, [
|
->add('projetProfessionnelNote', TextareaType::class, [
|
||||||
'label' => 'Notes concernant le projet professionnel',
|
'label' => 'Notes concernant le projet professionnel',
|
||||||
'required' => false
|
'required' => false,
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
|
}
|
||||||
|
|
||||||
}/**
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
* {@inheritdoc}
|
{
|
||||||
*/
|
$resolver->setDefaults(['data_class' => ProjetProfessionnel::class]);
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
|
||||||
{
|
|
||||||
$resolver->setDefaults(array(
|
|
||||||
'data_class' => 'Chill\ChillJobBundle\Entity\ProjetProfessionnel'
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
{
|
{
|
||||||
return 'csconnectes_spbundle_projetprofessionnel';
|
return 'csconnectes_spbundle_projetprofessionnel';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Form\Type;
|
namespace Chill\ChillJobBundle\Form\Type;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@ -17,19 +25,16 @@ use Chill\ChillJobBundle\Form\ChoiceLoader\RomeAppellationChoiceLoader;
|
|||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allow to grab an appellation
|
* Allow to grab an appellation.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class PickRomeAppellationType extends AbstractType
|
class PickRomeAppellationType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var TranslatorInterface
|
* @var TranslatorInterface
|
||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var UrlGeneratorInterface
|
* @var UrlGeneratorInterface
|
||||||
*/
|
*/
|
||||||
protected $urlGenerator;
|
protected $urlGenerator;
|
||||||
@ -41,13 +46,11 @@ class PickRomeAppellationType extends AbstractType
|
|||||||
// protected $romeAppellationTransformer;
|
// protected $romeAppellationTransformer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var EntityManagerInterface
|
* @var EntityManagerInterface
|
||||||
*/
|
*/
|
||||||
protected $em;
|
protected $em;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var PartenaireRomeAppellation
|
* @var PartenaireRomeAppellation
|
||||||
*/
|
*/
|
||||||
protected $apiPartenaire;
|
protected $apiPartenaire;
|
||||||
@ -59,12 +62,6 @@ class PickRomeAppellationType extends AbstractType
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* PickRomeAppellationType constructor.
|
* PickRomeAppellationType constructor.
|
||||||
*
|
|
||||||
* @param TranslatorInterface $translator
|
|
||||||
* @param UrlGeneratorInterface $urlGenerator
|
|
||||||
* @param EntityManagerInterface $em
|
|
||||||
* @param PartenaireRomeAppellation $apiPartenaire
|
|
||||||
* @param ValidatorInterface $validator
|
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
@ -82,27 +79,21 @@ class PickRomeAppellationType extends AbstractType
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
// ->addModelTransformer($this->romeAppellationTransformer)
|
||||||
//->addModelTransformer($this->romeAppellationTransformer)
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
{
|
{
|
||||||
$resolver
|
$resolver
|
||||||
->setDefault('class', Appellation::class)
|
->setDefault('class', Appellation::class)
|
||||||
->setDefault('choice_label', function(Appellation $a) {
|
->setDefault('choice_label', fn (Appellation $a) => $a->getLibelle())
|
||||||
return $a->getLibelle();
|
->setDefault('placeholder', 'Choisir une appellation')
|
||||||
})
|
// ->setDefault('attr', ['class' => 'select2 '])
|
||||||
->setDefault('placeholder', 'Choisir une appellation')
|
->setDefault('choice_loader', fn (Options $o) => new RomeAppellationChoiceLoader(
|
||||||
//->setDefault('attr', ['class' => 'select2 '])
|
$this->em,
|
||||||
->setDefault('choice_loader', function(Options $o) {
|
$this->apiPartenaire,
|
||||||
return new RomeAppellationChoiceLoader(
|
$this->validator
|
||||||
$this->em,
|
))
|
||||||
$this->apiPartenaire,
|
|
||||||
$this->validator
|
|
||||||
);
|
|
||||||
})
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +107,7 @@ class PickRomeAppellationType extends AbstractType
|
|||||||
$view->vars['attr']['data-rome-appellation-picker'] = true;
|
$view->vars['attr']['data-rome-appellation-picker'] = true;
|
||||||
$view->vars['attr']['data-select-interactive-loading'] = true;
|
$view->vars['attr']['data-select-interactive-loading'] = true;
|
||||||
$view->vars['attr']['data-search-url'] = $this->urlGenerator
|
$view->vars['attr']['data-search-url'] = $this->urlGenerator
|
||||||
->generate('chill_pole_emploi_api_appellation_search', [ '_format' => 'json' ]);
|
->generate('chill_pole_emploi_api_appellation_search', ['_format' => 'json']);
|
||||||
$view->vars['attr']['data-placeholder'] = 'Choisir une appellation';
|
$view->vars['attr']['data-placeholder'] = 'Choisir une appellation';
|
||||||
$view->vars['attr']['data-no-results-label'] = $this->translator->trans('select2.no_results');
|
$view->vars['attr']['data-no-results-label'] = $this->translator->trans('select2.no_results');
|
||||||
$view->vars['attr']['data-error-load-label'] = $this->translator->trans('select2.error_loading');
|
$view->vars['attr']['data-error-load-label'] = $this->translator->trans('select2.error_loading');
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Menu;
|
namespace Chill\ChillJobBundle\Menu;
|
||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
@ -7,14 +16,9 @@ use Knp\Menu\MenuItem;
|
|||||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||||
use Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter;
|
use Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class MenuBuilder implements LocalMenuBuilderInterface
|
class MenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var AuthorizationCheckerInterface
|
* @var AuthorizationCheckerInterface
|
||||||
*/
|
*/
|
||||||
protected $authorizationChecker;
|
protected $authorizationChecker;
|
||||||
@ -30,39 +34,39 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
|||||||
$person = $parameters['person'];
|
$person = $parameters['person'];
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(CSConnectesVoter::REPORT_NEW, $person)) {
|
if ($this->authorizationChecker->isGranted(CSConnectesVoter::REPORT_NEW, $person)) {
|
||||||
$menu->addChild('Situation personnelle', [
|
$menu->addChild('Situation personnelle', [
|
||||||
'route' => 'chill_crud_csperson_personal_situation_view',
|
'route' => 'chill_crud_csperson_personal_situation_view',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $person->getId()
|
'id' => $person->getId(),
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order'=> 50
|
'order' => 50,
|
||||||
]);
|
]);
|
||||||
$menu->addChild('Dispositifs', [
|
$menu->addChild('Dispositifs', [
|
||||||
'route' => 'chill_crud_csperson_dispositifs_view',
|
'route' => 'chill_crud_csperson_dispositifs_view',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $person->getId()
|
'id' => $person->getId(),
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order'=> 51
|
'order' => 51,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu->addChild('Parcours d\'accompagnement', [
|
$menu->addChild('Parcours d\'accompagnement', [
|
||||||
'route' => 'chill_csconnectes_csreport_index',
|
'route' => 'chill_csconnectes_csreport_index',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'person' => $person->getId()
|
'person' => $person->getId(),
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->setExtras([
|
->setExtras([
|
||||||
'order' => 52
|
'order' => 52,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return [ 'person' ];
|
return ['person'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository;
|
namespace Chill\ChillJobBundle\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CSPersonRepository
|
* CSPersonRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class CSPersonRepository extends \Doctrine\ORM\EntityRepository
|
class CSPersonRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository\CV;
|
namespace Chill\ChillJobBundle\Repository\CV;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExperienceRepository
|
* ExperienceRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class ExperienceRepository extends \Doctrine\ORM\EntityRepository
|
class ExperienceRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository\CV;
|
namespace Chill\ChillJobBundle\Repository\CV;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FormationRepository
|
* FormationRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class FormationRepository extends \Doctrine\ORM\EntityRepository
|
class FormationRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository;
|
namespace Chill\ChillJobBundle\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CVRepository
|
* CVRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class CVRepository extends \Doctrine\ORM\EntityRepository
|
class CVRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository;
|
namespace Chill\ChillJobBundle\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FreinRepository
|
* FreinRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class FreinRepository extends \Doctrine\ORM\EntityRepository
|
class FreinRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository;
|
namespace Chill\ChillJobBundle\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ImmersionRepository
|
* ImmersionRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class ImmersionRepository extends \Doctrine\ORM\EntityRepository
|
class ImmersionRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository;
|
namespace Chill\ChillJobBundle\Repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ProjetProfessionnelRepository
|
* ProjetProfessionnelRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class ProjetProfessionnelRepository extends \Doctrine\ORM\EntityRepository
|
class ProjetProfessionnelRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository\Rome;
|
namespace Chill\ChillJobBundle\Repository\Rome;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AppellationRepository
|
* AppellationRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class AppellationRepository extends \Doctrine\ORM\EntityRepository
|
class AppellationRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Repository\Rome;
|
namespace Chill\ChillJobBundle\Repository\Rome;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MetierRepository
|
* MetierRepository.
|
||||||
*
|
*
|
||||||
* This class was generated by the Doctrine ORM. Add your own custom
|
* This class was generated by the Doctrine ORM. Add your own custom
|
||||||
* repository methods below.
|
* repository methods below.
|
||||||
*/
|
*/
|
||||||
class MetierRepository extends \Doctrine\ORM\EntityRepository
|
class MetierRepository extends \Doctrine\ORM\EntityRepository {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
<?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\ChillJobBundle\Security\Authorization;
|
namespace Chill\ChillJobBundle\Security\Authorization;
|
||||||
|
|
||||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
use Chill\ChillJobBundle\Entity\Frein;
|
use Chill\ChillJobBundle\Entity\Frein;
|
||||||
use Chill\ChillJobBundle\Entity\CV;
|
use Chill\ChillJobBundle\Entity\CV;
|
||||||
use Chill\ChillJobBundle\Entity\CSPerson;
|
|
||||||
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
|
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
|
||||||
use Chill\ChillJobBundle\Entity\Immersion;
|
use Chill\ChillJobBundle\Entity\Immersion;
|
||||||
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
||||||
@ -14,29 +22,24 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
|||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* check ACL for CSConnectes.
|
||||||
* check ACL for CSConnectes
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface, VoterInterface
|
class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface, VoterInterface
|
||||||
{
|
{
|
||||||
|
public const REPORT_NEW = 'CHILL_CSCONNECTES_REPORT_NEW';
|
||||||
|
public const REPORT_CV = 'CHILL_CSCONNECTES_REPORT_CV';
|
||||||
|
public const REPORT_DELETE = 'CHILL_CSCONNECTES_REPORT_DELETE';
|
||||||
|
|
||||||
const REPORT_NEW = 'CHILL_CSCONNECTES_REPORT_NEW';
|
public const ALL = [
|
||||||
const REPORT_CV = 'CHILL_CSCONNECTES_REPORT_CV';
|
|
||||||
const REPORT_DELETE = 'CHILL_CSCONNECTES_REPORT_DELETE';
|
|
||||||
|
|
||||||
const ALL = [
|
|
||||||
self::REPORT_NEW,
|
self::REPORT_NEW,
|
||||||
self::REPORT_CV,
|
self::REPORT_CV,
|
||||||
self::REPORT_DELETE
|
self::REPORT_DELETE,
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $date15DaysAgo;
|
protected $date15DaysAgo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @var AuthorizationHelper
|
* @var AuthorizationHelper
|
||||||
*/
|
*/
|
||||||
protected $authorizationHelper;
|
protected $authorizationHelper;
|
||||||
@ -47,7 +50,6 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
|||||||
$this->authorizationHelper = $authorizationHelper;
|
$this->authorizationHelper = $authorizationHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function supports($attribute, $subject)
|
protected function supports($attribute, $subject)
|
||||||
{
|
{
|
||||||
if (!\in_array($attribute, self::ALL)) {
|
if (!\in_array($attribute, self::ALL)) {
|
||||||
@ -73,9 +75,8 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
|||||||
$center = $subject->getPerson()->getCenter();
|
$center = $subject->getPerson()->getCenter();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($attribute) {
|
switch ($attribute) {
|
||||||
case self::REPORT_NEW:
|
case self::REPORT_NEW:
|
||||||
|
|
||||||
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
||||||
|
|
||||||
case self::REPORT_CV:
|
case self::REPORT_CV:
|
||||||
@ -86,7 +87,6 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
|||||||
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
||||||
|
|
||||||
case self::REPORT_DELETE:
|
case self::REPORT_DELETE:
|
||||||
|
|
||||||
if ($subject instanceof Immersion) {
|
if ($subject instanceof Immersion) {
|
||||||
$date = \DateTimeImmutable::createFromMutable($subject->getDebutDate())->add($subject->getDuration());
|
$date = \DateTimeImmutable::createFromMutable($subject->getDebutDate())->add($subject->getDuration());
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
<?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\ChillJobBundle\Security\Authorization;
|
namespace Chill\ChillJobBundle\Security\Authorization;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
@ -12,15 +21,13 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
|
|||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ExportsVoter
|
* Class ExportsVoter.
|
||||||
*
|
*
|
||||||
* @package Chill\ChillJobBundle\Security\Authorization
|
|
||||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||||
*/
|
*/
|
||||||
class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface, VoterInterface
|
class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface, VoterInterface
|
||||||
{
|
{
|
||||||
|
public const EXPORT = 'CHILL_CSCONNECTES_EXPORTS';
|
||||||
const EXPORT = 'CHILL_CSCONNECTES_EXPORTS';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var AuthorizationHelper
|
* @var AuthorizationHelper
|
||||||
@ -29,8 +36,6 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* CVVoter constructor.
|
* CVVoter constructor.
|
||||||
*
|
|
||||||
* @param AuthorizationHelper $authorizationHelper
|
|
||||||
*/
|
*/
|
||||||
public function __construct(AuthorizationHelper $authorizationHelper)
|
public function __construct(AuthorizationHelper $authorizationHelper)
|
||||||
{
|
{
|
||||||
@ -38,24 +43,21 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $attribute
|
|
||||||
* @param $subject
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function supports($attribute, $subject)
|
protected function supports($attribute, $subject)
|
||||||
{
|
{
|
||||||
if ($subject instanceof Center) {
|
if ($subject instanceof Center) {
|
||||||
return $attribute === self::EXPORT;
|
return self::EXPORT === $attribute;
|
||||||
} elseif ($subject === NULL) {
|
|
||||||
return $attribute === self::EXPORT;
|
|
||||||
}
|
}
|
||||||
|
if (null === $subject) {
|
||||||
|
return self::EXPORT === $attribute;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $attribute
|
|
||||||
* @param $subject
|
|
||||||
* @param TokenInterface $token
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
|
||||||
@ -68,7 +70,7 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
|
|
||||||
$centers = $this->authorizationHelper->getReachableCenters($user, new Role($attribute));
|
$centers = $this->authorizationHelper->getReachableCenters($user, new Role($attribute));
|
||||||
|
|
||||||
if ($subject === null) {
|
if (null === $subject) {
|
||||||
return count($centers) > 0;
|
return count($centers) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +91,11 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
*/
|
*/
|
||||||
public function getRolesWithHierarchy()
|
public function getRolesWithHierarchy()
|
||||||
{
|
{
|
||||||
return [ 'CSConnectes' => $this->getRoles() ];
|
return ['CSConnectes' => $this->getRoles()];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return an array of role provided by the object
|
* return an array of role provided by the object.
|
||||||
*
|
*
|
||||||
* @return string[] array of roles (as string)
|
* @return string[] array of roles (as string)
|
||||||
*/
|
*/
|
||||||
@ -103,7 +105,7 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return roles which doesn't need
|
* return roles which doesn't need.
|
||||||
*
|
*
|
||||||
* @return string[] array of roles without scopes
|
* @return string[] array of roles without scopes
|
||||||
*/
|
*/
|
||||||
@ -115,7 +117,8 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
|||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function getAttributes() {
|
private function getAttributes()
|
||||||
return [ self::EXPORT ];
|
{
|
||||||
|
return [self::EXPORT];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
<?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\ChillJobBundle\Tests\Controller;
|
namespace Chill\ChillJobBundle\Tests\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
class CSPersonControllerTest extends WebTestCase
|
/**
|
||||||
{
|
* @internal
|
||||||
}
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
|
class CSPersonControllerTest extends WebTestCase {}
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
<?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\ChillJobBundle\Tests\Controller;
|
namespace Chill\ChillJobBundle\Tests\Controller;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
|
||||||
class CSReportControllerTest extends WebTestCase
|
/**
|
||||||
{
|
* @internal
|
||||||
}
|
*
|
||||||
|
* @coversNothing
|
||||||
|
*/
|
||||||
|
class CSReportControllerTest extends WebTestCase {}
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
<?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\ChillJobBundle\ThirdParty;
|
namespace Chill\ChillJobBundle\ThirdParty;
|
||||||
|
|
||||||
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type "Entreprise" pour les third parties
|
* Type "Entreprise" pour les third parties.
|
||||||
*/
|
*/
|
||||||
class EntrepriseType implements ThirdPartyTypeProviderInterface
|
class EntrepriseType implements ThirdPartyTypeProviderInterface
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
<?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\ChillJobBundle\ThirdParty;
|
namespace Chill\ChillJobBundle\ThirdParty;
|
||||||
|
|
||||||
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type "Prescripteur" pour les third parties
|
* Type "Prescripteur" pour les third parties.
|
||||||
*/
|
*/
|
||||||
class PrescripteurType implements ThirdPartyTypeProviderInterface
|
class PrescripteurType implements ThirdPartyTypeProviderInterface
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add schema chill_csconnectes & table cs_person inside
|
* Add schema chill_csconnectes & table cs_person inside.
|
||||||
*/
|
*/
|
||||||
final class Version20191119172511 extends AbstractMigration
|
final class Version20191119172511 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('CREATE SCHEMA chill_csconnectes');
|
$this->addSql('CREATE SCHEMA chill_csconnectes');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.cs_person (
|
$this->addSql('CREATE TABLE chill_csconnectes.cs_person (
|
||||||
@ -92,12 +101,11 @@ final class Version20191119172511 extends AbstractMigration
|
|||||||
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.typeContrat IS NULL');
|
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.typeContrat IS NULL');
|
||||||
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.ressources IS NULL');
|
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.ressources IS NULL');
|
||||||
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS NULL');
|
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS NULL');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP TABLE chill_csconnectes.cs_person');
|
$this->addSql('DROP TABLE chill_csconnectes.cs_person');
|
||||||
$this->addSql('DROP SCHEMA chill_csconnectes CASCADE');
|
$this->addSql('DROP SCHEMA chill_csconnectes CASCADE');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fix missing fields in previous migration
|
* Fix missing fields in previous migration.
|
||||||
*/
|
*/
|
||||||
final class Version20191129112321 extends AbstractMigration
|
final class Version20191129112321 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP INDEX chill_csconnectes.IDX_10864f31217bbb47');
|
$this->addSql('DROP INDEX chill_csconnectes.IDX_10864f31217bbb47');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CERSignataire TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CERSignataire TEXT DEFAULT NULL');
|
||||||
@ -28,11 +37,11 @@ final class Version20191129112321 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ALTER person_id DROP NOT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ALTER person_id DROP NOT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->throwIrreversibleMigrationException("this migration is not reversible ("
|
$this->throwIrreversibleMigrationException('this migration is not reversible ('
|
||||||
. "actions on primary keys)");
|
.'actions on primary keys)');
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP INDEX UNIQ_10864F31217BBB47');
|
$this->addSql('DROP INDEX UNIQ_10864F31217BBB47');
|
||||||
$this->addSql('DROP INDEX cs_person_pkey');
|
$this->addSql('DROP INDEX cs_person_pkey');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajout Immersion
|
* Ajout Immersion.
|
||||||
*/
|
*/
|
||||||
final class Version20200113104411 extends AbstractMigration
|
final class Version20200113104411 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('CREATE SEQUENCE chill_csconnectes.immersion_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE chill_csconnectes.immersion_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.immersion (id INT NOT NULL, person_id INT DEFAULT NULL, entreprise_id INT DEFAULT NULL, referent_id INT DEFAULT NULL, domaineActivite TEXT DEFAULT NULL, tuteurName TEXT DEFAULT NULL, tuteurFonction TEXT DEFAULT NULL, tuteurPhoneNumber TEXT DEFAULT NULL, structureAccName TEXT DEFAULT NULL, structureAccPhonenumber TEXT DEFAULT NULL, posteDescriptif TEXT DEFAULT NULL, posteTitle TEXT DEFAULT NULL, posteLieu TEXT DEFAULT NULL, debutDate DATE DEFAULT NULL, duration INTERVAL DEFAULT NULL, horaire TEXT DEFAULT NULL, objectifs JSONB DEFAULT NULL, savoirEtre JSONB DEFAULT NULL, noteimmersion TEXT NOT NULL, principalesActivites TEXT DEFAULT NULL, competencesAcquises TEXT DEFAULT NULL, competencesADevelopper TEXT DEFAULT NULL, noteBilan TEXT DEFAULT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE chill_csconnectes.immersion (id INT NOT NULL, person_id INT DEFAULT NULL, entreprise_id INT DEFAULT NULL, referent_id INT DEFAULT NULL, domaineActivite TEXT DEFAULT NULL, tuteurName TEXT DEFAULT NULL, tuteurFonction TEXT DEFAULT NULL, tuteurPhoneNumber TEXT DEFAULT NULL, structureAccName TEXT DEFAULT NULL, structureAccPhonenumber TEXT DEFAULT NULL, posteDescriptif TEXT DEFAULT NULL, posteTitle TEXT DEFAULT NULL, posteLieu TEXT DEFAULT NULL, debutDate DATE DEFAULT NULL, duration INTERVAL DEFAULT NULL, horaire TEXT DEFAULT NULL, objectifs JSONB DEFAULT NULL, savoirEtre JSONB DEFAULT NULL, noteimmersion TEXT NOT NULL, principalesActivites TEXT DEFAULT NULL, competencesAcquises TEXT DEFAULT NULL, competencesADevelopper TEXT DEFAULT NULL, noteBilan TEXT DEFAULT NULL, PRIMARY KEY(id))');
|
||||||
@ -25,9 +34,9 @@ final class Version20200113104411 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB435E47E35 FOREIGN KEY (referent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB435E47E35 FOREIGN KEY (referent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP SEQUENCE chill_csconnectes.immersion_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE chill_csconnectes.immersion_id_seq CASCADE');
|
||||||
$this->addSql('DROP TABLE chill_csconnectes.immersion');
|
$this->addSql('DROP TABLE chill_csconnectes.immersion');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -14,18 +23,18 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200113142525 extends AbstractMigration
|
final class Version20200113142525 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD structureAccEmail TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD structureAccEmail TEXT DEFAULT NULL');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD structureAccAddress_id INT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD structureAccAddress_id INT DEFAULT NULL');
|
||||||
$this->addSql('CREATE INDEX IDX_FBB3CBB4B5E04267 ON chill_csconnectes.immersion (structureAccAddress_id)');
|
$this->addSql('CREATE INDEX IDX_FBB3CBB4B5E04267 ON chill_csconnectes.immersion (structureAccAddress_id)');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP structureAccEmail');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP structureAccEmail');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP structureAccAddress_id');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP structureAccAddress_id');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -13,9 +22,9 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200114081435 extends AbstractMigration
|
final class Version20200114081435 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD is_bilan_fullfilled BOOLEAN DEFAULT \'false\' NOT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD is_bilan_fullfilled BOOLEAN DEFAULT \'false\' NOT NULL');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD savoirEtreNote TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD savoirEtreNote TEXT DEFAULT NULL');
|
||||||
@ -23,9 +32,9 @@ final class Version20200114081435 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4B5E04267 FOREIGN KEY (structureAccAddress_id) REFERENCES chill_main_address (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4B5E04267 FOREIGN KEY (structureAccAddress_id) REFERENCES chill_main_address (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP CONSTRAINT FK_FBB3CBB4B5E04267');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP CONSTRAINT FK_FBB3CBB4B5E04267');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP is_bilan_fullfilled');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP is_bilan_fullfilled');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,22 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add "datecontratIEJ" on dispositif
|
* Add "datecontratIEJ" on dispositif.
|
||||||
*/
|
*/
|
||||||
final class Version20200124130244 extends AbstractMigration
|
final class Version20200124130244 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD datecontratIEJ DATE DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD datecontratIEJ DATE DEFAULT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP datecontratIEJ');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP datecontratIEJ');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,20 +15,20 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajout type de contrat aidé
|
* Ajout type de contrat aidé.
|
||||||
*/
|
*/
|
||||||
final class Version20200124132321 extends AbstractMigration
|
final class Version20200124132321 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD typeContratAide TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD typeContratAide TEXT DEFAULT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP typeContratAide');
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP typeContratAide');
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,22 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajout colonne "objectifsAutre"
|
* Ajout colonne "objectifsAutre".
|
||||||
*/
|
*/
|
||||||
final class Version20200127132932 extends AbstractMigration
|
final class Version20200127132932 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD objectifsAutre TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD objectifsAutre TEXT DEFAULT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP objectifsAutre');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP objectifsAutre');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -10,31 +19,31 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200205132532 extends AbstractMigration
|
final class Version20200205132532 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP SEQUENCE report_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE report_id_seq CASCADE');
|
||||||
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_appellation_id_seq '
|
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_appellation_id_seq '
|
||||||
. 'INCREMENT BY 1 MINVALUE 1 START 1');
|
.'INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_metier_id_seq '
|
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_metier_id_seq '
|
||||||
. 'INCREMENT BY 1 MINVALUE 1 START 1');
|
.'INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE chill_csconnectes.projet_professionnel_id_seq '
|
$this->addSql('CREATE SEQUENCE chill_csconnectes.projet_professionnel_id_seq '
|
||||||
. 'INCREMENT BY 1 MINVALUE 1 START 1');
|
.'INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.rome_appellation ('
|
$this->addSql('CREATE TABLE chill_csconnectes.rome_appellation ('
|
||||||
. 'id INT NOT NULL, metier_id INT DEFAULT NULL, code VARCHAR(40) NOT NULL, '
|
.'id INT NOT NULL, metier_id INT DEFAULT NULL, code VARCHAR(40) NOT NULL, '
|
||||||
. 'libelle TEXT NOT NULL, PRIMARY KEY(id))');
|
.'libelle TEXT NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE INDEX IDX_D9E9CABCED16FA20 ON chill_csconnectes.rome_appellation (metier_id)');
|
$this->addSql('CREATE INDEX IDX_D9E9CABCED16FA20 ON chill_csconnectes.rome_appellation (metier_id)');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.rome_metier (id INT NOT NULL, '
|
$this->addSql('CREATE TABLE chill_csconnectes.rome_metier (id INT NOT NULL, '
|
||||||
. 'libelle TEXT NOT NULL, code VARCHAR(20) NOT NULL, PRIMARY KEY(id))');
|
.'libelle TEXT NOT NULL, code VARCHAR(20) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.projet_professionnel (id INT NOT NULL, '
|
$this->addSql('CREATE TABLE chill_csconnectes.projet_professionnel (id INT NOT NULL, '
|
||||||
. 'person_id INT DEFAULT NULL, reportDate DATE NOT NULL, '
|
.'person_id INT DEFAULT NULL, reportDate DATE NOT NULL, '
|
||||||
. 'typeContrat JSONB DEFAULT NULL, typeContratNotes TEXT DEFAULT NULL, '
|
.'typeContrat JSONB DEFAULT NULL, typeContratNotes TEXT DEFAULT NULL, '
|
||||||
. 'volumeHoraire JSONB DEFAULT NULL, volumeHoraireNotes TEXT DEFAULT NULL, '
|
.'volumeHoraire JSONB DEFAULT NULL, volumeHoraireNotes TEXT DEFAULT NULL, '
|
||||||
. 'idee TEXT DEFAULT NULL, enCoursConstruction TEXT DEFAULT NULL, '
|
.'idee TEXT DEFAULT NULL, enCoursConstruction TEXT DEFAULT NULL, '
|
||||||
. 'valideNotes TEXT DEFAULT NULL, projetProfessionnelNote TEXT DEFAULT NULL, '
|
.'valideNotes TEXT DEFAULT NULL, projetProfessionnelNote TEXT DEFAULT NULL, '
|
||||||
. 'PRIMARY KEY(id))');
|
.'PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE INDEX IDX_12E4FFBF217BBB47 ON chill_csconnectes.projet_professionnel (person_id)');
|
$this->addSql('CREATE INDEX IDX_12E4FFBF217BBB47 ON chill_csconnectes.projet_professionnel (person_id)');
|
||||||
$this->addSql('CREATE TABLE chill_csconnectes.projetprofessionnel_souhait (projetprofessionnel_id INT NOT NULL, appellation_id INT NOT NULL, PRIMARY KEY(projetprofessionnel_id, appellation_id))');
|
$this->addSql('CREATE TABLE chill_csconnectes.projetprofessionnel_souhait (projetprofessionnel_id INT NOT NULL, appellation_id INT NOT NULL, PRIMARY KEY(projetprofessionnel_id, appellation_id))');
|
||||||
$this->addSql('CREATE INDEX IDX_3280B96DB87BF7B5 ON chill_csconnectes.projetprofessionnel_souhait (projetprofessionnel_id)');
|
$this->addSql('CREATE INDEX IDX_3280B96DB87BF7B5 ON chill_csconnectes.projetprofessionnel_souhait (projetprofessionnel_id)');
|
||||||
@ -48,13 +57,11 @@ final class Version20200205132532 extends AbstractMigration
|
|||||||
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait ADD CONSTRAINT FK_3280B96D7CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait ADD CONSTRAINT FK_3280B96D7CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE0B87BF7B5 FOREIGN KEY (projetprofessionnel_id) REFERENCES chill_csconnectes.projet_professionnel (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE0B87BF7B5 FOREIGN KEY (projetprofessionnel_id) REFERENCES chill_csconnectes.projet_professionnel (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE07CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE07CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait DROP CONSTRAINT FK_3280B96D7CDE30DD');
|
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait DROP CONSTRAINT FK_3280B96D7CDE30DD');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide DROP CONSTRAINT FK_E0501BE07CDE30DD');
|
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide DROP CONSTRAINT FK_E0501BE07CDE30DD');
|
||||||
@ -70,7 +77,5 @@ final class Version20200205132532 extends AbstractMigration
|
|||||||
$this->addSql('DROP TABLE chill_csconnectes.projet_professionnel');
|
$this->addSql('DROP TABLE chill_csconnectes.projet_professionnel');
|
||||||
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_souhait');
|
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_souhait');
|
||||||
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_valide');
|
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_valide');
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,21 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add index for rome code appellation / metier
|
* Add index for rome code appellation / metier.
|
||||||
*/
|
*/
|
||||||
final class Version20200207224152 extends AbstractMigration
|
final class Version20200207224152 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('CREATE INDEX code_appellation_idx ON chill_csconnectes.rome_appellation (code)');
|
$this->addSql('CREATE INDEX code_appellation_idx ON chill_csconnectes.rome_appellation (code)');
|
||||||
$this->addSql('CREATE INDEX code_metier_idx ON chill_csconnectes.rome_metier (code)');
|
$this->addSql('CREATE INDEX code_metier_idx ON chill_csconnectes.rome_metier (code)');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('DROP INDEX code_appellation_idx ON chill_csconnectes.rome_appellation');
|
$this->addSql('DROP INDEX code_appellation_idx ON chill_csconnectes.rome_appellation');
|
||||||
$this->addSql('DROP INDEX code_metier_idx ON chill_csconnectes.rome_metier');
|
$this->addSql('DROP INDEX code_metier_idx ON chill_csconnectes.rome_metier');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -10,18 +19,17 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200210105342 extends AbstractMigration
|
final class Version20200210105342 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("CREATE UNIQUE INDEX UNIQ_D9E9CABC77153098 ON chill_csconnectes.rome_appellation (code);");
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_D9E9CABC77153098 ON chill_csconnectes.rome_appellation (code);');
|
||||||
$this->addSql("CREATE UNIQUE INDEX UNIQ_3274952577153098 ON chill_csconnectes.rome_metier (code);");
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_3274952577153098 ON chill_csconnectes.rome_metier (code);');
|
||||||
$this->addSql("DROP INDEX IF EXISTS chill_csconnectes.code_metier_idx ");
|
$this->addSql('DROP INDEX IF EXISTS chill_csconnectes.code_metier_idx ');
|
||||||
$this->addSql("DROP INDEX IF EXISTS chill_csconnectes.code_appellation_idx ");
|
$this->addSql('DROP INDEX IF EXISTS chill_csconnectes.code_appellation_idx ');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("DROP INDEX chill_csconnectes.UNIQ_D9E9CABC77153098");
|
$this->addSql('DROP INDEX chill_csconnectes.UNIQ_D9E9CABC77153098');
|
||||||
$this->addSql("DROP INDEX chill_csconnectes.UNIQ_3274952577153098");
|
$this->addSql('DROP INDEX chill_csconnectes.UNIQ_3274952577153098');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -10,9 +19,9 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200313124323 extends AbstractMigration
|
final class Version20200313124323 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.cv_formation ALTER diplomaobtained TYPE VARCHAR(255)');
|
$this->addSql('ALTER TABLE chill_csconnectes.cv_formation ALTER diplomaobtained TYPE VARCHAR(255)');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD ponctualite_salarie TEXT DEFAULT NULL');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD ponctualite_salarie TEXT DEFAULT NULL');
|
||||||
@ -46,9 +55,9 @@ final class Version20200313124323 extends AbstractMigration
|
|||||||
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.types IS NULL');
|
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.types IS NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP ponctualite_salarie');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP ponctualite_salarie');
|
||||||
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP ponctualite_salarie_note');
|
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP ponctualite_salarie_note');
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -11,15 +20,15 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
*/
|
*/
|
||||||
final class Version20200403114520 extends AbstractMigration
|
final class Version20200403114520 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.projet_professionnel ADD domaineActiviteSouhait TEXT DEFAULT NULL;");
|
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD domaineActiviteSouhait TEXT DEFAULT NULL;');
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.projet_professionnel ADD domaineActiviteValide TEXT DEFAULT NULL;");
|
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD domaineActiviteValide TEXT DEFAULT NULL;');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteSouhait");
|
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteSouhait');
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteValide");
|
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteValide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
namespace Chill\Migrations\Job;
|
namespace Chill\Migrations\Job;
|
||||||
|
|
||||||
@ -6,17 +15,17 @@ use Doctrine\DBAL\Schema\Schema;
|
|||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajout champ date avenant ieJ sur csperson
|
* Ajout champ date avenant ieJ sur csperson.
|
||||||
*/
|
*/
|
||||||
final class Version20200403123148 extends AbstractMigration
|
final class Version20200403123148 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function up(Schema $schema) : void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.cs_person ADD dateavenantIEJ DATE DEFAULT NULL;");
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD dateavenantIEJ DATE DEFAULT NULL;');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down(Schema $schema) : void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql("ALTER TABLE chill_csconnectes.cs_person DROP dateavenantIEJ");
|
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP dateavenantIEJ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user