mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-20 10:21:32 +00:00
Use TristateCheckboxes for parameter and orderdetail types
This commit is contained in:
parent
9b8ddc0c0b
commit
dd60cb1110
3 changed files with 4 additions and 3 deletions
|
|
@ -57,7 +57,7 @@ class BatchEdaController extends AbstractController
|
|||
$redirectUrl = $request->query->getString('_redirect', '');
|
||||
|
||||
//Parse part IDs and load parts
|
||||
$idArray = array_filter(array_map('intval', explode(',', $ids)), static fn (int $id): bool => $id > 0);
|
||||
$idArray = array_filter(array_map(intval(...), explode(',', $ids)), static fn (int $id): bool => $id > 0);
|
||||
$parts = $this->entityManager->getRepository(Part::class)->findBy(['id' => $idArray]);
|
||||
|
||||
if ($parts === []) {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ use App\Entity\Parameters\StorageLocationParameter;
|
|||
use App\Entity\Parameters\SupplierParameter;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Form\Type\ExponentialNumberType;
|
||||
use App\Form\Type\TriStateCheckboxType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
|
|
@ -151,7 +152,7 @@ class ParameterType extends AbstractType
|
|||
|
||||
// Only show the EDA visibility field for part parameters, as it has no function for other entities
|
||||
if ($options['data_class'] === PartParameter::class) {
|
||||
$builder->add('eda_visibility', CheckboxType::class, [
|
||||
$builder->add('eda_visibility', TriStateCheckboxType::class, [
|
||||
'label' => false,
|
||||
'required' => false,
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class OrderdetailType extends AbstractType
|
|||
'label' => 'orderdetails.edit.prices_includes_vat',
|
||||
]);
|
||||
|
||||
$builder->add('eda_visibility', CheckboxType::class, [
|
||||
$builder->add('eda_visibility', TriStateCheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'orderdetails.edit.eda_visibility',
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue