* fixed filter query #28 * fixed annotation #28 * merge message files #28 * added page size type #28 * added visibility type #28 * added filter toolbar to customer screen #28
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace TimesheetBundle\Form;
|
||||
|
||||
use AppBundle\Form\Type\YesNoType;
|
||||
use AppBundle\Form\Type\VisibilityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
@@ -48,7 +48,7 @@ class ActivityEditForm extends AbstractType
|
||||
'label' => 'label.project',
|
||||
])
|
||||
// boolean
|
||||
->add('visible', YesNoType::class, [
|
||||
->add('visible', VisibilityType::class, [
|
||||
'label' => 'label.visible',
|
||||
])
|
||||
;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace TimesheetBundle\Form;
|
||||
|
||||
use AppBundle\Form\Type\YesNoType;
|
||||
use AppBundle\Form\Type\VisibilityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CountryType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CurrencyType;
|
||||
@@ -61,7 +61,7 @@ class CustomerEditForm extends AbstractType
|
||||
])
|
||||
*/
|
||||
// boolean
|
||||
->add('visible', YesNoType::class, [
|
||||
->add('visible', VisibilityType::class, [
|
||||
'label' => 'label.visible',
|
||||
])
|
||||
// string - length 255
|
||||
|
||||
67
src/TimesheetBundle/Form/CustomerToolbarForm.php
Normal file
67
src/TimesheetBundle/Form/CustomerToolbarForm.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace TimesheetBundle\Form;
|
||||
|
||||
use AppBundle\Form\Type\PageSizeType;
|
||||
use AppBundle\Form\Type\VisibilityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use TimesheetBundle\Repository\Query\CustomerQuery;
|
||||
|
||||
/**
|
||||
* Defines the form used for filtering the customer.
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class CustomerToolbarForm extends AbstractType
|
||||
{
|
||||
/**
|
||||
* Dirty hack to enable easy handling of GET form in controller and javascript.
|
||||
*Cleans up the name of all form elents (and unfortunately of the form itself).
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
/** @var CustomerQuery $query */
|
||||
$query = $options['data'];
|
||||
|
||||
$builder
|
||||
->add('pageSize', PageSizeType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('visibility', VisibilityType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => CustomerQuery::class,
|
||||
'csrf_protection' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace TimesheetBundle\Form;
|
||||
|
||||
use AppBundle\Form\Type\YesNoType;
|
||||
use AppBundle\Form\Type\VisibilityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
@@ -49,7 +49,7 @@ class ProjectEditForm extends AbstractType
|
||||
'label' => 'label.customer',
|
||||
])
|
||||
// boolean
|
||||
->add('visible', YesNoType::class, [
|
||||
->add('visible', VisibilityType::class, [
|
||||
'label' => 'label.visible',
|
||||
])
|
||||
// string
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace TimesheetBundle\Form;
|
||||
|
||||
use AppBundle\Form\Type\PageSizeType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@@ -47,9 +48,7 @@ class TimesheetToolbarForm extends AbstractType
|
||||
$query = $options['data'];
|
||||
|
||||
$builder
|
||||
->add('pageSize', ChoiceType::class, [
|
||||
'label' => 'label.pageSize',
|
||||
'choices' => [10 => 10, 25 => 25, 50 => 50, 75 => 75, 100 => 100],
|
||||
->add('pageSize', PageSizeType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('state', ChoiceType::class, [
|
||||
|
||||
Reference in New Issue
Block a user