mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Feature: [acp] record the step history of each accompanying period
Each time a step is changed on an history, a record is stored in a dedicated table. When the acp's opening date is moved, the first row is adapted to match the new opening's date. This mechanisme does not work if the opening date is move beyon the first end date (if any), nor on the closing date.
This commit is contained in:
@@ -12,12 +12,9 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Export\Filter\PersonFilters;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\MaritalStatus;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Query\Expr\Andx;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
|
||||
class MaritalStatusFilter implements FilterInterface
|
||||
@@ -37,25 +34,10 @@ class MaritalStatusFilter implements FilterInterface
|
||||
|
||||
public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data)
|
||||
{
|
||||
$where = $qb->getDQLPart('where');
|
||||
|
||||
$clause = $qb->expr()->andX(
|
||||
$qb->expr()->in('person.maritalStatus', ':maritalStatus'),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->eq('person.maritalStatusDate', ':calc_date'),
|
||||
$qb->expr()->isNull('person.maritalStatusDate')
|
||||
)
|
||||
$qb->andWhere(
|
||||
$qb->expr()->in('person.maritalStatus', ':maritalStatus')
|
||||
);
|
||||
|
||||
if ($where instanceof Andx) {
|
||||
$where->add($clause);
|
||||
} else {
|
||||
$where = $qb->expr()->andX($clause);
|
||||
}
|
||||
|
||||
$qb->add('where', $where);
|
||||
$qb->setParameter('maritalStatus', $data['maritalStatus']);
|
||||
$qb->setParameter('calc_date', $data['calc_date']);
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
@@ -75,11 +57,6 @@ class MaritalStatusFilter implements FilterInterface
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
||||
$builder->add('calc_date', ChillDateType::class, [
|
||||
'label' => 'Marital status at this time',
|
||||
'data' => new DateTime(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string')
|
||||
|
Reference in New Issue
Block a user