mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 10:14:44 +02:00
Applied symplify rules to codebase.
This commit is contained in:
parent
2f20d90041
commit
388e847b17
136 changed files with 1370 additions and 789 deletions
|
@ -56,13 +56,16 @@ class OrderdetailType extends AbstractType
|
|||
|
||||
$builder->add('supplierpartnr', TextType::class, [
|
||||
'label' => 'orderdetails.edit.supplierpartnr',
|
||||
'attr' => ['placeholder' => 'orderdetails.edit.supplierpartnr.placeholder'],
|
||||
'attr' => [
|
||||
'placeholder' => 'orderdetails.edit.supplierpartnr.placeholder',
|
||||
],
|
||||
'required' => false,
|
||||
'empty_data' => '',
|
||||
]);
|
||||
|
||||
$builder->add('supplier', StructuralEntityType::class, [
|
||||
'class' => Supplier::class, 'disable_not_selectable' => true,
|
||||
'class' => Supplier::class,
|
||||
'disable_not_selectable' => true,
|
||||
'label' => 'orderdetails.edit.supplier',
|
||||
]);
|
||||
|
||||
|
@ -74,7 +77,9 @@ class OrderdetailType extends AbstractType
|
|||
|
||||
$builder->add('obsolete', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'label' => 'orderdetails.edit.obsolete',
|
||||
]);
|
||||
|
||||
|
|
|
@ -81,7 +81,9 @@ class PartBaseType extends AbstractType
|
|||
->add('name', TextType::class, [
|
||||
'empty_data' => '',
|
||||
'label' => 'part.edit.name',
|
||||
'attr' => ['placeholder' => 'part.edit.name.placeholder'],
|
||||
'attr' => [
|
||||
'placeholder' => 'part.edit.name.placeholder',
|
||||
],
|
||||
'disabled' => ! $this->security->isGranted('name.edit', $part),
|
||||
])
|
||||
->add('description', CKEditorType::class, [
|
||||
|
@ -89,11 +91,17 @@ class PartBaseType extends AbstractType
|
|||
'empty_data' => '',
|
||||
'label' => 'part.edit.description',
|
||||
'config_name' => 'description_config',
|
||||
'attr' => ['placeholder' => 'part.edit.description.placeholder', 'rows' => 2],
|
||||
'attr' => [
|
||||
'placeholder' => 'part.edit.description.placeholder',
|
||||
'rows' => 2,
|
||||
],
|
||||
'disabled' => ! $this->security->isGranted('description.edit', $part),
|
||||
])
|
||||
->add('minAmount', SIUnitType::class, [
|
||||
'attr' => ['min' => 0, 'placeholder' => 'part.editmininstock.placeholder'],
|
||||
'attr' => [
|
||||
'min' => 0,
|
||||
'placeholder' => 'part.editmininstock.placeholder',
|
||||
],
|
||||
'label' => 'part.edit.mininstock',
|
||||
'measurement_unit' => $part->getPartUnit(),
|
||||
'disabled' => ! $this->security->isGranted('minamount.edit', $part),
|
||||
|
@ -117,7 +125,8 @@ class PartBaseType extends AbstractType
|
|||
'empty_data' => '',
|
||||
'attr' => [
|
||||
'class' => 'tagsinput',
|
||||
'data-autocomplete' => $this->urlGenerator->generate('typeahead_tags', ['query' => 'QUERY']), ],
|
||||
'data-autocomplete' => $this->urlGenerator->generate('typeahead_tags', ['query' => 'QUERY']),
|
||||
],
|
||||
'disabled' => ! $this->security->isGranted('tags.edit', $part),
|
||||
]);
|
||||
|
||||
|
@ -139,7 +148,8 @@ class PartBaseType extends AbstractType
|
|||
'required' => false,
|
||||
'empty_data' => '',
|
||||
'label' => 'part.edit.mpn',
|
||||
'disabled' => ! $this->security->isGranted('mpn.edit', $part), ])
|
||||
'disabled' => ! $this->security->isGranted('mpn.edit', $part),
|
||||
])
|
||||
->add('manufacturing_status', ChoiceType::class, [
|
||||
'label' => 'part.edit.manufacturing_status',
|
||||
'choices' => $status_choices,
|
||||
|
@ -149,13 +159,17 @@ class PartBaseType extends AbstractType
|
|||
|
||||
//Advanced section
|
||||
$builder->add('needsReview', CheckboxType::class, [
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'required' => false,
|
||||
'label' => 'part.edit.needs_review',
|
||||
'disabled' => ! $this->security->isGranted('edit', $part),
|
||||
])
|
||||
->add('favorite', CheckboxType::class, [
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'required' => false,
|
||||
'label' => 'part.edit.is_favorite',
|
||||
'disabled' => ! $this->security->isGranted('change_favorite', $part),
|
||||
|
@ -178,8 +192,11 @@ class PartBaseType extends AbstractType
|
|||
$builder->add('comment', CKEditorType::class, [
|
||||
'required' => false,
|
||||
'label' => 'part.edit.comment',
|
||||
'attr' => ['rows' => 4],
|
||||
'disabled' => ! $this->security->isGranted('comment.edit', $part), 'empty_data' => '',
|
||||
'attr' => [
|
||||
'rows' => 4,
|
||||
],
|
||||
'disabled' => ! $this->security->isGranted('comment.edit', $part),
|
||||
'empty_data' => '',
|
||||
]);
|
||||
|
||||
//Part Lots section
|
||||
|
|
|
@ -52,43 +52,65 @@ class PartLotType extends AbstractType
|
|||
'label' => 'part_lot.edit.description',
|
||||
'required' => false,
|
||||
'empty_data' => '',
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('storage_location', StructuralEntityType::class, ['class' => Storelocation::class,
|
||||
$builder->add('storage_location', StructuralEntityType::class, [
|
||||
'class' => Storelocation::class,
|
||||
'label' => 'part_lot.edit.location',
|
||||
'required' => false,
|
||||
'disable_not_selectable' => true,
|
||||
'attr' => ['class' => 'selectpicker form-control-sm', 'data-live-search' => true],
|
||||
'attr' => [
|
||||
'class' => 'selectpicker form-control-sm',
|
||||
'data-live-search' => true,
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('amount', SIUnitType::class, [
|
||||
'measurement_unit' => $options['measurement_unit'],
|
||||
'label' => 'part_lot.edit.amount',
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('instock_unknown', CheckboxType::class, ['required' => false,
|
||||
$builder->add('instock_unknown', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'part_lot.edit.instock_unknown',
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('needs_refill', CheckboxType::class, ['label_attr' => ['class' => 'checkbox-custom'],
|
||||
$builder->add('needs_refill', CheckboxType::class, [
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'label' => 'part_lot.edit.needs_refill',
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'required' => false,
|
||||
]);
|
||||
|
||||
$builder->add('expirationDate', DateTimeType::class, [
|
||||
'label' => 'part_lot.edit.expiration_date',
|
||||
'attr' => [],
|
||||
'required' => false, ]);
|
||||
'required' => false,
|
||||
]);
|
||||
|
||||
$builder->add('comment', TextType::class, [
|
||||
'label' => 'part_lot.edit.comment',
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'required' => false, 'empty_data' => '',
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'required' => false,
|
||||
'empty_data' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,18 +41,25 @@ class PricedetailType extends AbstractType
|
|||
$builder->add('min_discount_quantity', SIUnitType::class, [
|
||||
'label' => false,
|
||||
'measurement_unit' => $options['measurement_unit'],
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
]);
|
||||
$builder->add('price_related_quantity', SIUnitType::class, [
|
||||
'label' => false,
|
||||
'measurement_unit' => $options['measurement_unit'],
|
||||
'attr' => ['class' => 'form-control-sm'],
|
||||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
]);
|
||||
$builder->add('price', NumberType::class, [
|
||||
'label' => false,
|
||||
'scale' => 5,
|
||||
'html5' => true,
|
||||
'attr' => ['min' => 0, 'step' => 'any'],
|
||||
'attr' => [
|
||||
'min' => 0,
|
||||
'step' => 'any',
|
||||
],
|
||||
]);
|
||||
$builder->add('currency', CurrencyEntityType::class, [
|
||||
'required' => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue