mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 15:43:51 +00:00
Export: add clauses on the social work start date and end date within the filter "Filter accompanying period by accompanying period work"'
This commit is contained in:
@@ -37,9 +37,13 @@ class RollingDateDataMapper implements DataMapperInterface
|
||||
{
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
$viewData = new RollingDate(
|
||||
$forms['roll']->getData() ?? RollingDate::T_TODAY,
|
||||
$forms['fixedDate']->getData()
|
||||
);
|
||||
if (null === $forms['roll']->getData()) {
|
||||
$viewData = null;
|
||||
} else {
|
||||
$viewData = new RollingDate(
|
||||
$forms['roll']->getData(),
|
||||
$forms['fixedDate']->getData()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ class PickRollingDateType extends AbstractType
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'class' => RollingDate::class,
|
||||
'empty_data' => new RollingDate(RollingDate::T_TODAY),
|
||||
'empty_data' => null,
|
||||
'constraints' => [
|
||||
new Callback($this->validate(...)),
|
||||
],
|
||||
@@ -66,6 +66,10 @@ class PickRollingDateType extends AbstractType
|
||||
|
||||
public function validate($data, ExecutionContextInterface $context, $payload): void
|
||||
{
|
||||
if (null === $data) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var RollingDate $data */
|
||||
if (RollingDate::T_FIXED_DATE === $data->getRoll() && null === $data->getFixedDate()) {
|
||||
$context
|
||||
|
Reference in New Issue
Block a user