mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
ByEndDateFilter evaluation
This commit is contained in:
parent
42012dbad2
commit
f714c7206c
@ -12,9 +12,12 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Export\Filter\EvaluationFilters;
|
||||
|
||||
use Chill\MainBundle\Export\FilterInterface;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\PersonBundle\Export\Declarations;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use DateTime;
|
||||
|
||||
class ByEndDateFilter implements FilterInterface
|
||||
{
|
||||
@ -26,10 +29,9 @@ class ByEndDateFilter implements FilterInterface
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
$qb
|
||||
->andWhere(
|
||||
$qb->expr()->in('', ':')
|
||||
)
|
||||
->setParameter('', $data[]);
|
||||
->andWhere('workeval.endDate IS BETWEEN :start_date and :end_date')
|
||||
->setParameter('start_date', $data['start_date'], Types::DATE_IMMUTABLE)
|
||||
->setParameter('end_date', $data['end_date'], Types::DATE_IMMUTABLE);
|
||||
}
|
||||
|
||||
public function applyOn(): string
|
||||
@ -39,12 +41,22 @@ class ByEndDateFilter implements FilterInterface
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder->add();
|
||||
$builder
|
||||
->add('start_date', ChillDateType::class, [
|
||||
'label' => 'start period date',
|
||||
'data' => new DateTime(),
|
||||
])
|
||||
->add('end_date', ChillDateType::class, [
|
||||
'label' => 'end period date',
|
||||
'data' => new DateTime(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function describeAction($data, $format = 'string'): array
|
||||
{
|
||||
return ['', [
|
||||
return ['Filtered by end date: between %start_date% and %end_date%', [
|
||||
'%start_date%' => $data['start_date']->format('d-m-Y'),
|
||||
'%end_date%' => $data['end_date']->format('d-m-Y'),
|
||||
]];
|
||||
}
|
||||
|
||||
|
@ -569,11 +569,11 @@ Group by current actions: Grouper les actions en cours
|
||||
Current action: Actions en cours
|
||||
Not current action: Actions terminées
|
||||
Filter by start date evaluations: Filtrer les évaluations par date de début
|
||||
Filter by end date evaluations: Filtrer les évaluations par date de fin
|
||||
start period date: Date de début de la période
|
||||
end period date: Date de fin de la période
|
||||
"Filtered by start date: between %start_date% and %end_date%": "Filtré par la date de début: entre %start_date% et %end_date%"
|
||||
Filter by end date evaluations: Filtrer les évaluations par date de fin
|
||||
Filter by max date evaluations: Filtrer les évaluations par date d'échéance
|
||||
"Filtered by start date: between %start_date% and %end_date%": "Filtré par la date de début: comprise entre %start_date% et %end_date%"
|
||||
"Filtered by end date: between %start_date% and %end_date%": "Filtré par la date de fin: comprise entre %start_date% et %end_date%"
|
||||
Filter by current evaluations: Filtrer les évaluations en cours
|
||||
Group by start date evaluations: Grouper les évaluations par semaine/mois/année de la date de début
|
||||
Group by end date evaluations: Grouper les évaluations par semaine/mois/année de la date de fin
|
||||
|
Loading…
x
Reference in New Issue
Block a user