Add jobBundle and FranceTravailApiBundle

This commit is contained in:
Julie Lenaerts 2024-04-19 10:21:17 +02:00
parent ce655ed435
commit 2c68224e9c
109 changed files with 12544 additions and 0 deletions

View File

@ -114,6 +114,8 @@
"Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle", "Chill\\DocGeneratorBundle\\": "src/Bundle/ChillDocGeneratorBundle",
"Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle", "Chill\\DocStoreBundle\\": "src/Bundle/ChillDocStoreBundle",
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle", "Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
"Chill\\FranceTravailApiBundle\\": "src/Bundle/ChillFranceTravailApiBundle/src",
"Chill\\JobBundle\\": "src/Bundle/ChillJobBundle/src",
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle", "Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle", "Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle", "Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",

View File

@ -0,0 +1,95 @@
<?php
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
*
*/
class ApiWrapper
{
private $clientId;
private $clientSecret;
/**
*
* @var ChillRedis
*/
private $redis;
/**
*
* @var Client
*/
private $client;
/**
* key for the bearer for the api pole emploi.
*
* This bearer is shared across users
*/
const UNPERSONAL_BEARER = 'api_pemploi_bear_';
public function __construct($clientId, $clientSecret, 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'
]);
}
public function getPublicBearer($scopes): string
{
$cacheKey = $this->getCacheKey($scopes);
if ($this->redis->exists($cacheKey) > 0) {
$data = \unserialize($this->redis->get($cacheKey));
return $data->access_token;
}
try {
$response = $this->client->post('', [
'query' => ['realm' => '/partenaire'],
'headers' => [
'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'
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'scope' => \implode(' ', \array_merge($scopes, [ 'application_'.$this->clientId ])),
]
//]);
]);
//
}
catch (ClientException $e) {
dump(Psr7\str($e->getRequest()));
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));
return $data->access_token;
}
protected function getCacheKey($scopes)
{
return self::UNPERSONAL_BEARER.implode('', $scopes);
}
}

View File

@ -0,0 +1,101 @@
<?php
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
*
*
*/
class PartenaireRomeAppellation
{
/**
*
* @var ApiWrapper
*/
protected $wrapper;
/**
*
* @var Client
*/
protected $client;
/**
*
* @var LoggerInterface
*/
protected $logger;
use ProcessRequestTrait;
public function __construct(
ApiWrapper $wrapper,
LoggerInterface $logger
) {
$this->wrapper = $wrapper;
$this->logger = $logger;
$this->client = new Client([
'base_uri' => 'https://api.emploi-store.fr/partenaire/rome/v1/'
]);
}
private function getBearer()
{
return $this->wrapper->getPublicBearer([
'api_romev1',
'nomenclatureRome',
]);
}
/**
*
* @param string $search
*/
public function getListeAppellation($search)
{
$bearer = $this->getBearer();
$request = new Request('GET', 'appellation');
$parameters = [
'query' => [
'q' => $search,
'qf' => 'libelle'
],
'headers' => [
'Authorization' => 'Bearer '.$bearer
]
];
$response = $this->handleRequest($request, $parameters, $this->client,
$this->logger);
return \GuzzleHttp\json_decode((string) $response->getBody());
}
public function getAppellation($code)
{
$bearer = $this->getBearer();
$request = new Request('GET', sprintf('appellation/%s', $code));
$parameters = [
'headers' => [
'Authorization' => 'Bearer '.$bearer
],
'query' => [
'champs' => 'code,libelle,metier(code,libelle)'
]
];
$response = $this->handleRequest($request, $parameters, $this->client,
$this->logger);
return \GuzzleHttp\json_decode((string) $response->getBody());
}
}

View File

@ -0,0 +1,97 @@
<?php
/*
*/
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;
/**
* Methods to process request against the api, and handle the
* Exceptions
*
*/
trait ProcessRequestTrait
{
/**
* 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(
Request $request,
array $parameters,
Client $client,
LoggerInterface $logger
) {
return $this->handleRequestRecursive($request, $parameters,
$client, $logger);
}
/**
* 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(
Request $request,
array $parameters,
Client $client,
LoggerInterface $logger,
$counter = 0
) {
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) {
if ($counter > 5) {
$logger->error("too much 429 response", [
'request' => Psr7\str($e->getRequest())
]);
throw $e;
}
$delays = $e->getResponse()->getHeader('Retry-After');
$delay = \end($delays);
sleep($delay);
return $this->handleRequestRecursive($request, $parameters,
$client, $logger, $counter + 1);
}
// handling other errors
$logger->error("Error while querying ROME api", [
'status_code' => $e->getResponse()->getStatusCode(),
'part' => 'appellation',
'request' => Psr7\str($e->getRequest()),
'response' => Psr7\str($e->getResponse()),
]);
throw $e;
}
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace Chill\ChillFranceTravailApiBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillFranceTravailApiBundle extends Bundle
{
}

View File

@ -0,0 +1,54 @@
<?php
namespace Chill\ChillFranceTravailApiBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation;
use Symfony\Component\HttpFoundation\JsonResponse;
class RomeController extends Controller
{
/**
* @var PartenaireRomeAppellation
*/
protected $apiAppellation;
public function __construct(PartenaireRomeAppellation $apiAppellation)
{
$this->apiAppellation = $apiAppellation;
}
/**
* @Route("/{_locale}/pole-emploi/appellation/search.{_format}",
* name="chill_pole_emploi_api_appellation_search",
* requirements={ "_format" = "json" }
* )
*/
public function appellationSearchAction(Request $request)
{
if ($request->query->has('q') === FALSE) {
return new JsonResponse([]);
}
$appellations = $this->apiAppellation
->getListeAppellation($request->query->get('q'));
$results = [];
foreach ($appellations as $appellation) {
$appellation->id = 'original-'.$appellation->code;
$appellation->text = $appellation->libelle;
$results[] = $appellation;
}
$computed = new \stdClass();
$computed->pagination = (new \stdClass());
$computed->pagination->more = false;
$computed->results = $results;
return new JsonResponse($computed);
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace Chill\ChillFranceTravailApiBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
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
*/
class ChillFranceTravailApiExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Chill\ChillFranceTravailApiBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('chill_pole_emploi_api');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}

View File

@ -0,0 +1,3 @@
chill_poleemploi_api_controllers:
resource: "@ChillPoleEmploiApiBundle/Controller"
type: annotation

View File

@ -0,0 +1,14 @@
services:
Chill\ChillFranceTravailApiBundle\ApiHelper\ApiWrapper:
$clientId: '%pole_emploi_dev_client_id%'
$clientSecret: '%pole_emploi_dev_client_secret%'
$redis: '@Chill\MainBundle\Redis\ChillRedis'
Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation:
$wrapper: '@Chill\ChillFranceTravailApiBundle\ApiHelper\ApiWrapper'
$logger: '@Psr\Log\LoggerInterface'
Chill\ChillFranceTravailApiBundle\Controller\RomeController:
arguments:
$apiAppellation: '@Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation'
tags: ['controller.service_arguments']

View File

@ -0,0 +1,75 @@
<?php
namespace Chill\ChillFranceTravailApiBundle\Tests\ApiHelper;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Chill\ChillFranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class PartenaireRomeAppellationTest extends KernelTestCase
{
protected function setUp()
{
parent::setUp();
self::bootKernel();
}
public function testGetListeMetiersSimple()
{
/** @var PartenaireRomeAppellation $appellations */
$appellations = self::$kernel
->getContainer()
->get(PartenaireRomeAppellation::class)
;
$data = $appellations->getListeAppellation('arb');
$this->assertTrue(\is_array($data));
$this->assertNotNull($data[0]->libelle);
$this->assertNotNull($data[0]->code);
}
public function testGetListeMetiersTooMuchRequests()
{
/** @var PartenaireRomeMetier $appellations */
$appellations = self::$kernel
->getContainer()
->get(PartenaireRomeAppellation::class)
;
$appellations->getListeAppellation('arb');
$appellations->getListeAppellation('ing');
$appellations->getListeAppellation('rob');
$appellations->getListeAppellation('chori');
$data = $appellations->getListeAppellation('camion');
$this->assertTrue($data[0] instanceof \stdClass,
'assert that first index of data is an instance of stdClass');
}
public function testGetAppellation()
{
/** @var PartenaireRomeMetier $appellations */
$appellations = self::$kernel
->getContainer()
->get(PartenaireRomeAppellation::class)
;
$a = $appellations->getListeAppellation('arb');
$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');
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace Chill\ChillFranceTravailApiBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class RomeControllerTest extends WebTestCase
{
public function testAppellationsearch()
{
$client = static::createClient();
$crawler = $client->request('GET', '/{_locale}/pole-emploi/appellation/search');
}
}

View File

@ -0,0 +1,9 @@
<?php
namespace Chill\ChillJobBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillJobBundle extends Bundle
{
}

View File

@ -0,0 +1,124 @@
<?php
namespace Chill\ChillJobBundle\Controller;
use Chill\PersonBundle\CRUD\Controller\EntityPersonCRUDController;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\Request;
use Chill\ChillJobBundle\Entity\Immersion;
/**
* CRUD Controller for reports (Frein, ...)
*
*
*/
class CSCrudReportController extends EntityPersonCRUDController
{
protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request)
{
$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);
}
}
protected function duplicateEntity(string $action, Request $request)
{
if ($this->getCrudName() === 'cscv') {
$id = $request->query->get('duplicate_id', 0);
/** @var \Chill\ChillJobBundle\Entity\CV $cv */
$cv = $this->getEntity($action, $id, $request);
$em = $this->getDoctrine()->getManager();
$em->detach($cv);
foreach($cv->getExperiences() as $experience) {
$cv->removeExperience($experience);
$em->detach($experience);
$cv->addExperience($experience);
}
foreach($cv->getFormations() as $formation) {
$cv->removeFormation($formation);
$em->detach($formation);
$cv->addFormation($formation);
}
return $cv;
} elseif ($this->getCrudName() === 'projet_prof') {
$id = $request->query->get('duplicate_id', 0);
/** @var \Chill\ChillJobBundle\Entity\ProjetProfessionnel $original */
$original = $this->getEntity($action, $id, $request);
$new = parent::duplicateEntity($action, $request);
foreach ($original->getSouhait() as $s) {
$new->addSouhait($s);
}
foreach ($original->getValide() as $s) {
$new->addValide($s);
}
return $new;
}
return parent::duplicateEntity($action, $request);
}
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()
]);
} elseif ('bilan' === $action) {
return parent::createFormFor($action, $entity, $formClass, [
'center' => $entity->getPerson()->getCenter(),
'step' => 'bilan'
]);
} elseif ($action === 'delete') {
return parent::createFormFor($action, $entity, $formClass, $formOptions);
} else {
throw new \LogicException("this step $action is not supported");
}
}
return parent::createFormFor($action, $entity, $formClass, $formOptions);
}
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request)
{
// for immersion / edit-bilan action
if ('bilan' === $action) {
/* @var $entity Immersion */
$entity->setIsBilanFullfilled(true);
}
parent::onPreFlush($action, $entity, $form, $request);
}
/**
* 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);
}
}

View File

@ -0,0 +1,151 @@
<?php
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
{
public function personalSituationEdit(Request $request, $id)
{
return $this->formEditAction(
'ps_situation_edit',
$request,
$id,
CSPersonPersonalSituationType::class
);
}
public function dispositifsEdit(Request $request, $id)
{
return $this->formEditAction(
'dispositifs_edit',
$request,
$id,
CSPersonDispositifsType::class
);
}
public function personalSituationView(Request $request, $id): Response
{
return $this->viewAction('ps_situation_view', $request, $id);
}
public function dispositifsView(Request $request, $id): Response
{
return $this->viewAction('dispositifs_view', $request, $id);
}
protected function generateRedirectOnCreateRoute($action, Request $request, $entity)
{
switch($action) {
case 'ps_situation_view':
$route = 'chill_crud_csperson_personal_situation_edit';
break;
case 'dispositifs_view':
$route = 'chill_crud_csperson_dispositifs_edit';
break;
default:
parent::generateRedirectOnCreateRoute($action, $request, $entity);
}
return $this->generateUrl($route, ['id' => $entity->getPerson()->getId()]);
}
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);
}
}
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;
}
}
protected function getTemplateFor($action, $entity, Request $request)
{
switch ($action) {
case 'ps_situation_edit':
return '@CSConnectesSP/CSPerson/personal_situation_edit.html.twig';
case 'dispositifs_edit':
return '@CSConnectesSP/CSPerson/dispositifs_edit.html.twig';
case 'ps_situation_view':
return '@CSConnectesSP/CSPerson/personal_situation_view.html.twig';
case 'dispositifs_view':
return '@CSConnectesSP/CSPerson/dispositifs_view.html.twig';
default:
parent::getTemplateFor($action, $entity, $request);
}
}
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() ]));
$this->customizeForm($action, $form);
return $form;
case 'ps_situation_edit':
$form = $this->createForm($formClass, $entity, \array_merge(
$formOptions, [ 'center' => $entity->getPerson()->getCenter() ]));
$this->customizeForm($action, $form);
return $form;
default:
return parent::createFormFor($action, $entity, $formClass, $formOptions);
}
}
protected function generateLabelForButton($action, $formName, $form)
{
switch($action):
case 'ps_situation_edit':
case 'dispositifs_edit':
if ($formName === 'submit') {
return 'Enregistrer';
} else {
throw new \LogicException("this formName is not supported: $formName");
}
break;
default:
return parent::generateLabelForButton($action, $formName, $form);
endswitch;
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace Chill\ChillJobBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Chill\PersonBundle\Entity\Person;
use Symfony\Component\HttpFoundation\Response;
use Chill\ChillJobBundle\Entity\Frein;
use Chill\ChillJobBundle\Entity\CV;
use Chill\ChillJobBundle\Entity\Immersion;
use Chill\ChillJobBundle\Entity\ProjetProfessionnel;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
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");
$reports = $this->getReports($person);
return $this->render('@CSConnectesSP/Report/index.html.twig', \array_merge([
'person' => $person,
], $reports));
}
protected function getReports(Person $person)
{
$results = [];
$kinds = [];
if ($this->isGranted(CSConnectesVoter::REPORT_CV, $person)) {
$kinds['cvs'] = CV::class;
}
if ($this->isGranted(CSConnectesVoter::REPORT_NEW, $person)) {
$kinds = \array_merge($kinds, [
'cvs' => CV::class,
'freins' => Frein::class,
'immersions' => Immersion::class,
'projet_professionnels' => ProjetProfessionnel::class,
]);
}
foreach ($kinds as $key => $className) {
switch ($key) {
case 'immersions':
$ordering = [ 'debutDate' => 'DESC' ];
break;
default:
$ordering = [ 'reportDate' => 'DESC' ];
break;
}
$results[$key] = $this->getDoctrine()->getManager()
->getRepository($className)
->findByPerson($person, $ordering);
}
return $results;
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace Chill\ChillJobBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
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
*/
class ChillJobExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
// exports: list_CSperson override list_person
$container->setAlias('chill.person.export.list_person','Chill\ChillJobBundle\Export\ListCSPerson');
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Chill\ChillJobBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files.
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/configuration.html}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('cs_connectes_sp');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,353 @@
<?php
namespace Chill\ChillJobBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Chill\PersonBundle\Entity\Person;
use Doctrine\Common\Collections\ArrayCollection;
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")
*/
class CV
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var \DateTime
*
* @ORM\Column(name="reportDate", type="date")
* @Assert\NotNull()
*/
private $reportDate;
const FORMATION_LEVEL = [
'sans_diplome',
'BEP_CAP',
'BAC',
'BAC+2',
'BAC+3',
'BAC+4',
'BAC+5',
'BAC+8'
];
/**
* @var string|null
*
* @ORM\Column(name="formationLevel", type="string", length=255, nullable=true)
* @Assert\NotBlank()
*/
private $formationLevel;
const FORMATION_TYPE = [
'formation_initiale',
'formation_continue'
];
/**
* @var string
*
* @ORM\Column(name="formationType", type="string", length=255, nullable=true)
*/
private $formationType;
/**
* @var string[]|null
*
* @ORM\Column(name="spokenLanguages", type="json", nullable=true)
*/
private $spokenLanguages;
/**
* @var string|null
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
*
* @var Collection
* @ORM\OneToMany(
* targetEntity="Chill\ChillJobBundle\Entity\CV\Formation",
* mappedBy="CV",
* cascade={"persist", "remove", "detach"},
* orphanRemoval=true
* )
* @ORM\OrderBy({"startDate"= "DESC", "endDate"= "DESC"})
* @Assert\Valid(traverse=true)
*/
private $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;
/**
*
* @var \Chill\PersonBundle\Entity\Person
* @ORM\ManyToOne(
* targetEntity="Chill\PersonBundle\Entity\Person"
* )
*/
private $person;
public function __construct()
{
$this->formations = new ArrayCollection();
$this->experiences = new ArrayCollection();
$this->reportDate = new \DateTime('now');
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set reportDate.
*
* @param \DateTime $reportDate
*
* @return CV
*/
public function setReportDate($reportDate)
{
$this->reportDate = $reportDate;
return $this;
}
/**
* Get reportDate.
*
* @return \DateTime
*/
public function getReportDate()
{
return $this->reportDate;
}
/**
* Set formationLevel.
*
* @param string|null $formationLevel
*
* @return CV
*/
public function setFormationLevel($formationLevel = null)
{
$this->formationLevel = $formationLevel;
return $this;
}
/**
* Get formationLevel.
*
* @return string|null
*/
public function getFormationLevel()
{
return $this->formationLevel;
}
/**
* Set formationType.
*
* @param string $formationType
*
* @return CV
*/
public function setFormationType($formationType)
{
$this->formationType = $formationType;
return $this;
}
/**
* Get formationType.
*
* @return string
*/
public function getFormationType()
{
return $this->formationType;
}
/**
* Set spokenLanguages.
*
* @param json|null $spokenLanguages
*
* @return CV
*/
public function setSpokenLanguages($spokenLanguages = null)
{
$this->spokenLanguages = $spokenLanguages;
return $this;
}
/**
* Get spokenLanguages.
*
* @return json|null
*/
public function getSpokenLanguages()
{
return $this->spokenLanguages ?? [];
}
/**
* Set notes.
*
* @param string|null $notes
*
* @return CV
*/
public function setNotes($notes = null)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes.
*
* @return string|null
*/
public function getNotes()
{
return $this->notes;
}
public function getFormations(): Collection
{
return $this->formations;
}
public function getExperiences(): Collection
{
return $this->experiences;
}
public function setFormations(Collection $formations)
{
foreach ($formations as $formation) {
/** @var CV\Formation $formation */
$formation->setCV($this);
}
$this->formations = $formations;
return $this;
}
public function addFormation(CV\Formation $formation)
{
if ($this->formations->contains($formation)) {
return $this;
}
$this->formations->add($formation);
$formation->setCV($this);
return $this;
}
public function removeFormation(CV\Formation $formation)
{
if (FALSE === $this->formations->contains($formation)) {
return $this;
}
$formation->setCV(null);
$this->formations->removeElement($formation);
return $this;
}
public function setExperiences(Collection $experiences)
{
foreach ($experiences as $experience) {
/** @var CV\Experience $experience */
$experience->setCV($this);
}
$this->experiences = $experiences;
return $this;
}
public function addExperience(CV\Experience $experience)
{
if ($this->experiences->contains($experience)) {
return $this;
}
$experience->setCV($this);
$this->experiences->add($experience);
return $this;
}
public function removeExperience(CV\Experience $experience)
{
if (FALSE === $this->experiences->contains($experience)) {
return $this;
}
$this->experiences->removeElement($experience);
$experience->setCV(null);
return $this;
}
public function getPerson(): Person
{
return $this->person;
}
public function setPerson(Person $person)
{
$this->person = $person;
return $this;
}
public function __toString()
{
return 'CV de '.$this->getPerson().' daté du '.
$this->getReportDate()->format('d-m-Y');
}
}

View File

@ -0,0 +1,263 @@
<?php
namespace Chill\ChillJobBundle\Entity\CV;
use Doctrine\ORM\Mapping as ORM;
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")
*/
class Experience
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @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;
const CONTRAT_TYPE = [
'cddi',
'cdd-6mois',
'cdd+6mois',
'interim',
'apprentissage',
'contrat_prof',
'cui',
'cae',
'cdi',
'stage',
'volontariat',
'benevolat',
'autres'
];
/**
* @var string
*
* @ORM\Column(name="contratType", type="string", length=100)
*/
private $contratType;
/**
* @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;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set poste.
*
* @param string|null $poste
*
* @return Experience
*/
public function setPoste($poste = null)
{
$this->poste = $poste;
return $this;
}
/**
* Get poste.
*
* @return string|null
*/
public function getPoste()
{
return $this->poste;
}
/**
* Set structure.
*
* @param string|null $structure
*
* @return Experience
*/
public function setStructure($structure = null)
{
$this->structure = $structure;
return $this;
}
/**
* Get structure.
*
* @return string|null
*/
public function getStructure()
{
return $this->structure;
}
/**
* Set startDate.
*
* @param \DateTime|null $startDate
*
* @return Experience
*/
public function setStartDate($startDate = null)
{
$this->startDate = $startDate;
return $this;
}
/**
* Get startDate.
*
* @return \DateTime|null
*/
public function getStartDate()
{
return $this->startDate;
}
/**
* Set endDate.
*
* @param \DateTime|null $endDate
*
* @return Experience
*/
public function setEndDate($endDate = null)
{
$this->endDate = $endDate;
return $this;
}
/**
* Get endDate.
*
* @return \DateTime|null
*/
public function getEndDate()
{
return $this->endDate;
}
/**
* Set contratType.
*
* @param string $contratType
*
* @return Experience
*/
public function setContratType($contratType)
{
$this->contratType = $contratType;
return $this;
}
/**
* Get contratType.
*
* @return string
*/
public function getContratType()
{
return $this->contratType;
}
/**
* Set notes.
*
* @param string $notes
*
* @return Experience
*/
public function setNotes($notes)
{
$this->notes = $notes;
return $this;
}
/**
* Get notes.
*
* @return string
*/
public function getNotes()
{
return $this->notes;
}
public function getCV(): CV
{
return $this->CV;
}
public function setCV(?CV $CV = null)
{
$this->CV = $CV;
return $this;
}
}

View File

@ -0,0 +1,258 @@
<?php
namespace Chill\ChillJobBundle\Entity\CV;
use Doctrine\ORM\Mapping as ORM;
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")
*/
class Formation
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="text")
* @Assert\Length(min=3)
* @Assert\NotNull()
*/
private $title;
/**
* @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;
const DIPLOMA_OBTAINED = [
'fr', 'non-fr', 'aucun'
];
/**
* @var string|null
*
* @ORM\Column(name="diplomaObtained", type="string", nullable=true)
*/
private $diplomaObtained;
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;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title.
*
* @param string $title
*
* @return Formation
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set startDate.
*
* @param \DateTime|null $startDate
*
* @return Formation
*/
public function setStartDate($startDate = null)
{
$this->startDate = $startDate;
return $this;
}
/**
* Get startDate.
*
* @return \DateTime|null
*/
public function getStartDate()
{
return $this->startDate;
}
/**
* Set endDate.
*
* @param \DateTime|null $endDate
*
* @return Formation
*/
public function setEndDate($endDate = null)
{
$this->endDate = $endDate;
return $this;
}
/**
* Get endDate.
*
* @return \DateTime|null
*/
public function getEndDate()
{
return $this->endDate;
}
/**
* Set diplomaObtained.
*
* @param json|null $diplomaObtained
*
* @return Formation
*/
public function setDiplomaObtained($diplomaObtained = null)
{
$this->diplomaObtained = $diplomaObtained;
return $this;
}
/**
* Get diplomaObtained.
*
* @return json|null
*/
public function getDiplomaObtained()
{
return $this->diplomaObtained;
}
/**
* Set diplomaReconnue.
*
* @param string|null $diplomaReconnue
*
* @return Formation
*/
public function setDiplomaReconnue($diplomaReconnue = null)
{
$this->diplomaReconnue = $diplomaReconnue;
return $this;
}
/**
* Get diplomaReconnue.
*
* @return string|null
*/
public function getDiplomaReconnue()
{
return $this->diplomaReconnue;
}
/**
* Set organisme.
*
* @param string $organisme
*
* @return Formation
*/
public function setOrganisme($organisme)
{
$this->organisme = $organisme;
return $this;
}
/**
* Get organisme.
*
* @return string
*/
public function getOrganisme()
{
return $this->organisme;
}
public function getCV(): ?CV
{
return $this->CV;
}
public function setCV(?CV $CV = null)
{
$this->CV = $CV;
return $this;
}
}

View File

@ -0,0 +1,272 @@
<?php
namespace Chill\ChillJobBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Chill\PersonBundle\Entity\HasPerson;
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")
*/
class Frein implements HasPerson
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @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;
const FREINS_PERSO = [
'situation_administrative',
'situation_personnelle_et_familiale',
'comportement',
'etat_de_sante',
'precarite_situation_materielle',
'condition_ou_absence_logement',
'autres'
];
/**
* @var string[]
*
* @ORM\Column(name="freinsPerso", type="json")
*/
private $freinsPerso = [];
/**
* @var string
*
* @ORM\Column(name="notesPerso", type="text")
*/
private $notesPerso = '';
const FREINS_EMPLOI = [
'garde_d_enfants',
'sante',
'famille',
'finances',
'maitrise_de_la_langue',
'autres'
];
/**
* @var string[]
*
* @ORM\Column(name="freinsEmploi", type="json")
*/
private $freinsEmploi = [];
/**
* @var string
*
* @ORM\Column(name="notesEmploi", type="text")
*/
private $notesEmploi = '';
/**
*
* @var Person
*
* @ORM\ManytoOne(
* targetEntity="Chill\PersonBundle\Entity\Person")
* @Assert\NotNull()
*/
private $person;
function __construct()
{
$this->reportDate = new \DateTime('today');
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set reportDate.
*
* @param \DateTime $reportDate
*
* @return Frein
*/
public function setReportDate($reportDate)
{
$this->reportDate = $reportDate;
return $this;
}
/**
* Get reportDate.
*
* @return \DateTime
*/
public function getReportDate()
{
return $this->reportDate;
}
/**
* Set freinsPerso.
*
* @param string[] $freinsPerso
*
* @return Frein
*/
public function setFreinsPerso(array $freinsPerso = [])
{
$this->freinsPerso = $freinsPerso;
return $this;
}
/**
* Get freinsPerso.
*
* @return json
*/
public function getFreinsPerso()
{
return $this->freinsPerso;
}
/**
* Set notesPerso.
*
* @param string $notesPerso
*
* @return Frein
*/
public function setNotesPerso(string $notesPerso = null)
{
$this->notesPerso = (string) $notesPerso;
return $this;
}
/**
* Get notesPerso.
*
* @return string
*/
public function getNotesPerso()
{
return $this->notesPerso;
}
/**
* Set freinsEmploi.
*
* @param json $freinsEmploi
*
* @return Frein
*/
public function setFreinsEmploi(array $freinsEmploi = [])
{
$this->freinsEmploi = $freinsEmploi;
return $this;
}
/**
* Get freinsEmploi.
*
* @return json
*/
public function getFreinsEmploi()
{
return $this->freinsEmploi;
}
/**
* Set notesEmploi.
*
* @param string $notesEmploi
*
* @return Frein
*/
public function setNotesEmploi(string $notesEmploi = null)
{
$this->notesEmploi = (string) $notesEmploi;
return $this;
}
/**
* Get notesEmploi.
*
* @return string
*/
public function getNotesEmploi()
{
return $this->notesEmploi;
}
public function getPerson(): ?\Chill\PersonBundle\Entity\Person
{
return $this->person;
}
public function setPerson(\Chill\PersonBundle\Entity\Person $person = null): HasPerson
{
$this->person = $person;
return $this;
}
/**
* 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.";
$context->buildViolation($msg)
->atPath('freinsEmploi')
->addViolation();
$context->buildViolation($msg)
->atPath('freinsPerso')
->addViolation();
}
}
public function __toString()
{
return 'Rapport "frein" de '.$this->getPerson().' daté du '.
$this->getReportDate()->format('d-m-Y');
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,468 @@
<?php
namespace Chill\ChillJobBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
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")
*/
class ProjetProfessionnel
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
*
* @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;
/**
*
* @var Collection
* @ORM\ManyToMany(
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
* cascade={"persist"}
* )
* @ORM\JoinTable(
* name="chill_csconnectes.projetprofessionnel_souhait"
* )
*/
private $souhait;
/**
*
* @var string
* @ORM\Column(name="domaineActiviteSouhait", type="text", nullable=true)
*/
private $domaineActiviteSouhait;
const TYPE_CONTRAT = [
'cdd', 'cdi', 'contrat_insertion',
'interim', 'indifferent', 'apprentissage',
'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")
*/
private $typeContrat;
/**
* @var string|null
*
* @ORM\Column(name="typeContratNotes", type="text", nullable=true)
*/
private $typeContratNotes;
const VOLUME_HORAIRES = [
'temps_plein',
'temps_partiel'
];
/**
* @var array|null
*
* @ORM\Column(name="volumeHoraire", type="json", nullable=true)
* @Assert\Count(min=1, minMessage="Indiquez un volume horaire souhaité")
*/
private $volumeHoraire;
/**
* @var string|null
*
* @ORM\Column(name="volumeHoraireNotes", type="text", nullable=true)
*/
private $volumeHoraireNotes;
/**
* @var string|null
*
* @ORM\Column(name="idee", type="text", nullable=true)
*/
private $idee;
/**
* @var string|null
*
* @ORM\Column(name="enCoursConstruction", type="text", nullable=true)
*/
private $enCoursConstruction;
/**
*
* @var Collection
* @ORM\ManyToMany(
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation"
* )
* @ORM\JoinTable(
* name="chill_csconnectes.projetprofessionnel_valide"
* )
*/
private $valide;
/**
*
* @var string
* @ORM\Column(name="domaineActiviteValide", type="text", nullable=true)
*/
private $domaineActiviteValide;
/**
* @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;
public function __construct()
{
$this->valide = new ArrayCollection();
$this->souhait = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set reportDate.
*
* @param \DateTime $reportDate
*
* @return ProjetProfessionnel
*/
public function setReportDate($reportDate)
{
$this->reportDate = $reportDate;
return $this;
}
/**
* Get reportDate.
*
* @return \DateTime
*/
public function getReportDate()
{
return $this->reportDate;
}
/**
* Set typeContrat.
*
* @param json|null $typeContrat
*
* @return ProjetProfessionnel
*/
public function setTypeContrat($typeContrat = null)
{
$this->typeContrat = $typeContrat;
return $this;
}
/**
* Get typeContrat.
*
* @return json|null
*/
public function getTypeContrat()
{
return $this->typeContrat;
}
/**
* Set typeContratNotes.
*
* @param string|null $typeContratNotes
*
* @return ProjetProfessionnel
*/
public function setTypeContratNotes($typeContratNotes = null)
{
$this->typeContratNotes = $typeContratNotes;
return $this;
}
/**
* Get typeContratNotes.
*
* @return string|null
*/
public function getTypeContratNotes()
{
return $this->typeContratNotes;
}
/**
* Set volumeHoraire.
*
* @param json|null $volumeHoraire
*
* @return ProjetProfessionnel
*/
public function setVolumeHoraire($volumeHoraire = null)
{
$this->volumeHoraire = $volumeHoraire;
return $this;
}
/**
* Get volumeHoraire.
*
* @return json|null
*/
public function getVolumeHoraire()
{
return $this->volumeHoraire;
}
/**
* Set volumeHoraireNotes.
*
* @param string|null $volumeHoraireNotes
*
* @return ProjetProfessionnel
*/
public function setVolumeHoraireNotes($volumeHoraireNotes = null)
{
$this->volumeHoraireNotes = $volumeHoraireNotes;
return $this;
}
/**
* Get volumeHoraireNotes.
*
* @return string|null
*/
public function getVolumeHoraireNotes()
{
return $this->volumeHoraireNotes;
}
/**
* Set idee.
*
* @param string|null $idee
*
* @return ProjetProfessionnel
*/
public function setIdee($idee = null)
{
$this->idee = $idee;
return $this;
}
/**
* Get idee.
*
* @return string|null
*/
public function getIdee()
{
return $this->idee;
}
/**
* Set enCoursConstruction.
*
* @param string|null $enCoursConstruction
*
* @return ProjetProfessionnel
*/
public function setEnCoursConstruction($enCoursConstruction = null)
{
$this->enCoursConstruction = $enCoursConstruction;
return $this;
}
/**
* Get enCoursConstruction.
*
* @return string|null
*/
public function getEnCoursConstruction()
{
return $this->enCoursConstruction;
}
/**
* Set valideNotes.
*
* @param string|null $valideNotes
*
* @return ProjetProfessionnel
*/
public function setValideNotes($valideNotes = null)
{
$this->valideNotes = $valideNotes;
return $this;
}
/**
* Get valideNotes.
*
* @return string|null
*/
public function getValideNotes()
{
return $this->valideNotes;
}
/**
* Set projetProfessionnelNote.
*
* @param string|null $projetProfessionnelNote
*
* @return ProjetProfessionnel
*/
public function setProjetProfessionnelNote($projetProfessionnelNote = null)
{
$this->projetProfessionnelNote = $projetProfessionnelNote;
return $this;
}
/**
* Get projetProfessionnelNote.
*
* @return string|null
*/
public function getProjetProfessionnelNote()
{
return $this->projetProfessionnelNote;
}
public function getPerson(): Person
{
return $this->person;
}
public function getSouhait(): Collection
{
return $this->souhait;
}
public function getValide(): Collection
{
return $this->valide;
}
public function setPerson(Person $person)
{
$this->person = $person;
return $this;
}
public function setSouhait(Collection $souhait)
{
$this->souhait = $souhait;
return $this;
}
public function addSouhait(Appellation $souhait)
{
$this->souhait->add($souhait);
return $this;
}
public function setValide(Collection $valide)
{
$this->valide = $valide;
return $this;
}
public function addValide(Appellation $valide)
{
$this->valide->add($valide);
return $this;
}
public function getDomaineActiviteSouhait(): ?string
{
return $this->domaineActiviteSouhait;
}
public function getDomaineActiviteValide(): ?string
{
return $this->domaineActiviteValide;
}
public function setDomaineActiviteSouhait(string $domaineActiviteSouhait = null)
{
$this->domaineActiviteSouhait = $domaineActiviteSouhait;
return $this;
}
public function setDomaineActiviteValide(string $domaineActiviteValide = null)
{
$this->domaineActiviteValide = $domaineActiviteValide;
return $this;
}
public function __toString()
{
return 'Rapport "projet professionnel" de '.$this->getPerson().' daté du '.
$this->getReportDate()->format('d-m-Y');
}
}

View File

@ -0,0 +1,125 @@
<?php
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")
*/
class Appellation
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=40, unique=true)
*/
private $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;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code.
*
* @param string $code
*
* @return Appellation
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set libelle.
*
* @param string $libelle
*
* @return Appellation
*/
public function setLibelle($libelle)
{
$this->libelle = $libelle;
return $this;
}
/**
* Get libelle.
*
* @return string
*/
public function getLibelle()
{
return $this->libelle;
}
public function getMetier(): Metier
{
return $this->metier;
}
public function setMetier(Metier $metier)
{
$this->metier = $metier;
return $this;
}
public function __toString()
{
return $this->libelle;
}
}

View File

@ -0,0 +1,112 @@
<?php
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")
*/
class Metier
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="libelle", type="text")
*/
private $libelle = '';
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=20, unique=true)
*/
private $code = '';
/**
*
* @var \Doctrine\Common\Collections\Collection
* @ORM\OneToMany(
* targetEntity="Chill\ChillJobBundle\Entity\Rome\Appellation",
* mappedBy="metier"
* )
*/
private $appellations;
public function __construct()
{
$this->appellation = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set libelle.
*
* @param string $libelle
*
* @return Metier
*/
public function setLibelle($libelle)
{
$this->libelle = $libelle;
return $this;
}
/**
* Get libelle.
*
* @return string
*/
public function getLibelle()
{
return $this->libelle;
}
/**
* Set code.
*
* @param string $code
*
* @return Metier
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
}

View File

@ -0,0 +1,653 @@
<?php
namespace Chill\ChillJobBundle\Export;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Chill\MainBundle\Export\ListInterface;
use Chill\PersonBundle\Export\Export\ListPerson;
use Chill\ChillJobBundle\Entity\CSPerson;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\CustomFieldsBundle\Service\CustomFieldProvider;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* 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 = [
'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
];
/**
* @var array
*/
protected $personIds = [];
/** EntityManagerInterface $em */
protected $em;
/** TranslatorInterface $translator */
protected $translator;
/** TranslatableStringHelper $translatableStringHelper */
protected $translatableStringHelper;
/** CustomFieldProvider $customFieldProvider */
protected $customFieldProvider;
public function __construct(
EntityManagerInterface $em,
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper,
CustomFieldProvider $customFieldProvider
) {
parent::__construct($em, $translator, $translatableStringHelper, $customFieldProvider);
}
/**
* Rebuild fields array, combining parent ListPerson and ListCSPerson,
* adding query type as value
*
* @return array
*/
protected function allFields()
{
$fields = [
'id' => 'integer',
'firstName' => 'string',
'lastName' => 'string',
'gender' => 'string',
'birthdate' => 'date',
'placeOfBirth' => 'string',
'countryOfBirth' => 'json',
'nationality' => 'json',
'email' => 'string',
'phonenumber' => 'string',
'mobilenumber' => 'string',
'contactInfo' => 'string',
'memo' => 'string',
'address_valid_from' => 'date',
'address_street_address_1' => 'string',
'address_street_address_2' => 'string',
'address_postcode_code' => 'string',
'address_postcode_label' => 'string',
'address_country_name' => 'string',
'address_country_code' => 'string',
'address_isnoaddress' => 'boolean'
];
$CSfields = [
'recentopeningdate' => 'date',
'recentclosingdate' => 'date',
'closingmotive' => 'json',
'situation_familiale' => 'json',
'enfantacharge' => 'integer',
'accompagnement__label' => 'json',
'findernieremploidate' => 'date',
'prescripteur__name' => 'string',
'prescripteur__email' => 'string',
'prescripteur__phone' => 'string',
'poleemploiid' => 'string',
'cafid' => 'string',
'cafinscriptiondate' => 'date',
'contratiejdate' => 'date',
'cerinscriptiondate' => 'date',
'ppaeinscriptiondate' => 'date',
'ppaesignataire' => 'string',
'cersignataire' => 'string',
'neet_eligibility__label' => 'string',
'neetcommissiondate' => 'date',
'fsemademarchecode' => 'string',
'permis_conduire__label' => 'json',
'situation_professionnelle__label' => 'string',
'datefindernieremploi' => 'date',
'type_contrat__label' => 'json',
'ressource__label' => 'json',
'moyen_transport__label' => 'json'
];
return array_merge($fields, $CSfields);
}
/**
* Return array FIELDS keys only
*
* @return array
*/
private function getFields()
{
return array_keys($this->allFields());
}
/**
* give the list of keys the current export added to the queryBuilder in
* 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)
{
$csperson = self::CSPERSON;
$fields = [];
foreach ($data['fields'] as $key) {
switch ($key) {
case 'ressource__label':
case 'moyen_transport__label':
foreach ($csperson[$key] as $item) {
$this->translationCompatKey($item, $key);
$fields[] = $item;
}
break;
case 'prescripteur__name':
case 'prescripteur__email':
case 'prescripteur__phone':
$key = str_replace('__', '.', $key);
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
*
* @param array $rows
* @return array|\Closure
*/
private function splitArrayToColumns($rows)
{
$csperson = self::CSPERSON;
/**
* @var array $row each row exported
*/
$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)) {
$res[$item] = '';
} else {
foreach ($value as $v) {
$this->translationCompatKey($v, $key);
if ($item === $v) {
$res[$item] = 'x';
break;
} else {
$res[$item] = '';
}
}
}
}
break;
case 'situation_professionnelle__label':
$f = false;
if ($value === 'en_activite') {
$f = true;
}
$res[$key] = $value;
break;
case 'type_contrat__label':
if (! empty($value)) {
$res[$key] = ($f) ? $value : null;
} else {
$res[$key] = null;
}
break;
case 'prescripteur__name':
case 'prescripteur__email':
case 'prescripteur__phone':
$key = str_replace('__', '.', $key);
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)
*
* AVANT
* key: projet_prof__volume_horaire__label
* item: temps_plein
* APRES
* item: projet_prof.volume_horaire.temps_plein
*
* @param string $item (&) passed by reference
* @param string $key
*/
private function translationCompatKey(&$item, $key)
{
$key = str_replace('label', $item, $key);
$key = str_replace('__', '.', $key);
$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(
'multiple' => true,
'expanded' => true,
'choices' => $choices,
'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_') {
return ['data-display-target' => 'address_date'];
} else {
return [];
}
},
'constraints' => [new Callback(array(
'callback' => function($selected, ExecutionContextInterface $context) {
if (count($selected) === 0) {
$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())
{
$centers = array_map(function($el) { return $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");
}
$qb = $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)
{
$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);
$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);
}
}
$nq = $this->entityManager->createNativeQuery($query, $rsm);
$idx = 0;
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]);
}
return $this->splitArrayToColumns(
$nq->getResult()
);
}
/**
* @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)
{
$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 $value['fr'];
};
case 'accompagnement__label':
case 'permis_conduire__label':
case 'type_contrat__label':
return function ($value) use ($key, $csperson) {
if ($value === '_header') {
return $this->translator->trans(
str_replace('__', '.', $key)
);
}
if (empty($value)) { return ''; }
$arr = [];
foreach ($value as $v) {
$this->translationCompatKey($v, $key);
$arr[] = $this->translator->trans($v);
}
return implode(', ', $arr);
};
case 'situation_professionnelle__label':
case 'neet_eligibility__label':
return function ($value) use ($key) {
if ($value === '_header') {
return $this->translator->trans(
str_replace('__', '.', $key)
);
}
if (empty($value)) { return ''; }
$this->translationCompatKey($value, $key);
return $this->translator->trans($value);
};
case 'birthdate':
case 'address_valid_from':
case 'recentopeningdate':
case 'recentclosingdate':
case 'findernieremploidate':
case 'cafinscriptiondate':
case 'contratiejdate':
case 'cerinscriptiondate':
case 'ppaeinscriptiondate':
case 'neetcommissiondate':
case 'datefindernieremploi':
/** @var \DateTime $value */
return function($value) use ($key) {
if ($value === '_header') { return $key; }
if (empty($value)) { return ''; }
return $value->format('d-m-Y');
};
// remplace les getLabels de ListPerson
// (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') {
return $key;
}
if (empty($value)) { return ''; }
return $value;
};
}
}
/**
* Native Query SQL
*/
const QUERY = <<<SQL
WITH accompagning AS (
SELECT *
FROM (
SELECT
p.id,
ac.openingdate,
rank() OVER (
PARTITION BY p.id
ORDER BY ac.openingdate DESC
) openingrank,
ac.closingdate,
rank() OVER (
PARTITION BY p.id
ORDER BY ac.closingdate DESC
) closingrank,
( CASE
WHEN ac.closingdate IS NULL
THEN NULL
ELSE cm.name
END ) as closingmotive
FROM public.chill_person_person AS p
LEFT OUTER JOIN public.chill_person_accompanying_period AS ac
ON p.id = ac.person_id
LEFT OUTER JOIN public.chill_person_closingmotive AS cm
ON ac.closingmotive_id = cm.id
) AS sq
WHERE sq.openingrank = 1
OR sq.closingrank = 1
)
SELECT
-- identifiant
p.id as id,
-- **
p.firstname as firstName,
-- **
p.lastname as lastName,
-- genre
p.gender as gender,
-- date de naissance
p.birthdate as birthdate,
-- **
p.place_of_birth as placeOfBirth,
-- **
cnb.name as countryOfBirth,
-- nationalité
cnn.name as nationality,
-- Courriel
p.email as email,
-- numéro de téléphone
p.phonenumber as phonenumber,
-- numéro de téléphone portable
p.mobilenumber as mobilenumber,
-- **
p.contactInfo as contactInfo,
-- memo
p.memo as memo,
-- Date de début de validité de l'adresse
get_last_address_validfrom(p.id, ?::date) as address_valid_from,
-- Adresse SDF
get_last_address_isnoaddress(p.id, ?::date) as address_isnoaddress,
-- Adresse ligne 1
get_last_address_streetaddress1(p.id, ?::date) as address_street_address_1,
-- Adresse ligne 2
get_last_address_streetaddress2(p.id, ?::date) as address_street_address_2,
-- Code postal
get_last_address_postcode_code(p.id, ?::date) as address_postcode_code,
-- Commune
get_last_address_postcode_label(p.id, ?::date) as address_postcode_label,
-- Code pays
get_last_address_country_code(p.id, ?::date) as address_country_code,
-- Pays
get_last_address_country_name(p.id, ?::date) as address_country_name,
-- date douverture du dossier la plus récente
ac.openingdate as recentopeningdate,
-- date de fermeture du dossier la plus récente
ac.closingdate as recentclosingdate,
-- motif de cloture
ac.closingmotive as closingmotive,
-- Situation familiale
ms.name as situation_familiale,
-- Enfants à charge
cs.enfantacharge as enfantacharge,
-- Date de fin du dernier emploi
cs.datefindernieremploi as findernieremploidate,
-- Accompagnement
cs.accompagnement as accompagnement__label,
-- Prescripteur
tpp.name as prescripteur__name,
-- Email prescripteur
tpp.email as prescripteur__email,
-- Téléphone prescripteur
tpp.telephone as prescripteur__phone,
-- Identifiant pôle emploi
cs.poleemploiid as poleemploiid,
-- Numéro allocataire CAF
cs.cafid as cafid,
-- Date de linscription CAF
cs.cafinscriptiondate as cafinscriptiondate,
-- Date de lavenant du contrat
cs.datecontratiej as contratiejdate,
-- Date de linscription CER
cs.cerinscriptiondate as cerinscriptiondate,
-- Date de linscription PPAE
cs.ppaeinscriptiondate as ppaeinscriptiondate,
-- Signataire PPAE
cs.ppaesignataire as ppaesignataire,
-- Signataire CER
cs.cersignataire as cersignataire,
-- Éligibilité NEET
cs.neeteligibilite as neet_eligibility__label,
-- Date de commission NEET
cs.neetcommissiondate as neetcommissiondate,
-- Code démarche FSE
cs.fsemademarchecode as fsemademarchecode,
-- Permis de conduire
cs.permisconduire as permis_conduire__label,
-- Situation professionnelle
cs.situationprofessionnelle as situation_professionnelle__label,
-- Type de contrat
cs.typecontrat as type_contrat__label,
-- Salaire(s), ARE, ASS, RSA, AAH, Autre
cs.ressources as ressource__label,
-- Transport en commun, Scooter, Vélo, Voiture, Autre
cs.mobilitemoyentransport as moyen_transport__label
FROM public.chill_person_person AS p
LEFT JOIN chill_csconnectes.cs_person AS cs
ON p.id = cs.person_id
LEFT JOIN chill_3party.third_party AS tpp
ON cs.prescripteur_id = tpp.id
LEFT JOIN public.chill_person_marital_status AS ms
ON p.maritalstatus_id = ms.id
LEFT JOIN public.country AS cnb
ON p.countryofbirth_id = cnb.id
LEFT JOIN public.country AS cnn
ON p.nationality_id = cnn.id
LEFT JOIN accompagning AS ac
ON p.id = ac.id
WHERE
p.id IN (%person_ids%)
ORDER BY p.id ASC
SQL;
}

View File

@ -0,0 +1,392 @@
<?php
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;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Class ListCV
*
* @package Chill\ChillJobBundle\Export
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
*/
class ListCV implements ListInterface, ExportElementValidatedInterface
{
/**
* @var array
*/
const FIELDS = [
'id' => 'integer',
'firstname' => 'string',
'lastname' => 'string',
'gender' => 'string',
'birthdate' => 'date',
'placeofbirth' => 'string',
'countryofbirth' => 'json',
'formationlevel' => 'string',
];
/**
* @var array
*/
protected $personIds = [];
/**
* @var EntityManagerInterface
*/
protected $entityManager;
/**
* ListAcquisition constructor.
*
* @param EntityManagerInterface $em
*/
public function __construct(EntityManagerInterface $em)
{
$this->entityManager = $em;
}
/**
* validate the form's data and, if required, build a contraint
* 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)
*
* @return string
*/
public function getTitle()
{
return "Liste des CVs par personne";
}
/**
* Add a form to collect data from the user.
*
* @param FormBuilderInterface $builder
*/
public function buildForm(FormBuilderInterface $builder)
{
$builder
->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
'choices_as_values' => true,
'label' => 'Fields to include in export',
'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) {
$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'
],
'attr' => [
'class' => 'reportdate_range'
]
])
->add('reportdate_max', ChillDateType::class, [
'label' => 'Date du rapport avant le',
'required' => false,
'label_attr' => [
'class' => 'report_date_range'
],
'attr' => [
'class' => 'report_date_range'
]
])
;
}
/**
* Return the Export's type. This will inform _on what_ export will apply.
* Most of the type, it will be a string which references an entity.
*
* Example of types : Chill\PersonBundle\Export\Declarations::PERSON_TYPE
*
* @return string
*/
public function getType()
{
return Person::class;
}
/**
* A description, which will be used in the UI to explain what the export does.
* This description will be translated.
*
* @return string
*/
public function getDescription()
{
return "Crée une liste des CVs en fonction de différents paramètres.";
}
/**
* The initial query, which will be modified by ModifiersInterface
* (i.e. AggregatorInterface, FilterInterface).
*
* This query should take into account the `$acl` and restrict result only to
* what the user is allowed to see. (Do not show personal data the user
* is not allowed to see).
*
* 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.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
return $this->entityManager->createQueryBuilder()
->from('ChillPersonBundle:Person', 'person');
}
/**
* Inform which ModifiersInterface (i.e. AggregatorInterface, FilterInterface)
* are allowed. The modifiers should be an array of types the _modifier_ apply on
* (@see ModifiersInterface::applyOn()).
*
* @return string[]
*/
public function supportsModifiers()
{
return [ 'cv', 'person' ];
}
/**
* Return the required Role to execute the Export.
*
* @return \Symfony\Component\Security\Core\Role\Role
*
*/
public function requiredRole()
{
return new Role(ExportsVoter::EXPORT);
}
/**
* Return which formatter type is allowed for this report.
*
* @return string[]
*/
public function getAllowedFormattersTypes()
{
return [ FormatterInterface::TYPE_LIST ];
}
/**
* give the list of keys the current export added to the queryBuilder in
* 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)
{
return array_keys($data['fields']);
}
/**
* Return array FIELDS keys only
*
* @return array
*/
private function getFields()
{
return array_keys(self::FIELDS);
}
/**
* Return the results of the query builder.
*
* @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)
{
$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);
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
$rsm = new Query\ResultSetMapping();
foreach (self::FIELDS as $name => $type) {
if ($data['fields'][$name]) {
$rsm->addScalarResult($name, $name, $type);
}
}
$nq = $this->entityManager->createNativeQuery($query, $rsm);
$idx = 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');
return $nq->getResult();
}
/**
* transform the results to viewable and understable string.
*
* The callable will have only one argument: the `value` to translate.
*
* The callable should also be able to return a key `_header`, which
* will contains the header of the column.
*
* The string returned **must** be already translated if necessary,
* **with an exception** for the string returned for `_header`.
*
* Example :
*
* ```
* protected $translator;
*
* public function getLabels($key, array $values, $data)
* {
* return function($value) {
* case $value
* {
* case '_header' :
* return 'my header not translated';
* case true:
* return $this->translator->trans('true');
* case false:
* return $this->translator->trans('false');
* default:
* // this should not happens !
* throw new \LogicException();
* }
* }
* ```
*
* **Note:** Why each string must be translated with an exception for
* the `_header` ? For performance reasons: most of the value will be number
* 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 $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') {
return $key;
}
return $value;
};
}
}
/**
* Native Query SQL
*/
const QUERY = <<<SQL
SELECT
p.id as id,
p.firstname as firstname,
p.lastname as lastname,
p.gender as gender,
p.birthdate as birthdate,
p.place_of_birth as placeofbirth,
cn.name as countryofbirth,
cv.formationlevel as formationlevel
FROM
public.chill_person_person AS p
LEFT JOIN chill_csconnectes.cv AS cv
ON p.id = cv.person_id
LEFT JOIN public.country AS cn
ON p.countryofbirth_id = cn.id
-- condition 1
WHERE p.id IN (%person_ids%)
-- condition 2
AND (
cv.reportdate
BETWEEN COALESCE(?::date, '1900-01-01')
AND COALESCE(?::date, '2100-01-01')
)
ORDER BY cv.reportdate DESC
SQL;
}

View File

@ -0,0 +1,506 @@
<?php
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\Frein;
use Chill\ChillJobBundle\Security\Authorization\ExportsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Class ListFrein
*
* @package Chill\ChillJobBundle\Export
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
*/
class ListFrein implements ListInterface, ExportElementValidatedInterface
{
/**
* @var array
*/
const FREINS = [
'freinsperso' => Frein::FREINS_PERSO,
'freinsemploi' => Frein::FREINS_EMPLOI,
];
/**
* @var array
*/
const FIELDS = [
'id' => 'integer',
'firstname' => 'string',
'lastname' => 'string',
'gender' => 'string',
'birthdate' => 'date',
'placeofbirth' => 'string',
'countryofbirth' => 'json',
'reportdate' => 'date',
'freinsperso' => 'json',
'notesperso' => 'string',
'freinsemploi' => 'json',
'notesemploi' => 'string',
];
/**
* @var array
*/
protected $personIds = [];
/**
* @var EntityManagerInterface
*/
protected $entityManager;
/**
* ListAcquisition constructor.
*
* @param EntityManagerInterface $em
*/
public function __construct(EntityManagerInterface $em)
{
$this->entityManager = $em;
}
/**
* validate the form's data and, if required, build a contraint
* 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)
*
* @return string
*/
public function getTitle()
{
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)
{
$builder
->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
'choices_as_values' => true,
'label' => 'Fields to include in export',
'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) {
$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',
],
'attr' => [
'class' => 'reportdate_range',
],
])
->add('reportdate_max', ChillDateType::class, [
'label' => 'Date du rapport avant le',
'required' => false,
'label_attr' => [
'class' => 'report_date_range',
],
'attr' => [
'class' => 'report_date_range',
],
])
;
}
/**
* Return the Export's type. This will inform _on what_ export will apply.
* Most of the type, it will be a string which references an entity.
*
* Example of types : Chill\PersonBundle\Export\Declarations::PERSON_TYPE
*
* @return string
*/
public function getType()
{
return Person::class;
}
/**
* A description, which will be used in the UI to explain what the export does.
* This description will be translated.
*
* @return string
*/
public function getDescription()
{
return "Crée une liste des personnes et de leurs freins identifiés en fonction de différents paramètres.";
}
/**
* The initial query, which will be modified by ModifiersInterface
* (i.e. AggregatorInterface, FilterInterface).
*
* This query should take into account the `$acl` and restrict result only to
* what the user is allowed to see. (Do not show personal data the user
* is not allowed to see).
*
* 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.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
return $this->entityManager->createQueryBuilder()
->from('ChillPersonBundle:Person', 'person');
}
/**
* Inform which ModifiersInterface (i.e. AggregatorInterface, FilterInterface)
* are allowed. The modifiers should be an array of types the _modifier_ apply on
* (@see ModifiersInterface::applyOn()).
*
* @return string[]
*/
public function supportsModifiers()
{
return [ 'frein', 'person' ];
}
/**
* Return the required Role to execute the Export.
*
* @return \Symfony\Component\Security\Core\Role\Role
*
*/
public function requiredRole()
{
return new Role(ExportsVoter::EXPORT);
}
/**
* Return which formatter type is allowed for this report.
*
* @return string[]
*/
public function getAllowedFormattersTypes()
{
return [ FormatterInterface::TYPE_LIST ];
}
/**
* Return array FIELDS keys only
*
* @return array
*/
private function getFields()
{
return array_keys(self::FIELDS);
}
/**
* give the list of keys the current export added to the queryBuilder in
* 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)
{
$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;
}
break;
default:
$fields[] = $key;
}
}
return $fields;
}
/**
* Make key compatible with YAML messages ids
* for fields that are splitted in columns
*
* @param string $item (&) passed by reference
* @param string $key
*/
private function translationCompatKey(&$item, $key)
{
$prefix = substr_replace($key, 'freins_', 0, 6);
$item = $prefix .'.'. $item;
}
/**
* Some fields values are arrays that have to be splitted in columns.
* This function split theses fields
*
* @param array $rows
* @return array|\Closure
*/
private function splitArrayToColumns($rows)
{
$freins = self::FREINS;
/**
* @var array $row each row exported
*/
$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) {
$res[$item] = '';
} else {
foreach ($value as $v) {
$this->translationCompatKey($v, $key);
if ($item === $v) {
$res[$item] = 'x';
break;
} else {
$res[$item] = '';
}
}
}
}
break;
default:
$res[$key] = $value;
}
}
$results[] = $res;
}
return $results;
}
/**
* Return the results of the query builder.
*
* @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)
{
$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);
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
$rsm = new Query\ResultSetMapping();
foreach (self::FIELDS as $name => $type) {
if ($data['fields'][$name]) {
$rsm->addScalarResult($name, $name, $type);
}
}
$nq = $this->entityManager->createNativeQuery($query, $rsm);
$idx = 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');
return $this->splitArrayToColumns(
$nq->getResult()
);
}
/**
* transform the results to viewable and understable string.
*
* The callable will have only one argument: the `value` to translate.
*
* The callable should also be able to return a key `_header`, which
* will contains the header of the column.
*
* The string returned **must** be already translated if necessary,
* **with an exception** for the string returned for `_header`.
*
* Example :
*
* ```
* protected $translator;
*
* public function getLabels($key, array $values, $data)
* {
* return function($value) {
* case $value
* {
* case '_header' :
* return 'my header not translated';
* case true:
* return $this->translator->trans('true');
* case false:
* return $this->translator->trans('false');
* default:
* // this should not happens !
* throw new \LogicException();
* }
* }
* ```
*
* **Note:** Why each string must be translated with an exception for
* the `_header` ? For performance reasons: most of the value will be number
* 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 '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') {
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;
};
}
}
/**
* Native Query SQL
*/
const QUERY = <<<SQL
SELECT
p.id as id,
p.firstname as firstname,
p.lastname as lastname,
p.gender as gender,
p.birthdate as birthdate,
p.place_of_birth as placeofbirth,
cn.name as countryofbirth,
fr.reportdate as reportdate,
fr.freinsperso as freinsperso,
fr.notesperso as notesperso,
fr.freinsemploi as freinsemploi,
fr.notesemploi as notesemploi
FROM
public.chill_person_person AS p
LEFT JOIN chill_csconnectes.frein AS fr
ON p.id = fr.person_id
LEFT JOIN public.country AS cn
ON p.countryofbirth_id = cn.id
-- condition 1
WHERE p.id IN (%person_ids%)
-- condition 2
AND (
fr.reportdate
BETWEEN COALESCE(?::date, '1900-01-01')
AND COALESCE(?::date, '2100-01-01')
)
ORDER BY fr.reportdate DESC
SQL;
}

View File

@ -0,0 +1,584 @@
<?php
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\ProjetProfessionnel;
use Chill\ChillJobBundle\Security\Authorization\ExportsVoter;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Query;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Validator\Constraints\Callback;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* Class ListProjetProfessionnel
*
* @package Chill\ChillJobBundle\Export
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
*/
class ListProjetProfessionnel implements ListInterface, ExportElementValidatedInterface
{
/**
* @var array
*/
const PPROF = [
'projet_prof__type_contrat__label' => ProjetProfessionnel::TYPE_CONTRAT,
'projet_prof__volume_horaire__label' => ProjetProfessionnel::VOLUME_HORAIRES
];
/**
* @var array
*/
const FIELDS = [
'id' => 'integer',
'firstname' => 'string',
'lastname' => 'string',
'gender' => 'string',
'birthdate' => 'date',
'placeofbirth' => 'string',
'countryofbirth' => 'json',
'projet_prof__souhait__code' => 'string',
'projet_prof__type_contrat__label' => 'json',
'projet_prof__type_contrat__note' => 'string',
'projet_prof__volume_horaire__label' => 'json',
'projet_prof__volume_horaire__note' => 'string',
'projet_prof__idee' => 'string',
'projet_prof__encoursdeconstruction' => 'string',
'projet_prof__valide__note' => 'string',
'projet_prof__valide__code' => 'string',
'projet_prof__note' => 'string',
];
/**
* @var array
*/
protected $personIds = [];
/**
* @var EntityManagerInterface
*/
protected $entityManager;
/**
* ListAcquisition constructor.
*
* @param EntityManagerInterface $em
*/
public function __construct(EntityManagerInterface $em)
{
$this->entityManager = $em;
}
/**
* validate the form's data and, if required, build a contraint
* 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)
*
* @return string
*/
public function getTitle()
{
return "Liste des projets professionnels par personne";
}
/**
* Add a form to collect data from the user.
*
* @param FormBuilderInterface $builder
*/
public function buildForm(FormBuilderInterface $builder)
{
$builder
->add('fields', ChoiceType::class, [
'multiple' => true,
'expanded' => true,
'choices_as_values' => true,
'label' => 'Fields to include in export',
'choice_label' => function ($key) {
return str_replace('__', '.', $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) {
$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',
],
'attr' => [
'class' => 'reportdate_range',
],
])
->add('reportdate_max', ChillDateType::class, [
'label' => 'Date du rapport avant le',
'required' => false,
'label_attr' => [
'class' => 'report_date_range',
],
'attr' => [
'class' => 'report_date_range',
],
])
;
}
/**
* Return the Export's type. This will inform _on what_ export will apply.
* Most of the type, it will be a string which references an entity.
*
* Example of types : Chill\PersonBundle\Export\Declarations::PERSON_TYPE
*
* @return string
*/
public function getType()
{
return Person::class;
}
/**
* A description, which will be used in the UI to explain what the export does.
* This description will be translated.
*
* @return string
*/
public function getDescription()
{
return "Crée une liste des personnes et de leur projet professionnel en fonction de différents paramètres.";
}
/**
* The initial query, which will be modified by ModifiersInterface
* (i.e. AggregatorInterface, FilterInterface).
*
* This query should take into account the `$acl` and restrict result only to
* what the user is allowed to see. (Do not show personal data the user
* is not allowed to see).
*
* 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.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = array())
{
return $this->entityManager->createQueryBuilder()
->from('ChillPersonBundle:Person', 'person');
}
/**
* Inform which ModifiersInterface (i.e. AggregatorInterface, FilterInterface)
* are allowed. The modifiers should be an array of types the _modifier_ apply on
* (@see ModifiersInterface::applyOn()).
*
* @return string[]
*/
public function supportsModifiers()
{
return [ 'projetprofessionnel', 'person' ];
}
/**
* Return the required Role to execute the Export.
*
* @return \Symfony\Component\Security\Core\Role\Role
*
*/
public function requiredRole()
{
return new Role(ExportsVoter::EXPORT);
}
/**
* Return which formatter type is allowed for this report.
*
* @return string[]
*/
public function getAllowedFormattersTypes()
{
return [ FormatterInterface::TYPE_LIST ];
}
/**
* Return array FIELDS keys only
*
* @return array
*/
private function getFields()
{
return array_keys(self::FIELDS);
}
/**
* give the list of keys the current export added to the queryBuilder in
* 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)
{
$projet_professionnel = self::PPROF;
$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);
default:
$fields[] = $key;
}
}
return $fields;
}
/**
* Make item compatible with YAML messages ids
* for fields that are splitted in columns (with field key to replace)
*
* AVANT
* key: projet_prof__volume_horaire__label
* item: temps_plein
* APRES
* item: projet_prof.volume_horaire.temps_plein
*
* @param string $item (&) passed by reference
* @param string $key
*/
private function translationCompatKey(&$item, $key)
{
$key = str_replace('label', $item, $key);
$key = str_replace('__', '.', $key);
$item = $key;
}
/**
* Some fields values are arrays that have to be splitted in columns.
* This function split theses fields
*
* @param array $rows
* @return array|\Closure
*/
private function splitArrayToColumns($rows)
{
$projet_professionnel = self::PPROF;
/**
* @var array $row each row exported
*/
$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) {
$res[$item] = '';
} else {
foreach ($value as $v) {
$this->translationCompatKey($v, $key);
if ($item === $v) {
$res[$item] = 'x';
break;
} else {
$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);
default:
$res[$key] = $value;
}
}
$results[] = $res;
}
return $results;
}
/**
* Return the results of the query builder.
*
* @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)
{
$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);
$query = \str_replace('%person_ids%', $personIdsParameters, self::QUERY);
$rsm = new Query\ResultSetMapping();
foreach (self::FIELDS as $name => $type) {
if ($data['fields'][$name]) {
$rsm->addScalarResult($name, $name, $type);
}
}
$nq = $this->entityManager->createNativeQuery($query, $rsm);
$idx = 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');
return $this->splitArrayToColumns(
$nq->getResult()
);
}
/**
* transform the results to viewable and understable string.
*
* The callable will have only one argument: the `value` to translate.
*
* The callable should also be able to return a key `_header`, which
* will contains the header of the column.
*
* The string returned **must** be already translated if necessary,
* **with an exception** for the string returned for `_header`.
*
* Example :
*
* ```
* protected $translator;
*
* public function getLabels($key, array $values, $data)
* {
* return function($value) {
* case $value
* {
* case '_header' :
* return 'my header not translated';
* case true:
* return $this->translator->trans('true');
* case false:
* return $this->translator->trans('false');
* default:
* // this should not happens !
* throw new \LogicException();
* }
* }
* ```
*
* **Note:** Why each string must be translated with an exception for
* the `_header` ? For performance reasons: most of the value will be number
* 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 $key;
}
return $value['fr'];
};
case 'projet_prof.valide.code':
case 'projet_prof.souhait.code':
return function ($value) use ($key) {
if ($value === '_header') { return $key; }
if ($value === '{NULL}') { return ''; }
return str_replace(['{','}'], '', $value);
};
case 'gender':
return function ($value) use ($key) {
$gend_array = [ 'man' => 'Homme', 'woman' => 'Femme', 'both' => 'Indéterminé' ];
if ($value === '_header') { return $key; }
if (empty($value)) { return ''; }
return $gend_array[$value];
};
case 'id':
case 'firstname':
case 'lastname':
case 'placeofbirth':
default:
return function ($value) use ($key) {
if ($value === '_header') {
return $key;
}
if (empty($value)) { return ''; }
return $value;
};
}
}
/**
* Native Query SQL
*/
const QUERY = <<<SQL
WITH projet_professionnel AS (
SELECT
pp.id,
pp.reportdate,
pp.typecontrat,
pp.typecontratnotes,
pp.volumehoraire,
pp.volumehorairenotes,
pp.idee,
pp.encoursconstruction,
pp.validenotes,
pp.projetprofessionnelnote,
ARRAY_AGG (DISTINCT rms.code) as rms_codes,
ARRAY_AGG (DISTINCT rmv.code) as rmv_codes
FROM chill_csconnectes.projet_professionnel AS pp
LEFT OUTER JOIN chill_csconnectes.projetprofessionnel_souhait AS pps
ON pp.id = pps.projetprofessionnel_id
LEFT OUTER JOIN chill_csconnectes.rome_appellation AS ras
ON pps.appellation_id = ras.id
LEFT OUTER JOIN chill_csconnectes.rome_metier AS rms
ON ras.metier_id = rms.id
LEFT OUTER JOIN chill_csconnectes.projetprofessionnel_valide AS ppv
ON pp.id = ppv.projetprofessionnel_id
LEFT OUTER JOIN chill_csconnectes.rome_appellation AS rav
ON ppv.appellation_id = rav.id
LEFT OUTER JOIN chill_csconnectes.rome_metier AS rmv
ON rav.metier_id = rmv.id
GROUP BY pp.id
)
SELECT
p.id,
p.firstname,
p.lastname,
p.gender as gender,
p.birthdate as birthdate,
p.place_of_birth as placeofbirth,
cn.name as countryofbirth,
pp.rms_codes as projet_prof__souhait__code,
pp.typecontrat as projet_prof__type_contrat__label,
pp.typecontratnotes as projet_prof__type_contrat__note,
pp.volumehoraire as projet_prof__volume_horaire__label,
pp.volumehorairenotes as projet_prof__volume_horaire__note,
pp.idee as projet_prof__idee,
pp.encoursconstruction as projet_prof__encoursdeconstruction,
pp.validenotes as projet_prof__valide__note,
pp.rmv_codes as projet_prof__valide__code,
pp.projetprofessionnelnote as projet_prof__note
FROM public.chill_person_person AS p
LEFT JOIN projet_professionnel AS pp
ON p.id = pp.id
LEFT OUTER JOIN public.country AS cn
ON p.countryofbirth_id = cn.id
-- condition 1
WHERE p.id IN (%person_ids%)
-- condition 2
AND (
pp.reportdate
BETWEEN COALESCE(?::date, '1900-01-01')
AND COALESCE(?::date, '2100-01-01')
)
ORDER BY pp.reportdate DESC
SQL;
}

View File

@ -0,0 +1,132 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\ChillJobBundle\Entity\CSPerson;
use Symfony\Component\Form\Extension\Core\Type\TextType;
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
->add('accompagnement', ChoiceType::class, [
'choices' => \array_combine(CSPerson::ACCOMPAGNEMENTS, CSPerson::ACCOMPAGNEMENTS),
'required' => false,
'label' => 'Accompagnement',
'multiple' => true,
'expanded' => true,
'choice_label' => function($k) { return 'accompagnement.'.$k; }
])
->add('accompagnementRQTHDate', ChillDateType::class, [
'label' => "Date d'accompagnement RQTH",
'required' => false,
])
->add('accompagnementComment', TextAreaType::class, [
'label' => "Accompagnement autre: précisions",
'required' => false,
])
->add('poleEmploiId', TextType::class, [
'label' => "Identifiant pôle emploi",
'required' => false,
])
->add('poleEmploiInscriptionDate', ChillDateType::class, [
'label' => "Date d'inscription Pôle emploi",
'required' => false
])
->add('cafId', TextType::class, [
'label' => "Numéro allocataire CAF",
'required' => false
])
->add('cafInscriptionDate', ChillDateType::class, [
'label' => "Date d'inscription à la CAF",
'required' => false
])
->add('cERInscriptionDate', ChillDateType::class, [
'label' => "Date CER",
'required' => false
])
->add('pPAEInscriptionDate', ChillDateType::class, [
'label' => "Date PPAE",
'required' => false
])
->add('nEETEligibilite', ChoiceType::class, [
'label' => "Éligibilité NEET",
'choices' => \array_combine(CSPerson::NEET_ELIGIBILITY, CSPerson::NEET_ELIGIBILITY),
'choice_label' => function($k) { return 'neet_eligibility.'.$k; },
'multiple' => false,
'expanded' => true,
'required' => false
])
->add('cERSignataire', TextType::class, [
'label' => "Signataire CER",
'required' => false
])
->add('pPAESignataire', TextType::class, [
'label' => "Signataire PPAE",
'required' => false
])
->add('nEETCommissionDate', ChillDateType::class, [
'label' => "Date commission NEET",
'required' => false
])
->add('fSEMaDemarcheCode', TextType::class, [
'label' => 'Code "Ma démarche FSE"',
'required' => false
])
->add('prescripteur', PickThirdPartyType::class, [
'required' => false,
'types' => ['prescripteur'],
'label' => 'Prescripteur',
'center' => $options['center']
])
->add('dispositifsNotes', TextareaType::class, [
'required' => false,
'label' => "Notes"
])
->add('dateContratIEJ', ChillDateType::class, [
'required' => false,
'label' => " Date du contrat dengagement IEJ"
])
->add('dateAvenantIEJ', ChillDateType::class, [
'required' => false,
'label' => " Date de l'avenant IEJ"
]);
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\CSPerson'
));
$resolver
->setDefined('center')
->setAllowedTypes('center', [\Chill\MainBundle\Entity\Center::class])
;
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_csperson';
}
}

View File

@ -0,0 +1,263 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\ChillJobBundle\Entity\CSPerson;
use Symfony\Component\Form\Extension\Core\Type\TextType;
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;
use Chill\DocStoreBundle\Form\StoredObjectType;
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
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('situationLogement', ChoiceType::class, [
'choices' => \array_combine(
CSPerson::SITUATIONS_LOGEMENTS,
CSPerson::SITUATIONS_LOGEMENTS),
'choice_label' => function($k) { return 'situation_logement.'.$k; },
'required' => false,
'label' => 'Situation de logement',
'multiple' => false,
'expanded' => true
])
->add('situationLogementPrecision', TextareaType::class, [
'label' => 'Précisions',
'required' => false
])
->add('enfantACharge', IntegerType::class, [
'label' => 'Enfants à charge',
'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; },
'multiple' => true,
'required' => false,
'expanded' => true,
'label' => 'Maitrise de la langue française'
])
->add('vehiculePersonnel', ChoiceType::class, [
'choices' => [
'Oui' => true,
'Non' => false
],
'required' => false,
'multiple' => false
])
->add('permisConduire', ChoiceType::class, [
'choices' => [
\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; }
])
->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; }
])
->add('dateFinDernierEmploi', ChillDateType::class, [
'label' => 'Date de la fin du dernier emploi',
'required' => false
])
->add('typeContrat', ChoiceType::class, [
'choices' => \array_combine(CSPerson::TYPE_CONTRAT, CSPerson::TYPE_CONTRAT),
'label' => 'Type de contrat',
'required' => false,
'multiple' => true,
'expanded' => true,
'choice_label' => function($k) { return 'type_contrat.'.$k; }
])
->add('typeContratAide', TextType::class, [
'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; },
'required' => false,
'multiple' => true,
'expanded' => true,
])
->add('ressourcesComment', TextareaType::class, [
'label' => 'Information autre ressource',
'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",
'required' => false,
])
->add('acompteDIF', MoneyType::class, [
'label' => "Compte DIF",
'required' => false,
])
->add('handicapIs', ChoiceType::class, [
'label' => 'Handicap',
'required' => false,
'choices' => [
'Oui' => true,
'Non' => false
],
'multiple' => false,
'expanded' => true,
])
->add('handicapNotes', TextareaType::class, [
'label' => 'Type de handicap',
'required' => false,
])
->add('handicapRecommandation', ChoiceType::class, [
'label' => 'Recommandation',
'required' => false,
'multiple' => false,
'expanded' => true,
'choices' => \array_combine(CSPerson::HANDICAP_RECOMMANDATIONS, CSPerson::HANDICAP_RECOMMANDATIONS),
'choice_label' => function($k) { return 'handicap_recommandation.'.$k; }
])
->add('handicapAccompagnement', PickThirdPartyType::class, [
'center' => $options['center'],
'types' => [ 'prescripteur' ],
'required' => false,
'multiple' => false
])
->add('mobiliteMoyenDeTransport', ChoiceType::class, [
'required' => false,
'multiple' => true,
'expanded' => true,
'label' => "Moyens de transports accessibles",
'choices' => \array_combine(
CSPerson::MOBILITE_MOYEN_TRANSPORT,
CSPerson::MOBILITE_MOYEN_TRANSPORT),
'choice_label' => function($k) {
return 'moyen_transport.'.$k;
}
])
->add('mobiliteNotes', TextareaType::class, [
'required' => false,
'label' => "Notes concernant la mobilité"
])
->add('documentCV', StoredObjectType::class, [
'label' => 'CV',
'required' => false,
'error_bubbling' => false
])
->add('documentAgrementIAE', StoredObjectType::class, [
'label' => 'Document Agrément IAE',
'required' => false,
'error_bubbling' => false
])
->add('documentRQTH', StoredObjectType::class, [
'label' => 'Document RQTH',
'required' => false,
'error_bubbling' => false
])
->add('documentAttestationNEET', StoredObjectType::class, [
'label' => 'Attestation NEET',
'required' => false,
'error_bubbling' => false
])
->add('documentCI', StoredObjectType::class, [
'label' => 'Carte d\'identité',
'required' => false,
'error_bubbling' => false
])
->add('documentTitreSejour', StoredObjectType::class, [
'label' => 'Titre de séjour',
'required' => false,
'error_bubbling' => false
])
->add('documentAttestationFiscale', StoredObjectType::class, [
'label' => 'Attestation fiscale',
'required' => false,
'error_bubbling' => false
])
->add('documentPermis', StoredObjectType::class, [
'label' => 'Permis',
'required' => false,
'error_bubbling' => false
])
->add('documentAttestationCAAF', StoredObjectType::class, [
'label' => 'Attestation CAF',
'required' => false,
'error_bubbling' => false
])
->add('documentContraTravail', StoredObjectType::class, [
'label' => 'Contrat de travail',
'required' => false,
'error_bubbling' => false
])
->add('documentAttestationFormation', StoredObjectType::class, [
'label' => 'Attestation formation',
'required' => false,
'error_bubbling' => false
])
->add('documentQuittanceLoyer', StoredObjectType::class, [
'label' => 'Quittance de loyer',
'required' => false,
'error_bubbling' => false
])
->add('documentFactureElectricite', StoredObjectType::class, [
'label' => 'Facture d\'électricité',
'required' => false,
'error_bubbling' => false
])
->add('documentAttestationSecuriteSociale', StoredObjectType::class, [
'label' => 'Attestation de sécurité sociale',
'required' => 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 getBlockPrefix()
{
return 'csconnectes_spbundle_csperson';
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace Chill\ChillJobBundle\Form\CV;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\ChillJobBundle\Entity\CV\Experience;
class ExperienceType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('poste', TextType::class, [
'required' => true,
'label' => 'Poste',
'label_attr' => [
'class' => 'required '
]
])
->add('structure', TextType::class, [
'required' => false,
'label' => "Nom de la structure"
])
->add('startDate', ChillDateType::class, [
'required' => false,
'label' => 'Date de début'
])
->add('endDate', ChillDateType::class, [
'required' => false,
'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; }
])
->add('notes', TextareaType::class, [
'label' => 'Notes',
'required' => false
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Experience'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_cv_experience';
}
}

View File

@ -0,0 +1,77 @@
<?php
namespace Chill\ChillJobBundle\Form\CV;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
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_attr' => [
'class' => 'required '
]
])
->add('organisme', TextType::class, [
'label' => 'Organisme',
'required' => false
])
->add('startDate', ChillDateType::class, [
'required' => false,
'label' => "Date de début"
])
->add('endDate', ChillDateType::class, [
'required' => false,
'label' => "Date de fin"
])
->add('diplomaObtained', ChoiceType::class, [
'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; }
])
->add('diplomaReconnue', ChoiceType::class, [
'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; }
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\CV\Formation'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_cv_formation';
}
}

View File

@ -0,0 +1,94 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\ChillJobBundle\Entity\CV;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\ChillJobBundle\Form\CV\FormationType;
use Chill\ChillJobBundle\Form\CV\ExperienceType;
use Chill\MainBundle\Form\Type\Select2LanguageType;
class CVType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('reportDate', ChillDateType::class, [
'label' => 'Date de rédaction du CV',
])
->add('formationLevel', ChoiceType::class, [
'label' => 'Niveau de formation',
'required' => true,
'multiple' => false,
'expanded' => true,
'choices' => \array_combine(CV::FORMATION_LEVEL, CV::FORMATION_LEVEL),
'choice_label' => function($k) { return 'formation_level.'.$k; }
])
->add('formationType', ChoiceType::class, [
'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; }
])
->add('spokenLanguages', Select2LanguageType::class, [
'required' => false,
'multiple' => true,
])
->add('notes', TextareaType::class, [
'label' => "Note",
'required' => false
])
->add('formations', ChillCollectionType::class, [
'label' => "Formations",
'entry_type' => FormationType::class,
'allow_add' => true,
'allow_delete' => true,
'button_add_label' => 'Ajouter une formation',
'button_remove_label' => 'Retirer cette formation',
'required' => false,
'by_reference' => false,
'block_name' => 'formation_list'
])
->add('experiences', ChillCollectionType::class, [
'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
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\CV'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_cv';
}
}

View File

@ -0,0 +1,144 @@
<?php
/*
*/
namespace Chill\ChillJobBundle\Form\ChoiceLoader;
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
use Chill\ChillJobBundle\Entity\Rome\Appellation;
use Doctrine\ORM\EntityManagerInterface;
use Chill\PoleEmploiApiBundle\ApiHelper\PartenaireRomeAppellation;
use Chill\ChillJobBundle\Entity\Rome\Metier;
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
*/
protected $validator;
/**
* RomeAppellationChoiceLoader constructor.
*
* @param EntityManagerInterface $em
* @param PartenaireRomeAppellation $apiAppellation
* @param ValidatorInterface $validator
*/
public function __construct(
EntityManagerInterface $em,
PartenaireRomeAppellation $apiAppellation,
ValidatorInterface $validator
) {
$this->em = $em;
$this->apiAppellation = $apiAppellation;
$this->appellationRepository = $em->getRepository(Appellation::class);
$this->validator = $validator;
}
public function loadChoiceList($value = null): ChoiceListInterface
{
return new ArrayChoiceList($this->lazyLoadedAppellations, $value);
}
public function loadChoicesForValues($values, $value = null)
{
$choices = [];
foreach($values as $v) {
if (empty($v)) {
continue;
}
// start with "original-" ? then we load from api
if (\substr($v, 0, \strlen('original-')) === 'original-') {
$code = \substr($v, \strlen('original-'));
$appellation = $this->appellationRepository->findOneByCode($code);
} else {
$id = $v;
$appellation = $this->appellationRepository->find($id);
}
if (NULL === $appellation) {
$def = $this->apiAppellation->getAppellation($code);
$metier = $this->em->getRepository(Metier::class)
->findOneByCode($def->metier->code)
;
if ($metier === NULL) {
$metier = (new Metier())
->setCode($def->metier->code)
->setLibelle($def->metier->libelle)
;
}
$appellation = new Appellation();
$appellation
->setCode($def->code)
->setLibelle($def->libelle)
->setMetier($metier)
;
if ($this->validator->validate($appellation) && $this->validator->validate($metier))
{
$this->em->persist($appellation);
}
}
if ($this->em->contains($metier) and $this->em->contains($appellation))
{
$choices[] = $appellation;
}
}
return $choices;
}
public function loadValuesForChoices(array $choices, $value = null)
{
foreach ($choices as $choice) {
if (NULL === $choice) {
$values[] = null;
continue;
}
$id = \call_user_func($value, $choice);
$this->lazyLoadedAppellations[$id] = $choice;
}
return $this->loadChoiceList($value)->getValuesForChoices($choices);
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\ChillJobBundle\Entity\Frein;
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'
])
->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; },
'required' => false,
'expanded' => true,
'multiple' => true,
])
->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; },
'required' => false,
'expanded' => true,
'multiple' => true,
])
->add('notesPerso', TextareaType::class, [
'label' => 'Notes concernant la situation personnelle',
'required' => false
])
->add('notesEmploi', TextareaType::class, [
'label' => 'Notes concernant l\'accès à l\'emploi',
'required' => false
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\Frein'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_frein';
}
}

View File

@ -0,0 +1,209 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\MainBundle\Form\Type\ChillDateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\ThirdPartyBundle\Form\Type\PickThirdPartyType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Chill\MainBundle\Form\Type\DateIntervalType;
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') {
$builder
->add('entreprise', PickThirdPartyType::class, [
'center' => $options['center'],
'types' => [ 'entreprise' ],
'label' => "Identité de l'entreprise",
'required' => true,
'multiple' => false
])
->add('domaineActivite', TextType::class, [
'label' => "Domaine d'activité",
'required' => true,
])
->add('tuteurName', TextType::class, [
'label' => "Nom du tuteur",
'required' => true
])
->add('tuteurFonction', TextType::class, [
'label' => "Fonction du tuteur",
'required' => true
])
->add('tuteurPhoneNumber', TextType::class, [
'label' => "Téléphone du tuteur",
'required' => true
])
->add('structureAccName', TextType::class, [
'label' => "Nom de la structure",
"required" => false
])
->add('structureAccPhonenumber', TextType::class, [
'label' => "Téléphone de la structure",
'required' => false
])
->add('structureAccEmail', EmailType::class, [
'label' => 'Email de la structure',
'required' => false
])
->add('structureAccAddress', AddressType::class, [
'label' => 'Addresse de la structure d\'accompagnement',
'required' => false,
'has_valid_from' => false,
'null_if_empty' => true
])
->add('posteTitle', TextType::class, [
'label' => 'Intitulé du poste',
'required' => true
])
->add('posteLieu', TextType::class, [
'label' => "Lieu d'exercice",
'required' => true
])
->add('debutDate', ChillDateType::class, [
'label' => "Date de début de l'immersion",
'required' => true
])
->add('duration', DateIntervalType::class, [
'unit_choices' => [
"Weeks" => 'W',
"Months" => 'M',
"Days" => 'D'
],
'label' => "Durée de l'immersion",
'required' => true
])
->add('horaire', TextareaType::class, [
'label' => "Horaire du stagiaire",
'required' => true,
])
->add('objectifs', ChoiceType::class, [
'label' => "Objectifs",
'required' => false,
'multiple' => true,
'expanded' => true,
'choices' => \array_combine(Immersion::OBJECTIFS, Immersion::OBJECTIFS),
'choice_label' => function($k) { return 'immersion_objectif.'.$k; }
])
->add('objectifsAutre', TextareaType::class, [
'label' => 'Précision sur les objectifs',
'required' => false
])
->add('noteImmersion', TextareaType::class, [
'label' => "Note",
'required' => false
])
;
} elseif ($options['step'] === 'bilan') {
$builder
->add('savoirEtre', ChoiceType::class, [
'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; }
])
->add('savoirEtreNote', TextareaType::class, [
'label' => "Note",
'required' => false
])
->add('principalesActivites', TextareaType::class, [
'label' => "Principales activités",
'required' => false
])
->add('competencesAcquises', TextareaType::class, [
'label' => "Compétences acquises",
'required' => false
])
->add('competencesADevelopper', TextareaType::class, [
'label' => "Compétences à développer",
'required' => false
])
->add('noteBilan', TextareaType::class, [
'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 sintéresse à lensemble des activités et membres de lentreprise"],
['integreRegle', Immersion::INTEGRE_REGLE, "La personne a intégré les règles (les principes) de lentreprise"],
['espritInitiative', Immersion::YES_NO_NSP, "La personne fait preuve desprit dinitiative"],
['organisation', Immersion::YES_NO_NSP, "La personne a fait preuve dorganisation"],
['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)) {
$builder
->add($name, ChoiceType::class, [
'label' => $label,
'multiple' => false,
'required' => false,
'expanded' => true,
'choices' => $choices,
'choice_label' => function($el) use ($choices, $name) {
if ($choices === Immersion::YES_NO_NSP) {
return 'immersion_nsp.'.$el;
}
return 'immersion_'.$name.'.'.$el;
}
])
->add($name.'Note', TextareaType::class, [
'label' => "Notes",
'required' => false
]);
}
}
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\Immersion',
'step' => 'immersion'
));
$resolver
->setAllowedValues('step', ['immersion', 'bilan'])
->setRequired('center')
->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class)
;
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_immersion';
}
}

View File

@ -0,0 +1,109 @@
<?php
namespace Chill\ChillJobBundle\Form;
use Symfony\Component\Form\AbstractType;
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
->add('souhait', PickRomeAppellationType::class, [
'label' => 'Souhait',
'multiple' => true,
'required' => false,
])
->add('domaineActiviteSouhait', TextareaType::class, [
'label' => "Domaine d'activité souhaité",
'required' => false
])
->add('reportDate', ChillDateType::class, [
'label' => 'Date',
'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; }
])
->add('typeContratNotes', TextareaType::class, [
'label' => 'Notes concernant le contrat recherché',
'required' => false,
])
->add('volumeHoraire', ChoiceType::class, [
'label' => 'Volume horaire',
'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; }
])
->add('volumeHoraireNotes', TextareaType::class, [
'label' => 'Notes concernant le volume horaire',
'required' => false
])
->add('idee', TextareaType::class, [
'label' => 'Idée',
'required' => false,
])
->add('enCoursConstruction', TextareaType::class, [
'label' => 'En cours de construction',
'required' => false,
])
->add('valide', PickRomeAppellationType::class, [
'label' => 'Validé',
'multiple' => true,
'by_reference' => false,
'required' => false,
])
->add('domaineActiviteValide', TextareaType::class, [
'label' => "Domaine d'activité validé",
'required' => false
])
->add('valideNotes', TextareaType::class, [
'label' => 'Validé (notes)',
'required' => false,
])
->add('projetProfessionnelNote', TextareaType::class, [
'label' => 'Notes concernant le projet professionnel',
'required' => false
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'Chill\ChillJobBundle\Entity\ProjetProfessionnel'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'csconnectes_spbundle_projetprofessionnel';
}
}

View File

@ -0,0 +1,125 @@
<?php
/*
*/
namespace Chill\ChillJobBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\FormBuilderInterface;
use Chill\ChillJobBundle\Entity\Rome\Appellation;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Chill\PoleEmploiApiBundle\ApiHelper\PartenaireRomeAppellation;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\OptionsResolver\Options;
use Chill\ChillJobBundle\Form\ChoiceLoader\RomeAppellationChoiceLoader;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/**
* Allow to grab an appellation
*
*/
class PickRomeAppellationType extends AbstractType
{
/**
*
* @var TranslatorInterface
*/
protected $translator;
/**
*
* @var UrlGeneratorInterface
*/
protected $urlGenerator;
// /**
// *
// * @var \Chill\ChillJobBundle\Form\DataTransformer\RomeAppellationTransformer
// */
// protected $romeAppellationTransformer;
/**
*
* @var EntityManagerInterface
*/
protected $em;
/**
*
* @var PartenaireRomeAppellation
*/
protected $apiPartenaire;
/**
* @var ValidatorInterface
*/
protected $validator;
/**
* PickRomeAppellationType constructor.
*
* @param TranslatorInterface $translator
* @param UrlGeneratorInterface $urlGenerator
* @param EntityManagerInterface $em
* @param PartenaireRomeAppellation $apiPartenaire
* @param ValidatorInterface $validator
*/
public function __construct(
TranslatorInterface $translator,
UrlGeneratorInterface $urlGenerator,
EntityManagerInterface $em,
PartenaireRomeAppellation $apiPartenaire,
ValidatorInterface $validator
) {
$this->translator = $translator;
$this->urlGenerator = $urlGenerator;
$this->em = $em;
$this->apiPartenaire = $apiPartenaire;
$this->validator = $validator;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
//->addModelTransformer($this->romeAppellationTransformer)
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', Appellation::class)
->setDefault('choice_label', function(Appellation $a) {
return $a->getLibelle();
})
->setDefault('placeholder', 'Choisir une appellation')
//->setDefault('attr', ['class' => 'select2 '])
->setDefault('choice_loader', function(Options $o) {
return new RomeAppellationChoiceLoader(
$this->em,
$this->apiPartenaire,
$this->validator
);
})
;
}
public function getParent()
{
return EntityType::class;
}
public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options)
{
$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' ]);
$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');
$view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching');
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace Chill\ChillJobBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
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;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
/** @var \Chill\PersonBundle\Entity\Person $person */
$person = $parameters['person'];
if ($this->authorizationChecker->isGranted(CSConnectesVoter::REPORT_NEW, $person)) {
$menu->addChild('Situation personnelle', [
'route' => 'chill_crud_csperson_personal_situation_view',
'routeParameters' => [
'id' => $person->getId()
]
])
->setExtras([
'order'=> 50
]);
$menu->addChild('Dispositifs', [
'route' => 'chill_crud_csperson_dispositifs_view',
'routeParameters' => [
'id' => $person->getId()
]
])
->setExtras([
'order'=> 51
]);
}
$menu->addChild('Parcours d\'accompagnement', [
'route' => 'chill_csconnectes_csreport_index',
'routeParameters' => [
'person' => $person->getId()
]
])
->setExtras([
'order' => 52
]);
}
public static function getMenuIds(): array
{
return [ 'person' ];
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository;
/**
* CSPersonRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class CSPersonRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository\CV;
/**
* ExperienceRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ExperienceRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository\CV;
/**
* FormationRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class FormationRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository;
/**
* CVRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class CVRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository;
/**
* FreinRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class FreinRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository;
/**
* ImmersionRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ImmersionRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository;
/**
* ProjetProfessionnelRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ProjetProfessionnelRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository\Rome;
/**
* AppellationRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class AppellationRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,13 @@
<?php
namespace Chill\ChillJobBundle\Repository\Rome;
/**
* MetierRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class MetierRepository extends \Doctrine\ORM\EntityRepository
{
}

View File

@ -0,0 +1,3 @@
csconnectes_sp_controllers:
resource: "@CSConnectesSPBundle/Controller"
type: annotation

View File

@ -0,0 +1,12 @@
imports:
- './services/3party_type.yml'
- './services/menu.yml'
- './services/security.yml'
- './services/controller.yml'
- './services/form.yml'
- './services/export.yml'
services:
# cs_connectes_sp.example:
# class: Chill\ChillJobBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]

View File

@ -0,0 +1,9 @@
services:
Chill\ChillJobBundle\ThirdParty\PrescripteurType:
tags:
- { name: chill_3party.provider }
Chill\ChillJobBundle\ThirdParty\EntrepriseType:
tags:
- { name: chill_3party.provider }

View File

@ -0,0 +1,3 @@
services:
Chill\ChillJobBundle\Controller\CSReportController:
tags: ['controller.service_arguments']

View File

@ -0,0 +1,28 @@
services:
Chill\ChillJobBundle\Export\ListCSPerson:
arguments:
$em: '@doctrine.orm.entity_manager'
$translator: "@translator"
$translatableStringHelper: "@chill.main.helper.translatable_string"
$customFieldProvider: "@chill.custom_field.provider"
tags:
- { name: chill.export, alias: list_CSPerson }
Chill\ChillJobBundle\Export\ListCV:
arguments:
$em: '@doctrine.orm.entity_manager'
tags:
- { name: chill.export, alias: list_CV }
Chill\ChillJobBundle\Export\ListFrein:
arguments:
$em: '@doctrine.orm.entity_manager'
tags:
- { name: chill.export, alias: list_Frein }
Chill\ChillJobBundle\Export\ListProjetProfessionnel:
arguments:
$em: '@doctrine.orm.entity_manager'
tags:
- { name: chill.export, alias: list_ProjetProfessionnel }

View File

@ -0,0 +1,8 @@
services:
Chill\ChillJobBundle\Form\Type\PickRomeAppellationType:
autowire: true
tags:
- { name: form.type }
Chill\ChillJobBundle\Form\DataTransformer\RomeAppellationTransformer:
autowire: true

View File

@ -0,0 +1,6 @@
services:
Chill\ChillJobBundle\Menu\MenuBuilder:
arguments:
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
tags:
- { name: 'chill.menu_builder' }

View File

@ -0,0 +1,15 @@
services:
Chill\ChillJobBundle\Security\Authorization\CSConnectesVoter:
arguments:
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
tags:
- { name: security.voter }
- { name: chill.role }
Chill\ChillJobBundle\Security\Authorization\ExportsVoter:
arguments:
$authorizationHelper: '@Chill\MainBundle\Security\Authorization\AuthorizationHelper'
tags:
- { name: security.voter }
- { name: chill.role }

View File

@ -0,0 +1,105 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add schema chill_csconnectes & table cs_person inside
*/
final class Version20191119172511 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SCHEMA chill_csconnectes');
$this->addSql('CREATE TABLE chill_csconnectes.cs_person (
id INT NOT NULL,
person_id INT NOT NULL,
prescripteur_id INT DEFAULT NULL,
situationLogement VARCHAR(255) DEFAULT NULL,
enfantACharge INT DEFAULT NULL,
niveauMaitriseLangue JSONB DEFAULT NULL,
vehiculePersonnel BOOLEAN DEFAULT NULL,
permisConduire JSONB DEFAULT NULL,
situationProfessionnelle VARCHAR(255) DEFAULT NULL,
dateFinDernierEmploi DATE DEFAULT NULL,
typeContrat JSONB DEFAULT NULL,
ressources JSONB DEFAULT NULL,
ressourcesComment TEXT DEFAULT NULL,
ressourceDate1Versement DATE DEFAULT NULL,
CPFNombreHeures INT DEFAULT NULL,
accompagnement JSONB DEFAULT NULL,
accompagnementRQTHDate DATE DEFAULT NULL,
accompagnementComment VARCHAR(255) DEFAULT NULL,
poleEmploiId VARCHAR(255) DEFAULT NULL,
poleEmploiInscriptionDate DATE DEFAULT NULL,
cafId VARCHAR(255) DEFAULT NULL,
cafInscriptionDate DATE DEFAULT NULL,
CERInscriptionDate DATE DEFAULT NULL,
PPAEInscriptionDate DATE DEFAULT NULL,
NEETEligibilite BOOLEAN DEFAULT NULL,
NEETCommissionDate DATE DEFAULT NULL,
FSEMaDemarcheCode TEXT DEFAULT NULL,
documentCV_id INT DEFAULT NULL,
documentAgrementIAE_id INT DEFAULT NULL,
documentRQTH_id INT DEFAULT NULL,
documentAttestationNEET_id INT DEFAULT NULL,
documentCI_id INT DEFAULT NULL,
documentTitreSejour_id INT DEFAULT NULL,
documentAttestationFiscale_id INT DEFAULT NULL,
documentPermis_id INT DEFAULT NULL,
documentAttestationCAAF_id INT DEFAULT NULL,
documentContraTravail_id INT DEFAULT NULL,
documentAttestationFormation_id INT DEFAULT NULL,
documentQuittanceLoyer_id INT DEFAULT NULL,
documentFactureElectricite_id INT DEFAULT NULL,
PRIMARY KEY(id, person_id))');
$this->addSql('CREATE INDEX IDX_10864F31217BBB47 ON chill_csconnectes.cs_person (person_id)');
$this->addSql('CREATE INDEX IDX_10864F3154866550 ON chill_csconnectes.cs_person (documentCV_id)');
$this->addSql('CREATE INDEX IDX_10864F318825E118 ON chill_csconnectes.cs_person (documentAgrementIAE_id)');
$this->addSql('CREATE INDEX IDX_10864F31A396AFAC ON chill_csconnectes.cs_person (documentRQTH_id)');
$this->addSql('CREATE INDEX IDX_10864F3187541764 ON chill_csconnectes.cs_person (documentAttestationNEET_id)');
$this->addSql('CREATE INDEX IDX_10864F315CFC2299 ON chill_csconnectes.cs_person (documentCI_id)');
$this->addSql('CREATE INDEX IDX_10864F3134FDF11D ON chill_csconnectes.cs_person (documentTitreSejour_id)');
$this->addSql('CREATE INDEX IDX_10864F315742C99D ON chill_csconnectes.cs_person (documentAttestationFiscale_id)');
$this->addSql('CREATE INDEX IDX_10864F31166494D4 ON chill_csconnectes.cs_person (documentPermis_id)');
$this->addSql('CREATE INDEX IDX_10864F3172820D66 ON chill_csconnectes.cs_person (documentAttestationCAAF_id)');
$this->addSql('CREATE INDEX IDX_10864F31AFA5E636 ON chill_csconnectes.cs_person (documentContraTravail_id)');
$this->addSql('CREATE INDEX IDX_10864F3161E05C22 ON chill_csconnectes.cs_person (documentAttestationFormation_id)');
$this->addSql('CREATE INDEX IDX_10864F316F744BB0 ON chill_csconnectes.cs_person (documentQuittanceLoyer_id)');
$this->addSql('CREATE INDEX IDX_10864F31AC39B1B ON chill_csconnectes.cs_person (documentFactureElectricite_id)');
$this->addSql('CREATE INDEX IDX_10864F31D486E642 ON chill_csconnectes.cs_person (prescripteur_id)');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F3154866550 FOREIGN KEY (documentCV_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F318825E118 FOREIGN KEY (documentAgrementIAE_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31A396AFAC FOREIGN KEY (documentRQTH_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F3187541764 FOREIGN KEY (documentAttestationNEET_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F315CFC2299 FOREIGN KEY (documentCI_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F3134FDF11D FOREIGN KEY (documentTitreSejour_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F315742C99D FOREIGN KEY (documentAttestationFiscale_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31166494D4 FOREIGN KEY (documentPermis_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F3172820D66 FOREIGN KEY (documentAttestationCAAF_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31AFA5E636 FOREIGN KEY (documentContraTravail_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F3161E05C22 FOREIGN KEY (documentAttestationFormation_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F316F744BB0 FOREIGN KEY (documentQuittanceLoyer_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31AC39B1B FOREIGN KEY (documentFactureElectricite_id) REFERENCES chill_doc.stored_object (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD CONSTRAINT FK_10864F31D486E642 FOREIGN KEY (prescripteur_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.niveauMaitriseLangue IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.permisConduire IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.typeContrat IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.ressources IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS NULL');
}
public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('DROP TABLE chill_csconnectes.cs_person');
$this->addSql('DROP SCHEMA chill_csconnectes CASCADE');
}
}

View File

@ -0,0 +1,50 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Fix missing fields in previous migration
*/
final class Version20191129112321 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD PPAESignataire TEXT DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.niveauMaitriseLangue IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.permisConduire IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.typeContrat IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.ressources IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS NULL');
$this->addSql('CREATE UNIQUE INDEX UNIQ_10864F31217BBB47 ON chill_csconnectes.cs_person (person_id)');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP CONSTRAINT cs_person_pkey');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ALTER person_id DROP NOT NULL');
}
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->addSql('DROP INDEX UNIQ_10864F31217BBB47');
$this->addSql('DROP INDEX cs_person_pkey');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP CERSignataire');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP PPAESignataire');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ALTER person_id SET NOT NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.niveaumaitriselangue IS \'(DC2Type:json_array)\'');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.permisconduire IS \'(DC2Type:json_array)\'');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.typecontrat IS \'(DC2Type:json_array)\'');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.ressources IS \'(DC2Type:json_array)\'');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS \'(DC2Type:json_array)\'');
$this->addSql('CREATE INDEX idx_10864f31217bbb47 ON chill_csconnectes.cs_person (person_id)');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD PRIMARY KEY (id, person_id)');
}
}

View File

@ -0,0 +1,35 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout Immersion
*/
final class Version20200113104411 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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))');
$this->addSql('CREATE INDEX IDX_FBB3CBB4217BBB47 ON chill_csconnectes.immersion (person_id)');
$this->addSql('CREATE INDEX IDX_FBB3CBB4A4AEAFEA ON chill_csconnectes.immersion (entreprise_id)');
$this->addSql('CREATE INDEX IDX_FBB3CBB435E47E35 ON chill_csconnectes.immersion (referent_id)');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.duration IS \'(DC2Type:dateinterval)\'');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4A4AEAFEA FOREIGN KEY (entreprise_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB435E47E35 FOREIGN KEY (referent_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
}
}

View File

@ -0,0 +1,33 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout:
* - structure addresse
* - structure email
*
* à l'entité Immersion
*/
final class Version20200113142525 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
}
}

View File

@ -0,0 +1,34 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout colonnes manquantes à Immersion:
*
* - is bilan fullfilled ;
* - savoir être notes
*/
final class Version20200114081435 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.savoirEtre IS NULL');
$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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP savoirEtreNote');
}
}

View File

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add "datecontratIEJ" on dispositif
*/
final class Version20200124130244 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP datecontratIEJ');
}
}

View File

@ -0,0 +1,26 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout type de contrat aidé
*/
final class Version20200124132321 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP typeContratAide');
}
}

View File

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout colonne "objectifsAutre"
*/
final class Version20200127132932 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP objectifsAutre');
}
}

View File

@ -0,0 +1,76 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200205132532 extends AbstractMigration
{
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->addSql('DROP SEQUENCE report_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_appellation_id_seq '
. 'INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE chill_csconnectes.rome_metier_id_seq '
. 'INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE chill_csconnectes.projet_professionnel_id_seq '
. '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))');
$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))');
$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))');
$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)');
$this->addSql('CREATE INDEX IDX_3280B96D7CDE30DD ON chill_csconnectes.projetprofessionnel_souhait (appellation_id)');
$this->addSql('CREATE TABLE chill_csconnectes.projetprofessionnel_valide (projetprofessionnel_id INT NOT NULL, appellation_id INT NOT NULL, PRIMARY KEY(projetprofessionnel_id, appellation_id))');
$this->addSql('CREATE INDEX IDX_E0501BE0B87BF7B5 ON chill_csconnectes.projetprofessionnel_valide (projetprofessionnel_id)');
$this->addSql('CREATE INDEX IDX_E0501BE07CDE30DD ON chill_csconnectes.projetprofessionnel_valide (appellation_id)');
$this->addSql('ALTER TABLE chill_csconnectes.rome_appellation ADD CONSTRAINT FK_D9E9CABCED16FA20 FOREIGN KEY (metier_id) REFERENCES chill_csconnectes.rome_metier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD CONSTRAINT FK_12E4FFBF217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait ADD CONSTRAINT FK_3280B96DB87BF7B5 FOREIGN KEY (projetprofessionnel_id) REFERENCES chill_csconnectes.projet_professionnel (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait ADD CONSTRAINT FK_3280B96D7CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE0B87BF7B5 FOREIGN KEY (projetprofessionnel_id) REFERENCES chill_csconnectes.projet_professionnel (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE07CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('ALTER TABLE chill_csconnectes.rome_appellation DROP CONSTRAINT FK_D9E9CABCED16FA20');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_souhait DROP CONSTRAINT FK_3280B96DB87BF7B5');
$this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide DROP CONSTRAINT FK_E0501BE0B87BF7B5');
$this->addSql('DROP SEQUENCE chill_csconnectes.rome_appellation_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_csconnectes.rome_metier_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_csconnectes.projet_professionnel_id_seq CASCADE');
$this->addSql('DROP TABLE chill_csconnectes.rome_appellation');
$this->addSql('DROP TABLE chill_csconnectes.rome_metier');
$this->addSql('DROP TABLE chill_csconnectes.projet_professionnel');
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_souhait');
$this->addSql('DROP TABLE chill_csconnectes.projetprofessionnel_valide');
}
}

View File

@ -0,0 +1,28 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add index for rome code appellation / metier
*/
final class Version20200207224152 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
}
}

View File

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200210105342 extends AbstractMigration
{
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 ");
}
public function down(Schema $schema) : void
{
$this->addSql("DROP INDEX chill_csconnectes.UNIQ_D9E9CABC77153098");
$this->addSql("DROP INDEX chill_csconnectes.UNIQ_3274952577153098");
}
}

View File

@ -0,0 +1,78 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200313124323 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD ponctualite_salarie_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD assiduite TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD assiduite_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD interet_activite TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD interet_activite_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD integre_regle TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD integre_regle_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD esprit_initiative TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD esprit_initiative_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD organisation TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD organisation_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD capacite_travail_equipe TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD capacite_travail_equipe_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD style_vestimentaire TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD style_vestimentaire_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD langage_prof TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD langage_prof_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD applique_consigne TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD applique_consigne_note TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD respect_hierarchie TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_csconnectes.immersion ADD respect_hierarchie_note TEXT DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.objectifs IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.savoirEtre IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.frein.freinsPerso IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.frein.freinsEmploi IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.projet_professionnel.typeContrat IS NULL');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.projet_professionnel.volumeHoraire IS NULL');
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.types IS NULL');
}
public function down(Schema $schema) : void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', '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');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP assiduite');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP assiduite_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP interet_activite');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP interet_activite_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP integre_regle');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP integre_regle_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP esprit_initiative');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP esprit_initiative_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP organisation');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP organisation_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP capacite_travail_equipe');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP capacite_travail_equipe_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP style_vestimentaire');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP style_vestimentaire_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP langage_prof');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP langage_prof_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP applique_consigne');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP applique_consigne_note');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP respect_hierarchie');
$this->addSql('ALTER TABLE chill_csconnectes.immersion DROP respect_hierarchie_note');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.objectifs IS \'(DC2Type:json_array)\'');
$this->addSql('COMMENT ON COLUMN chill_csconnectes.immersion.savoiretre IS \'(DC2Type:json_array)\'');
}
}

View File

@ -0,0 +1,25 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajoute colonnes "domaineActiviteSouhait" et "DomaineAciviteValide" au projet
* professionnel.
*/
final class Version20200403114520 extends AbstractMigration
{
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;");
}
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");
}
}

View File

@ -0,0 +1,22 @@
<?php declare(strict_types=1);
namespace Application\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Ajout champ date avenant ieJ sur csperson
*/
final class Version20200403123148 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->addSql("ALTER TABLE chill_csconnectes.cs_person ADD dateavenantIEJ DATE DEFAULT NULL;");
}
public function down(Schema $schema) : void
{
$this->addSql("ALTER TABLE chill_csconnectes.cs_person DROP dateavenantIEJ");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1 @@
require('./footer_bandeau.jpg');

View File

@ -0,0 +1,43 @@
import { ShowHide } from 'ShowHide/show_hide.js';
// listen to adding of formation and register a show hide
var make_show_hide = function(entry) {
let
obtained = entry.querySelector('[data-diploma-obtained]'),
reconnue = entry.querySelector('[data-diploma-reconnue]')
;
var a = new ShowHide({
load_event: null,
froms: [ obtained ],
container: [ reconnue ],
test: function(froms, event) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input').values()) {
if (input.value === 'non-fr') {
return input.checked;
}
}
}
return false;
}
});
};
window.addEventListener('collection-add-entry', function(e) {
if (e.detail.collection.dataset.collectionName === 'formations') {
make_show_hide(e.detail.entry);
}
});
// starting the formation on load
window.addEventListener('load', function(_e) {
let
formations = document.querySelectorAll('[data-formation-entry]')
;
for (let f of formations.values()) {
make_show_hide(f);
}
});

View File

@ -0,0 +1,72 @@
import { ShowHide } from 'ShowHide/show_hide.js';
var
div_accompagnement = document.getElementById("form_accompagnement"),
div_accompagnement_rqth = document.getElementById("form_accompagnement_rqth"),
div_accompagnement_comment = document.getElementById("form_accompagnement_comment"),
div_caf_id = document.getElementById("cafId"),
div_caf_inscription_date = document.getElementById("cafInscriptionDate"),
div_neet_eligibilite = document.getElementById("neetEligibilite"),
div_neet_commission_date = document.getElementById("neetCommissionDate")
;
// faire apparaitre / disparaitre RQTH si RQTH coché
new ShowHide({
"froms": [div_accompagnement],
"test": function(froms, event) {
for (let el of froms.values()) {
for (let input of el.querySelectorAll('input').values()) {
if (input.value === 'rqth') {
return input.checked;
}
}
}
},
"container": [div_accompagnement_rqth]
});
// faire apparaitre / disparaitre commetnaire si coché
new ShowHide({
"froms": [div_accompagnement],
"test": function(froms, event) {
for (let el of froms.values()) {
for (let input of el.querySelectorAll('input').values()) {
if (input.value === 'autre') {
return input.checked;
}
}
}
return false;
},
"container": [div_accompagnement_comment]
});
// faire apparaitre cafInscriptionDate seulement si cafID est rempli
new ShowHide({
froms: [ div_caf_id ],
test: function(froms, event) {
for (let el of froms.values()) {
return el.querySelector("input").value !== "";
}
},
container: [ div_caf_inscription_date ],
event_name: 'input'
});
// faire apparaitre date de commission neet seulement si eligible
new ShowHide({
froms: [ div_neet_eligibilite ],
test: function(froms, event) {
for (let el of froms.values()) {
for (let input of el.querySelectorAll('input').values()) {
if (input.value === "oui") {
return input.checked;
}
}
}
return false;
},
container: [ div_neet_commission_date ]
});

View File

@ -0,0 +1,20 @@
import { ShowHide } from 'ShowHide/show_hide.js';
var
div_objectifs = document.getElementById("objectifs"),
div_objectifs_autre = document.getElementById("objectifsAutre")
;
new ShowHide({
froms: [div_objectifs],
container: [div_objectifs_autre],
test: function(froms, event) {
for (let el of froms.values()) {
for (let input of el.querySelectorAll('input').values()) {
if (input.value === 'autre') {
return input.checked;
}
}
}
}
});

View File

@ -0,0 +1,103 @@
import { ShowHide } from 'ShowHide/show_hide.js';
var
ressources = document.getElementById("ressources"),
ressources_comment = document.getElementById("ressourcesComment"),
handicap_is = document.getElementById('handicap_is'),
handicap_if = document.getElementById('handicap_if'),
situation_prof = document.getElementById('situation_prof'),
type_contrat = document.getElementById('type_contrat'),
type_contrat_aide = document.getElementById('type_contrat_aide'),
situation_logement = document.getElementById('situation_logement'),
situation_logement_precision = document.getElementById('situation_logement_precision')
;
new ShowHide({
froms: [ressources],
container: [ressources_comment],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input').values()) {
if (input.value === 'autre') {
return input.checked;
}
}
}
}
});
new ShowHide({
froms: [handicap_is],
container: [handicap_if],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input').values()) {
if (input.value === '1') {
return input.checked;
}
}
}
return false;
}
});
var show_hide_contrat_aide = new ShowHide({
froms: [type_contrat],
container: [type_contrat_aide],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input').values()) {
if (input.value === 'contrat_aide') {
return input.checked;
}
}
}
return false;
}
});
new ShowHide({
id: 'situation_prof_type_contrat',
froms: [situation_prof],
container: [type_contrat],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input').values()) {
if (input.value === 'en_activite') {
return input.checked;
}
}
}
return false;
}
});
window.addEventListener('show-hide-hide', function (e) {
if (e.detail.id = 'situation_prof_type_contrat') {
show_hide_contrat_aide.forceHide();
}
});
window.addEventListener('show-hide-show', function (e) {
if (e.detail.id = 'situation_prof_type_contrat') {
show_hide_contrat_aide.forceCompute();
}
});
new ShowHide({
froms: [situation_logement],
container: [situation_logement_precision],
test: function(froms) {
for (let f of froms.values()) {
for (let input of f.querySelectorAll('input')) {
if (input.value === 'heberge_chez_tiers') {
return input.checked;
}
}
}
return false;
}
});

View File

@ -0,0 +1,19 @@
footer.footer {
padding: 0;
background-color: white;
border-top: 1px solid grey;
div.sponsors {
p {
padding-bottom: 10px;
color: #000;
font-size: 16px;
}
background-color: white;
padding: 2em 0;
img {
display: block;
margin: auto;
}
}
}

View File

@ -0,0 +1 @@
require('./csconnectes.scss');

View File

@ -0,0 +1,250 @@
situation_logement:
proprietaire: Propriétaire
locataire: Locataire
heberge_chez_tiers: Hébergé chez un tiers
heberge_chez_parents: Hébergé chez un parent
hebergement_en_foyer: Hébergé en foyer
sans_domicile: Sans domicile
niveau_maitrise_langue:
lu: Lu
ecrit: Écrit
parle: Parlé
aucun: Aucun
permis_conduire:
a: Permis A
b: Permis B
c: Permis C
d: Permis D
e: Permis E
en_cours: En cours
pas_de_permis: Pas de permis
caces: CACES
label: "Permis de conduire"
situation_professionnelle:
sans_emploi: Sans emploi
en_activite: En activité
etudiant: Étudiant
etudiant_descolarise: Étudiant déscolarisé
label: "Situation professionnelle"
type_contrat:
cdd: CDD
cdi: CDI
contrat_interim: Contrat intérim
contrat_aide: Contrat aidé
cdd_insertion: CDD insertion
contrat_extra: Contrat extra
service_civique: Service civique
label: "Type de contrat"
ressource:
salaires: Salaire(s)
ARE: ARE
are: ARE
ASS: ASS
ass: ASS
RSA: RSA
rsa: RSA
AAH: AAH
aah: AAH
autre: Autre
label: "Ressource"
accompagnement:
plie: PLIE
pole_emploi: Pôle emploi
referent_RSA: Référent RSA
mission_locale: Mission locale
rqth: RQTH
autre: Autre
label: "Accompagnement"
freins_perso:
situation_administrative: Situation administrative
situation_personnelle_et_familiale: Situation personnelle et familiale
comportement: Comportement
etat_de_sante: État de santé
precarite_situation_materielle: Précarité de la situation matérielle
condition_ou_absence_logement: Condition ou absence de logement
autres: Autres
freins_emploi:
garde_d_enfants: Garde d'enfants
sante: Santé
famille: Famille
finances: Finances
maitrise_de_la_langue: Maitrise de la langue
autres: Autres
neet_eligibility:
oui: Oui
non: Non
en_attente: En attente
label: "Éligibilité NEET"
handicap_recommandation:
travail_esat: Travail en ESAT
milieu_ordinaire: Milieu ordinaire
entreprise_adaptee: Entreprise adaptée
moyen_transport:
transport_commun: Transport en commun
scooter: Scooter
velo: Vélo
voiture: Voiture
autre: Autre
label: "Moyen de transport"
formation_level:
sans_diplome: Sans diplôme
BEP_CAP: BEP CAP
BAC: BAC
BAC+2: BAC +2
BAC+3: BAC +3
BAC+4: BAC +4
BAC+5: BAC +5
BAC+8: BAC +8
formation_type:
formation_initiale: Formation initiale
formation_continue: Formation continue
diploma_obtained:
fr: En France
non-fr: À l'étranger
aucun: Aucun
diploma_reconnu:
oui: Oui
non: Non
nsp: Ne sait pas
xp_contrat_type:
cddi: CDDI
cdd-6mois: CDD -6mois
cdd+6mois: CDD +6mois
interim: Intérim
apprentissage: Apprentissage
contrat_prof: Contrat professionnel
cui: CUI
cae: CAE
cdi: CDI
stage: Stage
volontariat: Volontariat
benevolat: Bénévolat
autres: Autres
immersion_objectif:
'decouvrir_metier': "Découvrir un métier ou un secteur d'activité"
'confirmer_projet_prof': "Confirmer un projet professionnel"
'acquerir_experience': "Acquérir une expérience professionnelle"
'acquerir_competences': "Acquérir de nouvelles compétences"
'initier_demarche_recrutement': "Initier une démarche de recrutement"
'autre': "Autre"
immersion_savoir_etre:
'assiduite': "Assiduité"
'ponctualite': "Ponctualité"
'respect_consigne_securite': "Respect des consignes de sécurité"
'relation_hierarchie': "Relation avec la hiérarchie"
'capacite_adaptation': "Capacité d'adaptation"
'motivation_travail': "Motivation au travail"
immersion_ponctualiteSalarie:
un: Un retard
aucun: Aucun retard
plusieurs: Plusieurs retards
immersion_assiduite:
aucun: Aucune absence
un: Une absence
plusieurs: Plusieurs absences
immersion_integreRegle:
1_temps: Au bout d'un certain temps
rapidement: Rapidement
pas_encore: Ne les a pas encore intégrées
immersion_nsp:
oui: Oui
non: Non
nsp: Ne sait pas
projet_prof:
type_contrat:
cdd: "CDD"
cdi: "CDI"
contrat_insertion: "Contrat d'insertion"
interim: "Intérim"
indifferent: "Indifférent"
label: "Type de contrat recherché"
apprentissage: Contrat d'apprentissage
personnalisation: Personnalisation
creation_entreprise: Création d'entreprise
note: "Notes contrat recherché"
volume_horaire:
temps_plein: "Temps plein"
temps_partiel: "Temps partiel"
label: "Volume horaire"
note: "Notes volume horaire"
idee: "Idées"
encoursdeconstruction: "En cours de construction"
valide:
note: "Notes validés"
code: "Codes validés"
note: "Notes"
souhait:
code: "Codes souhaits"
chill_3party:
key_label:
prescripteur: Prescripteur
entreprise: Entreprise
crud:
csfrein:
title_new: Nouveau rapport "frein" pour %person%
title_view: Rapport 'Frein' pour %person%
title_edit: Modifier un rapport "frein"
title_delete: Supprimer un Frein
button_delete: Supprimer
confirm_message_delete: Supprimer le %as_string% ?
cscv:
title_new: Nouveau CV pour %person%
title_view: CV pour %person%
title_edit: Modifier un CV
title_delete: Supprimer un CV
button_delete: Supprimer
confirm_message_delete: Supprimer le %as_string% ?
immersion:
title_new: Nouvelle immersion pour %person%
title_view: Immersion pour %person%
title_edit: Modifier immersion
title_delete: Supprimer immersion
button_delete: Supprimer
confirm_message_delete: Supprimer le %as_string% ?
projet_prof:
title_new: Nouveau projet professionnel pour %person%
title_view: Projet professionnel pour %person%
title_edit: Modifier un projet professionnel
title_delete: Supprimer le projet professionnel
button_delete: Supprimer
confirm_message_delete: Supprimer le %as_string% ?
#
# Exports
#
placeofbirth: 'Lieu de naissance'
countryofbirth: 'Pays de naissance'
formationlevel: 'Niveau de formation'
reportdate: 'Date du rapport'
notesperso: 'Notes situation personnelle'
notesemploi: "Notes accès à lemploi"
prescripteur:
name: "Prescripteur"
email: "Email prescripteur"
phone: "Téléphone prescripteur"
recentopeningdate: "Date récente douverture du dossier"
recentclosingdate: "Date récente de fermeture du dossier"
closingmotive: "Motif de fermeture"
situation_familiale: "Situation familiale"
enfantacharge: "Enfants à charge"
poleemploiid: "Identifiant pôle emploi"
cafid: "Numéro allocataire CAF"
cafinscriptiondate: "Date de linscription CAF"
cerinscriptiondate: "Date de linscription CER"
contratiejdate: "Date de lavenant du contrat"
ppaeinscriptiondate: "Date de linscription PPAE"
ppaesignataire: "Signataire PPAE"
cersignataire: "Signataire CER"
neetcommissiondate: "Date de commission NEET"
fsemademarchecode: "Code démarche FSE"
findernieremploidate: "Date de fin dernier emploi"
CHILL_CSCONNECTES_REPORT_NEW: Création et modification des rapports CSConnectes
CHILL_CSCONNECTES_REPORT_DELETE: Suppression des rapports CSConnectes
CHILL_CSCONNECTES_REPORT_CV: Création et modification des rapports CSConnectes (CV uniquement)
CHILL_CSCONNECTES_EXPORTS: Exports CSConnectes

View File

@ -0,0 +1,91 @@
{% extends '@ChillPerson/CRUD/edit.html.twig' %}
{% block title 'Dispositifs de ' ~ entity.person.firstName ~ ' ' ~ entity.person.lastName %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block crud_content_header %}
<h1>Dispositifs</h1>
{% endblock %}
{# surcharge le block "retour" par un lien vers la page vue #}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_crud_csperson_dispositifs_view', { 'id': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block content_form_actions_view %}
{# no view acceptable #}
{% endblock %}
{% block content_form_actions_save_and_close %}
{# save and close does not makes sens #}
{% endblock %}
{% block crud_content_form_rows %}
<h2>Accompagnement</h2>
<div id="form_accompagnement">
{{ form_row(form.accompagnement) }}
</div>
<div id="form_accompagnement_rqth">
{{ form_row(form.accompagnementRQTHDate) }}
</div>
<div id="form_accompagnement_comment">
{{ form_row(form.accompagnementComment) }}
</div>
{{ form_row(form.prescripteur) }}
{{ form_row(form.dispositifsNotes) }}
<h2>Pôle emploi</h2>
{{ form_row(form.poleEmploiId) }}
{{ form_row(form.poleEmploiInscriptionDate) }}
<h2>CAF</h2>
<div id="cafId">
{{ form_row(form.cafId) }}
</div>
<div id="cafInscriptionDate">
{{ form_row(form.cafInscriptionDate) }}
</div>
<h2>Autres informations</h2>
{{ form_row(form.cERInscriptionDate) }}
{{ form_row(form.cERSignataire) }}
{{ form_row(form.pPAEInscriptionDate) }}
{{ form_row(form.pPAESignataire) }}
<div id="neetEligibilite">
{{ form_row(form.nEETEligibilite) }}
</div>
<div id="neetCommissionDate">
{{ form_row(form.nEETCommissionDate) }}
</div>
{{ form_row(form.fSEMaDemarcheCode) }}
{{ form_row(form.dateContratIEJ) }}
{{ form_row(form.dateAvenantIEJ) }}
{% endblock %}
{% endembed %}
{% endblock %}
{% block js %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('build/dispositifs_edit.js') }}"></script>
<script type="text/javascript">
</script>
{% endblock js %}

View File

@ -0,0 +1,126 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set person = entity.getPerson() %}
{% set activeRouteKey = '' %}
{% set accompagnements = constant('CSConnectes\\SPBundle\\Entity\\CSPerson::ACCOMPAGNEMENTS') %}
{% import '@ChillDocStore/Macro/macro.html.twig' as doc %}
{% block title 'Dispositifs d\'accompagnement de %name%'|trans( { '%name%': person.firstName ~ ' ' ~ person.lastName } ) %}
{% block personcontent %}
<h1>{{ 'Dispositifs d\'accompagnement de %name%'|trans( { '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}</h1>
<h2>Accompagnement</h2>
<dl class="chill_view_data">
<dt>Accompagnements</dt>
{% if entity.accompagnement is null or entity.accompagnement|length == 0 %}
<dd>{{ null|chill_print_or_message }}</dd>
{% else %}
<dd>
<ul>
{% for e in accompagnements %}
{% if e in entity.accompagnement %}
{% if e == 'autre' %}
<li>Autre: <br/>{{ entity.accompagnementComment|chill_print_or_message(null, 'blockquote') }}</li>
{% elseif e == 'rqth' %}
<li>{{ ('accompagnement.' ~ e)|trans }} - <strong>Date de l'accompagnement:</strong> {{ entity.accompagnementRQTHDate|chill_print_or_message }}</li>
{% else %}
<li>{{ ('accompagnement.' ~ e)|trans }}</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</dd>
{% endif %}
<dt>Prescripteur</dt>
{% if entity.prescripteur is not null %}
<dd>{{ entity.prescripteur|chill_entity_render_box({'with_valid_from': false}) }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
<dt>Notes</dt>
<dd>{{ entity.dispositifsNotes|chill_print_or_message("Aucune note", 'blockquote') }}</dd>
</dl>
<h2>Pôle emploi</h2>
<dl class="chill_view_data">
<dt>Identifiant pôle emploi</dt>
<dd>{{ entity.poleEmploiId|chill_print_or_message }}</dd>
<dt>Date d'inscription pôle emploi</dt>
<dd>{{ entity.poleEmploiInscriptionDate|chill_print_or_message }}</dd>
</dl>
<h2>CAF</h2>
<dl class="chill_view_data">
<dt>Identifiant CAF</dt>
<dd>{{ entity.cafId|chill_print_or_message }}</dd>
<dt>Date d'inscription CAF</dt>
<dd>{{ entity.cafInscriptionDate|chill_print_or_message }}</dd>
</dl>
<h2>Autres informations</h2>
<dl class="chill_view_data">
{% for item in [
['cERInscriptionDate', 'Date CER'],
['cERSignataire', 'Signataire CER'],
['pPAEInscriptionDate', 'Date PPAE'],
['pPAESignataire', 'Signataire PPAE'],
] %}
<dt>{{ item[1] }}</dt>
<dd>{{ attribute(entity, item[0])|chill_print_or_message }}</dd>
{% endfor %}
<dt>Éligibilite NEET</dt>
<dd>
{% if entity.nEETEligibilite is null %}
{{ null|chill_print_or_message }}
{% elseif entity.nEETEligibilite == 'oui' %}
Oui <strong>Date de commission :</strong> {{ entity.nEETCommissionDate|chill_print_or_message }}
{% elseif entity.nEETEligibilite == 'non' %}
Non
{% else %}
{{ ('neet_eligibility.' ~ entity.nEETEligibilite)|trans }}
{% endif %}
</dd>
<dt>Code "Ma démarche FSE"</dt>
<dd>{{ entity.fSEMaDemarcheCode|chill_print_or_message }}</dd>
{% if entity.dateContratIEJ != null or entity.dateAvenantIEJ != null %}
<dt>IEJ</dt>
<dd>
{% if entity.dateContratIEJ != null %}
<p>Date du contrat IEJ&nbsp;: {{ entity.dateContratIEJ|localizeddate('long', 'none') }}</p>
{% endif %}
{% if entity.dateAvenantIEJ != null %}
<p>Date de l'avenant IEJ&nbsp;: {{ entity.dateAvenantIEJ|localizeddate('long', 'none') }}</p>
{% endif %}
</dd>
{% endif %}
</dl>
<ul class="record_actions sticky-form-buttons">
<li><a class="sc-button bt-update" href="{{ path('chill_crud_csperson_dispositifs_edit', { 'id': entity.person.id }) }}">Modifier</a></li>
</ul>
{% endblock personcontent %}
{% block css %}
<link rel="stylesheet" href="{{ asset('build/thirdparty_styles.css') }}"/>
{% endblock %}

View File

@ -0,0 +1,124 @@
{% extends '@ChillPerson/CRUD/edit.html.twig' %}
{% block title 'Situation personnelle de ' ~ entity.person.firstName ~ ' ' ~ entity.person.lastName %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block crud_content_header %}
<h1>Situation personnelle</h1>
{% endblock %}
{# surcharge le block "retour" par un lien vers la page vue #}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_crud_csperson_personal_situation_view', { 'id': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block content_form_actions_view %}
{# no view acceptable #}
{% endblock %}
{% block content_form_actions_save_and_close %}
{# save and close does not makes sens #}
{% endblock %}
{% block crud_content_form_rows %}
<h2>Logement</h2>
<div id="situation_logement">
{{ form_row(form.situationLogement) }}
</div>
<div id="situation_logement_precision">
{{ form_row(form.situationLogementPrecision) }}
</div>
<h2>Situation familiale</h2>
{{ form_row(form.enfantACharge) }}
{{ form_row(form.personMaritalStatus) }}
<h2>Maitrise de la langue</h2>
{{ form_row(form.niveauMaitriseLangue) }}
<h2>Mobilité</h2>
{{ form_row(form.mobiliteMoyenDeTransport) }}
{{ form_row(form.vehiculePersonnel) }}
{{ form_row(form.permisConduire) }}
{{ form_row(form.mobiliteNotes) }}
<h2>Situation professionnelle et économique</h2>
<div id="situation_prof">
{{ form_row(form.situationProfessionnelle) }}
</div>
{{ form_row(form.dateFinDernierEmploi) }}
<div id="type_contrat">
{{ form_row(form.typeContrat) }}
</div>
<div id="type_contrat_aide">
{{ form_row(form.typeContratAide) }}
</div>
<div id="ressources">
{{ form_row(form.ressources) }}
</div>
<div id="ressourcesComment">
{{ form_row(form.ressourcesComment) }}
</div>
{{ form_row(form.ressourceDate1Versement) }}
{{ form_row(form.cPFMontant) }}
{{ form_row(form.acompteDIF) }}
<h2>Situation de handicap</h2>
<div id="handicap_is">
{{ form_row(form.handicapIs) }}
</div>
<div id="handicap_if">
{{ form_row(form.handicapNotes) }}
{{ form_row(form.handicapRecommandation) }}
{{ form_row(form.handicapAccompagnement) }}
</div>
<h2>Documents</h2>
{{ form_row(form.documentCV) }}
{{ form_row(form.documentAgrementIAE) }}
{{ form_row(form.documentRQTH) }}
{{ form_row(form.documentAttestationNEET) }}
{{ form_row(form.documentCI) }}
{{ form_row(form.documentTitreSejour) }}
{{ form_row(form.documentAttestationFiscale) }}
{{ form_row(form.documentPermis) }}
{{ form_row(form.documentAttestationCAAF) }}
{{ form_row(form.documentContraTravail) }}
{{ form_row(form.documentAttestationFormation) }}
{{ form_row(form.documentQuittanceLoyer) }}
{{ form_row(form.documentFactureElectricite) }}
{{ form_row(form.documentAttestationSecuriteSociale) }}
{% endblock %}
{% endembed %}
{% endblock %}
{% block css %}
{{ parent() }}
<link rel="stylesheet" type="text/css" href="{{ asset('build/async_upload.css') }}" />
{% endblock css %}
{% block js %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('build/async_upload.js') }}"></script>
<script type="text/javascript" src="{{ asset('build/personal_situation_edit.js') }}"></script>
{% endblock js %}

View File

@ -0,0 +1,282 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set person = entity.getPerson() %}
{% set activeRouteKey = '' %}
{% set niveaux_maitrise_langue = constant('CSConnectes\\SPBundle\\Entity\\CSPerson::NIVEAU_MAITRISE_LANGUE') %}
{% set permis_conduire = constant('CSConnectes\\SPBundle\\Entity\\CSPerson::PERMIS_CONDUIRE') %}
{% set types_contrat = constant('CSConnectes\\SPBundle\\Entity\\CSPerson::TYPE_CONTRAT') %}
{% set ressources = constant('CSConnectes\\SPBundle\\Entity\\CSPerson::RESSOURCES') %}
{% import '@ChillDocStore/Macro/macro.html.twig' as doc %}
{% block title 'Situation personnelle de %name%'|trans( { '%name%': person.firstName ~ ' ' ~ person.lastName } ) %}
{% block personcontent %}
<h1>{{ 'Situation personnelle de %name%'|trans( { '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}</h1>
<h2>Logement</h2>
<dl class="chill_view_data">
<dt>Situation de logement</dt>
{% if entity.situationLogement is not null %}
<dd>{{ ('situation_logement.' ~ entity.situationLogement)|trans }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message("Aucune information") }}</dd>
{% endif %}
</dl>
<h2>Situation familiale</h2>
<dl class="chill_view_data">
<dt>Enfants à charge</dt>
{% if entity.enfantACharge is not null %}
<dd>
{% if entity.enfantACharge == 0 %}Aucun enfant{% elseif entity.enfantACharge == 1 %}Un enfant{% else %}{{ entity.enfantACharge }} enfants{% endif %} à charge</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
<dt>{{'Marital status'|trans}}&nbsp;:</dt>
<dd>
{% if entity.person.maritalStatus is not null %}
{{ entity.person.maritalStatus.name|localize_translatable_string }}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</dd>
</dl>
<h2>Maitrise de la langue</h2>
<dl class="chill_view_data">
<dt>Niveau de maitrise de la langue française</dt>
{% if entity.niveauMaitriseLangue is null or entity.niveauMaitriseLangue|length == 0 %}
<dd>{{ null|chill_print_or_message }}</dd>
{% else %}
<dd>
<ul>
{% for niveau in niveaux_maitrise_langue %}
{% if niveau in entity.niveauMaitriseLangue %}
<li>{{ ('niveau_maitrise_langue.' ~ niveau)|trans }}</li>
{% endif %}
{% endfor %}
</ul>
</dd>
{% endif %}
</dl>
<h2>Mobilité</h2>
<dl class="chill_view_data">
<dt>Moyens de transports accessibles</dt>
<dd>
{% if entity.mobiliteMoyenDeTransport is null or entity.mobiliteMoyenDeTransport|length == 0 %}
{{ null|chill_print_or_message("Aucun moyen de transport renseigné") }}
{% else %}
<ul>
{% for e in entity.mobiliteMoyenDeTransport %}
<li>{{ ('moyen_transport.' ~ e)|trans }}</li>
{% endfor %}
</ul>
{% endif %}
</dd>
<dt>Véhicule Personnel</dt>
{% if entity.vehiculePersonnel is null %}
<dd>{{ null|chill_print_or_message }}</dd>
{% elseif entity.vehiculePersonnel == true %}
<dd>A un véhicule personnel</dd>
{% else %}
<dd>N'a pas de véhicule personnel</dd>
{% endif %}
<dt>Permis de conduire</dt>
{% if entity.permisConduire is null or entity.permisConduire|length == 0 %}
<dd>{{ null|chill_print_or_message }}</dd>
{% else %}
<dd>
<ul>
{% for e in permis_conduire %}
{% if e in entity.permisConduire %}
<li>{{ ('permis_conduire.' ~ e)|trans }}</li>
{% endif %}
{% endfor %}
</ul>
</dd>
{% endif %}
<dt>Notes concernant la mobilité</dt>
<dd>
{{ entity.mobiliteNotes|chill_print_or_message("Aucune note", 'blockquote') }}
</dd>
</dl>
<h2>Situation professionnelle et économique</h2>
<dl class="chill_view_data">
<dt>Situation professionnelle</dt>
{% if entity.situationProfessionnelle is not null %}
<dd>{{ ('situation_professionnelle.' ~ entity.situationProfessionnelle)|trans }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
<dt>Date de fin du dernier emploi</dt>
{% if entity.dateFinDernierEmploi is not null %}
<dd>{{ entity.dateFinDernierEmploi|localizeddate('medium', 'none') }}
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
{% if entity.situationProfessionnelle == 'en_activite' %}
<dt>Type de contrat</dt>
{% if entity.typeContrat is null or entity.typeContrat|length == 0 %}
<dd>{{ null|chill_print_or_message }}</dd>
{% else %}
<dd>
<ul>
{% for e in types_contrat %}
{% if e in entity.typeContrat %}
<li>{{ ('type_contrat.' ~ e)|trans }}</li>
{% endif %}
{% endfor %}
</ul>
</dd>
{% endif %}
{% endif %}
<dt>Ressources</dt>
{% if entity.ressources is null or entity.ressources|length == 0 %}
<dd>{{ null|chill_print_or_message }}</dd>
{% else %}
<dd>
<ul>
{% for e in ressources %}
{% if e in entity.ressources %}
{% if e == 'autre' %}
<li>Autre: {{ entity.ressourcesComment|chill_print_or_message }}</li>
{% else %}
<li>{{ ('ressource.' ~ e)|trans }}</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</dd>
{% endif %}
<dt>Date du premier versement</dt>
{% if entity.ressourceDate1Versement is not null %}
<dd>{{ entity.ressourceDate1Versement|localizeddate('medium', 'none') }}
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
<dt>Montant CPF</dt>
{% if entity.cPFMontant is not null %}
<dd>{{ entity.cPFMontant|localizedcurrency('EUR') }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
<dt>Montant acompte DIF</dt>
{% if entity.acompteDIF is not null %}
<dd>{{ entity.acompteDIF|localizedcurrency('EUR') }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
</dl>
<h2>Handicap</h2>
<dl class="chill_view_data">
<dt>Handicap ?</dt>
<dd>
{% if entity.handicapIs is null %}
{{ null|chill_print_or_message }}
{% elseif entity.handicapIs %}
Oui<br/>
<br/>
<strong>Type de handicap</strong>&nbsp;: {{ entity.handicapNotes|chill_print_or_message("Aucune précision", 'blockquote') }}
{% else %}
Non
{% endif %}
</dd>
{% if entity.handicapIs %}
<dt>Recommandation</dt>
<dd>
{% if entity.handicapRecommandation is null %}
{{ null|chill_print_or_message("Aucune recommandation renseignée") }}
{% else %}
{{ ('handicap_recommandation.' ~ entity.handicapRecommandation)|trans }}
{% endif %}
</dd>
<dt>Accompagnement</dt>
{% if entity.handicapAccompagnement is not null %}
<dd>{{ entity.handicapAccompagnement.name }}</dd>
{% else %}
<dd>{{ null|chill_print_or_message }}</dd>
{% endif %}
{% endif %}
</dl>
<h2>Documents</h2>
<dl class="chill_view_data">
{% for r in [
['documentCV', 'CV'],
['documentAgrementIAE', 'Document Agrément AIE'],
['documentRQTH', 'Document RQTH'],
['documentAttestationNEET', 'Attestation NEET'],
['documentCI', "Carte d'identité"],
['documentTitreSejour', 'Titre de séjour'],
['documentAttestationFiscale', 'Attestation fiscale'],
['documentPermis', 'Permis'],
['documentAttestationCAAF', 'Attestation CAAF'],
['documentContraTravail', 'Contrat de travail'],
['documentAttestationFormation', 'Attestation formation'],
['documentQuittanceLoyer', 'Quittance de loyer'],
['documentFactureElectricite', "Facture d'électricité"],
['documentAttestationSecuriteSociale', "Attestation sécurité sociale"],
] %}
<dt>{{ r[1] }}</dt>
{% set document = attribute(entity, r[0]) %}
{% if document is null %}
<dd>{{ null|chill_print_or_message("Aucun document") }}</dd>
{% else %}
<dd>{{ doc.download_button(document, r[1] ~ " de " ~ person.firstName ~ " " ~ person.lastName) }}</dd>
{% endif %}
{% endfor %}
</dl>
<ul class="record_actions sticky-form-buttons">
<li><a class="sc-button bt-update" href="{{ path('chill_crud_csperson_personal_situation_edit', { 'id': entity.person.id }) }}">Modifier</a></li>
</ul>
{% endblock %}
{% block css %}
{{ parent() }}
<link rel="stylesheet" type="text/css" href="{{ asset('build/async_upload.css') }}" />
{% endblock css %}
{% block js %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('build/async_upload.js') }}"></script>
{% endblock js %}

View File

@ -0,0 +1,61 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock title %}
{% form_theme form _self %}
{% block csconnectes_spbundle_cv_formation_widget %}
<div data-formation-entry>
{{ form_row(form.title) }}
{{ form_row(form.organisme) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
<div data-diploma-obtained>
{{ form_row(form.diplomaObtained) }}
</div>
<div data-diploma-reconnue>
{{ form_row(form.diplomaReconnue) }}
</div>
</div>
{% endblock %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block crud_content_form_rows %}
{{ form_row(form.reportDate) }}
{{ form_row(form.formationLevel) }}
{{ form_row(form.formationType) }}
{{ form_row(form.spokenLanguages) }}
<h2>Formations</h2>
{{ form_widget(form.formations) }}
<h2>Expériences</h2>
{{ form_widget(form.experiences) }}
<h2>Notes</h2>
{{ form_widget(form.notes) }}
{% endblock crud_content_form_rows %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}
{% block css %}
<script type="text/javascript" src="{{ asset('build/cs_cv.js') }}"></script>
{% endblock css %}

View File

@ -0,0 +1,61 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% embed('@ChillPerson/CRUD/_new_title.html.twig') %}{% endembed %}
{% endblock %}
{% form_theme form _self %}
{% block csconnectes_spbundle_cv_formation_widget %}
<div data-formation-entry>
{{ form_row(form.title) }}
{{ form_row(form.organisme) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
<div data-diploma-obtained>
{{ form_row(form.diplomaObtained) }}
</div>
<div data-diploma-reconnue>
{{ form_row(form.diplomaReconnue) }}
</div>
</div>
{% endblock %}
{% block personcontent %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_new')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_form_rows %}
{{ form_row(form.reportDate) }}
{{ form_row(form.formationLevel) }}
{{ form_row(form.formationType) }}
{{ form_row(form.spokenLanguages) }}
<h2>Formations</h2>
{{ form_widget(form.formations) }}
<h2>Expériences</h2>
{{ form_widget(form.experiences) }}
<h2>Notes</h2>
{{ form_widget(form.notes) }}
{% endblock crud_content_form_rows %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}
{% block css %}
<script type="text/javascript" src="{{ asset('build/cs_cv.js') }}"></script>
{% endblock css %}

View File

@ -0,0 +1,142 @@
{% extends '@ChillPerson/CRUD/view.html.twig' %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_view_details %}
<dl class="chill_view_data">
<dt>Date du rapport</dt>
<dd>{{ entity.reportDate|localizeddate('long', 'none') }}</dd>
<h2>Compétences</h2>
<dt>Langues parlées</dt>
<dd>
{% if entity.spokenLanguages is null or entity.spokenLanguages|length == 0 %}
{{ null|chill_print_or_message }}
{% else %}
{% for lang in entity.spokenLanguages %}
{{ lang.name|localize_translatable_string }}{% if not loop.last %},{% endif %}
{% endfor %}
{% endif %}
</dd>
<h2>Formation</h2>
<dt>Niveau de formation</dt>
<dd>
{{ (entity.formationLevel is null ? null : ('formation_level.' ~ entity.formationLevel))|chill_print_or_message("Aucune information") }}
</dd>
<dt>Type de formation</dt>
<dd>
{{ (entity.formationType is null ? null : ('formation_type.' ~ entity.formationType))|chill_print_or_message("Aucune information") }}
</dd>
</dl>
<h3>Formations suivies</h3>
<div class="csconnectes__cv-view__formations">
{% for f in entity.formations %}
<div class="csconnectes__cv-view__formations__formation">
<h4>{{ f.title }}{% if f.organisme is not empty %} <span style="font-size: 85%;">auprès de <span style="font-style: italic;">{{ f.organisme }}</span></span>{% endif %}</h4>
<dl class="chill_view_data">
<dt>Dates de formation</dt>
<dd>
{% if f.startDate is null and f.endDate is null %}
{{ null|chill_print_or_message("Aucune date indiquée") }}
{% elseif f.startDate is null %}
Jusqu'au {{ f.endDate|localizeddate('long', 'none') }} <span class="chill-no-data-statement">(date de début inconnue)</span>
{% elseif f.endDate is null %}
Depuis le {{ f.startDate|localizeddate('long', 'none') }} <span class="chill-no-data-statement">(date de fin inconnue)</span>
{% else %}
Du {{ f.startDate|localizeddate('long', 'none') }} au {{ f.endDate|localizeddate('long', 'none') }}
{% endif %}
</dd>
<dt>Diplôme</dt>
<dd>
<p>Diplôme obtenu: {{ (f.diplomaObtained is null ? null : ('diploma_obtained.' ~ f.diplomaObtained))|chill_print_or_message("Aucune information") }}</p>
<p>Diplôme reconnu en France: {{ (f.diplomaReconnue is null ? null : ('diploma_reconnu.' ~ f.diplomaReconnue))|chill_print_or_message("Aucune information") }}</p>
</dd>
</dl>
</div>
{% else %}
<p class="chill-no-data-statement">Aucune formation renseignée</p>
{% endfor %}
</div>
<h3>Expériences</h3>
<div class="csconnectes__cv-view__experiences">
{% for f in entity.experiences %}
<div class="">
<h4>{{ f.poste }} {% if f.structure is not empty %}<span style="font-size: 85%;">auprès de <span style=" font-style: italic;">{{ f.structure }}</span></span>{% endif %}</h4>
<dl class="chill_view_data">
<dt>Dates de l'expérience</dt>
<dd>
{% if f.startDate is null and f.endDate is null %}
{{ null|chill_print_or_message("Aucune date indiquée") }}
{% elseif f.startDate is null %}
Jusqu'au {{ f.endDate|localizeddate('long', 'none') }} <span class="chill-no-data-statement">(date de début inconnue)</span>
{% elseif f.endDate is null %}
Depuis le {{ f.startDate|localizeddate('long', 'none') }} <span class="chill-no-data-statement">(date de fin inconnue)</span>
{% else %}
Du {{ f.startDate|localizeddate('long', 'none') }} au {{ f.endDate|localizeddate('long', 'none') }}
{% endif %}
</dd>
<dt>Type de contrat</dt>
<dd>
{{ (f.contratType is null ? null : ('xp_contrat_type.'~f.contratType))|chill_print_or_message }}
</dd>
{% if f.notes is not empty %}
<dt>Notes</dt>
<dd>
{{ f.notes|chill_print_or_message(null, 'blockquote') }}
</dd>
{% endif %}
</dl>
</div>
{% else %}
<p class="chill-no-data-statement">Aucune formation renseignée</p>
{% endfor %}
</div>
<h3>Note</h3>
{{ entity.notes|chill_print_or_message("Aucune note", 'blockquote') }}
{% endblock crud_content_view_details %}
{% block content_view_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', { 'person': entity.person.id }) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}
{% block css %}
<style>
div.csconnectes__cv-view__experiences > div {
padding: 0 0.5em 0.5em 0.5em;
}
div.csconnectes__cv-view__experiences > div:nth-child(2n+1) {
background-color: var(--chill-llight-gray);
}
div.csconnectes__cv-view__experiences > div:nth-child(2n) {
background-color: var(--chill-beige);
}
</style>
{% endblock %}

View File

@ -0,0 +1,20 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock title %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,23 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% embed('@ChillPerson/CRUD/_new_title.html.twig') %}{% endembed %}
{% endblock %}
{% block personcontent %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_new')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,58 @@
{% extends '@ChillPerson/CRUD/view.html.twig' %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_view_details %}
<dl class="chill_view_data">
<dt>Date du rapport</dt>
<dd>{{ entity.reportDate|localizeddate('long', 'none') }}</dd>
<dt>Freins identifiés</dt>
<dd>
{% if entity.freinsPerso|length > 0 %}
<ul>
{% for e in entity.freinsPerso %}
<li>{{ ('freins_perso.' ~ e)|trans }}</li>
{% endfor %}
</ul>
{% else %}
<p>{{ null|chill_print_or_message("Aucun frein personnel renseigné") }}
{% endif %}
{% if entity.notesPerso is not empty %}
{{ entity.notesPerso|chill_print_or_message(null, 'blockquote') }}
{% endif %}
</dd>
<dt>Freins d'accès à l'emploi</dt>
<dd>
{% if entity.freinsEmploi|length > 0 %}
<ul>
{% for e in entity.freinsEmploi %}
<li>{{ ('freins_emploi.' ~ e)|trans }}</li>
{% endfor %}
</ul>
{% else %}
<p>{{ null|chill_print_or_message("Aucun frein à l'emploi renseigné") }}
{% endif %}
{% if entity.notesEmploi is not empty %}
{{ entity.notesEmploi|chill_print_or_message(null, 'blockquote') }}
{% endif %}
</dd>
</dl>
{% endblock crud_content_view_details %}
{% block content_view_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', { 'person': entity.person.id }) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,92 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
Bilan d'immersion
{% endblock title %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block crud_content_header %}
<h1>Bilan d'immersion</h1>
{% endblock crud_content_header %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block crud_content_form_rows %}
<p>
Immersion du {{ entity.debutDate|localizeddate('long', 'none') }} au {{ entity.getDateEndComputed|localizeddate('long', 'none') }},
auprès de <pre>{{ entity.entreprise.name }}</pre>
Domaine d'activité: {{ entity.domaineActivite }}
<br/><br/>
<a class="sc-button bt-edit" href={{ path('chill_crud_immersion_edit', {'id': entity.id}) }}>Modifier</a>
</p>
<h2>Savoir-être du jeune</h2>
{{ form_widget(form.savoirEtre) }}
{{ form_row(form.savoirEtreNote) }}
<h3>Ponctualité</h3>
{{ form_row(form.ponctualiteSalarie) }}
{{ form_row(form.ponctualiteSalarieNote) }}
<h3>Assiduité</h3>
{{ form_row(form.assiduite) }}
{{ form_row(form.assiduiteNote) }}
<h3>Intégration</h3>
{{ form_row(form.interetActivite) }}
{{ form_row(form.interetActiviteNote) }}
{{ form_row(form.integreRegle) }}
{{ form_row(form.integreRegleNote) }}
<h3>Autonomie</h3>
{{ form_row(form.espritInitiative) }}
{{ form_row(form.espritInitiativeNote) }}
{{ form_row(form.organisation) }}
{{ form_row(form.organisationNote) }}
<h3>Attitude</h3>
{{ form_row(form.capaciteTravailEquipe) }}
{{ form_row(form.capaciteTravailEquipeNote) }}
<h3>Posture professionnelle</h3>
{{ form_row(form.styleVestimentaire) }}
{{ form_row(form.styleVestimentaireNote) }}
{{ form_row(form.langageProf) }}
{{ form_row(form.langageProfNote) }}
<h3>Relation avec la hiérarchie</h3>
{{ form_row(form.appliqueConsigne) }}
{{ form_row(form.appliqueConsigneNote) }}
{{ form_row(form.respectHierarchie) }}
{{ form_row(form.respectHierarchieNote) }}
<h2>Savoir-faire développés</h2>
{{ form_row(form.principalesActivites) }}
{{ form_row(form.competencesAcquises) }}
{{ form_row(form.competencesADevelopper) }}
<h2>Notes</h2>
{{ form_widget(form.noteBilan) }}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,65 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock title %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block crud_content_form_rows %}
{{ form_row(form.entreprise) }}
{{ form_row(form.domaineActivite) }}
<h2>Tuteur</h2>
{{ form_row(form.tuteurName) }}
{{ form_row(form.tuteurFonction) }}
{{ form_row(form.tuteurPhoneNumber) }}
<h2>Structure d'accompagnement</h2>
{{ form_row(form.structureAccName) }}
{{ form_row(form.structureAccPhonenumber) }}
{{ form_row(form.structureAccEmail) }}
{{ form_widget(form.structureAccAddress) }}
<h2>Descriptif du poste occupé</h2>
{{ form_row(form.posteTitle) }}
{{ form_row(form.posteLieu) }}
{{ form_row(form.debutDate) }}
{{ form_row(form.duration) }}
{{ form_row(form.horaire) }}
<h2>Objectifs</h2>
<div id="objectifs">
{{ form_widget(form.objectifs) }}
</div>
<div id="objectifsAutre">
{{ form_row(form.objectifsAutre) }}
</div>
<h2>Notes</h2>
{{ form_widget(form.noteImmersion) }}
{% endblock %}
{% endembed %}
{% endblock %}
{% block js %}
<script type="text/javascript" src="{{ asset('build/immersion_edit.js') }}"></script>
{% endblock %}

View File

@ -0,0 +1,68 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% embed('@ChillPerson/CRUD/_new_title.html.twig') %}{% endembed %}
{% endblock %}
{% block personcontent %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_new')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block crud_content_form_rows %}
{{ form_row(form.entreprise) }}
{{ form_row(form.domaineActivite) }}
<h2>Tuteur</h2>
{{ form_row(form.tuteurName) }}
{{ form_row(form.tuteurFonction) }}
{{ form_row(form.tuteurPhoneNumber) }}
<h2>Structure d'accompagnement</h2>
{{ form_row(form.structureAccName) }}
{{ form_row(form.structureAccPhonenumber) }}
{{ form_row(form.structureAccEmail) }}
{{ form_widget(form.structureAccAddress) }}
<h2>Descriptif du poste occupé</h2>
{{ form_row(form.posteTitle) }}
{{ form_row(form.posteLieu) }}
{{ form_row(form.debutDate) }}
{{ form_row(form.duration) }}
{{ form_row(form.horaire) }}
<h2>Objectifs</h2>
<div id="objectifs">
{{ form_widget(form.objectifs) }}
</div>
<div id="objectifsAutre">
{{ form_row(form.objectifsAutre) }}
</div>
<h2>Notes</h2>
{{ form_widget(form.noteImmersion) }}
{% endblock %}
{% endembed %}
{% endblock %}
{% block js %}
<script type="text/javascript" src="{{ asset('build/immersion_edit.js') }}"></script>
{% endblock %}

View File

@ -0,0 +1,209 @@
{% extends '@ChillPerson/CRUD/view.html.twig' %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_view_details %}
{% import 'ChillMainBundle:Address:macro.html.twig' as macro_address %}
<dl class="chill_view_data">
<h2>Entreprise</h2>
<dt>Entreprise</dt>
<dd>{{ entity.entreprise|chill_entity_render_box({'with_valid_from': false}) }}</dd>
<dt>Domaine d'activité</dt>
<dd>{{ entity.domaineActivite }}</dd>
<h2>Tuteur</h2>
<dt>Nom du tuteur</dt>
<dd>{{ entity.tuteurName }}</dd>
<dt>Fonction du tuteur</dt>
<dd>{{ entity.tuteurFonction }}</dd>
{% if entity.tuteurPhoneNumber is not empty %}
<dt>Téléphone du tuteur</dt>
<dd>
<a href="tel:{{ entity.tuteurPhoneNumber }}"><pre>{{ entity.tuteurPhoneNumber|chill_format_phonenumber }}</pre></a>
</dd>
{% endif %}
<h2>Structure d'accompagnement</h2>
<dd>
{% for el in ['structureAccName', 'structureAccPhonenumber', 'structureAccEmail'] %}
{% set el_data = attribute(entity, el) %}
{% if el_data is not empty %}{{ el_data }}<br/>{% endif %}
{% endfor %}
{% if entity.structureAccAddress is not empty %}
{{ macro_address._render(entity.structureAccAddress, { 'with_valid_from': false }) }}
{% endif %}
</dd>
<h2>Poste occupé</h2>
<dt>Titre</dt>
<dd>{{ entity.posteTitle|chill_print_or_message }}</dd>
<dt>Lieu du poste</dt>
<dd>{{ entity.posteLieu|chill_print_or_message }}</dd>
<dt>Dates</dt>
<dd>Du {{ entity.debutDate|localizeddate('long', 'none') }}
au {{ entity.getDateEndComputed|localizeddate('long', 'none') }}
</dd>
<dt>Horaire</dt>
<dd>{{ entity.horaire|nl2br }}</dd>
<h2>Objectifs</h2>
<dt>Objectifs</dt>
<dd>
{% for el in entity.objectifs %}
{% if loop.first %}<ul>{% endif %}
<li>{{ ('immersion_objectif.' ~ el)|trans }}</li>
{% if loop.last %}</ul>{% endif %}
{% else %}
<p class="chill-no-data-statement">Aucun objectif renseigné</p>
{% endfor %}
{% if 'autre' in entity.objectifs and entity.objectifsAutre is not empty %}
<label>Précisions:</label>
<blockquote class="chill-user-quote">
{{ entity.objectifsAutre|nl2br }}
</blockquote>
{% endif %}
</dd>
<h2>Note</h2>
<dd>
{{ entity.noteImmersion|chill_print_or_message('Aucune note') }}
</dd>
{% if entity.isBilanFullfilled %}
<h1>Bilan</h1>
<h2>Savoir-êtres du jeune</h2>
<dt>Savoir-être du jeune</dt>
<dd>
{% for el in entity.savoirEtre %}
{% if loop.first %}<ul>{% endif %}
<li>{{ ('immersion_savoir_etre.' ~ el)|trans }}</li>
{% if loop.last %}</ul>{% endif %}
{% else %}
<p class="chill-no-data-statement">Aucun élément indiqué</p>
{% endfor %}
{% if entity.savoirEtreNote is not empty %}
{{ entity.savoirEtreNote|chill_print_or_message(null, 'blockquote') }}
{% endif %}
</dd>
{% for line in [
['Ponctualité'],
['ponctualiteSalarie', "Ponctualité du salarié"],
['Assiduité'],
['assiduite', "Assiduité"],
['Intégration'],
['interetActivite', "La personne sintéresse à lensemble des activités et membres de lentreprise"],
['integreRegle', "La personne a intégré les règles (les principes) de lentreprise"],
['Autonomie'],
['espritInitiative', "La personne fait preuve desprit dinitiative"],
['organisation', "La personne a fait preuve dorganisation"],
['Attitude'],
['capaciteTravailEquipe', "Capacité à travailler à en équipe"],
['Posture professionnelle'],
['styleVestimentaire', 'Style vestimentaire adapté'],
['langageProf', "Langage professionnel"],
['Relation avec la hiérarchie'],
['appliqueConsigne', "Applique les consignes"],
['respectHierarchie', "Respecte les niveaux hiérarchiques"],
] %}
{% if line|length == 1 %}
<h3>{{ line[0] }}</h3>
{% else %}
<dt>{{ line[1] }}</dt>
<dd>
{% set attr = attribute(entity, line[0]) %}
{% if attr != null %}
{% if attr in constant('CSConnectes\\SPBundle\\Entity\\Immersion::YES_NO_NSP') %}
{{ ('immersion_nsp.'~attr)|trans }}
{% else %}
{{ ('immersion_' ~ line[0] ~ '.' ~ attr)|trans }}
{% endif %}
{% else %}
{{ null|chill_print_or_message("Aucune information") }}
{% endif %}
{% set note = attribute(entity, (line[0] ~ 'Note')) %}
{% if note != null %}
{{ note|chill_print_or_message(null, 'blockquote') }}
{% endif %}
</dd>
{% endif %}
{% endfor %}
{% if entity.principalesActivites is not empty
or entity.competencesAcquises is not empty
or entity.competencesADevelopper is not empty %}
<h2>Savoir-faire développés</h2>
{% for el in ['principalesActivites', 'competencesAcquises','competencesADevelopper'] %}
{% set data = attribute(entity, el) %}
{% if data is not empty %}
<dt>{% if el == 'principalesActivites' %}
Principales activités
{% elseif el == 'competencesAcquises' %}
Compétences acquises
{% else %}
Compétences à développer
{% endif %}</dt>
<dd>
{{ data|chill_print_or_message(null, 'blockquote') }}
</dd>
{% endif %}
{% endfor %}
{% endif %}
{% if entity.noteBilan is not empty %}
<h2>Note</h2>
<dd>
{{ entity.noteBilan|chill_print_or_message(null, 'blockquote') }}
</dd>
{% endif %}
{% endif %}
</dl>
{% endblock crud_content_view_details %}
{% block content_view_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', { 'person': entity.person.id }) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block content_view_actions_after %}
<li>
<a class="sc-button" href="{{ chill_return_path_or('chill_crud_immersion_bilan', { 'id': entity.id }) }}">
<svg style="height: 1rem;" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="graduation-cap" class="svg-inline--fa fa-graduation-cap fa-w-20" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M622.34 153.2L343.4 67.5c-15.2-4.67-31.6-4.67-46.79 0L17.66 153.2c-23.54 7.23-23.54 38.36 0 45.59l48.63 14.94c-10.67 13.19-17.23 29.28-17.88 46.9C38.78 266.15 32 276.11 32 288c0 10.78 5.68 19.85 13.86 25.65L20.33 428.53C18.11 438.52 25.71 448 35.94 448h56.11c10.24 0 17.84-9.48 15.62-19.47L82.14 313.65C90.32 307.85 96 298.78 96 288c0-11.57-6.47-21.25-15.66-26.87.76-15.02 8.44-28.3 20.69-36.72L296.6 284.5c9.06 2.78 26.44 6.25 46.79 0l278.95-85.7c23.55-7.24 23.55-38.36 0-45.6zM352.79 315.09c-28.53 8.76-52.84 3.92-65.59 0l-145.02-44.55L128 384c0 35.35 85.96 64 192 64s192-28.65 192-64l-14.18-113.47-145.03 44.56z"></path></svg>
Bilan
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}
{% block css %}
<link rel="stylesheet" href="{{ asset('build/thirdparty_styles.css') }}"/>
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock title %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_edit_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_edit')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_form_rows %}
{{ form_row(form.reportDate) }}
<h2>Orientation souhaitée</h2>
{{ form_row(form.souhait) }}
{{ form_row(form.domaineActiviteSouhait) }}
{{ form_row(form.typeContrat) }}
{{ form_row(form.typeContratNotes) }}
{{ form_row(form.volumeHoraire) }}
{{ form_row(form.volumeHoraireNotes) }}
<h2>Projet professionnel</h2>
{{ form_row(form.idee) }}
{{ form_row(form.enCoursConstruction) }}
{{ form_row(form.valide) }}
{{ form_row(form.domaineActiviteValide) }}
{{ form_row(form.valideNotes) }}
<h2>Notes</h2>
{{ form_widget(form.projetProfessionnelNote) }}
{% endblock %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends '@ChillPerson/layout.html.twig' %}
{% set person = entity.person %}
{% set activeRouteKey = '' %}
{% block title %}
{% embed('@ChillPerson/CRUD/_new_title.html.twig') %}{% endembed %}
{% endblock %}
{% block personcontent %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.'~crud_name~'.title_new')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_form_rows %}
{{ form_row(form.reportDate) }}
<h2>Orientation souhaitée</h2>
{{ form_row(form.souhait) }}
{{ form_row(form.domaineActiviteSouhait) }}
{{ form_row(form.typeContrat) }}
{{ form_row(form.typeContratNotes) }}
{{ form_row(form.volumeHoraire) }}
{{ form_row(form.volumeHoraireNotes) }}
<h2>Projet professionnel</h2>
{{ form_row(form.idee) }}
{{ form_row(form.enCoursConstruction) }}
{{ form_row(form.valide) }}
{{ form_row(form.domaineActiviteValide) }}
{{ form_row(form.valideNotes) }}
<h2>Notes</h2>
{{ form_widget(form.projetProfessionnelNote) }}
{% endblock %}
{% block content_form_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', {'person': entity.person.id}) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,108 @@
{% extends '@ChillPerson/CRUD/view.html.twig' %}
{% block personcontent %}
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
{% block crud_content_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
{% endblock crud_content_header %}
{% block crud_content_view_details %}
<dl class="chill_view_data">
<dt>Date</dt>
<dd>{{ entity.reportDate|localizeddate('long', 'none') }}</dd>
<h2>Souhaits</h2>
<dt>Orientation souhaitée</dt>
<dd>
{% for r in entity.souhait %}
{% if loop.first %}<ul>{% endif %}
<li>{{ r.libelle }} ({{ r.metier.code }} - {{ r.metier.libelle }})</li>
{% if loop.last %}</ul>{% endif %}
{% else %}
<p>Aucune orientation indiquée</p>
{% endfor %}
{% if entity.domaineActiviteSouhait is not empty %}
<p>Domaine d'activité souhaité&nbsp;:</p>
<blockquote class="chill-user-quote">{{ entity.domaineActiviteSouhait|nl2br }}</blockquote>
{% endif %}
</dd>
<dt>Type de contrat recherché</dt>
<dd>
{% for type in entity.typeContrat %}
{% if loop.first %}<ul>{% endif %}
<li>{{ ('projet_prof.type_contrat.' ~ type)|trans }}</li>
{% if loop.last %}</ul>{% endif %}
{% endfor %}
{% if entity.typeContratNotes is not empty %}
<blockquote class="chill-user-quote">{{ entity.typeContratNotes|nl2br }}</blockquote>
{% endif %}
</dd>
<dt>Volume horaire souhaité</dt>
<dd>
{% for type in entity.volumeHoraire %}
{% if loop.first %}<ul>{% endif %}
<li>{{ ('projet_prof.volume_horaire.' ~ type)|trans }}</li>
{% if loop.last %}</ul>{% endif %}
{% endfor %}
{% if entity.volumeHoraireNotes is not empty %}
<blockquote class="chill-user-quote">{{ entity.volumeHoraireNotes|nl2br }}</blockquote>
{% endif %}
</dd>
<h2>Projet professionnel</h2>
<dt>Idée</dt>
<dd>
{{ entity.idee|chill_print_or_message('Aucune information', 'blockquote') }}
</dd>
<dt>En cours de construction</dt>
<dd>
{{ entity.enCoursConstruction|chill_print_or_message('Aucune information', 'blockquote') }}
</dd>
<dt>Validé</dt>
<dd>
{% for r in entity.valide %}
{% if loop.first %}<ul>{% endif %}
<li>{{ r.libelle }} ({{ r.metier.code }} - {{ r.metier.libelle }})</li>
{% if loop.last %}</ul>{% endif %}
{% else %}
<p>Aucune orientation indiquée</p>
{% endfor %}
{% if entity.valideNotes is not empty %}
<blockquote class="chill-user-quote">
{{ entity.valideNotes|nl2br }}
</blockquote>
{% endif %}
{% if entity.domaineActiviteValide is not empty %}
<p>Domaine d'activité validé&nbsp;:</p>
<blockquote class="chill-user-quote">{{ entity.domaineActiviteValide|nl2br }}</blockquote>
{% endif %}
</dd>
</dl>
<h2>Notes</h2>
{{ entity.projetProfessionnelNote|chill_print_or_message('Aucune note', 'blockquote') }}
{% endblock crud_content_view_details %}
{% block content_view_actions_back %}
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ chill_return_path_or('chill_csconnectes_csreport_index', { 'person': entity.person.id }) }}">
{{ 'Cancel'|trans }}
</a>
</li>
{% endblock %}
{% block content_view_actions_after %}
{% endblock %}
{% endembed %}
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More