mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-21 11:24:40 +02:00
Added more filters
This commit is contained in:
parent
c9151c65ba
commit
ff5b59e25d
4 changed files with 253 additions and 12 deletions
|
@ -4,11 +4,16 @@ namespace App\Form\Filters;
|
|||
|
||||
use App\DataTables\Filters\PartFilter;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Form\Filters\Constraints\BooleanConstraintType;
|
||||
use App\Form\Filters\Constraints\DateTimeConstraintType;
|
||||
use App\Form\Filters\Constraints\NumberConstraintType;
|
||||
use App\Form\Filters\Constraints\StructuralEntityConstraintType;
|
||||
use App\Form\Filters\Constraints\TextConstraintType;
|
||||
use Svg\Tag\Text;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
|
@ -29,11 +34,41 @@ class PartFilterType extends AbstractType
|
|||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
/*
|
||||
* Common tab
|
||||
*/
|
||||
|
||||
$builder->add('name', TextConstraintType::class, [
|
||||
'label' => 'part.edit.name',
|
||||
]);
|
||||
|
||||
$builder->add('description', TextConstraintType::class, [
|
||||
'label' => 'part.edit.description',
|
||||
]);
|
||||
|
||||
$builder->add('category', StructuralEntityConstraintType::class, [
|
||||
'label' => 'part.edit.category',
|
||||
'entity_class' => Category::class
|
||||
]);
|
||||
|
||||
$builder->add('footprint', StructuralEntityConstraintType::class, [
|
||||
'label' => 'part.edit.footprint',
|
||||
'entity_class' => Footprint::class
|
||||
]);
|
||||
|
||||
$builder->add('comment', TextConstraintType::class, [
|
||||
'label' => 'part.edit.comment'
|
||||
]);
|
||||
|
||||
/*
|
||||
* Advanced tab
|
||||
*/
|
||||
|
||||
$builder->add('dbId', NumberConstraintType::class, [
|
||||
'label' => 'part.filter.dbId',
|
||||
'min' => 1,
|
||||
]);
|
||||
|
||||
$builder->add('favorite', BooleanConstraintType::class, [
|
||||
'label' => 'part.edit.is_favorite'
|
||||
]);
|
||||
|
@ -48,12 +83,9 @@ class PartFilterType extends AbstractType
|
|||
'min' => 0,
|
||||
]);
|
||||
|
||||
$builder->add('name', TextConstraintType::class, [
|
||||
'label' => 'part.edit.name',
|
||||
]);
|
||||
|
||||
$builder->add('description', TextConstraintType::class, [
|
||||
'label' => 'part.edit.description',
|
||||
$builder->add('measurementUnit', StructuralEntityConstraintType::class, [
|
||||
'label' => 'part.edit.partUnit',
|
||||
'entity_class' => MeasurementUnit::class
|
||||
]);
|
||||
|
||||
$builder->add('lastModified', DateTimeConstraintType::class, [
|
||||
|
@ -65,6 +97,47 @@ class PartFilterType extends AbstractType
|
|||
]);
|
||||
|
||||
|
||||
/*
|
||||
* Manufacturer tab
|
||||
*/
|
||||
|
||||
$builder->add('manufacturer', StructuralEntityConstraintType::class, [
|
||||
'label' => 'part.edit.manufacturer.label',
|
||||
'entity_class' => Manufacturer::class
|
||||
]);
|
||||
|
||||
$builder->add('manufacturer_product_url', TextConstraintType::class, [
|
||||
'label' => 'part.edit.manufacturer_url.label'
|
||||
]);
|
||||
|
||||
$builder->add('manufacturer_product_number', TextConstraintType::class, [
|
||||
'label' => 'part.edit.mpn'
|
||||
]);
|
||||
|
||||
/*
|
||||
* Purchasee informations
|
||||
*/
|
||||
|
||||
$builder->add('supplier', StructuralEntityConstraintType::class, [
|
||||
'label' => 'supplier.label',
|
||||
'entity_class' => Manufacturer::class
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* Stocks tabs
|
||||
*/
|
||||
$builder->add('storelocation', StructuralEntityConstraintType::class, [
|
||||
'label' => 'storelocation.label',
|
||||
'entity_class' => Storelocation::class
|
||||
]);
|
||||
|
||||
$builder->add('minAmount', NumberConstraintType::class, [
|
||||
'label' => 'part.edit.mininstock',
|
||||
'min' => 0,
|
||||
]);
|
||||
|
||||
|
||||
$builder->add('submit', SubmitType::class, [
|
||||
'label' => 'Update',
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue