mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 20:35:08 +02:00
Fixed code style.
This commit is contained in:
parent
1aed1d1d26
commit
9a7223a301
142 changed files with 534 additions and 716 deletions
|
@ -28,7 +28,6 @@ use Symfony\Component\Form\CallbackTransformer;
|
|||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class AttachmentTypeAdminForm extends BaseEntityAdminForm
|
||||
{
|
||||
|
|
|
@ -38,7 +38,6 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class BaseEntityAdminForm extends AbstractType
|
||||
{
|
||||
|
@ -65,7 +64,7 @@ class BaseEntityAdminForm extends AbstractType
|
|||
|
||||
$builder
|
||||
->add('name', TextType::class, ['empty_data' => '', 'label' => 'name.label',
|
||||
'attr' => ['placeholder' =>'part.name.placeholder'],
|
||||
'attr' => ['placeholder' => 'part.name.placeholder'],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ])
|
||||
|
||||
->add('parent', StructuralEntityType::class, ['class' => \get_class($entity),
|
||||
|
|
|
@ -36,7 +36,7 @@ class GroupAdminForm extends BaseEntityAdminForm
|
|||
'label' => 'group.edit.enforce_2fa',
|
||||
'help' => 'entity.edit.enforce_2fa.help',
|
||||
'label_attr' => ['class' => 'checkbox-custom'],
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)
|
||||
'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity),
|
||||
]);
|
||||
|
||||
$builder->add('permissions', PermissionsType::class, [
|
||||
|
|
|
@ -31,7 +31,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class ImportType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -28,7 +28,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class MassCreationForm extends AbstractType
|
||||
{
|
||||
|
|
|
@ -38,7 +38,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Validator\Constraints\File;
|
||||
use Symfony\Component\Validator\Constraints\Url;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class AttachmentFormType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -36,13 +36,12 @@ use Symfony\Component\Form\FormEvent;
|
|||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class OrderdetailType extends AbstractType
|
||||
{
|
||||
protected $security;
|
||||
|
||||
public function __construct( Security $security)
|
||||
public function __construct(Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class PartBaseType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -33,7 +33,6 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class PartLotType extends AbstractType
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ class PricedetailType extends AbstractType
|
|||
]);
|
||||
$builder->add('currency', CurrencyEntityType::class, [
|
||||
'required' => false,
|
||||
'label' => false
|
||||
'label' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Validator\Constraints\ValidGoogleAuthCode;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
@ -33,11 +32,9 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class TFAGoogleSettingsType extends AbstractType
|
||||
{
|
||||
|
||||
protected $translator;
|
||||
|
||||
public function __construct()
|
||||
|
@ -46,20 +43,20 @@ class TFAGoogleSettingsType extends AbstractType
|
|||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) {
|
||||
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
|
||||
$form = $event->getForm();
|
||||
/** @var User $user */
|
||||
$user = $event->getData();
|
||||
|
||||
//Only show setup fields, when google authenticator is not enabled
|
||||
if(!$user->isGoogleAuthenticatorEnabled()) {
|
||||
if (!$user->isGoogleAuthenticatorEnabled()) {
|
||||
$form->add(
|
||||
'google_confirmation',
|
||||
TextType::class,
|
||||
[
|
||||
'mapped' => false,
|
||||
'attr' => ['maxlength' => '6', 'minlength' => '6', 'pattern' => '\d*', 'autocomplete' => 'off'],
|
||||
'constraints' => [new ValidGoogleAuthCode()]
|
||||
'constraints' => [new ValidGoogleAuthCode()],
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -72,12 +69,12 @@ class TFAGoogleSettingsType extends AbstractType
|
|||
);
|
||||
|
||||
$form->add('submit', SubmitType::class, [
|
||||
'label' => 'tfa_google.enable'
|
||||
'label' => 'tfa_google.enable',
|
||||
]);
|
||||
} else {
|
||||
$form->add('submit', SubmitType::class, [
|
||||
'label' =>'tfa_google.disable',
|
||||
'attr' => ['class' => 'btn-danger']
|
||||
'label' => 'tfa_google.disable',
|
||||
'attr' => ['class' => 'btn-danger'],
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
@ -91,4 +88,4 @@ class TFAGoogleSettingsType extends AbstractType
|
|||
'data_class' => User::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserAdminForm extends AbstractType
|
||||
{
|
||||
|
|
|
@ -34,7 +34,6 @@ use Symfony\Component\Form\Extension\Core\Type\TimezoneType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserSettingsType extends AbstractType
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue