acp HasNoAction Filter (UNTESTED)

This commit is contained in:
Mathieu Jaumotte 2022-10-31 11:18:29 +01:00 committed by Julien Fastré
parent afb5ebc077
commit 2e52729806
2 changed files with 8 additions and 8 deletions

View File

@ -25,11 +25,11 @@ class HasNoActionFilter implements FilterInterface
public function alterQuery(QueryBuilder $qb, $data)
{
$qb
->andWhere(
$qb->expr()->in('', ':')
)
->setParameter('', $data[]);
if (!in_array('acpw', $qb->getAllAliases(), true)) {
$qb->join('acp.works', 'acpw');
}
$qb->andWhere('COUNT(acp.works) IS NULL');
}
public function applyOn(): string
@ -39,13 +39,12 @@ class HasNoActionFilter implements FilterInterface
public function buildForm(FormBuilderInterface $builder)
{
$builder->add();
// no form
}
public function describeAction($data, $format = 'string'): array
{
return ['', [
]];
return ['Filtered acp which has no actions'];
}
public function getTitle(): string

View File

@ -555,6 +555,7 @@ Date to: Date de fin
Filter by temporary location: Filtrer les parcours avec une localisation temporaire
Filter by which has no referrer: Filtrer les parcours sans référent
Filter by which has no action: Filtrer les parcours qui nont pas dactions
Filtered acp which has no actions: Filtré les parcours qui n'ont pas d'actions
Group by number of actions: Grouper les parcours par nombre dactions
Filter by creator: Filtrer les parcours par créateur
Filter by creator job: Filtrer les parcours par métier du créateur