mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
ChillPersonBundle: add administrativeStatus property to Person
This commit is contained in:
parent
9e3431f397
commit
6c37d798bf
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\PersonBundle\Controller;
|
||||||
|
|
||||||
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
|
class AdministrativeStatusController extends CRUDController
|
||||||
|
{
|
||||||
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
|
{
|
||||||
|
$query->addOrderBy('e.order', 'ASC');
|
||||||
|
|
||||||
|
return parent::orderQuery($action, $query, $request, $paginator);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\PersonBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Entity\AdministrativeStatus;
|
||||||
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
|
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||||
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
|
class LoadAdministrativeStatus extends Fixture implements FixtureGroupInterface
|
||||||
|
{
|
||||||
|
public static function getGroups(): array
|
||||||
|
{
|
||||||
|
return ['administrative_status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function load(ObjectManager $manager): void
|
||||||
|
{
|
||||||
|
$status = [
|
||||||
|
['name' => ['fr' => 'situation administrative régulière']],
|
||||||
|
['name' => ['fr' => 'sans papier']],
|
||||||
|
['name' => ['fr' => 'séjour provisoire']],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($status as $val) {
|
||||||
|
$administrativeStatus = (new AdministrativeStatus())
|
||||||
|
->setName($val['name'])
|
||||||
|
->setActive(true);
|
||||||
|
$manager->persist($administrativeStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
$manager->flush();
|
||||||
|
}
|
||||||
|
}
|
@ -15,12 +15,15 @@ use Chill\MainBundle\DependencyInjection\MissingBundleException;
|
|||||||
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
|
||||||
use Chill\PersonBundle\Controller\AccompanyingPeriodCommentApiController;
|
use Chill\PersonBundle\Controller\AccompanyingPeriodCommentApiController;
|
||||||
use Chill\PersonBundle\Controller\AccompanyingPeriodResourceApiController;
|
use Chill\PersonBundle\Controller\AccompanyingPeriodResourceApiController;
|
||||||
|
use Chill\PersonBundle\Controller\AdministrativeStatusController;
|
||||||
use Chill\PersonBundle\Controller\EmploymentStatusController;
|
use Chill\PersonBundle\Controller\EmploymentStatusController;
|
||||||
use Chill\PersonBundle\Controller\HouseholdCompositionTypeApiController;
|
use Chill\PersonBundle\Controller\HouseholdCompositionTypeApiController;
|
||||||
use Chill\PersonBundle\Controller\RelationApiController;
|
use Chill\PersonBundle\Controller\RelationApiController;
|
||||||
use Chill\PersonBundle\Doctrine\DQL\AddressPart;
|
use Chill\PersonBundle\Doctrine\DQL\AddressPart;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
use Chill\PersonBundle\Entity\AdministrativeStatus;
|
||||||
use Chill\PersonBundle\Entity\EmploymentStatus;
|
use Chill\PersonBundle\Entity\EmploymentStatus;
|
||||||
|
use Chill\PersonBundle\Form\AdministrativeStatusType;
|
||||||
use Chill\PersonBundle\Form\EmploymentStatusType;
|
use Chill\PersonBundle\Form\EmploymentStatusType;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter;
|
||||||
@ -195,6 +198,28 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'class' => AdministrativeStatus::class,
|
||||||
|
'name' => 'administrative_status',
|
||||||
|
'base_path' => '/admin/administrative',
|
||||||
|
'base_role' => 'ROLE_ADMIN',
|
||||||
|
'form_class' => AdministrativeStatusType::class,
|
||||||
|
'controller' => AdministrativeStatusController::class,
|
||||||
|
'actions' => [
|
||||||
|
'index' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillPerson/AdministrativeStatus/index.html.twig',
|
||||||
|
],
|
||||||
|
'new' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillPerson/AdministrativeStatus/new.html.twig',
|
||||||
|
],
|
||||||
|
'edit' => [
|
||||||
|
'role' => 'ROLE_ADMIN',
|
||||||
|
'template' => '@ChillPerson/AdministrativeStatus/edit.html.twig',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'class' => EmploymentStatus::class,
|
'class' => EmploymentStatus::class,
|
||||||
'name' => 'employment_status',
|
'name' => 'employment_status',
|
||||||
|
@ -86,6 +86,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->append($this->addFieldNode('acceptEmail'))
|
->append($this->addFieldNode('acceptEmail'))
|
||||||
->append($this->addFieldNode('deathdate'))
|
->append($this->addFieldNode('deathdate'))
|
||||||
->append($this->addFieldNode('employment_status', 'hidden'))
|
->append($this->addFieldNode('employment_status', 'hidden'))
|
||||||
|
->append($this->addFieldNode('administrative_status', 'hidden'))
|
||||||
->arrayNode('alt_names')
|
->arrayNode('alt_names')
|
||||||
->defaultValue([])
|
->defaultValue([])
|
||||||
->arrayPrototype()
|
->arrayPrototype()
|
||||||
|
80
src/Bundle/ChillPersonBundle/Entity/AdministrativeStatus.php
Normal file
80
src/Bundle/ChillPersonBundle/Entity/AdministrativeStatus.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\PersonBundle\Entity;
|
||||||
|
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||||
|
|
||||||
|
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_person_administrative_status' => AdministrativeStatus::class])]
|
||||||
|
#[ORM\Entity]
|
||||||
|
#[ORM\Table(name: 'chill_person_administrative_status')]
|
||||||
|
class AdministrativeStatus
|
||||||
|
{
|
||||||
|
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[Serializer\Groups(['read', 'docgen:read'])]
|
||||||
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||||
|
#[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])]
|
||||||
|
private array $name = [];
|
||||||
|
|
||||||
|
#[Serializer\Groups(['read'])]
|
||||||
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||||
|
private bool $active = true;
|
||||||
|
|
||||||
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, name: 'ordering', nullable: true, options: ['default' => '0.0'])]
|
||||||
|
private float $order = 0;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getActive(): ?bool
|
||||||
|
{
|
||||||
|
return $this->active;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName(): ?array
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getOrder(): ?float
|
||||||
|
{
|
||||||
|
return $this->order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setActive(bool $active): self
|
||||||
|
{
|
||||||
|
$this->active = $active;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setName(array $name): self
|
||||||
|
{
|
||||||
|
$this->name = $name;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setOrder(float $order): self
|
||||||
|
{
|
||||||
|
$this->order = $order;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
@ -304,6 +304,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT)]
|
||||||
private string $memo = '';
|
private string $memo = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The person's administrative status.
|
||||||
|
*/
|
||||||
|
#[ORM\ManyToOne(targetEntity: AdministrativeStatus::class)]
|
||||||
|
#[ORM\JoinColumn(nullable: true)]
|
||||||
|
private ?AdministrativeStatus $administrativeStatus = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The person's mobile phone number.
|
* The person's mobile phone number.
|
||||||
*/
|
*/
|
||||||
@ -777,6 +784,11 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
return $this->addresses;
|
return $this->addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAdministrativeStatus(): ?AdministrativeStatus
|
||||||
|
{
|
||||||
|
return $this->administrativeStatus;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the age of a person, calculated at the date 'now'.
|
* Return the age of a person, calculated at the date 'now'.
|
||||||
*
|
*
|
||||||
@ -1420,6 +1432,13 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setAdministrativeStatus(?AdministrativeStatus $administrativeStatus): self
|
||||||
|
{
|
||||||
|
$this->administrativeStatus = $administrativeStatus;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function setAcceptSMS(bool $acceptSMS): self
|
public function setAcceptSMS(bool $acceptSMS): self
|
||||||
{
|
{
|
||||||
$this->acceptSMS = $acceptSMS;
|
$this->acceptSMS = $acceptSMS;
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\PersonBundle\Form;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||||
|
use Chill\PersonBundle\Entity\AdministrativeStatus;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
|
class AdministrativeStatusType extends \Symfony\Component\Form\AbstractType
|
||||||
|
{
|
||||||
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
|
{
|
||||||
|
$builder
|
||||||
|
->add('name', TranslatableStringFormType::class, [
|
||||||
|
'required' => true,
|
||||||
|
])
|
||||||
|
->add('active', ChoiceType::class, [
|
||||||
|
'choices' => [
|
||||||
|
'Active' => true,
|
||||||
|
'Inactive' => false,
|
||||||
|
],
|
||||||
|
])
|
||||||
|
->add('order', NumberType::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
|
{
|
||||||
|
$resolver->setDefaults([
|
||||||
|
'data_class' => AdministrativeStatus::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
@ -26,6 +26,7 @@ use Chill\PersonBundle\Entity\Person;
|
|||||||
use Chill\PersonBundle\Entity\PersonPhone;
|
use Chill\PersonBundle\Entity\PersonPhone;
|
||||||
use Chill\PersonBundle\Form\Type\PersonAltNameType;
|
use Chill\PersonBundle\Form\Type\PersonAltNameType;
|
||||||
use Chill\PersonBundle\Form\Type\PersonPhoneType;
|
use Chill\PersonBundle\Form\Type\PersonPhoneType;
|
||||||
|
use Chill\PersonBundle\Form\Type\PickAdministrativeStatusType;
|
||||||
use Chill\PersonBundle\Form\Type\PickEmploymentStatusType;
|
use Chill\PersonBundle\Form\Type\PickEmploymentStatusType;
|
||||||
use Chill\PersonBundle\Form\Type\PickGenderType;
|
use Chill\PersonBundle\Form\Type\PickGenderType;
|
||||||
use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
||||||
@ -108,6 +109,11 @@ class PersonType extends AbstractType
|
|||||||
->add('employmentStatus', PickEmploymentStatusType::class, ['required' => false]);
|
->add('employmentStatus', PickEmploymentStatusType::class, ['required' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('visible' === $this->config['administrative_status']) {
|
||||||
|
$builder
|
||||||
|
->add('administrativeStatus', PickAdministrativeStatusType::class, ['required' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
if ('visible' === $this->config['place_of_birth']) {
|
if ('visible' === $this->config['place_of_birth']) {
|
||||||
$builder->add('placeOfBirth', TextType::class, [
|
$builder->add('placeOfBirth', TextType::class, [
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\PersonBundle\Form\Type;
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Chill\PersonBundle\Entity\AdministrativeStatus;
|
||||||
|
|
||||||
|
class PickAdministrativeStatusType extends AbstractType
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver
|
||||||
|
->setDefault('label', 'Administrative Status')
|
||||||
|
->setDefault(
|
||||||
|
'choice_label',
|
||||||
|
fn (AdministrativeStatus $administrativeStatus): string => $this->translatableStringHelper->localize($administrativeStatus->getName())
|
||||||
|
)
|
||||||
|
->setDefault(
|
||||||
|
'query_builder',
|
||||||
|
static fn (EntityRepository $er): QueryBuilder => $er->createQueryBuilder('c')
|
||||||
|
->where('c.active = true')
|
||||||
|
->orderBy('c.order'),
|
||||||
|
)
|
||||||
|
->setDefault('placeholder', $this->translatableStringHelper->localize(['Select an option…']))
|
||||||
|
->setDefault('class', AdministrativeStatus::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getParent()
|
||||||
|
{
|
||||||
|
return EntityType::class;
|
||||||
|
}
|
||||||
|
}
|
@ -65,6 +65,12 @@ class AdminPersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
])->setExtras(['order' => 2035]);
|
])->setExtras(['order' => 2035]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('visible' == $this->fields_visibility['administrative_status']) {
|
||||||
|
$menu->addChild('Administrative status', [
|
||||||
|
'route' => 'chill_crud_administrative_status_index',
|
||||||
|
])->setExtras(['order' => 2036]);
|
||||||
|
}
|
||||||
|
|
||||||
$menu->addChild('person_admin.person_resource_kind', [
|
$menu->addChild('person_admin.person_resource_kind', [
|
||||||
'route' => 'chill_crud_person_resource-kind_index',
|
'route' => 'chill_crud_person_resource-kind_index',
|
||||||
])->setExtras(['order' => 2040]);
|
])->setExtras(['order' => 2040]);
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock admin_content %}
|
@ -0,0 +1,42 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||||
|
{% block table_entities_thead_tr %}
|
||||||
|
<th>id</th>
|
||||||
|
<th>{{ 'name'|trans }}</th>
|
||||||
|
<th>{{ 'active'|trans }}</th>
|
||||||
|
<th>{{ 'ordering'|trans }}</th>
|
||||||
|
<th></th>
|
||||||
|
{% endblock %}
|
||||||
|
{% block table_entities_tbody %}
|
||||||
|
{% for entity in entities %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ entity.id }}</td>
|
||||||
|
<td>{{ entity.name|localize_translatable_string }}</td>
|
||||||
|
<td style="text-align:center;">
|
||||||
|
{%- if entity.active -%}
|
||||||
|
<i class="fa fa-check-square-o"></i>
|
||||||
|
{%- else -%}
|
||||||
|
<i class="fa fa-square-o"></i>
|
||||||
|
{%- endif -%}
|
||||||
|
</td>
|
||||||
|
<td>{{ entity.order }}</td>
|
||||||
|
<td>
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a href="{{ chill_path_add_return_path('chill_crud_administrative_status_edit', { 'id': entity.id}) }}" class="btn btn-sm btn-edit btn-mini"></a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block actions_before %}
|
||||||
|
<li class='cancel'>
|
||||||
|
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||||
|
</li>
|
||||||
|
{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock %}
|
@ -0,0 +1,11 @@
|
|||||||
|
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block admin_content %}
|
||||||
|
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||||
|
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||||
|
{% endembed %}
|
||||||
|
{% endblock admin_content %}
|
@ -107,6 +107,9 @@
|
|||||||
{%- if form.spokenLanguages is defined -%}
|
{%- if form.spokenLanguages is defined -%}
|
||||||
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
|
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- if form.administrativeStatus is defined -%}
|
||||||
|
{{ form_row(form.administrativeStatus, {'label' : 'Administrative status'}) }}
|
||||||
|
{%- endif -%}
|
||||||
{%- if form.employmentStatus is defined -%}
|
{%- if form.employmentStatus is defined -%}
|
||||||
{{ form_row(form.employmentStatus, {'label' : 'Employment status'}) }}
|
{{ form_row(form.employmentStatus, {'label' : 'Employment status'}) }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
@ -170,8 +170,20 @@ This view should receive those arguments:
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{% if chill_person.fields.administrative_status == 'visible' %}
|
||||||
<dl>
|
<dl>
|
||||||
|
<dt>{{ 'Administrative status'|trans }} :</dt>
|
||||||
|
<dd>
|
||||||
|
{% if person.administrativeStatus is not empty %}
|
||||||
|
{{ person.administrativeStatus.name|localize_translatable_string }}
|
||||||
|
{% else %}
|
||||||
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
{% endif %}
|
||||||
{% if chill_person.fields.employment_status == 'visible' %}
|
{% if chill_person.fields.employment_status == 'visible' %}
|
||||||
|
<dl>
|
||||||
<dt>{{ 'Employment status'|trans }} :</dt>
|
<dt>{{ 'Employment status'|trans }} :</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if person.employmentStatus is not empty %}
|
{% if person.employmentStatus is not empty %}
|
||||||
@ -180,8 +192,8 @@ This view should receive those arguments:
|
|||||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
{% endif %}
|
|
||||||
</dl>
|
</dl>
|
||||||
|
{% endif %}
|
||||||
{%- if chill_person.fields.number_of_children == 'visible' -%}
|
{%- if chill_person.fields.number_of_children == 'visible' -%}
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{'Number of children'|trans}} :</dt>
|
<dt>{{'Number of children'|trans}} :</dt>
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Chill is a software for social workers
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view
|
||||||
|
* the LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Person;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20241127160628 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Add administrative status';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('CREATE SEQUENCE chill_person_administrative_status_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
|
$this->addSql('CREATE TABLE chill_person_administrative_status (id INT NOT NULL, name JSON NOT NULL, active BOOLEAN NOT NULL, ordering DOUBLE PRECISION DEFAULT \'0.0\', PRIMARY KEY(id))');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_person ADD administrativeStatus_id INT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_person ADD CONSTRAINT FK_BF210A146E64B00C FOREIGN KEY (administrativeStatus_id) REFERENCES chill_person_administrative_status (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('CREATE INDEX IDX_BF210A146E64B00C ON chill_person_person (administrativeStatus_id)');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('DROP SEQUENCE chill_person_administrative_status_id_seq CASCADE');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A146E64B00C');
|
||||||
|
$this->addSql('DROP TABLE chill_person_administrative_status');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_person DROP administrativeStatus_id');
|
||||||
|
}
|
||||||
|
}
|
@ -100,6 +100,7 @@ numberOfChildren: Nombre d'enfants
|
|||||||
contactInfo: Commentaire des contacts
|
contactInfo: Commentaire des contacts
|
||||||
spokenLanguages: Langues parlées
|
spokenLanguages: Langues parlées
|
||||||
Employment status: Situation professionelle
|
Employment status: Situation professionelle
|
||||||
|
Administrative status: Situation administrative
|
||||||
|
|
||||||
|
|
||||||
# dédoublonnage
|
# dédoublonnage
|
||||||
@ -648,6 +649,12 @@ Group people by country of birth: Grouper les usagers par pays de naissance
|
|||||||
Similar persons: Usagers similaires
|
Similar persons: Usagers similaires
|
||||||
|
|
||||||
crud:
|
crud:
|
||||||
|
administrative_status:
|
||||||
|
index:
|
||||||
|
title: Situations administratives
|
||||||
|
add_new: Ajouter une nouvelle
|
||||||
|
title_new: Ajouter une situation administrative
|
||||||
|
title_edit: Modifier cette situation administrative
|
||||||
closing_motive:
|
closing_motive:
|
||||||
index:
|
index:
|
||||||
title: Liste des motifs de clotûre
|
title: Liste des motifs de clotûre
|
||||||
|
Loading…
x
Reference in New Issue
Block a user