mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 06:54:34 +02:00
Allow to scan IPN barcodes using the built in barcode scanner
This improves issue #373
This commit is contained in:
parent
3953e36921
commit
5cfccab671
9 changed files with 1480 additions and 1397 deletions
|
@ -41,7 +41,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Form\LabelSystem;
|
||||
|
||||
use App\Services\LabelSystem\Barcodes\BarcodeSourceType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
@ -59,6 +61,20 @@ class ScanDialogType extends AbstractType
|
|||
],
|
||||
]);
|
||||
|
||||
$builder->add('mode', EnumType::class, [
|
||||
'label' => 'scan_dialog.mode',
|
||||
'expanded' => true,
|
||||
'class' => BarcodeSourceType::class,
|
||||
'required' => false,
|
||||
'placeholder' => 'scan_dialog.mode.auto',
|
||||
'choice_label' => fn (?BarcodeSourceType $enum) => match($enum) {
|
||||
null => 'scan_dialog.mode.auto',
|
||||
BarcodeSourceType::INTERNAL => 'scan_dialog.mode.internal',
|
||||
BarcodeSourceType::IPN => 'scan_dialog.mode.ipn',
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
$builder->add('submit', SubmitType::class, [
|
||||
'label' => 'scan_dialog.submit',
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue