mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Only active reason are displayed in the activity encoding form
This commit is contained in:
parent
4ef4a64ea6
commit
0bee5e46db
@ -24,8 +24,8 @@ namespace Chill\ActivityBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
* Description of TranslatableActivityReason
|
||||
@ -63,6 +63,10 @@ class TranslatableActivityReason extends AbstractType
|
||||
},
|
||||
'group_by' => function($choice, $key) use ($helper) {
|
||||
return $helper->localize($choice->getCategory()->getName());
|
||||
},
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('r')
|
||||
->where('r.active = true');
|
||||
}
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user