mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 23:14:36 +02:00
Use bootstrap 5 checkboxes.
This commit is contained in:
parent
017170e2d6
commit
43b4c78553
21 changed files with 59 additions and 134 deletions
|
@ -111,9 +111,6 @@ class BaseEntityAdminForm extends AbstractType
|
|||
'required' => false,
|
||||
'label' => 'entity.edit.not_selectable',
|
||||
'help' => 'entity.edit.not_selectable.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]
|
||||
);
|
||||
|
|
|
@ -57,9 +57,6 @@ class CategoryAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'category.edit.disable_footprints',
|
||||
'help' => 'category.edit.disable_footprints.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
@ -67,9 +64,6 @@ class CategoryAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'category.edit.disable_manufacturers',
|
||||
'help' => 'category.edit.disable_manufacturers.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
@ -77,9 +71,6 @@ class CategoryAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'category.edit.disable_autodatasheets',
|
||||
'help' => 'category.edit.disable_autodatasheets.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
@ -87,9 +78,6 @@ class CategoryAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'category.edit.disable_properties',
|
||||
'help' => 'category.edit.disable_properties.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
|
|
@ -57,9 +57,6 @@ class GroupAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'group.edit.enforce_2fa',
|
||||
'help' => 'group.edit.enforce_2fa.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
|
|
@ -112,9 +112,6 @@ class ImportType extends AbstractType
|
|||
'data' => true,
|
||||
'required' => false,
|
||||
'label' => 'import.preserve_children',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => $disabled,
|
||||
])
|
||||
->add('abort_on_validation_error', CheckboxType::class, [
|
||||
|
@ -122,9 +119,6 @@ class ImportType extends AbstractType
|
|||
'required' => false,
|
||||
'label' => 'import.abort_on_validation',
|
||||
'help' => 'import.abort_on_validation.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => $disabled,
|
||||
])
|
||||
|
||||
|
|
|
@ -44,9 +44,6 @@ class LabelProfileAdminForm extends BaseEntityAdminForm
|
|||
$builder->add('show_in_dropdown', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'label_profile.showInDropdown',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
]);
|
||||
$builder->add('options', LabelOptionsType::class, [
|
||||
'label' => false,
|
||||
|
|
|
@ -57,9 +57,6 @@ class MeasurementUnitAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'measurement_unit.edit.is_integer',
|
||||
'help' => 'measurement_unit.edit.is_integer.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
@ -67,9 +64,6 @@ class MeasurementUnitAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'measurement_unit.edit.use_si_prefix',
|
||||
'help' => 'measurement_unit.edit.use_si_prefix.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
|
|
|
@ -58,9 +58,6 @@ class StorelocationAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'storelocation.edit.is_full.label',
|
||||
'help' => 'storelocation.edit.is_full.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
|
||||
]);
|
||||
|
||||
|
@ -68,9 +65,6 @@ class StorelocationAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'storelocation.limit_to_existing.label',
|
||||
'help' => 'storelocation.limit_to_existing.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
|
||||
]);
|
||||
|
||||
|
@ -78,9 +72,6 @@ class StorelocationAdminForm extends BaseEntityAdminForm
|
|||
'required' => false,
|
||||
'label' => 'storelocation.only_single_part.label',
|
||||
'help' => 'storelocation.only_single_part.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
|
||||
]);
|
||||
|
||||
|
|
|
@ -106,9 +106,6 @@ class AttachmentFormType extends AbstractType
|
|||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('secureFile', CheckboxType::class, [
|
||||
|
@ -120,9 +117,6 @@ class AttachmentFormType extends AbstractType
|
|||
'class' => 'form-control-sm',
|
||||
],
|
||||
'help' => 'attachment.edit.secure_file.help',
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('url', TextType::class, [
|
||||
|
@ -147,9 +141,6 @@ class AttachmentFormType extends AbstractType
|
|||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
]);
|
||||
|
||||
$builder->add('file', FileType::class, [
|
||||
|
|
|
@ -92,9 +92,6 @@ class OrderdetailType extends AbstractType
|
|||
|
||||
$builder->add('obsolete', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'label' => 'orderdetails.edit.obsolete',
|
||||
]);
|
||||
|
||||
|
|
|
@ -182,17 +182,11 @@ class PartBaseType extends AbstractType
|
|||
|
||||
//Advanced section
|
||||
$builder->add('needsReview', CheckboxType::class, [
|
||||
'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',
|
||||
],
|
||||
'required' => false,
|
||||
'label' => 'part.edit.is_favorite',
|
||||
'disabled' => !$this->security->isGranted('change_favorite', $part),
|
||||
|
|
|
@ -103,15 +103,9 @@ class PartLotType extends AbstractType
|
|||
'attr' => [
|
||||
'class' => 'form-control-sm',
|
||||
],
|
||||
'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',
|
||||
|
|
|
@ -61,9 +61,6 @@ final class TriStateCheckboxType extends AbstractType implements DataTransformer
|
|||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom checkbox-inline',
|
||||
],
|
||||
'attr' => [
|
||||
'class' => 'tristate',
|
||||
],
|
||||
|
|
|
@ -214,18 +214,12 @@ class UserAdminForm extends AbstractType
|
|||
|
||||
->add('need_pw_change', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'label' => 'user.edit.needs_pw_change',
|
||||
'disabled' => !$this->security->isGranted('set_password', $entity),
|
||||
])
|
||||
|
||||
->add('disabled', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label_attr' => [
|
||||
'class' => 'checkbox-custom',
|
||||
],
|
||||
'label' => 'user.edit.user_disabled',
|
||||
'disabled' => !$this->security->isGranted('set_password', $entity)
|
||||
|| $entity === $this->security->getUser(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue