mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
SocialWork: Current actions filter + aggregator
This commit is contained in:
parent
2e52729806
commit
9e89302aa4
@ -25,7 +25,11 @@ class CurrentActionAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb->addSelect('AS acpw_current_action_aggregator')
|
$qb
|
||||||
|
->addSelect('
|
||||||
|
(CASE true WHEN acpw.startDate IS NULL ELSE false END)
|
||||||
|
AS acpw_current_action_aggregator
|
||||||
|
')
|
||||||
->addGroupBy('acpw_current_action_aggregator');
|
->addGroupBy('acpw_current_action_aggregator');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,6 +49,17 @@ class CurrentActionAggregator implements AggregatorInterface
|
|||||||
if ('_header' === $value) {
|
if ('_header' === $value) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
switch ($value) {
|
||||||
|
case true:
|
||||||
|
return 'Current action';
|
||||||
|
|
||||||
|
case false:
|
||||||
|
return 'Not current action';
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new \LogicException(sprintf('The value %s is not valid', $value));
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,7 @@ class CurrentActionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
{
|
{
|
||||||
$qb
|
$qb->andWhere('acpw.startDate IS NULL');
|
||||||
->andWhere(
|
|
||||||
$qb->expr()->in('', ':')
|
|
||||||
)
|
|
||||||
->setParameter('', $data[]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applyOn(): string
|
public function applyOn(): string
|
||||||
@ -39,13 +35,12 @@ class CurrentActionFilter implements FilterInterface
|
|||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder)
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
{
|
{
|
||||||
$builder->add();
|
//no form
|
||||||
}
|
}
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string'): array
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return ['', [
|
return ['Filtered by current action'];
|
||||||
]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
|
@ -562,7 +562,10 @@ Filter by creator job: Filtrer les parcours par métier du créateur
|
|||||||
Group by creator job: Grouper les parcours par métier du créateur
|
Group by creator job: Grouper les parcours par métier du créateur
|
||||||
|
|
||||||
Filter by current actions: Filtrer les actions en cours
|
Filter by current actions: Filtrer les actions en cours
|
||||||
|
Filtered by current action: Filtré les actions en cours
|
||||||
Group by current actions: Grouper les actions en cours
|
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 start date evaluations: Filtrer les évaluations par date de début
|
||||||
Filter by end date evaluations: Filtrer les évaluations par date de fin
|
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
|
Filter by max date evaluations: Filtrer les évaluations par date d'échéance
|
||||||
|
Loading…
x
Reference in New Issue
Block a user