mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-19 10:24:50 +02:00
Added some more constraints for part lots.
This commit is contained in:
parent
5402d3b031
commit
22eb6601e8
5 changed files with 76 additions and 3 deletions
|
@ -24,6 +24,7 @@ class DateTimeConstraintType extends AbstractType
|
|||
|
||||
'value1_options' => [], // Options for the first value input
|
||||
'value2_options' => [], // Options for the second value input
|
||||
'input_type' => DateTimeType::class,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -40,7 +41,7 @@ class DateTimeConstraintType extends AbstractType
|
|||
'filter.number_constraint.value.operator.BETWEEN' => 'BETWEEN',
|
||||
];
|
||||
|
||||
$builder->add('value1', DateTimeType::class, array_merge_recursive([
|
||||
$builder->add('value1', $options['input_type'], array_merge_recursive([
|
||||
'label' => 'filter.datetime_constraint.value1',
|
||||
'attr' => [
|
||||
'placeholder' => 'filter.datetime_constraint.value1',
|
||||
|
@ -50,7 +51,7 @@ class DateTimeConstraintType extends AbstractType
|
|||
'widget' => 'single_text',
|
||||
], $options['value1_options']));
|
||||
|
||||
$builder->add('value2', DateTimeType::class, array_merge_recursive([
|
||||
$builder->add('value2', $options['input_type'], array_merge_recursive([
|
||||
'label' => 'filter.datetime_constraint.value2',
|
||||
'attr' => [
|
||||
'placeholder' => 'filter.datetime_constraint.value2',
|
||||
|
|
|
@ -17,6 +17,7 @@ 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\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ResetType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
@ -156,6 +157,19 @@ class PartFilterType extends AbstractType
|
|||
'step' => 1,
|
||||
]);
|
||||
|
||||
$builder->add('lotNeedsRefill', BooleanConstraintType::class, [
|
||||
'label' => 'part.filter.lotNeedsRefill'
|
||||
]);
|
||||
|
||||
$builder->add('lotUnknownAmount', BooleanConstraintType::class, [
|
||||
'label' => 'part.filter.lotUnknwonAmount'
|
||||
]);
|
||||
|
||||
$builder->add('lotExpirationDate', DateTimeConstraintType::class, [
|
||||
'label' => 'part.filter.lotExpirationDate',
|
||||
'input_type' => DateType::class,
|
||||
]);
|
||||
|
||||
/**
|
||||
* Attachments count
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue