mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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
|
||||
$rectorConfig->sets([
|
||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50,
|
||||
\Rector\Symfony\Set\SymfonySetList::SYMFONY_50_TYPES,
|
||||
\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\Set\ValueObject\LevelSetList::UP_TO_PHP_82,
|
||||
\Rector\Symfony\Set\SymfonyLevelSetList::UP_TO_SYMFONY_54,
|
||||
\Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
|
||||
\Rector\Doctrine\Set\DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
|
||||
]);
|
||||
|
@ -47,7 +47,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter
|
||||
private ?Scope $circle = null;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE)]
|
||||
private ?\DateTime $date;
|
||||
private ?\DateTime $date = null;
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(name: 'id', type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||
|
@ -1,31 +1,27 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Redis\ChillRedis;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Psr7;
|
||||
|
||||
/**
|
||||
* Wraps the pole emploi api
|
||||
*
|
||||
* Wraps the pole emploi api.
|
||||
*/
|
||||
class ApiWrapper
|
||||
{
|
||||
private $clientId;
|
||||
|
||||
private $clientSecret;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ChillRedis
|
||||
*/
|
||||
private $redis;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Client
|
||||
*/
|
||||
private $client;
|
||||
@ -35,15 +31,12 @@ class ApiWrapper
|
||||
*
|
||||
* 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([
|
||||
'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('', [
|
||||
'query' => ['realm' => '/partenaire'],
|
||||
'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' => [
|
||||
'grant_type' => 'client_credentials',
|
||||
'client_id' => $this->clientId,
|
||||
'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->getResponse()));
|
||||
dump(Psr7\str($e->getResponse()));
|
||||
}
|
||||
$data = \json_decode((string) $response->getBody());
|
||||
|
||||
// set the key with an expiry time
|
||||
$this->redis->setEx($cacheKey, $data->expires_in - 2,
|
||||
\serialize($data));
|
||||
$this->redis->setEx(
|
||||
$cacheKey,
|
||||
$data->expires_in - 2,
|
||||
\serialize($data)
|
||||
);
|
||||
|
||||
return $data->access_token;
|
||||
}
|
||||
@ -91,5 +85,4 @@ class ApiWrapper
|
||||
{
|
||||
return self::UNPERSONAL_BEARER.implode('', $scopes);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,41 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\ChillFranceTravailApiBundle\ApiHelper;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use GuzzleHttp\Exception\BadResponseException;
|
||||
use GuzzleHttp\Psr7;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Queries for ROME partenaires api
|
||||
*
|
||||
*
|
||||
* Queries for ROME partenaires api.
|
||||
*/
|
||||
class PartenaireRomeAppellation
|
||||
{
|
||||
use ProcessRequestTrait;
|
||||
/**
|
||||
*
|
||||
* @var ApiWrapper
|
||||
*/
|
||||
protected $wrapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Client
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var LoggerInterface
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
use ProcessRequestTrait;
|
||||
|
||||
public function __construct(
|
||||
ApiWrapper $wrapper,
|
||||
LoggerInterface $logger
|
||||
@ -43,7 +43,7 @@ class PartenaireRomeAppellation
|
||||
$this->wrapper = $wrapper;
|
||||
$this->logger = $logger;
|
||||
$this->client = new Client([
|
||||
'base_uri' => 'https://api.emploi-store.fr/partenaire/rome/v1/'
|
||||
'base_uri' => 'https://api.emploi-store.fr/partenaire/rome/v1/',
|
||||
]);
|
||||
}
|
||||
|
||||
@ -56,7 +56,6 @@ class PartenaireRomeAppellation
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $search
|
||||
*/
|
||||
public function getListeAppellation($search)
|
||||
@ -67,14 +66,18 @@ class PartenaireRomeAppellation
|
||||
$parameters = [
|
||||
'query' => [
|
||||
'q' => $search,
|
||||
'qf' => 'libelle'
|
||||
'qf' => 'libelle',
|
||||
],
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '.$bearer
|
||||
]
|
||||
'Authorization' => 'Bearer '.$bearer,
|
||||
],
|
||||
];
|
||||
$response = $this->handleRequest($request, $parameters, $this->client,
|
||||
$this->logger);
|
||||
$response = $this->handleRequest(
|
||||
$request,
|
||||
$parameters,
|
||||
$this->client,
|
||||
$this->logger
|
||||
);
|
||||
|
||||
return \GuzzleHttp\json_decode((string) $response->getBody());
|
||||
}
|
||||
@ -86,15 +89,19 @@ class PartenaireRomeAppellation
|
||||
$request = new Request('GET', sprintf('appellation/%s', $code));
|
||||
$parameters = [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer '.$bearer
|
||||
'Authorization' => 'Bearer '.$bearer,
|
||||
],
|
||||
'query' => [
|
||||
'champs' => 'code,libelle,metier(code,libelle)'
|
||||
]
|
||||
'champs' => 'code,libelle,metier(code,libelle)',
|
||||
],
|
||||
];
|
||||
|
||||
$response = $this->handleRequest($request, $parameters, $this->client,
|
||||
$this->logger);
|
||||
$response = $this->handleRequest(
|
||||
$request,
|
||||
$parameters,
|
||||
$this->client,
|
||||
$this->logger
|
||||
);
|
||||
|
||||
return \GuzzleHttp\json_decode((string) $response->getBody());
|
||||
}
|
||||
|
@ -1,6 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
@ -12,18 +20,16 @@ use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* Methods to process request against the api, and handle the
|
||||
* Exceptions
|
||||
*
|
||||
* Exceptions.
|
||||
*/
|
||||
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 Client $client
|
||||
* @param LoggerInterface $logger
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
protected function handleRequest(
|
||||
@ -32,19 +38,21 @@ trait ProcessRequestTrait
|
||||
Client $client,
|
||||
LoggerInterface $logger
|
||||
) {
|
||||
return $this->handleRequestRecursive($request, $parameters,
|
||||
$client, $logger);
|
||||
return $this->handleRequestRecursive(
|
||||
$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
|
||||
*
|
||||
* @return type
|
||||
*
|
||||
* @throws BadResponseException
|
||||
*/
|
||||
private function handleRequestRecursive(
|
||||
@ -56,19 +64,15 @@ trait ProcessRequestTrait
|
||||
) {
|
||||
try {
|
||||
return $client->send($request, $parameters);
|
||||
|
||||
} catch (BadResponseException $e) {
|
||||
if (
|
||||
// get 429 exceptions
|
||||
$e instanceof ClientException
|
||||
&&
|
||||
$e->getResponse()->getStatusCode() === 429
|
||||
&&
|
||||
count($e->getResponse()->getHeader('Retry-After')) > 0) {
|
||||
|
||||
&& 429 === $e->getResponse()->getStatusCode()
|
||||
&& count($e->getResponse()->getHeader('Retry-After')) > 0) {
|
||||
if ($counter > 5) {
|
||||
$logger->error("too much 429 response", [
|
||||
'request' => Psr7\str($e->getRequest())
|
||||
$logger->error('too much 429 response', [
|
||||
'request' => Psr7\str($e->getRequest()),
|
||||
]);
|
||||
|
||||
throw $e;
|
||||
@ -79,12 +83,17 @@ trait ProcessRequestTrait
|
||||
|
||||
sleep($delay);
|
||||
|
||||
return $this->handleRequestRecursive($request, $parameters,
|
||||
$client, $logger, $counter + 1);
|
||||
return $this->handleRequestRecursive(
|
||||
$request,
|
||||
$parameters,
|
||||
$client,
|
||||
$logger,
|
||||
$counter + 1
|
||||
);
|
||||
}
|
||||
|
||||
// handling other errors
|
||||
$logger->error("Error while querying ROME api", [
|
||||
$logger->error('Error while querying ROME api', [
|
||||
'status_code' => $e->getResponse()->getStatusCode(),
|
||||
'part' => 'appellation',
|
||||
'request' => Psr7\str($e->getRequest()),
|
||||
|
@ -1,9 +1,16 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillFranceTravailApiBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillFranceTravailApiBundle extends Bundle {}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
@ -10,7 +19,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
|
||||
class RomeController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @var PartenaireRomeAppellation
|
||||
*/
|
||||
@ -29,7 +37,7 @@ class RomeController extends Controller
|
||||
*/
|
||||
public function appellationSearchAction(Request $request)
|
||||
{
|
||||
if ($request->query->has('q') === FALSE) {
|
||||
if (false === $request->query->has('q')) {
|
||||
return new JsonResponse([]);
|
||||
}
|
||||
|
||||
@ -50,5 +58,4 @@ class RomeController extends Controller
|
||||
|
||||
return new JsonResponse($computed);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
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.
|
||||
*
|
||||
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||
*/
|
||||
class ChillFranceTravailApiExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
@ -12,9 +21,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
*/
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
|
@ -1,14 +1,25 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class PartenaireRomeAppellationTest extends KernelTestCase
|
||||
{
|
||||
@ -48,8 +59,10 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
||||
$appellations->getListeAppellation('chori');
|
||||
$data = $appellations->getListeAppellation('camion');
|
||||
|
||||
$this->assertTrue($data[0] instanceof \stdClass,
|
||||
'assert that first index of data is an instance of stdClass');
|
||||
$this->assertTrue(
|
||||
$data[0] instanceof \stdClass,
|
||||
'assert that first index of data is an instance of stdClass'
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetAppellation()
|
||||
@ -64,12 +77,17 @@ class PartenaireRomeAppellationTest extends KernelTestCase
|
||||
|
||||
$full = $appellations->getAppellation($a[0]->code);
|
||||
|
||||
$this->assertNotNull($full->libelle,
|
||||
'assert that libelle is not null');
|
||||
$this->assertTrue($full->metier instanceof \stdClass,
|
||||
'assert that metier is returned');
|
||||
$this->assertNotNull($full->metier->libelle,
|
||||
'assert that metier->libelle is not null');
|
||||
|
||||
$this->assertNotNull(
|
||||
$full->libelle,
|
||||
'assert that libelle is not null'
|
||||
);
|
||||
$this->assertTrue(
|
||||
$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
|
||||
|
||||
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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class RomeControllerTest extends WebTestCase
|
||||
{
|
||||
public function testAppellationsearch()
|
||||
@ -12,5 +26,4 @@ class RomeControllerTest extends WebTestCase
|
||||
|
||||
$crawler = $client->request('GET', '/{_locale}/pole-emploi/appellation/search');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,16 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class ChillJobBundle extends Bundle
|
||||
{
|
||||
}
|
||||
class ChillJobBundle extends Bundle {}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController;
|
||||
@ -8,51 +17,48 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Chill\ChillJobBundle\Entity\Immersion;
|
||||
|
||||
/**
|
||||
* CRUD Controller for reports (Frein, ...)
|
||||
*
|
||||
*
|
||||
* CRUD Controller for reports (Frein, ...).
|
||||
*/
|
||||
class CSCrudReportController extends EntityPersonCRUDController
|
||||
{
|
||||
public function __construct(private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {}
|
||||
|
||||
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) {
|
||||
case "save-and-close":
|
||||
case "delete-and-close":
|
||||
return $this->redirectToRoute('chill_csconnectes_csreport_index', [
|
||||
'person' => $entity->getPerson()->getId()
|
||||
]);
|
||||
default:
|
||||
return parent::onBeforeRedirectAfterSubmission($action, $entity, $form, $request);
|
||||
}
|
||||
return match ($next) {
|
||||
'save-and-close', 'delete-and-close' => $this->redirectToRoute('chill_csconnectes_csreport_index', [
|
||||
'person' => $entity->getPerson()->getId(),
|
||||
]),
|
||||
default => parent::onBeforeRedirectAfterSubmission($action, $entity, $form, $request),
|
||||
};
|
||||
}
|
||||
|
||||
protected function duplicateEntity(string $action, Request $request)
|
||||
{
|
||||
|
||||
if ($this->getCrudName() === 'cscv') {
|
||||
if ('cscv' === $this->getCrudName()) {
|
||||
$id = $request->query->get('duplicate_id', 0);
|
||||
/** @var \Chill\ChillJobBundle\Entity\CV $cv */
|
||||
$cv = $this->getEntity($action, $id, $request);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->managerRegistry->getManager();
|
||||
|
||||
$em->detach($cv);
|
||||
|
||||
foreach($cv->getExperiences() as $experience) {
|
||||
foreach ($cv->getExperiences() as $experience) {
|
||||
$cv->removeExperience($experience);
|
||||
$em->detach($experience);
|
||||
$cv->addExperience($experience);
|
||||
}
|
||||
foreach($cv->getFormations() as $formation) {
|
||||
foreach ($cv->getFormations() as $formation) {
|
||||
$cv->removeFormation($formation);
|
||||
$em->detach($formation);
|
||||
$cv->addFormation($formation);
|
||||
}
|
||||
|
||||
return $cv;
|
||||
} elseif ($this->getCrudName() === 'projet_prof') {
|
||||
}
|
||||
if ('projet_prof' === $this->getCrudName()) {
|
||||
$id = $request->query->get('duplicate_id', 0);
|
||||
/** @var \Chill\ChillJobBundle\Entity\ProjetProfessionnel $original */
|
||||
$original = $this->getEntity($action, $id, $request);
|
||||
@ -72,23 +78,24 @@ class CSCrudReportController extends EntityPersonCRUDController
|
||||
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 ('edit' === $action || 'new' === $action) {
|
||||
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, [
|
||||
'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);
|
||||
@ -105,20 +112,13 @@ class CSCrudReportController extends EntityPersonCRUDController
|
||||
parent::onPreFlush($action, $entity, $form, $request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Edit immersion bilan
|
||||
* Edit immersion bilan.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param type $id
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function editBilan(Request $request, $id): \Symfony\Component\HttpFoundation\Response
|
||||
{
|
||||
return $this->formEditAction('bilan', $request, $id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,22 @@
|
||||
<?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;
|
||||
|
||||
use Chill\PersonBundle\CRUD\Controller\OneToOneEntityPersonCRUDController;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Chill\ChillJobBundle\Form\CSPersonPersonalSituationType;
|
||||
use Chill\ChillJobBundle\Form\CSPersonDispositifsType;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
@ -46,7 +53,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
|
||||
protected function generateRedirectOnCreateRoute($action, Request $request, $entity)
|
||||
{
|
||||
switch($action) {
|
||||
switch ($action) {
|
||||
case 'ps_situation_view':
|
||||
$route = 'chill_crud_csperson_personal_situation_edit';
|
||||
break;
|
||||
@ -62,36 +69,32 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
|
||||
protected function checkACL($action, $entity)
|
||||
{
|
||||
switch($action) {
|
||||
case 'ps_situation_edit':
|
||||
case 'dispositifs_edit':
|
||||
$this->denyAccessUnlessGranted(PersonVoter::UPDATE,
|
||||
$entity->getPerson());
|
||||
break;
|
||||
case 'ps_situation_view':
|
||||
case 'dispositifs_view':
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE,
|
||||
$entity->getPerson());
|
||||
break;
|
||||
default:
|
||||
parent::checkACL($action, $entity);
|
||||
}
|
||||
match ($action) {
|
||||
'ps_situation_edit', 'dispositifs_edit' => $this->denyAccessUnlessGranted(
|
||||
PersonVoter::UPDATE,
|
||||
$entity->getPerson()
|
||||
),
|
||||
'ps_situation_view', 'dispositifs_view' => $this->denyAccessUnlessGranted(
|
||||
PersonVoter::SEE,
|
||||
$entity->getPerson()
|
||||
),
|
||||
default => parent::checkACL($action, $entity),
|
||||
};
|
||||
}
|
||||
|
||||
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
switch($action) {
|
||||
case 'ps_situation_edit':
|
||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_personal_situation_view',
|
||||
['id' => $entity->getId()]);
|
||||
|
||||
case 'dispositifs_edit':
|
||||
return $this->redirectToRoute('chill_crud_'.$this->getCrudName().'_dispositifs_view',
|
||||
['id' => $entity->getId()]);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return match ($action) {
|
||||
'ps_situation_edit' => $this->redirectToRoute(
|
||||
'chill_crud_'.$this->getCrudName().'_personal_situation_view',
|
||||
['id' => $entity->getId()]
|
||||
),
|
||||
'dispositifs_edit' => $this->redirectToRoute(
|
||||
'chill_crud_'.$this->getCrudName().'_dispositifs_view',
|
||||
['id' => $entity->getId()]
|
||||
),
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
||||
protected function getTemplateFor($action, $entity, Request $request)
|
||||
@ -110,19 +113,23 @@ 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) {
|
||||
case 'dispositifs_edit':
|
||||
$form = $this->createForm($formClass, $entity, \array_merge(
|
||||
$formOptions, [ 'center' => $entity->getPerson()->getCenter() ]));
|
||||
$formOptions,
|
||||
['center' => $entity->getPerson()->getCenter()]
|
||||
));
|
||||
$this->customizeForm($action, $form);
|
||||
|
||||
return $form;
|
||||
|
||||
case 'ps_situation_edit':
|
||||
$form = $this->createForm($formClass, $entity, \array_merge(
|
||||
$formOptions, [ 'center' => $entity->getPerson()->getCenter() ]));
|
||||
$formOptions,
|
||||
['center' => $entity->getPerson()->getCenter()]
|
||||
));
|
||||
$this->customizeForm($action, $form);
|
||||
|
||||
return $form;
|
||||
@ -134,18 +141,16 @@ class CSPersonController extends OneToOneEntityPersonCRUDController
|
||||
|
||||
protected function generateLabelForButton($action, $formName, $form)
|
||||
{
|
||||
switch($action):
|
||||
switch ($action) {
|
||||
case 'ps_situation_edit':
|
||||
case 'dispositifs_edit':
|
||||
if ($formName === 'submit') {
|
||||
if ('submit' === $formName) {
|
||||
return 'Enregistrer';
|
||||
} else {
|
||||
throw new \LogicException("this formName is not supported: $formName");
|
||||
}
|
||||
throw new \LogicException("this formName is not supported: {$formName}");
|
||||
break;
|
||||
default:
|
||||
return parent::generateLabelForButton($action, $formName, $form);
|
||||
endswitch;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
@ -16,16 +25,14 @@ use Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter;
|
||||
class CSReportController extends Controller
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @Route("{_locale}/csconnectes/person/{person}/report",
|
||||
* name="chill_csconnectes_csreport_index"
|
||||
* )
|
||||
* @param Person $person
|
||||
*/
|
||||
public function index(Person $person): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person, "The access to "
|
||||
. "person is denied");
|
||||
$this->denyAccessUnlessGranted(PersonVoter::SEE, $person, 'The access to '
|
||||
.'person is denied');
|
||||
|
||||
$reports = $this->getReports($person);
|
||||
|
||||
@ -54,14 +61,10 @@ class CSReportController extends Controller
|
||||
}
|
||||
|
||||
foreach ($kinds as $key => $className) {
|
||||
switch ($key) {
|
||||
case 'immersions':
|
||||
$ordering = [ 'debutDate' => 'DESC' ];
|
||||
break;
|
||||
default:
|
||||
$ordering = [ 'reportDate' => 'DESC' ];
|
||||
break;
|
||||
}
|
||||
$ordering = match ($key) {
|
||||
'immersions' => ['debutDate' => 'DESC'],
|
||||
default => ['reportDate' => 'DESC'],
|
||||
};
|
||||
$results[$key] = $this->getDoctrine()->getManager()
|
||||
->getRepository($className)
|
||||
->findByPerson($person, $ordering);
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
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.
|
||||
*
|
||||
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
|
||||
*/
|
||||
class ChillJobExtension extends Extension
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
@ -26,6 +32,6 @@ class ChillJobExtension extends Extension
|
||||
$loader->load('services.yml');
|
||||
|
||||
// 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
|
||||
|
||||
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;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
@ -12,9 +21,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
*/
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder();
|
||||
|
@ -13,31 +13,27 @@ use ChampsLibres\AsyncUploaderBundle\Validator\Constraints\AsyncFileExists;
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @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',
|
||||
'locataire',
|
||||
'heberge_chez_tiers',
|
||||
@ -48,74 +44,68 @@ class CSPerson
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="enfantACharge", type="integer", nullable=true)
|
||||
* @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'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="niveauMaitriseLangue", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'niveauMaitriseLangue', type: 'json', nullable: true)]
|
||||
private $niveauMaitriseLangue;
|
||||
|
||||
/**
|
||||
* @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'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="permisConduire", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'permisConduire', type: 'json', nullable: true)]
|
||||
private $permisConduire;
|
||||
|
||||
const SITUATION_PROFESSIONNELLE = [
|
||||
public const SITUATION_PROFESSIONNELLE = [
|
||||
'sans_emploi', 'en_activite', 'etudiant', 'etudiant_descolarise'
|
||||
];
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="dateFinDernierEmploi", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $dateFinDernierEmploi;
|
||||
#[ORM\Column(name: 'dateFinDernierEmploi', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $dateFinDernierEmploi = null;
|
||||
|
||||
const TYPE_CONTRAT = [
|
||||
public const TYPE_CONTRAT = [
|
||||
'cdd',
|
||||
'cdi',
|
||||
'contrat_interim',
|
||||
@ -127,19 +117,18 @@ class CSPerson
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="typeContrat", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'typeContrat', type: 'json', nullable: true)]
|
||||
private $typeContrat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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',
|
||||
'ARE',
|
||||
'ASS',
|
||||
@ -150,42 +139,36 @@ class CSPerson
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="ressources", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'ressources', type: 'json', nullable: true)]
|
||||
private $ressources;
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="ressourceDate1Versement", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $ressourceDate1Versement;
|
||||
#[ORM\Column(name: 'ressourceDate1Versement', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $ressourceDate1Versement = null;
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @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',
|
||||
'pole_emploi',
|
||||
'referent_RSA',
|
||||
@ -196,82 +179,73 @@ class CSPerson
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="accompagnement", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'accompagnement', type: 'json', nullable: true)]
|
||||
private $accompagnement;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="accompagnementRQTHDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $accompagnementRQTHDate;
|
||||
#[ORM\Column(name: 'accompagnementRQTHDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $accompagnementRQTHDate = null;
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="poleEmploiInscriptionDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $poleEmploiInscriptionDate;
|
||||
#[ORM\Column(name: 'poleEmploiInscriptionDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $poleEmploiInscriptionDate = null;
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="cafInscriptionDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $cafInscriptionDate;
|
||||
#[ORM\Column(name: 'cafInscriptionDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $cafInscriptionDate = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="CERInscriptionDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $cERInscriptionDate;
|
||||
#[ORM\Column(name: 'CERInscriptionDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $cERInscriptionDate = null;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="PPAEInscriptionDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $pPAEInscriptionDate;
|
||||
#[ORM\Column(name: 'PPAEInscriptionDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $pPAEInscriptionDate = 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
|
||||
* @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',
|
||||
'non',
|
||||
'en_attente'
|
||||
@ -279,64 +253,60 @@ class CSPerson
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="NEETCommissionDate", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $nEETCommissionDate;
|
||||
#[ORM\Column(name: 'NEETCommissionDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $nEETCommissionDate = null;
|
||||
|
||||
/**
|
||||
* @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
|
||||
* @ORM\Column(name="datecontratIEJ", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $dateContratIEJ;
|
||||
#[ORM\Column(name: 'datecontratIEJ', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $dateContratIEJ = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \DateTime
|
||||
* @ORM\Column(name="dateavenantIEJ", type="date", nullable=true)
|
||||
* @var \DateTimeInterface
|
||||
*/
|
||||
private $dateAvenantIEJ;
|
||||
#[ORM\Column(name: 'dateavenantIEJ', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $dateAvenantIEJ = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @ORM\Column(name="handicap", type="boolean", nullable=true)
|
||||
*/
|
||||
private $handicapIs;
|
||||
#[ORM\Column(name: 'handicap', type: 'boolean', nullable: true)]
|
||||
private ?bool $handicapIs = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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',
|
||||
'milieu_ordinaire',
|
||||
'entreprise_adaptee'
|
||||
@ -345,21 +315,19 @@ class CSPerson
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @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',
|
||||
'scooter',
|
||||
'velo',
|
||||
@ -370,179 +338,133 @@ class CSPerson
|
||||
/**
|
||||
*
|
||||
* @var string[]
|
||||
* @ORM\Column(name="mobilitemoyentransport", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'mobilitemoyentransport', type: 'json', nullable: true)]
|
||||
private $mobiliteMoyenDeTransport;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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()
|
||||
*/
|
||||
private $documentAgrementIAE;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAgrementIAE = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentRQTH;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentRQTH = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentAttestationNEET;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationNEET = null;
|
||||
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentCI;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentCI = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentTitreSejour;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentTitreSejour = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentAttestationFiscale;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationFiscale = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentPermis;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentPermis = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentAttestationCAAF;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationCAAF = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentContraTravail;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentContraTravail = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentAttestationFormation;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationFormation = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentQuittanceLoyer;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentQuittanceLoyer = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentFactureElectricite;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentFactureElectricite = null;
|
||||
|
||||
/**
|
||||
* @var StoredObject|null
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\DocStoreBundle\Entity\StoredObject",
|
||||
* cascade={ "persist" }
|
||||
* )
|
||||
* @Assert\Valid()
|
||||
*/
|
||||
private $documentAttestationSecuriteSociale;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\DocStoreBundle\Entity\StoredObject::class, cascade: ['persist'])]
|
||||
private ?\Chill\DocStoreBundle\Entity\StoredObject $documentAttestationSecuriteSociale = 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.
|
||||
@ -636,7 +558,6 @@ class CSPerson
|
||||
/**
|
||||
* Valide niveauMaitriseLangue
|
||||
*
|
||||
* @param ExecutionContextInterface $context
|
||||
* @Assert\Callback()
|
||||
*/
|
||||
public function validateNiveauMatriseLangue(ExecutionContextInterface $context)
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -9,31 +18,24 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* CV
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.cv")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CVRepository")
|
||||
* CV.
|
||||
*/
|
||||
class CV
|
||||
#[ORM\Table(name: 'chill_csconnectes.cv')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CVRepository::class)]
|
||||
class CV implements \Stringable
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="reportDate", type="date")
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $reportDate;
|
||||
#[ORM\Column(name: 'reportDate', type: 'date')]
|
||||
private ?\DateTimeInterface $reportDate = null;
|
||||
|
||||
const FORMATION_LEVEL = [
|
||||
public const FORMATION_LEVEL = [
|
||||
'sans_diplome',
|
||||
'BEP_CAP',
|
||||
'BAC',
|
||||
@ -41,79 +43,48 @@ class CV
|
||||
'BAC+3',
|
||||
'BAC+4',
|
||||
'BAC+5',
|
||||
'BAC+8'
|
||||
'BAC+8',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="formationLevel", type="string", length=255, nullable=true)
|
||||
* @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_continue'
|
||||
'formation_continue',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="formationType", type="string", length=255, nullable=true)
|
||||
*/
|
||||
private $formationType;
|
||||
#[ORM\Column(name: 'formationType', type: 'string', length: 255, nullable: true)]
|
||||
private ?string $formationType = null;
|
||||
|
||||
/**
|
||||
* @var string[]|null
|
||||
*
|
||||
* @ORM\Column(name="spokenLanguages", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'spokenLanguages', type: 'json', nullable: true)]
|
||||
private $spokenLanguages;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
|
||||
private ?string $notes = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Chill\PersonBundle\Entity\Person
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\PersonBundle\Entity\Person"
|
||||
* )
|
||||
*/
|
||||
private $person;
|
||||
#[ORM\ManyToOne(targetEntity: Person::class)]
|
||||
private ?Person $person = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -265,7 +236,7 @@ class CV
|
||||
public function setFormations(Collection $formations)
|
||||
{
|
||||
foreach ($formations as $formation) {
|
||||
/** @var CV\Formation $formation */
|
||||
/* @var CV\Formation $formation */
|
||||
$formation->setCV($this);
|
||||
}
|
||||
$this->formations = $formations;
|
||||
@ -287,7 +258,7 @@ class CV
|
||||
|
||||
public function removeFormation(CV\Formation $formation)
|
||||
{
|
||||
if (FALSE === $this->formations->contains($formation)) {
|
||||
if (false === $this->formations->contains($formation)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -300,7 +271,7 @@ class CV
|
||||
public function setExperiences(Collection $experiences)
|
||||
{
|
||||
foreach ($experiences as $experience) {
|
||||
/** @var CV\Experience $experience */
|
||||
/* @var CV\Experience $experience */
|
||||
$experience->setCV($this);
|
||||
}
|
||||
|
||||
@ -323,7 +294,7 @@ class CV
|
||||
|
||||
public function removeExperience(CV\Experience $experience)
|
||||
{
|
||||
if (FALSE === $this->experiences->contains($experience)) {
|
||||
if (false === $this->experiences->contains($experience)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -341,13 +312,13 @@ class CV
|
||||
public function setPerson(Person $person)
|
||||
{
|
||||
$this->person = $person;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'CV de '.$this->getPerson().' daté du '.
|
||||
$this->getReportDate()->format('d-m-Y');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -7,52 +16,33 @@ use Chill\ChillJobBundle\Entity\CV;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Experience
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.cv_experience")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CV\ExperienceRepository")
|
||||
* Experience.
|
||||
*/
|
||||
#[ORM\Table(name: 'chill_csconnectes.cv_experience')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CV\ExperienceRepository::class)]
|
||||
class Experience
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
#[ORM\Column(name: 'poste', type: 'text', nullable: true)]
|
||||
private ?string $poste = null;
|
||||
|
||||
#[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")
|
||||
*/
|
||||
private $endDate;
|
||||
#[ORM\Column(name: 'endDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $endDate = null;
|
||||
|
||||
const CONTRAT_TYPE = [
|
||||
public const CONTRAT_TYPE = [
|
||||
'cddi',
|
||||
'cdd-6mois',
|
||||
'cdd+6mois',
|
||||
@ -65,33 +55,17 @@ class Experience
|
||||
'stage',
|
||||
'volontariat',
|
||||
'benevolat',
|
||||
'autres'
|
||||
'autres',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="contratType", type="string", length=100)
|
||||
*/
|
||||
private $contratType;
|
||||
#[ORM\Column(name: 'contratType', type: 'string', length: 100)]
|
||||
private ?string $contratType = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var CV
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="Chill\ChillJobBundle\Entity\CV",
|
||||
* inversedBy="experiences"
|
||||
* )
|
||||
*/
|
||||
private $CV;
|
||||
#[ORM\Column(name: 'notes', type: 'text', nullable: true)]
|
||||
private ?string $notes = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: CV::class, inversedBy: 'experiences')]
|
||||
private ?CV $CV = null;
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
@ -258,6 +232,4 @@ class Experience
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -7,86 +16,53 @@ use Chill\ChillJobBundle\Entity\CV;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Formation
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.cv_formation")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\CV\FormationRepository")
|
||||
* Formation.
|
||||
*/
|
||||
#[ORM\Table(name: 'chill_csconnectes.cv_formation')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\CV\FormationRepository::class)]
|
||||
class Formation
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="title", type="text")
|
||||
* @Assert\Length(min=3)
|
||||
*
|
||||
* @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")
|
||||
*/
|
||||
private $endDate;
|
||||
#[ORM\Column(name: 'endDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $endDate = null;
|
||||
|
||||
const DIPLOMA_OBTAINED = [
|
||||
'fr', 'non-fr', 'aucun'
|
||||
public const DIPLOMA_OBTAINED = [
|
||||
'fr', 'non-fr', 'aucun',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="diplomaObtained", type="string", nullable=true)
|
||||
*/
|
||||
private $diplomaObtained;
|
||||
#[ORM\Column(name: 'diplomaObtained', type: 'string', nullable: true)]
|
||||
private ?string $diplomaObtained = null;
|
||||
|
||||
const DIPLOMA_RECONNU = [
|
||||
'oui', 'non', 'nsp'
|
||||
public const DIPLOMA_RECONNU = [
|
||||
'oui', 'non', 'nsp',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string|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: 'diplomaReconnue', type: 'string', length: 50, nullable: true)]
|
||||
private ?string $diplomaReconnue = null;
|
||||
|
||||
#[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.
|
||||
@ -253,6 +229,4 @@ class Formation
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -8,92 +17,77 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* Frein
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.frein")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\FreinRepository")
|
||||
* Frein.
|
||||
*/
|
||||
class Frein implements HasPerson
|
||||
#[ORM\Table(name: 'chill_csconnectes.frein')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\FreinRepository::class)]
|
||||
class Frein implements HasPerson, \Stringable
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="reportDate", type="date")
|
||||
* @Assert\NotNull()
|
||||
*
|
||||
* @Assert\Date()
|
||||
*
|
||||
* @Assert\GreaterThan("5 years ago",
|
||||
* 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_personnelle_et_familiale',
|
||||
'comportement',
|
||||
'etat_de_sante',
|
||||
'precarite_situation_materielle',
|
||||
'condition_ou_absence_logement',
|
||||
'autres'
|
||||
'autres',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*
|
||||
* @ORM\Column(name="freinsPerso", type="json")
|
||||
*/
|
||||
#[ORM\Column(name: 'freinsPerso', type: 'json')]
|
||||
private $freinsPerso = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notesPerso", type="text")
|
||||
*/
|
||||
private $notesPerso = '';
|
||||
#[ORM\Column(name: 'notesPerso', type: 'text')]
|
||||
private ?string $notesPerso = '';
|
||||
|
||||
const FREINS_EMPLOI = [
|
||||
public const FREINS_EMPLOI = [
|
||||
'garde_d_enfants',
|
||||
'sante',
|
||||
'famille',
|
||||
'finances',
|
||||
'maitrise_de_la_langue',
|
||||
'autres'
|
||||
'autres',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
*
|
||||
* @ORM\Column(name="freinsEmploi", type="json")
|
||||
*/
|
||||
#[ORM\Column(name: 'freinsEmploi', type: 'json')]
|
||||
private $freinsEmploi = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notesEmploi", type="text")
|
||||
*/
|
||||
private $notesEmploi = '';
|
||||
#[ORM\Column(name: 'notesEmploi', type: 'text')]
|
||||
private ?string $notesEmploi = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Person
|
||||
*
|
||||
* @ORM\ManytoOne(
|
||||
* targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $person;
|
||||
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
$this->reportDate = new \DateTime('today');
|
||||
}
|
||||
@ -159,11 +153,9 @@ class Frein implements HasPerson
|
||||
/**
|
||||
* Set notesPerso.
|
||||
*
|
||||
* @param string $notesPerso
|
||||
*
|
||||
* @return Frein
|
||||
*/
|
||||
public function setNotesPerso(string $notesPerso = null)
|
||||
public function setNotesPerso(?string $notesPerso = null)
|
||||
{
|
||||
$this->notesPerso = (string) $notesPerso;
|
||||
|
||||
@ -207,11 +199,9 @@ class Frein implements HasPerson
|
||||
/**
|
||||
* Set notesEmploi.
|
||||
*
|
||||
* @param string $notesEmploi
|
||||
*
|
||||
* @return Frein
|
||||
*/
|
||||
public function setNotesEmploi(string $notesEmploi = null)
|
||||
public function setNotesEmploi(?string $notesEmploi = null)
|
||||
{
|
||||
$this->notesEmploi = (string) $notesEmploi;
|
||||
|
||||
@ -233,7 +223,7 @@ class Frein implements HasPerson
|
||||
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;
|
||||
|
||||
@ -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
|
||||
*
|
||||
* @Assert\Callback()
|
||||
*/
|
||||
public function validateFreinsCount(ExecutionContextInterface $context, $payload)
|
||||
{
|
||||
$nb = count($this->getFreinsEmploi()) + count($this->getFreinsPerso());
|
||||
|
||||
if ($nb === 0) {
|
||||
$msg = "Indiquez au moins un frein parmi les freins "
|
||||
. "liés à l'emploi et les freins liés à la situation personnelle.";
|
||||
if (0 === $nb) {
|
||||
$msg = 'Indiquez au moins un frein parmi les freins '
|
||||
."liés à l'emploi et les freins liés à la situation personnelle.";
|
||||
$context->buildViolation($msg)
|
||||
->atPath('freinsEmploi')
|
||||
->addViolation();
|
||||
@ -264,7 +254,7 @@ class Frein implements HasPerson
|
||||
}
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'Rapport "frein" de '.$this->getPerson().' daté du '.
|
||||
$this->getReportDate()->format('d-m-Y');
|
||||
|
@ -12,13 +12,12 @@ use Chill\MainBundle\Validation\Constraint\PhonenumberConstraint;
|
||||
|
||||
/**
|
||||
* 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',
|
||||
'non',
|
||||
'nsp'
|
||||
@ -26,12 +25,11 @@ class Immersion
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\ThirdPartyBundle\Entity\ThirdParty"
|
||||
* )
|
||||
* @Assert\NotNull()
|
||||
* @Assert\Length(min=2)
|
||||
*/
|
||||
private $entreprise;
|
||||
#[ORM\ManyToOne(targetEntity: \\Chill\ThirdPartyBundle\Entity\ThirdParty::class)]
|
||||
private ?\Chill\ThirdPartyBundle\Entity\ThirdParty $entreprise = 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
|
||||
*
|
||||
* @ORM\Column(name="domaineActivite", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @Assert\Length(min=2)
|
||||
*/
|
||||
private $domaineActivite;
|
||||
#[ORM\Column(name: 'domaineActivite', type: 'text', nullable: true)]
|
||||
private ?string $domaineActivite = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="tuteurName", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @Assert\Length(min=2)
|
||||
*/
|
||||
private $tuteurName;
|
||||
#[ORM\Column(name: 'tuteurName', type: 'text', nullable: true)]
|
||||
private ?string $tuteurName = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="tuteurFonction", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @Assert\Length(min=2)
|
||||
*/
|
||||
private $tuteurFonction;
|
||||
#[ORM\Column(name: 'tuteurFonction', type: 'text', nullable: true)]
|
||||
private ?string $tuteurFonction = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="tuteurPhoneNumber", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="structureAccName", type="text", nullable=true)
|
||||
*/
|
||||
private $structureAccName;
|
||||
#[ORM\Column(name: 'structureAccName', type: 'text', nullable: true)]
|
||||
private ?string $structureAccName = null;
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="posteDescriptif", type="text", nullable=true)
|
||||
*/
|
||||
private $posteDescriptif;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="posteTitle", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @Assert\Length(min=2)
|
||||
*/
|
||||
private $posteTitle;
|
||||
#[ORM\Column(name: 'posteTitle', type: 'text', nullable: true)]
|
||||
private ?string $posteTitle = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="posteLieu", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @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()
|
||||
*/
|
||||
private $debutDate;
|
||||
#[ORM\Column(name: 'debutDate', type: 'date', nullable: true)]
|
||||
private ?\DateTimeInterface $debutDate = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="duration", type="dateinterval", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
#[ORM\Column(name: 'duration', type: 'dateinterval', nullable: true)]
|
||||
private $duration;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="horaire", type="text", nullable=true)
|
||||
* @Assert\NotNull()
|
||||
* @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',
|
||||
'confirmer_projet_prof',
|
||||
'acquerir_experience',
|
||||
@ -195,26 +183,25 @@ class Immersion
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*
|
||||
* @ORM\Column(name="objectifs", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'objectifs', type: 'json', nullable: true)]
|
||||
private $objectifs;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @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',
|
||||
'ponctualite',
|
||||
'respect_consigne_securite',
|
||||
@ -225,54 +212,48 @@ class Immersion
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*
|
||||
* @ORM\Column(name="savoirEtre", type="json", nullable=true)
|
||||
*/
|
||||
#[ORM\Column(name: 'savoirEtre', type: 'json', nullable: true)]
|
||||
private $savoirEtre;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @ORM\Column(name="noteimmersion", type="text")
|
||||
*/
|
||||
private $noteImmersion = '';
|
||||
#[ORM\Column(name: 'noteimmersion', type: 'text')]
|
||||
private ?string $noteImmersion = '';
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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
|
||||
*
|
||||
* @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',
|
||||
'un',
|
||||
'plusieurs'
|
||||
@ -281,18 +262,18 @@ class Immersion
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @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',
|
||||
'un',
|
||||
'plusieurs'
|
||||
@ -301,32 +282,32 @@ class Immersion
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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',
|
||||
'rapidement',
|
||||
'pas_encore'
|
||||
@ -335,114 +316,114 @@ class Immersion
|
||||
/**
|
||||
*
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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
|
||||
* @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.
|
||||
@ -1248,7 +1229,7 @@ class Immersion
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'Rapport "immersion" de '.$this->getPerson();
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -10,149 +19,91 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ChillJobBundle\Entity\Rome\Appellation;
|
||||
|
||||
/**
|
||||
* ProjetProfessionnel
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.projet_professionnel")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\ProjetProfessionnelRepository")
|
||||
* ProjetProfessionnel.
|
||||
*/
|
||||
class ProjetProfessionnel
|
||||
#[ORM\Table(name: 'chill_csconnectes.projet_professionnel')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\ProjetProfessionnelRepository::class)]
|
||||
class ProjetProfessionnel implements \Stringable
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Person
|
||||
*
|
||||
* @ORM\ManytoOne(
|
||||
* targetEntity="Chill\PersonBundle\Entity\Person")
|
||||
*
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $person;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="reportDate", type="date")
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $reportDate;
|
||||
#[ORM\Column(name: 'reportDate', type: 'date')]
|
||||
private ?\DateTimeInterface $reportDate = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Collection
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
|
||||
* cascade={"persist"}
|
||||
* )
|
||||
* @ORM\JoinTable(
|
||||
* name="chill_csconnectes.projetprofessionnel_souhait"
|
||||
* )
|
||||
*/
|
||||
private $souhait;
|
||||
#[ORM\JoinTable(name: 'chill_csconnectes.projetprofessionnel_souhait')]
|
||||
#[ORM\ManyToMany(targetEntity: Appellation::class, cascade: ['persist'])]
|
||||
private Collection $souhait;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
* @ORM\Column(name="domaineActiviteSouhait", type="text", nullable=true)
|
||||
*/
|
||||
private $domaineActiviteSouhait;
|
||||
#[ORM\Column(name: 'domaineActiviteSouhait', type: 'text', nullable: true)]
|
||||
private ?string $domaineActiviteSouhait = null;
|
||||
|
||||
const TYPE_CONTRAT = [
|
||||
public const TYPE_CONTRAT = [
|
||||
'cdd', 'cdi', 'contrat_insertion',
|
||||
'interim', 'indifferent', 'apprentissage',
|
||||
'personnalisation', 'creation_entreprise'
|
||||
'personnalisation', 'creation_entreprise',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*
|
||||
* @ORM\Column(name="typeContrat", type="json", nullable=true)
|
||||
* @Assert\Count(min=1, minMessage="Indiquez au moins un type de contrat")
|
||||
|
||||
*/
|
||||
#[ORM\Column(name: 'typeContrat', type: 'json', nullable: true)]
|
||||
private $typeContrat;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="typeContratNotes", type="text", nullable=true)
|
||||
*/
|
||||
private $typeContratNotes;
|
||||
#[ORM\Column(name: 'typeContratNotes', type: 'text', nullable: true)]
|
||||
private ?string $typeContratNotes = null;
|
||||
|
||||
const VOLUME_HORAIRES = [
|
||||
public const VOLUME_HORAIRES = [
|
||||
'temps_plein',
|
||||
'temps_partiel'
|
||||
'temps_partiel',
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
*
|
||||
* @ORM\Column(name="volumeHoraire", type="json", nullable=true)
|
||||
* @Assert\Count(min=1, minMessage="Indiquez un volume horaire souhaité")
|
||||
*/
|
||||
#[ORM\Column(name: 'volumeHoraire', type: 'json', nullable: true)]
|
||||
private $volumeHoraire;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="volumeHoraireNotes", type="text", nullable=true)
|
||||
*/
|
||||
private $volumeHoraireNotes;
|
||||
#[ORM\Column(name: 'volumeHoraireNotes', type: 'text', nullable: true)]
|
||||
private ?string $volumeHoraireNotes = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="idee", type="text", nullable=true)
|
||||
*/
|
||||
private $idee;
|
||||
#[ORM\Column(name: 'idee', type: 'text', nullable: true)]
|
||||
private ?string $idee = null;
|
||||
|
||||
/**
|
||||
* @var string|null
|
||||
*
|
||||
* @ORM\Column(name="enCoursConstruction", type="text", nullable=true)
|
||||
*/
|
||||
private $enCoursConstruction;
|
||||
#[ORM\Column(name: 'enCoursConstruction', type: 'text', nullable: true)]
|
||||
private ?string $enCoursConstruction = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Collection
|
||||
* @ORM\ManyToMany(
|
||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation"
|
||||
* )
|
||||
* @ORM\JoinTable(
|
||||
* name="chill_csconnectes.projetprofessionnel_valide"
|
||||
* )
|
||||
*/
|
||||
private $valide;
|
||||
#[ORM\JoinTable(name: 'chill_csconnectes.projetprofessionnel_valide')]
|
||||
#[ORM\ManyToMany(targetEntity: Appellation::class)]
|
||||
private Collection $valide;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
* @ORM\Column(name="domaineActiviteValide", type="text", nullable=true)
|
||||
*/
|
||||
private $domaineActiviteValide;
|
||||
#[ORM\Column(name: 'domaineActiviteValide', type: 'text', nullable: true)]
|
||||
private ?string $domaineActiviteValide = null;
|
||||
|
||||
/**
|
||||
* @var string|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: 'valideNotes', type: 'text', nullable: true)]
|
||||
private ?string $valideNotes = null;
|
||||
|
||||
#[ORM\Column(name: 'projetProfessionnelNote', type: 'text', nullable: true)]
|
||||
private ?string $projetProfessionnelNote = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -446,21 +397,21 @@ class ProjetProfessionnel
|
||||
return $this->domaineActiviteValide;
|
||||
}
|
||||
|
||||
public function setDomaineActiviteSouhait(string $domaineActiviteSouhait = null)
|
||||
public function setDomaineActiviteSouhait(?string $domaineActiviteSouhait = null)
|
||||
{
|
||||
$this->domaineActiviteSouhait = $domaineActiviteSouhait;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDomaineActiviteValide(string $domaineActiviteValide = null)
|
||||
public function setDomaineActiviteValide(?string $domaineActiviteValide = null)
|
||||
{
|
||||
$this->domaineActiviteValide = $domaineActiviteValide;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'Rapport "projet professionnel" de '.$this->getPerson().' daté du '.
|
||||
$this->getReportDate()->format('d-m-Y');
|
||||
|
@ -1,51 +1,38 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Appellation
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.rome_appellation")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\Rome\AppellationRepository")
|
||||
* Appellation.
|
||||
*/
|
||||
class Appellation
|
||||
#[ORM\Table(name: 'chill_csconnectes.rome_appellation')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\Rome\AppellationRepository::class)]
|
||||
class Appellation implements \Stringable
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="code", type="string", length=40, unique=true)
|
||||
*/
|
||||
private $code = '';
|
||||
#[ORM\Column(name: 'code', type: 'string', length: 40, unique: true)]
|
||||
private ?string $code = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @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\Column(name: 'libelle', type: 'text')]
|
||||
private ?string $libelle = '';
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Metier::class, inversedBy: 'appellations', cascade: ['persist'])]
|
||||
private ?Metier $metier = null;
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
@ -117,8 +104,7 @@ class Appellation
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->libelle;
|
||||
}
|
||||
|
@ -1,57 +1,46 @@
|
||||
<?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;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* Metier
|
||||
*
|
||||
* @ORM\Table(name="chill_csconnectes.rome_metier")
|
||||
* @ORM\Entity(repositoryClass="Chill\ChillJobBundle\Repository\Rome\MetierRepository")
|
||||
* Metier.
|
||||
*/
|
||||
#[ORM\Table(name: 'chill_csconnectes.rome_metier')]
|
||||
#[ORM\Entity(repositoryClass: \Chill\ChillJobBundle\Repository\Rome\MetierRepository::class)]
|
||||
class Metier
|
||||
{
|
||||
/**
|
||||
* @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;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="libelle", type="text")
|
||||
*/
|
||||
private $libelle = '';
|
||||
#[ORM\Column(name: 'libelle', type: 'text')]
|
||||
private ?string $libelle = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="code", type="string", length=20, unique=true)
|
||||
*/
|
||||
private $code = '';
|
||||
#[ORM\Column(name: 'code', type: 'string', length: 20, unique: true)]
|
||||
private ?string $code = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Doctrine\Common\Collections\Collection
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
|
||||
* mappedBy="metier"
|
||||
* )
|
||||
*/
|
||||
private $appellations;
|
||||
#[ORM\OneToMany(targetEntity: Appellation::class, mappedBy: 'metier')]
|
||||
private readonly \Doctrine\Common\Collections\Collection $appellations;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->appellations = new ArrayCollection();
|
||||
$this->appellation = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
|
@ -1,6 +1,16 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
use Chill\MainBundle\Export\ListInterface;
|
||||
use Chill\PersonBundle\Export\Export\ListPerson;
|
||||
@ -16,25 +26,23 @@ use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* Class ListCSPerson
|
||||
* Class ListCSPerson.
|
||||
*
|
||||
* @package Chill\ChillJobBundle\Export
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class ListCSPerson extends ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
const CSPERSON = [
|
||||
public const CSPERSON = [
|
||||
'ressource__label' => CSPerson::RESSOURCES,
|
||||
'moyen_transport__label' => CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
||||
'type_contrat__label' => CSPerson::TYPE_CONTRAT,
|
||||
'permis_conduire__label' => CSPerson::PERMIS_CONDUIRE,
|
||||
'accompagnement__label' => CSPerson::ACCOMPAGNEMENTS,
|
||||
'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,
|
||||
* adding query type as value
|
||||
* adding query type as value.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -89,7 +97,7 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
'address_postcode_label' => 'string',
|
||||
'address_country_name' => 'string',
|
||||
'address_country_code' => 'string',
|
||||
'address_isnoaddress' => 'boolean'
|
||||
'address_isnoaddress' => 'boolean',
|
||||
];
|
||||
|
||||
$CSfields = [
|
||||
@ -119,14 +127,14 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
'datefindernieremploi' => 'date',
|
||||
'type_contrat__label' => 'json',
|
||||
'ressource__label' => 'json',
|
||||
'moyen_transport__label' => 'json'
|
||||
'moyen_transport__label' => 'json',
|
||||
];
|
||||
|
||||
return array_merge($fields, $CSfields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array FIELDS keys only
|
||||
* Return array FIELDS keys only.
|
||||
*
|
||||
* @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
|
||||
* self::initiateQuery
|
||||
* self::initiateQuery.
|
||||
*
|
||||
* Example: if your query builder will contains `SELECT count(id) AS count_id ...`,
|
||||
* this function will return `array('count_id')`.
|
||||
*
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryKeys($data)
|
||||
@ -152,7 +161,6 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
$fields = [];
|
||||
foreach ($data['fields'] as $key) {
|
||||
switch ($key) {
|
||||
|
||||
case 'ressource__label':
|
||||
case 'moyen_transport__label':
|
||||
foreach ($csperson[$key] as $item) {
|
||||
@ -164,27 +172,28 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
case 'prescripteur__name':
|
||||
case 'prescripteur__email':
|
||||
case 'prescripteur__phone':
|
||||
$key = str_replace('__', '.', $key);
|
||||
$key = str_replace('__', '.', (string) $key);
|
||||
|
||||
// no break
|
||||
case 'situation_professionnelle__label':
|
||||
case 'neet_eligibility__label':
|
||||
|
||||
case 'accompagnement__label':
|
||||
case 'permis_conduire__label':
|
||||
case 'type_contrat__label':
|
||||
|
||||
default:
|
||||
$fields[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return array|\Closure
|
||||
*/
|
||||
private function splitArrayToColumns($rows)
|
||||
@ -196,21 +205,17 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
*/
|
||||
$results = [];
|
||||
foreach ($rows as $row) {
|
||||
|
||||
/**
|
||||
* @var string $key
|
||||
* @var mixed $value
|
||||
*/
|
||||
$res = [];
|
||||
foreach ($row as $key => $value) {
|
||||
|
||||
switch ($key) {
|
||||
case 'ressource__label':
|
||||
case 'moyen_transport__label':
|
||||
|
||||
foreach ($csperson[$key] as $item) {
|
||||
$this->translationCompatKey($item, $key);
|
||||
if (($value === null)||(count($value) === 0)) {
|
||||
if ((null === $value) || (0 === count($value))) {
|
||||
$res[$item] = '';
|
||||
} else {
|
||||
foreach ($value as $v) {
|
||||
@ -219,25 +224,22 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
if ($item === $v) {
|
||||
$res[$item] = 'x';
|
||||
break;
|
||||
} else {
|
||||
$res[$item] = '';
|
||||
}
|
||||
$res[$item] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'situation_professionnelle__label':
|
||||
|
||||
$f = false;
|
||||
if ($value === 'en_activite') {
|
||||
if ('en_activite' === $value) {
|
||||
$f = true;
|
||||
}
|
||||
$res[$key] = $value;
|
||||
break;
|
||||
|
||||
case 'type_contrat__label':
|
||||
|
||||
if (! empty($value)) {
|
||||
$res[$key] = ($f) ? $value : null;
|
||||
} else {
|
||||
@ -248,25 +250,25 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
case 'prescripteur__name':
|
||||
case 'prescripteur__email':
|
||||
case 'prescripteur__phone':
|
||||
$key = str_replace('__', '.', (string) $key);
|
||||
|
||||
$key = str_replace('__', '.', $key);
|
||||
|
||||
// no break
|
||||
case 'neet_eligibility__label':
|
||||
case 'accompagnement__label':
|
||||
case 'permis_conduire__label':
|
||||
|
||||
default:
|
||||
$res[$key] = $value;
|
||||
}
|
||||
}
|
||||
$results[] = $res;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* key: projet_prof__volume_horaire__label
|
||||
@ -284,73 +286,64 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
$item = $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
parent::buildForm($builder); // ajouter un '?' dans la query
|
||||
|
||||
$choices = array_combine($this->getFields(), $this->getFields());
|
||||
|
||||
$builder->add('fields', ChoiceType::class, array(
|
||||
$builder->add('fields', ChoiceType::class, [
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choices' => $choices,
|
||||
'data' => $choices, //les checkbox cochés !!
|
||||
'data' => $choices,
|
||||
// les checkbox cochés !!
|
||||
'choices_as_values' => true,
|
||||
'label' => 'Fields to include in export',
|
||||
'choice_label' => function ($key) {
|
||||
return str_replace('__', '.', $key);
|
||||
},
|
||||
'choice_attr' => function($val) {
|
||||
if (substr($val, 0, 8) === 'address_') {
|
||||
'choice_label' => fn ($key) => str_replace('__', '.', (string) $key),
|
||||
'choice_attr' => function ($val) {
|
||||
if (str_starts_with($val, 'address_')) {
|
||||
return ['data-display-target' => 'address_date'];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
'constraints' => [new Callback(array(
|
||||
'callback' => function($selected, ExecutionContextInterface $context) {
|
||||
if (count($selected) === 0) {
|
||||
'constraints' => [new Callback(['callback' => function ($selected, ExecutionContextInterface $context) {
|
||||
if (0 === count($selected)) {
|
||||
$context->buildViolation('You must select at least one element')
|
||||
->atPath('fields')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
))]
|
||||
));
|
||||
}])],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $requiredModifiers
|
||||
* @param array $acl
|
||||
* @param array $data
|
||||
* @return \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder
|
||||
*
|
||||
* @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
|
||||
if (!\array_key_exists('fields', $data)) {
|
||||
throw new \Doctrine\DBAL\Exception\InvalidArgumentException("any fields "
|
||||
. "have been checked");
|
||||
throw new \Doctrine\DBAL\Exception\InvalidArgumentException('any fields have been checked');
|
||||
}
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder()
|
||||
return $this->entityManager->createQueryBuilder()
|
||||
->from('ChillPersonBundle:Person', 'person')
|
||||
->join('person.center', 'center')
|
||||
->andWhere('center IN (:authorized_centers)')
|
||||
->setParameter('authorized_centers', $centers)
|
||||
;
|
||||
return $qb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Doctrine\ORM\NativeQuery|\Doctrine\ORM\QueryBuilder $qb
|
||||
* @param mixed[] $data
|
||||
*
|
||||
* @return mixed|mixed[]
|
||||
*/
|
||||
public function getResult($qb, $data)
|
||||
@ -358,14 +351,13 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
$qb->select('person.id');
|
||||
|
||||
$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);
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
|
||||
|
||||
foreach ($this->allFields() as $name => $type) {
|
||||
if ($data['fields'][$name]) {
|
||||
$rsm->addScalarResult(strtolower($name), $name, $type);
|
||||
@ -375,13 +367,13 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||
|
||||
$idx = 0;
|
||||
for ($i=1; $i<=8; $i++) {
|
||||
$idx++;
|
||||
for ($i = 1; $i <= 8; ++$i) {
|
||||
++$idx;
|
||||
$nq->setParameter($idx, $data['address_date'], 'date');
|
||||
}
|
||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
||||
$idx++;
|
||||
$nq->setParameter($idx, $this->personIds[$i-1]);
|
||||
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||
++$idx;
|
||||
$nq->setParameter($idx, $this->personIds[$i - 1]);
|
||||
}
|
||||
|
||||
return $this->splitArrayToColumns(
|
||||
@ -400,92 +392,89 @@ class ListCSPerson extends ListPerson implements ListInterface, ExportElementVal
|
||||
{
|
||||
$csperson = self::CSPERSON;
|
||||
|
||||
switch ($key) {
|
||||
case 'countryOfBirth':
|
||||
case 'situation_familiale':
|
||||
case 'closingmotive':
|
||||
case 'nationality':
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') { return $key; }
|
||||
return match ($key) {
|
||||
'countryOfBirth', 'situation_familiale', 'closingmotive', 'nationality' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
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') {
|
||||
},
|
||||
'accompagnement__label', 'permis_conduire__label', 'type_contrat__label' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return $this->translator->trans(
|
||||
str_replace('__', '.', $key)
|
||||
);
|
||||
}
|
||||
if (empty($value)) { return ''; }
|
||||
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') {
|
||||
},
|
||||
'situation_professionnelle__label', 'neet_eligibility__label' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return $this->translator->trans(
|
||||
str_replace('__', '.', $key)
|
||||
);
|
||||
}
|
||||
if (empty($value)) { return ''; }
|
||||
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
|
||||
// (pas possible d'utiliser parent qui appelle une méthode private pour les customfields)
|
||||
case 'gender' :
|
||||
return function ($value) {
|
||||
if ($value === '_header') { return 'gender'; }
|
||||
return $this->translator->trans($value);
|
||||
};
|
||||
case 'address_country_name':
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') { return \strtolower($key); }
|
||||
if ($value === null) { return ''; }
|
||||
return $this->translatableStringHelper->localize(json_decode($value, true));
|
||||
};
|
||||
case 'address_isnoaddress':
|
||||
return parent::getLabels($key, $values, $data);
|
||||
default:
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
},
|
||||
'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;
|
||||
};
|
||||
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 (
|
||||
|
||||
@ -650,4 +639,3 @@ ORDER BY p.id ASC
|
||||
|
||||
SQL;
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,21 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
use Chill\MainBundle\Export\FormatterInterface;
|
||||
use Chill\MainBundle\Export\ListInterface;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ChillJobBundle\Entity\CV;
|
||||
use Chill\ChillJobBundle\Security\Authorization\ExportsVoter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Query;
|
||||
@ -18,18 +27,16 @@ use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* Class ListCV
|
||||
* Class ListCV.
|
||||
*
|
||||
* @package Chill\ChillJobBundle\Export
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
const FIELDS = [
|
||||
public const FIELDS = [
|
||||
'id' => 'integer',
|
||||
'firstname' => 'string',
|
||||
'lastname' => 'string',
|
||||
@ -52,8 +59,6 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
|
||||
/**
|
||||
* ListAcquisition constructor.
|
||||
*
|
||||
* @param EntityManagerInterface $em
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
@ -65,24 +70,21 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
* violation on the data.
|
||||
*
|
||||
* @param mixed $data the data, as returned by the user
|
||||
* @param 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
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return "Liste des CVs par personne";
|
||||
return 'Liste des CVs par personne';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
@ -98,34 +100,34 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
'attr' => ['class' => ''],
|
||||
'constraints' => [new Callback([
|
||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||
if (count($selected) === 0) {
|
||||
if (0 === count($selected)) {
|
||||
$context
|
||||
->buildViolation('You must select at least one element')
|
||||
->atPath('fields')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
])]
|
||||
},
|
||||
])],
|
||||
])
|
||||
->add('reportdate_min', ChillDateType::class, [
|
||||
'label' => 'Date du rapport après le',
|
||||
'required' => false,
|
||||
'label_attr' => [
|
||||
'class' => 'reportdate_range'
|
||||
'class' => 'reportdate_range',
|
||||
],
|
||||
'attr' => [
|
||||
'class' => 'reportdate_range'
|
||||
]
|
||||
'class' => 'reportdate_range',
|
||||
],
|
||||
])
|
||||
->add('reportdate_max', ChillDateType::class, [
|
||||
'label' => 'Date du rapport avant le',
|
||||
'required' => false,
|
||||
'label_attr' => [
|
||||
'class' => 'report_date_range'
|
||||
'class' => 'report_date_range',
|
||||
],
|
||||
'attr' => [
|
||||
'class' => 'report_date_range'
|
||||
]
|
||||
'class' => 'report_date_range',
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
@ -151,7 +153,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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 $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()
|
||||
->from('ChillPersonBundle:Person', 'person');
|
||||
@ -184,14 +186,13 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
public function supportsModifiers()
|
||||
{
|
||||
return [ 'cv', 'person' ];
|
||||
return ['cv', 'person'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the required Role to execute the Export.
|
||||
*
|
||||
* @return \Symfony\Component\Security\Core\Role\Role
|
||||
*
|
||||
* @return Role
|
||||
*/
|
||||
public function requiredRole()
|
||||
{
|
||||
@ -205,17 +206,18 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
public function getAllowedFormattersTypes()
|
||||
{
|
||||
return [ FormatterInterface::TYPE_LIST ];
|
||||
return [FormatterInterface::TYPE_LIST];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 ...`,
|
||||
* this function will return `array('count_id')`.
|
||||
*
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
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
|
||||
*/
|
||||
@ -238,6 +240,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
*
|
||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return mixed[] an array of results
|
||||
*/
|
||||
public function getResult($qb, $data)
|
||||
@ -245,8 +248,8 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
$qb->select('person.id');
|
||||
|
||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
||||
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
@ -260,12 +263,12 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||
|
||||
$idx = 1;
|
||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
||||
$idx++;
|
||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
||||
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||
++$idx;
|
||||
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||
}
|
||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
||||
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||
|
||||
return $nq->getResult();
|
||||
}
|
||||
@ -309,56 +312,57 @@ class ListCV implements ListInterface, ExportElementValidatedInterface
|
||||
* which do not need to be translated, or value already translated in
|
||||
* database. But the header must be, in every case, translated.
|
||||
*
|
||||
*
|
||||
* @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 $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(); }`
|
||||
*/
|
||||
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) {
|
||||
case 'birthdate':
|
||||
/** @var \DateTime $value */
|
||||
return function($value) use ($key) {
|
||||
if ($value === '_header') { return $key; }
|
||||
if (empty($value)) { return ''; }
|
||||
return $value->format('d-m-Y');
|
||||
};
|
||||
case 'countryofbirth':
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
},
|
||||
'countryofbirth' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return $key;
|
||||
}
|
||||
|
||||
return $value['fr'];
|
||||
};
|
||||
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':
|
||||
case 'formationlevel':
|
||||
default:
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
},
|
||||
'gender' => function ($value) use ($key) {
|
||||
$gend_array = ['man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé'];
|
||||
if ('_header' === $value) {
|
||||
return $key;
|
||||
}
|
||||
return $value;
|
||||
};
|
||||
if (empty($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $gend_array[$value];
|
||||
},
|
||||
default => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return $key;
|
||||
}
|
||||
|
||||
return $value;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Native Query SQL
|
||||
* Native Query SQL.
|
||||
*/
|
||||
const QUERY = <<<SQL
|
||||
public const QUERY = <<<'SQL'
|
||||
|
||||
SELECT
|
||||
p.id as id,
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
@ -19,18 +28,16 @@ use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* Class ListFrein
|
||||
* Class ListFrein.
|
||||
*
|
||||
* @package Chill\ChillJobBundle\Export
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
const FREINS = [
|
||||
public const FREINS = [
|
||||
'freinsperso' => Frein::FREINS_PERSO,
|
||||
'freinsemploi' => Frein::FREINS_EMPLOI,
|
||||
];
|
||||
@ -38,7 +45,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
const FIELDS = [
|
||||
public const FIELDS = [
|
||||
'id' => 'integer',
|
||||
'firstname' => 'string',
|
||||
'lastname' => 'string',
|
||||
@ -58,8 +65,6 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
protected $personIds = [];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
@ -67,8 +72,6 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
|
||||
/**
|
||||
* ListAcquisition constructor.
|
||||
*
|
||||
* @param EntityManagerInterface $em
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
@ -80,24 +83,21 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
* violation on the data.
|
||||
*
|
||||
* @param mixed $data the data, as returned by the user
|
||||
* @param 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
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
@ -113,7 +113,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
'attr' => ['class' => ''],
|
||||
'constraints' => [new Callback([
|
||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||
if (count($selected) === 0) {
|
||||
if (0 === count($selected)) {
|
||||
$context
|
||||
->buildViolation('You must select at least one element')
|
||||
->atPath('fields')
|
||||
@ -166,7 +166,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
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,12 +179,12 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*
|
||||
* 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 $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()
|
||||
->from('ChillPersonBundle:Person', 'person');
|
||||
@ -199,14 +199,13 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
public function supportsModifiers()
|
||||
{
|
||||
return [ 'frein', 'person' ];
|
||||
return ['frein', 'person'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the required Role to execute the Export.
|
||||
*
|
||||
* @return \Symfony\Component\Security\Core\Role\Role
|
||||
*
|
||||
* @return Role
|
||||
*/
|
||||
public function requiredRole()
|
||||
{
|
||||
@ -220,11 +219,11 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
public function getAllowedFormattersTypes()
|
||||
{
|
||||
return [ FormatterInterface::TYPE_LIST ];
|
||||
return [FormatterInterface::TYPE_LIST];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array FIELDS keys only
|
||||
* Return array FIELDS keys only.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -235,12 +234,13 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
|
||||
/**
|
||||
* 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 ...`,
|
||||
* this function will return `array('count_id')`.
|
||||
*
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryKeys($data)
|
||||
@ -248,11 +248,9 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
$freins = self::FREINS;
|
||||
$fields = [];
|
||||
foreach ($data['fields'] as $key) {
|
||||
|
||||
switch ($key) {
|
||||
case 'freinsperso':
|
||||
case 'freinsemploi':
|
||||
|
||||
foreach ($freins[$key] as $item) {
|
||||
$this->translationCompatKey($item, $key);
|
||||
$fields[] = $item;
|
||||
@ -263,12 +261,13 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
$fields[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 $key
|
||||
@ -276,14 +275,15 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
private function translationCompatKey(&$item, $key)
|
||||
{
|
||||
$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.
|
||||
* This function split theses fields
|
||||
* This function split theses fields.
|
||||
*
|
||||
* @param array $rows
|
||||
*
|
||||
* @return array|\Closure
|
||||
*/
|
||||
private function splitArrayToColumns($rows)
|
||||
@ -295,34 +295,27 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*/
|
||||
$results = [];
|
||||
foreach ($rows as $row) {
|
||||
|
||||
/**
|
||||
* @var string $key
|
||||
* @var mixed $value
|
||||
*/
|
||||
$res = [];
|
||||
foreach ($row as $key => $value) {
|
||||
|
||||
switch ($key) {
|
||||
case 'freinsperso':
|
||||
case 'freinsemploi':
|
||||
|
||||
foreach ($freins[$key] as $item) {
|
||||
$this->translationCompatKey($item, $key);
|
||||
|
||||
if (count($value) === 0) {
|
||||
if (0 === count($value)) {
|
||||
$res[$item] = '';
|
||||
|
||||
} else {
|
||||
foreach ($value as $v) {
|
||||
|
||||
$this->translationCompatKey($v, $key);
|
||||
if ($item === $v) {
|
||||
$res[$item] = 'x';
|
||||
break;
|
||||
} else {
|
||||
$res[$item] = '';
|
||||
}
|
||||
$res[$item] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -334,6 +327,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
}
|
||||
$results[] = $res;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -342,6 +336,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
*
|
||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return mixed[]|\closure an array of results
|
||||
*/
|
||||
public function getResult($qb, $data)
|
||||
@ -349,8 +344,8 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
$qb->select('person.id');
|
||||
|
||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
||||
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
@ -364,12 +359,12 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||
|
||||
$idx = 1;
|
||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
||||
$idx++;
|
||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
||||
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||
++$idx;
|
||||
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||
}
|
||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
||||
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||
|
||||
return $this->splitArrayToColumns(
|
||||
$nq->getResult()
|
||||
@ -415,60 +410,60 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface
|
||||
* which do not need to be translated, or value already translated in
|
||||
* database. But the header must be, in every case, translated.
|
||||
*
|
||||
*
|
||||
* @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 $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(); }`
|
||||
*/
|
||||
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) {
|
||||
case 'reportdate':
|
||||
case 'birthdate':
|
||||
/** @var \DateTime $value */
|
||||
return function($value) use ($key) {
|
||||
if ($value === '_header') { return $key; }
|
||||
if (empty($value)) { return ''; }
|
||||
return $value->format('d-m-Y');
|
||||
};
|
||||
case 'countryofbirth':
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
},
|
||||
'countryofbirth' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
return $key;
|
||||
}
|
||||
return $value['fr'];
|
||||
};
|
||||
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':
|
||||
case 'notesperso':
|
||||
case 'notesemploi':
|
||||
default:
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
return $key;
|
||||
}
|
||||
if (empty($value)) { return ''; }
|
||||
return $value;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return $value['fr'];
|
||||
},
|
||||
'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'
|
||||
|
||||
SELECT
|
||||
p.id as id,
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
@ -19,26 +28,24 @@ use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* Class ListProjetProfessionnel
|
||||
* Class ListProjetProfessionnel.
|
||||
*
|
||||
* @package Chill\ChillJobBundle\Export
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class ListProjetProfessionnel implements ListInterface, ExportElementValidatedInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
const PPROF = [
|
||||
public const PPROF = [
|
||||
'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
|
||||
*/
|
||||
const FIELDS = [
|
||||
public const FIELDS = [
|
||||
'id' => 'integer',
|
||||
'firstname' => 'string',
|
||||
'lastname' => 'string',
|
||||
@ -70,8 +77,6 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
|
||||
/**
|
||||
* ListAcquisition constructor.
|
||||
*
|
||||
* @param EntityManagerInterface $em
|
||||
*/
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
@ -83,24 +88,21 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
* violation on the data.
|
||||
*
|
||||
* @param mixed $data the data, as returned by the user
|
||||
* @param 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
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @param FormBuilderInterface $builder
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
@ -110,16 +112,14 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
'expanded' => true,
|
||||
'choices_as_values' => true,
|
||||
'label' => 'Fields to include in export',
|
||||
'choice_label' => function ($key) {
|
||||
return str_replace('__', '.', $key);
|
||||
},
|
||||
'choice_label' => fn ($key) => str_replace('__', '.', (string) $key),
|
||||
'choices' => array_combine($this->getFields(), $this->getFields()),
|
||||
'data' => array_combine($this->getFields(), $this->getFields()),
|
||||
'choice_attr' => [],
|
||||
'attr' => ['class' => ''],
|
||||
'constraints' => [new Callback([
|
||||
'callback' => function ($selected, ExecutionContextInterface $context) {
|
||||
if (count($selected) === 0) {
|
||||
if (0 === count($selected)) {
|
||||
$context
|
||||
->buildViolation('You must select at least one element')
|
||||
->atPath('fields')
|
||||
@ -172,7 +172,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* @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 $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()
|
||||
->from('ChillPersonBundle:Person', 'person');
|
||||
@ -205,14 +205,13 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
*/
|
||||
public function supportsModifiers()
|
||||
{
|
||||
return [ 'projetprofessionnel', 'person' ];
|
||||
return ['projetprofessionnel', 'person'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the required Role to execute the Export.
|
||||
*
|
||||
* @return \Symfony\Component\Security\Core\Role\Role
|
||||
*
|
||||
* @return Role
|
||||
*/
|
||||
public function requiredRole()
|
||||
{
|
||||
@ -226,11 +225,11 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
*/
|
||||
public function getAllowedFormattersTypes()
|
||||
{
|
||||
return [ FormatterInterface::TYPE_LIST ];
|
||||
return [FormatterInterface::TYPE_LIST];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array FIELDS keys only
|
||||
* Return array FIELDS keys only.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -241,12 +240,13 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
|
||||
/**
|
||||
* 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 ...`,
|
||||
* this function will return `array('count_id')`.
|
||||
*
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryKeys($data)
|
||||
@ -255,37 +255,37 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
|
||||
$fields = [];
|
||||
foreach ($data['fields'] as $key) {
|
||||
|
||||
switch ($key) {
|
||||
case 'projet_prof__type_contrat__label':
|
||||
case 'projet_prof__volume_horaire__label':
|
||||
|
||||
foreach ($projet_professionnel[$key] as $item) {
|
||||
$this->translationCompatKey($item, $key);
|
||||
$fields[] = $item;
|
||||
}
|
||||
break;
|
||||
|
||||
case "projet_prof__souhait__code":
|
||||
case "projet_prof__type_contrat__note":
|
||||
case "projet_prof__volume_horaire__note":
|
||||
case "projet_prof__idee":
|
||||
case "projet_prof__encoursdeconstruction":
|
||||
case "projet_prof__valide__note":
|
||||
case "projet_prof__valide__code":
|
||||
case "projet_prof__note":
|
||||
$key = str_replace('__', '.', $key);
|
||||
case 'projet_prof__souhait__code':
|
||||
case 'projet_prof__type_contrat__note':
|
||||
case 'projet_prof__volume_horaire__note':
|
||||
case 'projet_prof__idee':
|
||||
case 'projet_prof__encoursdeconstruction':
|
||||
case 'projet_prof__valide__note':
|
||||
case 'projet_prof__valide__code':
|
||||
case 'projet_prof__note':
|
||||
$key = str_replace('__', '.', (string) $key);
|
||||
|
||||
// no break
|
||||
default:
|
||||
$fields[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* key: projet_prof__volume_horaire__label
|
||||
@ -305,9 +305,10 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* @return array|\Closure
|
||||
*/
|
||||
private function splitArrayToColumns($rows)
|
||||
@ -319,24 +320,19 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
*/
|
||||
$results = [];
|
||||
foreach ($rows as $row) {
|
||||
|
||||
/**
|
||||
* @var string $key
|
||||
* @var mixed $value
|
||||
*/
|
||||
$res = [];
|
||||
foreach ($row as $key => $value) {
|
||||
|
||||
switch ($key) {
|
||||
case 'projet_prof__type_contrat__label':
|
||||
case 'projet_prof__volume_horaire__label':
|
||||
|
||||
foreach ($projet_professionnel[$key] as $item) {
|
||||
$this->translationCompatKey($item, $key);
|
||||
|
||||
if (count($value) === 0) {
|
||||
if (0 === count($value)) {
|
||||
$res[$item] = '';
|
||||
|
||||
} else {
|
||||
foreach ($value as $v) {
|
||||
$this->translationCompatKey($v, $key);
|
||||
@ -344,30 +340,31 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
if ($item === $v) {
|
||||
$res[$item] = 'x';
|
||||
break;
|
||||
} else {
|
||||
$res[$item] = '';
|
||||
}
|
||||
$res[$item] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "projet_prof__souhait__code":
|
||||
case "projet_prof__type_contrat__note":
|
||||
case "projet_prof__volume_horaire__note":
|
||||
case "projet_prof__idee":
|
||||
case "projet_prof__encoursdeconstruction":
|
||||
case "projet_prof__valide__note":
|
||||
case "projet_prof__valide__code":
|
||||
case "projet_prof__note":
|
||||
$key = str_replace('__', '.', $key);
|
||||
case 'projet_prof__souhait__code':
|
||||
case 'projet_prof__type_contrat__note':
|
||||
case 'projet_prof__volume_horaire__note':
|
||||
case 'projet_prof__idee':
|
||||
case 'projet_prof__encoursdeconstruction':
|
||||
case 'projet_prof__valide__note':
|
||||
case 'projet_prof__valide__code':
|
||||
case 'projet_prof__note':
|
||||
$key = str_replace('__', '.', (string) $key);
|
||||
|
||||
// no break
|
||||
default:
|
||||
$res[$key] = $value;
|
||||
}
|
||||
}
|
||||
$results[] = $res;
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
@ -376,6 +373,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
*
|
||||
* @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb
|
||||
* @param mixed[] $data the data from the export's form (added by self::buildForm)
|
||||
*
|
||||
* @return mixed[] an array of results
|
||||
*/
|
||||
public function getResult($qb, $data)
|
||||
@ -383,8 +381,8 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
$qb->select('person.id');
|
||||
|
||||
$ids = $qb->getQuery()->getResult(Query::HYDRATE_SCALAR);
|
||||
$this->personIds = array_map(function ($e) { return $e['id']; }, $ids);
|
||||
$personIdsParameters = '?'. \str_repeat(', ?', count($this->personIds) -1);
|
||||
$this->personIds = array_map(fn ($e) => $e['id'], $ids);
|
||||
$personIdsParameters = '?'.\str_repeat(', ?', count($this->personIds) - 1);
|
||||
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
|
||||
|
||||
$rsm = new Query\ResultSetMapping();
|
||||
@ -398,12 +396,12 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
$nq = $this->entityManager->createNativeQuery($query, $rsm);
|
||||
|
||||
$idx = 1;
|
||||
for ($i=1; $i<=(count($this->personIds)); $i++) {
|
||||
$idx++;
|
||||
$nq->setParameter($i, $this->personIds[$i-1]);
|
||||
for ($i = 1; $i <= count($this->personIds); ++$i) {
|
||||
++$idx;
|
||||
$nq->setParameter($i, $this->personIds[$i - 1]);
|
||||
}
|
||||
$nq->setParameter($idx++, $data['reportdate_min'], 'date');
|
||||
$nq->setParameter($idx , $data['reportdate_max'], 'date');
|
||||
$nq->setParameter($idx, $data['reportdate_max'], 'date');
|
||||
|
||||
return $this->splitArrayToColumns(
|
||||
$nq->getResult()
|
||||
@ -449,63 +447,70 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn
|
||||
* which do not need to be translated, or value already translated in
|
||||
* database. But the header must be, in every case, translated.
|
||||
*
|
||||
*
|
||||
* @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 $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(); }`
|
||||
*/
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
switch ($key) {
|
||||
case 'birthdate':
|
||||
/** @var \DateTime $value */
|
||||
return function($value) use ($key) {
|
||||
if ($value === '_header') { return $key; }
|
||||
if (empty($value)) { return ''; }
|
||||
return $value->format('d-m-Y');
|
||||
};
|
||||
case 'countryofbirth':
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
return match ($key) {
|
||||
'birthdate' => function ($value) use ($key) {
|
||||
if ('_header' === $value) {
|
||||
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':
|
||||
if (empty($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
default:
|
||||
return function ($value) use ($key) {
|
||||
if ($value === '_header') {
|
||||
return $value->format('d-m-Y');
|
||||
},
|
||||
'countryofbirth' => function ($value) use ($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 (
|
||||
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
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 Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
|
||||
class CSPersonDispositifsType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
@ -27,94 +32,87 @@ class CSPersonDispositifsType extends AbstractType
|
||||
'label' => 'Accompagnement',
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choice_label' => function($k) { return 'accompagnement.'.$k; }
|
||||
'choice_label' => fn ($k) => 'accompagnement.'.$k,
|
||||
])
|
||||
->add('accompagnementRQTHDate', ChillDateType::class, [
|
||||
'label' => "Date d'accompagnement RQTH",
|
||||
'required' => false,
|
||||
|
||||
])
|
||||
->add('accompagnementComment', TextAreaType::class, [
|
||||
'label' => "Accompagnement autre: précisions",
|
||||
->add('accompagnementComment', TextareaType::class, [
|
||||
'label' => 'Accompagnement autre: précisions',
|
||||
'required' => false,
|
||||
|
||||
])
|
||||
->add('poleEmploiId', TextType::class, [
|
||||
'label' => "Identifiant pôle emploi",
|
||||
'label' => 'Identifiant pôle emploi',
|
||||
'required' => false,
|
||||
])
|
||||
->add('poleEmploiInscriptionDate', ChillDateType::class, [
|
||||
'label' => "Date d'inscription Pôle emploi",
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('cafId', TextType::class, [
|
||||
'label' => "Numéro allocataire CAF",
|
||||
'required' => false
|
||||
'label' => 'Numéro allocataire CAF',
|
||||
'required' => false,
|
||||
])
|
||||
->add('cafInscriptionDate', ChillDateType::class, [
|
||||
'label' => "Date d'inscription à la CAF",
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('cERInscriptionDate', ChillDateType::class, [
|
||||
'label' => "Date CER",
|
||||
'required' => false
|
||||
'label' => 'Date CER',
|
||||
'required' => false,
|
||||
])
|
||||
->add('pPAEInscriptionDate', ChillDateType::class, [
|
||||
'label' => "Date PPAE",
|
||||
'required' => false
|
||||
'label' => 'Date PPAE',
|
||||
'required' => false,
|
||||
])
|
||||
->add('nEETEligibilite', ChoiceType::class, [
|
||||
'label' => "Éligibilité NEET",
|
||||
'label' => 'Éligibilité NEET',
|
||||
'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,
|
||||
'expanded' => true,
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('cERSignataire', TextType::class, [
|
||||
'label' => "Signataire CER",
|
||||
'required' => false
|
||||
'label' => 'Signataire CER',
|
||||
'required' => false,
|
||||
])
|
||||
->add('pPAESignataire', TextType::class, [
|
||||
'label' => "Signataire PPAE",
|
||||
'required' => false
|
||||
'label' => 'Signataire PPAE',
|
||||
'required' => false,
|
||||
])
|
||||
->add('nEETCommissionDate', ChillDateType::class, [
|
||||
'label' => "Date commission NEET",
|
||||
'required' => false
|
||||
'label' => 'Date commission NEET',
|
||||
'required' => false,
|
||||
])
|
||||
->add('fSEMaDemarcheCode', TextType::class, [
|
||||
'label' => 'Code "Ma démarche FSE"',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('prescripteur', PickThirdPartyType::class, [
|
||||
'required' => false,
|
||||
'types' => ['prescripteur'],
|
||||
'label' => 'Prescripteur',
|
||||
'center' => $options['center']
|
||||
'center' => $options['center'],
|
||||
])
|
||||
->add('dispositifsNotes', TextareaType::class, [
|
||||
'required' => false,
|
||||
'label' => "Notes"
|
||||
'label' => 'Notes',
|
||||
])
|
||||
->add('dateContratIEJ', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => " Date du contrat d’engagement IEJ"
|
||||
'label' => ' Date du contrat d’engagement IEJ',
|
||||
])
|
||||
->add('dateAvenantIEJ', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => " Date de l'avenant IEJ"
|
||||
'label' => " Date de l'avenant IEJ",
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\CSPerson'
|
||||
));
|
||||
$resolver->setDefaults(['data_class' => CSPerson::class]);
|
||||
|
||||
$resolver
|
||||
->setDefined('center')
|
||||
@ -122,9 +120,6 @@ class CSPersonDispositifsType extends AbstractType
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_csperson';
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -18,73 +27,69 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
||||
|
||||
class CSPersonPersonalSituationType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
// quick and dirty way to handle marital status...
|
||||
->add('personMaritalStatus', Select2MaritalStatusType::class, array(
|
||||
'required' => false,
|
||||
'label' => 'État civil'
|
||||
))
|
||||
->add('personMaritalStatus', Select2MaritalStatusType::class, ['required' => false, 'label' => 'État civil'])
|
||||
->add('situationLogement', ChoiceType::class, [
|
||||
'choices' => \array_combine(
|
||||
CSPerson::SITUATIONS_LOGEMENTS,
|
||||
CSPerson::SITUATIONS_LOGEMENTS),
|
||||
'choice_label' => function($k) { return 'situation_logement.'.$k; },
|
||||
CSPerson::SITUATIONS_LOGEMENTS
|
||||
),
|
||||
'choice_label' => fn ($k) => 'situation_logement.'.$k,
|
||||
'required' => false,
|
||||
'label' => 'Situation de logement',
|
||||
'multiple' => false,
|
||||
'expanded' => true
|
||||
'expanded' => true,
|
||||
])
|
||||
->add('situationLogementPrecision', TextareaType::class, [
|
||||
'label' => 'Précisions',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('enfantACharge', IntegerType::class, [
|
||||
'label' => 'Enfants à charge',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('niveauMaitriseLangue', ChoiceType::class, [
|
||||
'choices' => \array_combine(
|
||||
CSPerson::NIVEAU_MAITRISE_LANGUE,
|
||||
CSPerson::NIVEAU_MAITRISE_LANGUE),
|
||||
'choice_label' => function($k) { return 'niveau_maitrise_langue.'.$k; },
|
||||
CSPerson::NIVEAU_MAITRISE_LANGUE
|
||||
),
|
||||
'choice_label' => fn ($k) => 'niveau_maitrise_langue.'.$k,
|
||||
'multiple' => true,
|
||||
'required' => false,
|
||||
'expanded' => true,
|
||||
'label' => 'Maitrise de la langue française'
|
||||
'label' => 'Maitrise de la langue française',
|
||||
])
|
||||
->add('vehiculePersonnel', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'Oui' => true,
|
||||
'Non' => false
|
||||
'Non' => false,
|
||||
],
|
||||
'required' => false,
|
||||
'multiple' => false
|
||||
'multiple' => false,
|
||||
])
|
||||
->add('permisConduire', ChoiceType::class, [
|
||||
'choices' => [
|
||||
\array_combine(CSPerson::PERMIS_CONDUIRE, CSPerson::PERMIS_CONDUIRE)
|
||||
\array_combine(CSPerson::PERMIS_CONDUIRE, CSPerson::PERMIS_CONDUIRE),
|
||||
],
|
||||
'label' => 'Permis de conduire',
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choice_label' => function($k) { return 'permis_conduire.'.$k; }
|
||||
'choice_label' => fn ($k) => 'permis_conduire.'.$k,
|
||||
])
|
||||
->add('situationProfessionnelle', ChoiceType::class, [
|
||||
'choices' => \array_combine(CSPerson::SITUATION_PROFESSIONNELLE, CSPerson::SITUATION_PROFESSIONNELLE),
|
||||
'required' => false,
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'choice_label' => function($k) { return 'situation_professionnelle.'.$k; }
|
||||
'choice_label' => fn ($k) => 'situation_professionnelle.'.$k,
|
||||
])
|
||||
->add('dateFinDernierEmploi', ChillDateType::class, [
|
||||
'label' => 'Date de la fin du dernier emploi',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('typeContrat', ChoiceType::class, [
|
||||
'choices' => \array_combine(CSPerson::TYPE_CONTRAT, CSPerson::TYPE_CONTRAT),
|
||||
@ -92,33 +97,33 @@ class CSPersonPersonalSituationType extends AbstractType
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choice_label' => function($k) { return 'type_contrat.'.$k; }
|
||||
'choice_label' => fn ($k) => 'type_contrat.'.$k,
|
||||
])
|
||||
->add('typeContratAide', TextType::class, [
|
||||
'label' => "Type de contrat aidé",
|
||||
'required' => false
|
||||
'label' => 'Type de contrat aidé',
|
||||
'required' => false,
|
||||
])
|
||||
->add('ressources', ChoiceType::class, [
|
||||
'choices' => \array_combine(CSPerson::RESSOURCES, CSPerson::RESSOURCES),
|
||||
'choice_label' => function($k) { return 'ressource.'.$k; },
|
||||
'choice_label' => fn ($k) => 'ressource.'.$k,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
])
|
||||
->add('ressourcesComment', TextareaType::class, [
|
||||
'label' => 'Information autre ressource',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('ressourceDate1Versement', ChillDateType::class, [
|
||||
'label' => "Date du premier versement (si bénéficiaire d'une aide)",
|
||||
'required' => false,
|
||||
])
|
||||
->add('cPFMontant', MoneyType::class, [
|
||||
'label' => "Montant CPF",
|
||||
'label' => 'Montant CPF',
|
||||
'required' => false,
|
||||
])
|
||||
->add('acompteDIF', MoneyType::class, [
|
||||
'label' => "Compte DIF",
|
||||
'label' => 'Compte DIF',
|
||||
'required' => false,
|
||||
])
|
||||
->add('handicapIs', ChoiceType::class, [
|
||||
@ -126,7 +131,7 @@ class CSPersonPersonalSituationType extends AbstractType
|
||||
'required' => false,
|
||||
'choices' => [
|
||||
'Oui' => true,
|
||||
'Non' => false
|
||||
'Non' => false,
|
||||
],
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
@ -141,123 +146,113 @@ class CSPersonPersonalSituationType extends AbstractType
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'center' => $options['center'],
|
||||
'types' => [ 'prescripteur' ],
|
||||
'types' => ['prescripteur'],
|
||||
'required' => false,
|
||||
'multiple' => false
|
||||
'multiple' => false,
|
||||
])
|
||||
->add('mobiliteMoyenDeTransport', ChoiceType::class, [
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'label' => "Moyens de transports accessibles",
|
||||
'label' => 'Moyens de transports accessibles',
|
||||
'choices' => \array_combine(
|
||||
CSPerson::MOBILITE_MOYEN_TRANSPORT,
|
||||
CSPerson::MOBILITE_MOYEN_TRANSPORT),
|
||||
'choice_label' => function($k) {
|
||||
return 'moyen_transport.'.$k;
|
||||
}
|
||||
CSPerson::MOBILITE_MOYEN_TRANSPORT
|
||||
),
|
||||
'choice_label' => fn ($k) => 'moyen_transport.'.$k,
|
||||
])
|
||||
->add('mobiliteNotes', TextareaType::class, [
|
||||
'required' => false,
|
||||
'label' => "Notes concernant la mobilité"
|
||||
'label' => 'Notes concernant la mobilité',
|
||||
])
|
||||
->add('documentCV', StoredObjectType::class, [
|
||||
'label' => 'CV',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAgrementIAE', StoredObjectType::class, [
|
||||
'label' => 'Document Agrément IAE',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentRQTH', StoredObjectType::class, [
|
||||
'label' => 'Document RQTH',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAttestationNEET', StoredObjectType::class, [
|
||||
'label' => 'Attestation NEET',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentCI', StoredObjectType::class, [
|
||||
'label' => 'Carte d\'identité',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentTitreSejour', StoredObjectType::class, [
|
||||
'label' => 'Titre de séjour',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAttestationFiscale', StoredObjectType::class, [
|
||||
'label' => 'Attestation fiscale',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentPermis', StoredObjectType::class, [
|
||||
'label' => 'Permis',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAttestationCAAF', StoredObjectType::class, [
|
||||
'label' => 'Attestation CAF',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentContraTravail', StoredObjectType::class, [
|
||||
'label' => 'Contrat de travail',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAttestationFormation', StoredObjectType::class, [
|
||||
'label' => 'Attestation formation',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentQuittanceLoyer', StoredObjectType::class, [
|
||||
'label' => 'Quittance de loyer',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentFactureElectricite', StoredObjectType::class, [
|
||||
'label' => 'Facture d\'électricité',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
->add('documentAttestationSecuriteSociale', StoredObjectType::class, [
|
||||
'label' => 'Attestation de sécurité sociale',
|
||||
'required' => false,
|
||||
'error_bubbling' => false
|
||||
'error_bubbling' => false,
|
||||
])
|
||||
;
|
||||
|
||||
}/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\CSPerson'
|
||||
));
|
||||
|
||||
$resolver->setRequired('center')
|
||||
->setAllowedTypes('center', [ \Chill\MainBundle\Entity\Center::class ])
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => CSPerson::class]);
|
||||
|
||||
$resolver->setRequired('center')
|
||||
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class])
|
||||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_csperson';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -13,9 +22,6 @@ use Chill\ChillJobBundle\Entity\CV\Experience;
|
||||
|
||||
class ExperienceType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
@ -23,50 +29,42 @@ class ExperienceType extends AbstractType
|
||||
'required' => true,
|
||||
'label' => 'Poste',
|
||||
'label_attr' => [
|
||||
'class' => 'required '
|
||||
]
|
||||
'class' => 'required ',
|
||||
],
|
||||
])
|
||||
->add('structure', TextType::class, [
|
||||
'required' => false,
|
||||
'label' => "Nom de la structure"
|
||||
'label' => 'Nom de la structure',
|
||||
])
|
||||
->add('startDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => 'Date de début'
|
||||
'label' => 'Date de début',
|
||||
])
|
||||
->add('endDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => "Date de fin"
|
||||
'label' => 'Date de fin',
|
||||
])
|
||||
->add('contratType', ChoiceType::class, [
|
||||
'required' => false,
|
||||
'expanded' => true,
|
||||
'multiple' => false,
|
||||
'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, [
|
||||
'label' => 'Notes',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Experience'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => Experience::class]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_cv_experience';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -12,66 +21,55 @@ use Chill\ChillJobBundle\Entity\CV\Formation as F;
|
||||
|
||||
class FormationType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('title', TextType::class, [
|
||||
'required' => true,
|
||||
'label' => "Nom de la formation",
|
||||
'label' => 'Nom de la formation',
|
||||
'label_attr' => [
|
||||
'class' => 'required '
|
||||
]
|
||||
'class' => 'required ',
|
||||
],
|
||||
])
|
||||
->add('organisme', TextType::class, [
|
||||
'label' => 'Organisme',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('startDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => "Date de début"
|
||||
'label' => 'Date de début',
|
||||
])
|
||||
->add('endDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => "Date de fin"
|
||||
'label' => 'Date de fin',
|
||||
])
|
||||
->add('diplomaObtained', ChoiceType::class, [
|
||||
'label' => "Diplôme obtenu ?",
|
||||
'label' => 'Diplôme obtenu ?',
|
||||
'required' => false,
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'label' => "Diplôme reconnu en France ?",
|
||||
'label' => 'Diplôme reconnu en France ?',
|
||||
'required' => false,
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'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)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Formation'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => F::class]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_cv_formation';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -16,9 +25,6 @@ use Chill\MainBundle\Form\Type\Select2LanguageType;
|
||||
|
||||
class CVType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
@ -31,27 +37,26 @@ class CVType extends AbstractType
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'label' => "Type de formation",
|
||||
'label' => 'Type de formation',
|
||||
'required' => false,
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
|
||||
])
|
||||
->add('notes', TextareaType::class, [
|
||||
'label' => "Note",
|
||||
'required' => false
|
||||
'label' => 'Note',
|
||||
'required' => false,
|
||||
])
|
||||
->add('formations', ChillCollectionType::class, [
|
||||
'label' => "Formations",
|
||||
'label' => 'Formations',
|
||||
'entry_type' => FormationType::class,
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
@ -59,36 +64,28 @@ class CVType extends AbstractType
|
||||
'button_remove_label' => 'Retirer cette formation',
|
||||
'required' => false,
|
||||
'by_reference' => false,
|
||||
'block_name' => 'formation_list'
|
||||
'block_name' => 'formation_list',
|
||||
])
|
||||
->add('experiences', ChillCollectionType::class, [
|
||||
'label' => "Expériences",
|
||||
'label' => 'Expériences',
|
||||
'entry_type' => ExperienceType::class,
|
||||
'allow_add' => true,
|
||||
'allow_delete' => true,
|
||||
'button_add_label' => 'Ajouter une expérience',
|
||||
'button_remove_label' => 'Retirer cette expérience',
|
||||
'required' => false,
|
||||
'by_reference' => false
|
||||
'by_reference' => false,
|
||||
])
|
||||
;
|
||||
}/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\CV'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => CV::class]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_cv';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
|
||||
@ -14,45 +22,36 @@ use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* Lazy load third parties.
|
||||
*
|
||||
*/
|
||||
class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var Appellation[]
|
||||
*/
|
||||
protected $lazyLoadedAppellations = [];
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \Chill\ChillJobBundle\Repository\Rome\AppellationRepository
|
||||
*/
|
||||
protected $appellationRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var PartenaireRomeAppellation;
|
||||
*/
|
||||
protected $apiAppellation;
|
||||
|
||||
/**
|
||||
* @var ValidatorInterface $validator
|
||||
* @var ValidatorInterface
|
||||
*/
|
||||
protected $validator;
|
||||
|
||||
/**
|
||||
* RomeAppellationChoiceLoader constructor.
|
||||
*
|
||||
* @param EntityManagerInterface $em
|
||||
* @param PartenaireRomeAppellation $apiAppellation
|
||||
* @param ValidatorInterface $validator
|
||||
*/
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
@ -65,7 +64,6 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
$this->validator = $validator;
|
||||
}
|
||||
|
||||
|
||||
public function loadChoiceList($value = null): ChoiceListInterface
|
||||
{
|
||||
return new ArrayChoiceList($this->lazyLoadedAppellations, $value);
|
||||
@ -73,16 +71,15 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
|
||||
public function loadChoicesForValues($values, $value = null)
|
||||
{
|
||||
|
||||
$choices = [];
|
||||
|
||||
foreach($values as $v) {
|
||||
foreach ($values as $v) {
|
||||
if (empty($v)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 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-'));
|
||||
$appellation = $this->appellationRepository->findOneByCode($code);
|
||||
} else {
|
||||
@ -90,13 +87,13 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
$appellation = $this->appellationRepository->find($id);
|
||||
}
|
||||
|
||||
if (NULL === $appellation) {
|
||||
if (null === $appellation) {
|
||||
$def = $this->apiAppellation->getAppellation($code);
|
||||
$metier = $this->em->getRepository(Metier::class)
|
||||
->findOneByCode($def->metier->code)
|
||||
;
|
||||
|
||||
if ($metier === NULL) {
|
||||
if (null === $metier) {
|
||||
$metier = (new Metier())
|
||||
->setCode($def->metier->code)
|
||||
->setLibelle($def->metier->libelle)
|
||||
@ -111,14 +108,12 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
->setMetier($metier)
|
||||
;
|
||||
|
||||
if ($this->validator->validate($appellation) && $this->validator->validate($metier))
|
||||
{
|
||||
if ($this->validator->validate($appellation) && $this->validator->validate($metier)) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
@ -129,7 +124,7 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface
|
||||
public function loadValuesForChoices(array $choices, $value = null)
|
||||
{
|
||||
foreach ($choices as $choice) {
|
||||
if (NULL === $choice) {
|
||||
if (null === $choice) {
|
||||
$values[] = null;
|
||||
continue;
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -12,19 +21,16 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
|
||||
class FreinType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('reportDate', ChillDateType::class, [
|
||||
'label' => 'Date du rapport'
|
||||
'label' => 'Date du rapport',
|
||||
])
|
||||
->add('freinsPerso', ChoiceType::class, [
|
||||
'label' => 'Freins identifiés liés à la situation personnelle',
|
||||
'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,
|
||||
'expanded' => true,
|
||||
'multiple' => true,
|
||||
@ -32,37 +38,29 @@ class FreinType extends AbstractType
|
||||
->add('freinsEmploi', ChoiceType::class, [
|
||||
'label' => 'Freins identifiés liés à la situation professionnelle',
|
||||
'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,
|
||||
'expanded' => true,
|
||||
'multiple' => true,
|
||||
])
|
||||
->add('notesPerso', TextareaType::class, [
|
||||
'label' => 'Notes concernant la situation personnelle',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('notesEmploi', TextareaType::class, [
|
||||
'label' => 'Notes concernant l\'accès à l\'emploi',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\Frein'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => Frein::class]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_frein';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -15,147 +24,141 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Chill\ChillJobBundle\Entity\Immersion;
|
||||
use Chill\MainBundle\Form\Type\AddressType;
|
||||
|
||||
|
||||
class ImmersionType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
if ($options['step'] === 'immersion') {
|
||||
if ('immersion' === $options['step']) {
|
||||
$builder
|
||||
->add('entreprise', PickThirdPartyType::class, [
|
||||
'center' => $options['center'],
|
||||
'types' => [ 'entreprise' ],
|
||||
'types' => ['entreprise'],
|
||||
'label' => "Identité de l'entreprise",
|
||||
'required' => true,
|
||||
'multiple' => false
|
||||
'multiple' => false,
|
||||
])
|
||||
->add('domaineActivite', TextType::class, [
|
||||
'label' => "Domaine d'activité",
|
||||
'required' => true,
|
||||
])
|
||||
->add('tuteurName', TextType::class, [
|
||||
'label' => "Nom du tuteur",
|
||||
'required' => true
|
||||
'label' => 'Nom du tuteur',
|
||||
'required' => true,
|
||||
])
|
||||
->add('tuteurFonction', TextType::class, [
|
||||
'label' => "Fonction du tuteur",
|
||||
'required' => true
|
||||
'label' => 'Fonction du tuteur',
|
||||
'required' => true,
|
||||
])
|
||||
->add('tuteurPhoneNumber', TextType::class, [
|
||||
'label' => "Téléphone du tuteur",
|
||||
'required' => true
|
||||
'label' => 'Téléphone du tuteur',
|
||||
'required' => true,
|
||||
])
|
||||
->add('structureAccName', TextType::class, [
|
||||
'label' => "Nom de la structure",
|
||||
"required" => false
|
||||
'label' => 'Nom de la structure',
|
||||
'required' => false,
|
||||
])
|
||||
->add('structureAccPhonenumber', TextType::class, [
|
||||
'label' => "Téléphone de la structure",
|
||||
'required' => false
|
||||
'label' => 'Téléphone de la structure',
|
||||
'required' => false,
|
||||
])
|
||||
->add('structureAccEmail', EmailType::class, [
|
||||
'label' => 'Email de la structure',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('structureAccAddress', AddressType::class, [
|
||||
'label' => 'Addresse de la structure d\'accompagnement',
|
||||
'required' => false,
|
||||
'has_valid_from' => false,
|
||||
'null_if_empty' => true
|
||||
'null_if_empty' => true,
|
||||
])
|
||||
->add('posteTitle', TextType::class, [
|
||||
'label' => 'Intitulé du poste',
|
||||
'required' => true
|
||||
'required' => true,
|
||||
])
|
||||
->add('posteLieu', TextType::class, [
|
||||
'label' => "Lieu d'exercice",
|
||||
'required' => true
|
||||
'required' => true,
|
||||
])
|
||||
->add('debutDate', ChillDateType::class, [
|
||||
'label' => "Date de début de l'immersion",
|
||||
'required' => true
|
||||
'required' => true,
|
||||
])
|
||||
->add('duration', DateIntervalType::class, [
|
||||
'unit_choices' => [
|
||||
"Weeks" => 'W',
|
||||
"Months" => 'M',
|
||||
"Days" => 'D'
|
||||
'Weeks' => 'W',
|
||||
'Months' => 'M',
|
||||
'Days' => 'D',
|
||||
],
|
||||
'label' => "Durée de l'immersion",
|
||||
'required' => true
|
||||
'required' => true,
|
||||
])
|
||||
->add('horaire', TextareaType::class, [
|
||||
'label' => "Horaire du stagiaire",
|
||||
'label' => 'Horaire du stagiaire',
|
||||
'required' => true,
|
||||
])
|
||||
->add('objectifs', ChoiceType::class, [
|
||||
'label' => "Objectifs",
|
||||
'label' => 'Objectifs',
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'label' => 'Précision sur les objectifs',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('noteImmersion', TextareaType::class, [
|
||||
'label' => "Note",
|
||||
'required' => false
|
||||
'label' => 'Note',
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
} elseif ($options['step'] === 'bilan') {
|
||||
} elseif ('bilan' === $options['step']) {
|
||||
$builder
|
||||
->add('savoirEtre', ChoiceType::class, [
|
||||
'label' => "Savoir-être du jeune",
|
||||
'label' => 'Savoir-être du jeune',
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'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, [
|
||||
'label' => "Note",
|
||||
'required' => false
|
||||
'label' => 'Note',
|
||||
'required' => false,
|
||||
])
|
||||
->add('principalesActivites', TextareaType::class, [
|
||||
'label' => "Principales activités",
|
||||
'required' => false
|
||||
'label' => 'Principales activités',
|
||||
'required' => false,
|
||||
])
|
||||
->add('competencesAcquises', TextareaType::class, [
|
||||
'label' => "Compétences acquises",
|
||||
'required' => false
|
||||
'label' => 'Compétences acquises',
|
||||
'required' => false,
|
||||
])
|
||||
->add('competencesADevelopper', TextareaType::class, [
|
||||
'label' => "Compétences à développer",
|
||||
'required' => false
|
||||
'label' => 'Compétences à développer',
|
||||
'required' => false,
|
||||
])
|
||||
->add('noteBilan', TextareaType::class, [
|
||||
'label' => "Notes sur le bilan",
|
||||
'required' => false
|
||||
'label' => 'Notes sur le bilan',
|
||||
'required' => false,
|
||||
])
|
||||
|
||||
;
|
||||
|
||||
foreach ([
|
||||
['ponctualiteSalarie', Immersion::PONCTUALITE_SALARIE, "Ponctualité du salarié"],
|
||||
['assiduite', Immersion::ASSIDUITE, "Assiduité"],
|
||||
['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"],
|
||||
['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"],
|
||||
['capaciteTravailEquipe', Immersion::YES_NO_NSP, "Sa capacité à travailler en équipe"],
|
||||
['styleVestimentaire', Immersion::YES_NO_NSP, "Style vestimentaire adapté"],
|
||||
['langageProf', Immersion::YES_NO_NSP, "Langage professionnel"],
|
||||
['appliqueConsigne', Immersion::YES_NO_NSP, "Applique les consignes"],
|
||||
['respectHierarchie', Immersion::YES_NO_NSP, "Respecte les niveaux hiérarchiques"],
|
||||
|
||||
] as list($name, $choices, $label)) {
|
||||
|
||||
['ponctualiteSalarie', Immersion::PONCTUALITE_SALARIE, 'Ponctualité du salarié'],
|
||||
['assiduite', Immersion::ASSIDUITE, 'Assiduité'],
|
||||
['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'],
|
||||
['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'],
|
||||
['capaciteTravailEquipe', Immersion::YES_NO_NSP, 'Sa capacité à travailler en équipe'],
|
||||
['styleVestimentaire', Immersion::YES_NO_NSP, 'Style vestimentaire adapté'],
|
||||
['langageProf', Immersion::YES_NO_NSP, 'Langage professionnel'],
|
||||
['appliqueConsigne', Immersion::YES_NO_NSP, 'Applique les consignes'],
|
||||
['respectHierarchie', Immersion::YES_NO_NSP, 'Respecte les niveaux hiérarchiques'],
|
||||
] as [$name, $choices, $label]) {
|
||||
$builder
|
||||
->add($name, ChoiceType::class, [
|
||||
'label' => $label,
|
||||
@ -163,32 +166,25 @@ class ImmersionType extends AbstractType
|
||||
'required' => false,
|
||||
'expanded' => true,
|
||||
'choices' => $choices,
|
||||
'choice_label' => function($el) use ($choices, $name) {
|
||||
if ($choices === Immersion::YES_NO_NSP) {
|
||||
'choice_label' => function ($el) use ($choices, $name) {
|
||||
if (Immersion::YES_NO_NSP === $choices) {
|
||||
return 'immersion_nsp.'.$el;
|
||||
}
|
||||
|
||||
return 'immersion_'.$name.'.'.$el;
|
||||
}
|
||||
},
|
||||
])
|
||||
->add($name.'Note', TextareaType::class, [
|
||||
'label' => "Notes",
|
||||
'required' => false
|
||||
'label' => 'Notes',
|
||||
'required' => false,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\Immersion',
|
||||
'step' => 'immersion'
|
||||
));
|
||||
$resolver->setDefaults(['data_class' => Immersion::class, 'step' => 'immersion']);
|
||||
|
||||
$resolver
|
||||
->setAllowedValues('step', ['immersion', 'bilan'])
|
||||
@ -197,13 +193,8 @@ class ImmersionType extends AbstractType
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_immersion';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -7,16 +16,12 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
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 Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
||||
use Chill\ChillJobBundle\Form\Type\PickRomeAppellationType;
|
||||
|
||||
class ProjetProfessionnelType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
@ -27,19 +32,21 @@ class ProjetProfessionnelType extends AbstractType
|
||||
])
|
||||
->add('domaineActiviteSouhait', TextareaType::class, [
|
||||
'label' => "Domaine d'activité souhaité",
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('reportDate', ChillDateType::class, [
|
||||
'label' => 'Date',
|
||||
'required' => true
|
||||
'required' => true,
|
||||
])
|
||||
->add('typeContrat', ChoiceType::class, [
|
||||
'label' => 'Type de contrat recherché',
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choices' => \array_combine(ProjetProfessionnel::TYPE_CONTRAT,
|
||||
ProjetProfessionnel::TYPE_CONTRAT),
|
||||
'choice_label' => function($k) { return 'projet_prof.type_contrat.'.$k; }
|
||||
'choices' => \array_combine(
|
||||
ProjetProfessionnel::TYPE_CONTRAT,
|
||||
ProjetProfessionnel::TYPE_CONTRAT
|
||||
),
|
||||
'choice_label' => fn ($k) => 'projet_prof.type_contrat.'.$k,
|
||||
])
|
||||
->add('typeContratNotes', TextareaType::class, [
|
||||
'label' => 'Notes concernant le contrat recherché',
|
||||
@ -50,13 +57,15 @@ class ProjetProfessionnelType extends AbstractType
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'required' => true,
|
||||
'choices' => \array_combine(ProjetProfessionnel::VOLUME_HORAIRES,
|
||||
ProjetProfessionnel::VOLUME_HORAIRES),
|
||||
'choice_label' => function($k) { return 'projet_prof.volume_horaire.'.$k; }
|
||||
'choices' => \array_combine(
|
||||
ProjetProfessionnel::VOLUME_HORAIRES,
|
||||
ProjetProfessionnel::VOLUME_HORAIRES
|
||||
),
|
||||
'choice_label' => fn ($k) => 'projet_prof.volume_horaire.'.$k,
|
||||
])
|
||||
->add('volumeHoraireNotes', TextareaType::class, [
|
||||
'label' => 'Notes concernant le volume horaire',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('idee', TextareaType::class, [
|
||||
'label' => 'Idée',
|
||||
@ -74,7 +83,7 @@ class ProjetProfessionnelType extends AbstractType
|
||||
])
|
||||
->add('domaineActiviteValide', TextareaType::class, [
|
||||
'label' => "Domaine d'activité validé",
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
->add('valideNotes', TextareaType::class, [
|
||||
'label' => 'Validé (notes)',
|
||||
@ -82,28 +91,18 @@ class ProjetProfessionnelType extends AbstractType
|
||||
])
|
||||
->add('projetProfessionnelNote', TextareaType::class, [
|
||||
'label' => 'Notes concernant le projet professionnel',
|
||||
'required' => false
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
|
||||
|
||||
}/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Chill\ChillJobBundle\Entity\ProjetProfessionnel'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(['data_class' => ProjetProfessionnel::class]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'csconnectes_spbundle_projetprofessionnel';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -17,19 +25,16 @@ use Chill\ChillJobBundle\Form\ChoiceLoader\RomeAppellationChoiceLoader;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
|
||||
/**
|
||||
* Allow to grab an appellation
|
||||
*
|
||||
* Allow to grab an appellation.
|
||||
*/
|
||||
class PickRomeAppellationType extends AbstractType
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
protected $translator;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var UrlGeneratorInterface
|
||||
*/
|
||||
protected $urlGenerator;
|
||||
@ -41,13 +46,11 @@ class PickRomeAppellationType extends AbstractType
|
||||
// protected $romeAppellationTransformer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var EntityManagerInterface
|
||||
*/
|
||||
protected $em;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var PartenaireRomeAppellation
|
||||
*/
|
||||
protected $apiPartenaire;
|
||||
@ -59,12 +62,6 @@ class PickRomeAppellationType extends AbstractType
|
||||
|
||||
/**
|
||||
* PickRomeAppellationType constructor.
|
||||
*
|
||||
* @param TranslatorInterface $translator
|
||||
* @param UrlGeneratorInterface $urlGenerator
|
||||
* @param EntityManagerInterface $em
|
||||
* @param PartenaireRomeAppellation $apiPartenaire
|
||||
* @param ValidatorInterface $validator
|
||||
*/
|
||||
public function __construct(
|
||||
TranslatorInterface $translator,
|
||||
@ -82,27 +79,21 @@ class PickRomeAppellationType extends AbstractType
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
//->addModelTransformer($this->romeAppellationTransformer)
|
||||
;
|
||||
// ->addModelTransformer($this->romeAppellationTransformer)
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Appellation::class)
|
||||
->setDefault('choice_label', function(Appellation $a) {
|
||||
return $a->getLibelle();
|
||||
})
|
||||
->setDefault('choice_label', fn (Appellation $a) => $a->getLibelle())
|
||||
->setDefault('placeholder', 'Choisir une appellation')
|
||||
//->setDefault('attr', ['class' => 'select2 '])
|
||||
->setDefault('choice_loader', function(Options $o) {
|
||||
return new RomeAppellationChoiceLoader(
|
||||
// ->setDefault('attr', ['class' => 'select2 '])
|
||||
->setDefault('choice_loader', fn (Options $o) => new RomeAppellationChoiceLoader(
|
||||
$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-select-interactive-loading'] = true;
|
||||
$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-no-results-label'] = $this->translator->trans('select2.no_results');
|
||||
$view->vars['attr']['data-error-load-label'] = $this->translator->trans('select2.error_loading');
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
@ -7,14 +16,9 @@ use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
class MenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
@ -33,36 +37,36 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
||||
$menu->addChild('Situation personnelle', [
|
||||
'route' => 'chill_crud_csperson_personal_situation_view',
|
||||
'routeParameters' => [
|
||||
'id' => $person->getId()
|
||||
]
|
||||
'id' => $person->getId(),
|
||||
],
|
||||
])
|
||||
->setExtras([
|
||||
'order'=> 50
|
||||
'order' => 50,
|
||||
]);
|
||||
$menu->addChild('Dispositifs', [
|
||||
'route' => 'chill_crud_csperson_dispositifs_view',
|
||||
'routeParameters' => [
|
||||
'id' => $person->getId()
|
||||
]
|
||||
'id' => $person->getId(),
|
||||
],
|
||||
])
|
||||
->setExtras([
|
||||
'order'=> 51
|
||||
'order' => 51,
|
||||
]);
|
||||
}
|
||||
|
||||
$menu->addChild('Parcours d\'accompagnement', [
|
||||
'route' => 'chill_csconnectes_csreport_index',
|
||||
'routeParameters' => [
|
||||
'person' => $person->getId()
|
||||
]
|
||||
'person' => $person->getId(),
|
||||
],
|
||||
])
|
||||
->setExtras([
|
||||
'order' => 52
|
||||
'order' => 52,
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return [ 'person' ];
|
||||
return ['person'];
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* CSPersonRepository
|
||||
* CSPersonRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class CSPersonRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class CSPersonRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* ExperienceRepository
|
||||
* ExperienceRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class ExperienceRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class ExperienceRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* FormationRepository
|
||||
* FormationRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class FormationRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class FormationRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* CVRepository
|
||||
* CVRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class CVRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class CVRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* FreinRepository
|
||||
* FreinRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class FreinRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class FreinRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* ImmersionRepository
|
||||
* ImmersionRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class ImmersionRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class ImmersionRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* ProjetProfessionnelRepository
|
||||
* ProjetProfessionnelRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class ProjetProfessionnelRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class ProjetProfessionnelRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* AppellationRepository
|
||||
* AppellationRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class AppellationRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class AppellationRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,13 +1,20 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* MetierRepository
|
||||
* MetierRepository.
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class MetierRepository extends \Doctrine\ORM\EntityRepository
|
||||
{
|
||||
}
|
||||
class MetierRepository extends \Doctrine\ORM\EntityRepository {}
|
||||
|
@ -1,12 +1,20 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Security\Authorization\AbstractChillVoter;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Chill\ChillJobBundle\Entity\Frein;
|
||||
use Chill\ChillJobBundle\Entity\CV;
|
||||
use Chill\ChillJobBundle\Entity\CSPerson;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
|
||||
use Chill\ChillJobBundle\Entity\Immersion;
|
||||
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
|
||||
@ -14,29 +22,24 @@ use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* check ACL for CSConnectes
|
||||
*
|
||||
* check ACL for CSConnectes.
|
||||
*/
|
||||
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';
|
||||
const REPORT_CV = 'CHILL_CSCONNECTES_REPORT_CV';
|
||||
const REPORT_DELETE = 'CHILL_CSCONNECTES_REPORT_DELETE';
|
||||
|
||||
const ALL = [
|
||||
public const ALL = [
|
||||
self::REPORT_NEW,
|
||||
self::REPORT_CV,
|
||||
self::REPORT_DELETE
|
||||
self::REPORT_DELETE,
|
||||
];
|
||||
|
||||
protected $date15DaysAgo;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var AuthorizationHelper
|
||||
*/
|
||||
protected $authorizationHelper;
|
||||
@ -47,7 +50,6 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
||||
$this->authorizationHelper = $authorizationHelper;
|
||||
}
|
||||
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if (!\in_array($attribute, self::ALL)) {
|
||||
@ -73,9 +75,8 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
||||
$center = $subject->getPerson()->getCenter();
|
||||
}
|
||||
|
||||
switch($attribute) {
|
||||
switch ($attribute) {
|
||||
case self::REPORT_NEW:
|
||||
|
||||
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
||||
|
||||
case self::REPORT_CV:
|
||||
@ -86,7 +87,6 @@ class CSConnectesVoter extends AbstractChillVoter implements ProvideRoleHierarch
|
||||
return $this->authorizationHelper->userHasAccess($token->getUser(), $center, $attribute);
|
||||
|
||||
case self::REPORT_DELETE:
|
||||
|
||||
if ($subject instanceof Immersion) {
|
||||
$date = \DateTimeImmutable::createFromMutable($subject->getDebutDate())->add($subject->getDuration());
|
||||
} else {
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
@ -12,15 +21,13 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
|
||||
use Symfony\Component\Security\Core\Role\Role;
|
||||
|
||||
/**
|
||||
* Class ExportsVoter
|
||||
* Class ExportsVoter.
|
||||
*
|
||||
* @package Chill\ChillJobBundle\Security\Authorization
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface, VoterInterface
|
||||
{
|
||||
|
||||
const EXPORT = 'CHILL_CSCONNECTES_EXPORTS';
|
||||
public const EXPORT = 'CHILL_CSCONNECTES_EXPORTS';
|
||||
|
||||
/**
|
||||
* @var AuthorizationHelper
|
||||
@ -29,8 +36,6 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
||||
|
||||
/**
|
||||
* CVVoter constructor.
|
||||
*
|
||||
* @param AuthorizationHelper $authorizationHelper
|
||||
*/
|
||||
public function __construct(AuthorizationHelper $authorizationHelper)
|
||||
{
|
||||
@ -38,24 +43,21 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $subject
|
||||
* @return bool
|
||||
*/
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
if ($subject instanceof Center) {
|
||||
return $attribute === self::EXPORT;
|
||||
} elseif ($subject === NULL) {
|
||||
return $attribute === self::EXPORT;
|
||||
return self::EXPORT === $attribute;
|
||||
}
|
||||
if (null === $subject) {
|
||||
return self::EXPORT === $attribute;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $attribute
|
||||
* @param $subject
|
||||
* @param TokenInterface $token
|
||||
* @return bool
|
||||
*/
|
||||
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));
|
||||
|
||||
if ($subject === null) {
|
||||
if (null === $subject) {
|
||||
return count($centers) > 0;
|
||||
}
|
||||
|
||||
@ -89,11 +91,11 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
@ -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
|
||||
*/
|
||||
@ -115,7 +117,8 @@ class ExportsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInt
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getAttributes() {
|
||||
return [ self::EXPORT ];
|
||||
private function getAttributes()
|
||||
{
|
||||
return [self::EXPORT];
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,21 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class CSPersonControllerTest extends WebTestCase
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class CSPersonControllerTest extends WebTestCase {}
|
||||
|
@ -1,9 +1,21 @@
|
||||
<?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;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
class CSReportControllerTest extends WebTestCase
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @coversNothing
|
||||
*/
|
||||
class CSReportControllerTest extends WebTestCase {}
|
||||
|
@ -1,12 +1,20 @@
|
||||
<?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;
|
||||
|
||||
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
||||
|
||||
/**
|
||||
* Type "Entreprise" pour les third parties
|
||||
* Type "Entreprise" pour les third parties.
|
||||
*/
|
||||
class EntrepriseType implements ThirdPartyTypeProviderInterface
|
||||
{
|
||||
|
@ -1,12 +1,20 @@
|
||||
<?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;
|
||||
|
||||
use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface;
|
||||
|
||||
/**
|
||||
* Type "Prescripteur" pour les third parties
|
||||
* Type "Prescripteur" pour les third parties.
|
||||
*/
|
||||
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;
|
||||
|
||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
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
|
||||
{
|
||||
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 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.ressources 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 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;
|
||||
|
||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Fix missing fields in previous migration
|
||||
* Fix missing fields in previous migration.
|
||||
*/
|
||||
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('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');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->throwIrreversibleMigrationException("this migration is not reversible ("
|
||||
. "actions on primary keys)");
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->throwIrreversibleMigrationException('this migration is not reversible ('
|
||||
.'actions on primary keys)');
|
||||
$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 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;
|
||||
|
||||
@ -6,13 +15,13 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Ajout Immersion
|
||||
* Ajout Immersion.
|
||||
*/
|
||||
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 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');
|
||||
}
|
||||
|
||||
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 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;
|
||||
|
||||
@ -14,18 +23,18 @@ use Doctrine\Migrations\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 structureAccAddress_id INT DEFAULT NULL');
|
||||
$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 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;
|
||||
|
||||
@ -13,9 +22,9 @@ use Doctrine\Migrations\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 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');
|
||||
}
|
||||
|
||||
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 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;
|
||||
|
||||
@ -6,22 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add "datecontratIEJ" on dispositif
|
||||
* Add "datecontratIEJ" on dispositif.
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -6,20 +15,20 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Ajout type de contrat aidé
|
||||
* Ajout type de contrat aidé.
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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');
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -6,22 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Ajout colonne "objectifsAutre"
|
||||
* Ajout colonne "objectifsAutre".
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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');
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -10,31 +19,31 @@ use Doctrine\Migrations\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->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('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 '
|
||||
. 'INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
.'INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$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 ('
|
||||
. 'id INT NOT NULL, metier_id INT DEFAULT NULL, code VARCHAR(40) NOT NULL, '
|
||||
. 'libelle TEXT NOT NULL, PRIMARY KEY(id))');
|
||||
.'id INT NOT NULL, metier_id INT DEFAULT NULL, code VARCHAR(40) NOT NULL, '
|
||||
.'libelle TEXT NOT NULL, PRIMARY KEY(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, '
|
||||
. '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, '
|
||||
. 'person_id INT DEFAULT NULL, reportDate DATE NOT NULL, '
|
||||
. 'typeContrat JSONB DEFAULT NULL, typeContratNotes TEXT DEFAULT NULL, '
|
||||
. 'volumeHoraire JSONB DEFAULT NULL, volumeHoraireNotes TEXT DEFAULT NULL, '
|
||||
. 'idee TEXT DEFAULT NULL, enCoursConstruction TEXT DEFAULT NULL, '
|
||||
. 'valideNotes TEXT DEFAULT NULL, projetProfessionnelNote TEXT DEFAULT NULL, '
|
||||
. 'PRIMARY KEY(id))');
|
||||
.'person_id INT DEFAULT NULL, reportDate DATE NOT NULL, '
|
||||
.'typeContrat JSONB DEFAULT NULL, typeContratNotes TEXT DEFAULT NULL, '
|
||||
.'volumeHoraire JSONB DEFAULT NULL, volumeHoraireNotes TEXT DEFAULT NULL, '
|
||||
.'idee TEXT DEFAULT NULL, enCoursConstruction TEXT DEFAULT NULL, '
|
||||
.'valideNotes TEXT DEFAULT NULL, projetProfessionnelNote TEXT DEFAULT NULL, '
|
||||
.'PRIMARY KEY(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 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_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');
|
||||
|
||||
|
||||
}
|
||||
|
||||
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_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.projetprofessionnel_souhait');
|
||||
$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;
|
||||
|
||||
@ -6,21 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add index for rome code appellation / metier
|
||||
* Add index for rome code appellation / metier.
|
||||
*/
|
||||
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_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_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;
|
||||
|
||||
@ -10,18 +19,17 @@ use Doctrine\Migrations\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_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_appellation_idx ");
|
||||
|
||||
$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('DROP INDEX IF EXISTS chill_csconnectes.code_metier_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_3274952577153098");
|
||||
$this->addSql('DROP INDEX chill_csconnectes.UNIQ_D9E9CABC77153098');
|
||||
$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;
|
||||
|
||||
@ -10,9 +19,9 @@ use Doctrine\Migrations\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.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');
|
||||
}
|
||||
|
||||
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_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;
|
||||
|
||||
@ -11,15 +20,15 @@ use Doctrine\Migrations\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 domaineActiviteValide 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;');
|
||||
}
|
||||
|
||||
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 domaineActiviteValide");
|
||||
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteSouhait');
|
||||
$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;
|
||||
|
||||
@ -6,17 +15,17 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Ajout champ date avenant ieJ sur csperson
|
||||
* Ajout champ date avenant ieJ sur csperson.
|
||||
*/
|
||||
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