6173 export adherent with numero anonymisation
1/1 discussion resolved
Showing
The changes were merged into ssa-gironde
The source branch has been removed
642 | 653 | } |
643 | 654 | |
655 | public function getAnynomousTokenFilter($queryBuilder, $alias, $field, $value) | |
656 | { | |
657 | if (!$value['value']) { | |
658 | return false; | |
659 | } | |
660 | ||
661 | $container = $this->getConfigurationPool()->getContainer(); | |
662 | $em = $container->get('doctrine.orm.entity_manager'); | |
663 | $expr = $em->getExpressionBuilder(); | |
664 | ||
665 | // Use `andWhere` instead of `where` to prevent overriding existing `where` conditions | |
666 | if ($value["value"]) { | |
667 | $queryBuilder->andWhere( | |
668 | '(' . $alias . '.anonymousToken is not null and ' . $alias . '.anonymousToken != false)' | |
Please
register
or
sign in
to reply
|
merged
merged
mentioned in commit fdd31ac6
mentioned in commit fdd31ac6
resolved all discussions
resolved all discussions
... | ... | @@ -581,7 +581,18 @@ class AdherentAdmin extends AbstractAdmin |
; | ||
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) { | ||
$datagridMapper->remove('cotisationajour'); | ||
$datagridMapper | ||
->remove('cotisationajour'); | ||
if ($this->getConfigurationPool()->getContainer()->getParameter('ccas_mode')) { | ||
$datagridMapper | ||
->add('anonymoustoken', CallbackFilter::class, [ | ||
'callback' => [$this, 'getAnynomousTokenFilter'], | ||
'field_type' => CheckboxType::class, | ||
'label' => 'Avec numéro d\'anonymisation', | ||
'show_filter' => true, | ||
'advanced_filter' => false, | ||
]); | ||
} | ||
} | ||
} | ||
... | ... | @@ -641,6 +652,26 @@ class AdherentAdmin extends AbstractAdmin |
return true; | ||
} | ||
public function getAnynomousTokenFilter($queryBuilder, $alias, $field, $value) | ||
{ | ||
if (!$value['value']) { | ||
return false; | ||
} | ||
$container = $this->getConfigurationPool()->getContainer(); | ||
$em = $container->get('doctrine.orm.entity_manager'); | ||
$expr = $em->getExpressionBuilder(); | ||
// Use `andWhere` instead of `where` to prevent overriding existing `where` conditions | ||
if ($value["value"]) { | ||
$queryBuilder->andWhere( | ||
|
'(' . $alias . '.anonymousToken is not null and ' . $alias . '.anonymousToken != false)' | |
|
||
); | ||
} | ||
return true; | ||
} | ||
/** | ||
* @param EventDispatcherInterface $userManager | ||
*/ | ||
... | ... |
This will create a new commit in order to revert the existing changes.