added filter for global activities (#614)

This commit is contained in:
Kevin Papst
2019-03-05 01:42:06 +01:00
committed by GitHub
parent 642db480ce
commit bce85b04d6
12 changed files with 21 additions and 75 deletions

View File

@@ -82,7 +82,7 @@ abstract class AbstractToolbarForm extends AbstractType
* @param FormBuilderInterface $builder
* @param null|string $label
*/
protected function addVisibilityChoice(FormBuilderInterface $builder, ?string $label = null)
protected function addVisibilityChoice(FormBuilderInterface $builder, string $label = 'label.visible')
{
$builder->add('visibility', VisibilityType::class, [
'required' => false,

View File

@@ -10,6 +10,7 @@
namespace App\Form\Toolbar;
use App\Repository\Query\ActivityQuery;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -25,6 +26,15 @@ class ActivityToolbarForm extends AbstractToolbarForm
{
$this->addPageSizeChoice($builder);
$this->addVisibilityChoice($builder);
$builder->add('globalsOnly', ChoiceType::class, [
'choices' => [
'yes' => 1,
'no' => 0,
],
'placeholder' => null,
'required' => false,
'label' => 'label.globalsOnly',
]);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
$this->addHiddenPagination($builder);