@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $builder->add('downloadURL', CheckboxType::class, ['required' => false, |
98 | 98 | 'label' => 'attachment.edit.download_url', |
99 | 99 | 'mapped' => false, |
100 | - 'disabled' => ! $this->allow_attachments_download, |
|
100 | + 'disabled' => !$this->allow_attachments_download, |
|
101 | 101 | 'attr' => ['class' => 'form-control-sm'], |
102 | 102 | 'label_attr' => ['class' => 'checkbox-custom'], ]); |
103 | 103 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | //Check the secure file checkbox, if file is in securefile location |
118 | 118 | $builder->get('secureFile')->addEventListener( |
119 | 119 | FormEvents::PRE_SET_DATA, |
120 | - function (FormEvent $event): void { |
|
120 | + function(FormEvent $event): void { |
|
121 | 121 | $attachment = $event->getForm()->getParent()->getData(); |
122 | 122 | if ($attachment instanceof Attachment) { |
123 | 123 | $event->setData($attachment->isSecure()); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | public function buildForm(FormBuilderInterface $builder, array $options): void |
63 | 63 | { |
64 | 64 | $builder->addModelTransformer(new CallbackTransformer( |
65 | - function ($value) use ($options) { |
|
65 | + function($value) use ($options) { |
|
66 | 66 | return $this->transform($value, $options); |
67 | - }, function ($value) use ($options) { |
|
67 | + }, function($value) use ($options) { |
|
68 | 68 | return $this->reverseTransform($value, $options); |
69 | 69 | })); |
70 | 70 | } |
@@ -74,23 +74,23 @@ discard block |
||
74 | 74 | $resolver->setRequired(['class']); |
75 | 75 | $resolver->setDefaults([ |
76 | 76 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
77 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
78 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
77 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
78 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
79 | 79 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
80 | - 'choice_loader' => function (Options $options) { |
|
81 | - return new CallbackChoiceLoader(function () use ($options) { |
|
80 | + 'choice_loader' => function(Options $options) { |
|
81 | + return new CallbackChoiceLoader(function() use ($options) { |
|
82 | 82 | return $this->getEntries($options); |
83 | 83 | }); |
84 | - }, 'choice_label' => function ($choice, $key, $value) { |
|
84 | + }, 'choice_label' => function($choice, $key, $value) { |
|
85 | 85 | return $this->generateChoiceLabels($choice, $key, $value); |
86 | - }, 'choice_attr' => function ($choice, $key, $value) { |
|
86 | + }, 'choice_attr' => function($choice, $key, $value) { |
|
87 | 87 | return $this->generateChoiceAttr($choice, $key, $value); |
88 | 88 | }, |
89 | 89 | ]); |
90 | 90 | |
91 | 91 | $resolver->setDefault('empty_message', null); |
92 | 92 | |
93 | - $resolver->setDefault('attr', function (Options $options) { |
|
93 | + $resolver->setDefault('attr', function(Options $options) { |
|
94 | 94 | $tmp = ['class' => 'selectpicker', 'data-live-search' => true]; |
95 | 95 | if ($options['empty_message']) { |
96 | 96 | $tmp['data-none-Selected-Text'] = $options['empty_message']; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // This options allows you to override the currency shown for the null value |
54 | 54 | $resolver->setDefault('base_currency', null); |
55 | 55 | |
56 | - $resolver->setDefault('empty_message', function (Options $options) { |
|
56 | + $resolver->setDefault('empty_message', function(Options $options) { |
|
57 | 57 | //By default we use the global base currency: |
58 | 58 | $iso_code = $this->base_currency; |
59 | 59 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | /** @var Currency $choice */ |
95 | 95 | $tmp = []; |
96 | 96 | |
97 | - if (! empty($choice->getIsoCode())) { |
|
97 | + if (!empty($choice->getIsoCode())) { |
|
98 | 98 | //Show the name of the currency |
99 | 99 | $tmp += ['data-subtext' => $choice->getName()]; |
100 | 100 | } |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | $resolver->setDefaults([ |
43 | 43 | 'filter' => 'picture', |
44 | 44 | 'attr' => ['class' => 'selectpicker'], |
45 | - 'choice_attr' => function (Options $options) { |
|
46 | - return function ($choice, $key, $value) use ($options) { |
|
45 | + 'choice_attr' => function(Options $options) { |
|
46 | + return function($choice, $key, $value) use ($options) { |
|
47 | 47 | /** @var Attachment $choice */ |
48 | 48 | $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL']; |
49 | 49 | |
50 | - if ('picture' === $options['filter'] && ! $choice->isPicture()) { |
|
50 | + if ('picture' === $options['filter'] && !$choice->isPicture()) { |
|
51 | 51 | $tmp += ['disabled' => 'disabled']; |
52 | - } elseif ('3d_model' === $options['filter'] && ! $choice->is3DModel()) { |
|
52 | + } elseif ('3d_model' === $options['filter'] && !$choice->is3DModel()) { |
|
53 | 53 | $tmp += ['disabled' => 'disabled']; |
54 | 54 | } |
55 | 55 | |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | }; |
58 | 58 | }, |
59 | 59 | 'choice_label' => 'name', |
60 | - 'class' => function (Options $options) { |
|
60 | + 'class' => function(Options $options) { |
|
61 | 61 | $short_class_name = (new \ReflectionClass($options['entity']))->getShortName(); |
62 | 62 | //Category becomes CategoryAttachment |
63 | 63 | return 'App\\Entity\\Attachments\\'.$short_class_name.'Attachment'; |
64 | 64 | }, |
65 | - 'query_builder' => function (Options $options) { |
|
66 | - return function (EntityRepository $er) use ($options) { |
|
65 | + 'query_builder' => function(Options $options) { |
|
66 | + return function(EntityRepository $er) use ($options) { |
|
67 | 67 | $entity = $options['entity']; |
68 | 68 | if (null === $entity->getID()) { |
69 | 69 | //This query is always false, so we get empty results |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $resolver->setDefaults([ |
52 | 52 | 'measurement_unit' => null, |
53 | - 'show_prefix' => function (Options $options) { |
|
53 | + 'show_prefix' => function(Options $options) { |
|
54 | 54 | if (null !== $options['measurement_unit']) { |
55 | 55 | /** @var MeasurementUnit $unit */ |
56 | 56 | $unit = $options['measurement_unit']; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | return false; |
62 | 62 | }, |
63 | - 'is_integer' => function (Options $options) { |
|
63 | + 'is_integer' => function(Options $options) { |
|
64 | 64 | if (null !== $options['measurement_unit']) { |
65 | 65 | /** @var MeasurementUnit $unit */ |
66 | 66 | $unit = $options['measurement_unit']; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | return false; |
72 | 72 | }, |
73 | - 'unit' => function (Options $options) { |
|
73 | + 'unit' => function(Options $options) { |
|
74 | 74 | if (null !== $options['measurement_unit']) { |
75 | 75 | /** @var MeasurementUnit $unit */ |
76 | 76 | $unit = $options['measurement_unit']; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $resolver->setDefaults([ |
91 | 91 | 'min' => 0, |
92 | 92 | 'max' => '', |
93 | - 'step' => function (Options $options) { |
|
93 | + 'step' => function(Options $options) { |
|
94 | 94 | if (true === $options['is_integer']) { |
95 | 95 | return 1; |
96 | 96 | } |
@@ -54,27 +54,27 @@ discard block |
||
54 | 54 | $builder |
55 | 55 | ->add('name', TextType::class, [ |
56 | 56 | 'label' => 'user.username.label', |
57 | - 'disabled' => ! $this->security->isGranted('edit_username', $options['data']) || $this->demo_mode, |
|
57 | + 'disabled' => !$this->security->isGranted('edit_username', $options['data']) || $this->demo_mode, |
|
58 | 58 | ]) |
59 | 59 | ->add('first_name', TextType::class, [ |
60 | 60 | 'required' => false, |
61 | 61 | 'label' => 'user.firstName.label', |
62 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
62 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
63 | 63 | ]) |
64 | 64 | ->add('last_name', TextType::class, [ |
65 | 65 | 'required' => false, |
66 | 66 | 'label' => 'user.lastName.label', |
67 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
67 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
68 | 68 | ]) |
69 | 69 | ->add('department', TextType::class, [ |
70 | 70 | 'required' => false, |
71 | 71 | 'label' => 'user.department.label', |
72 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
72 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
73 | 73 | ]) |
74 | 74 | ->add('email', EmailType::class, [ |
75 | 75 | 'required' => false, |
76 | 76 | 'label' => 'user.email.label', |
77 | - 'disabled' => ! $this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
77 | + 'disabled' => !$this->security->isGranted('edit_infos', $options['data']) || $this->demo_mode, |
|
78 | 78 | ]) |
79 | 79 | ->add('language', LanguageType::class, [ |
80 | 80 | 'disabled' => $this->demo_mode, |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'required' => false, |
98 | 98 | 'attr' => ['class' => 'selectpicker'], |
99 | 99 | 'choices' => User::AVAILABLE_THEMES, |
100 | - 'choice_label' => function ($entity, $key, $value) { |
|
100 | + 'choice_label' => function($entity, $key, $value) { |
|
101 | 101 | return $value; |
102 | 102 | }, |
103 | 103 | 'placeholder' => 'user_settings.theme.placeholder', |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | 'empty_data' => '', |
75 | 75 | 'label' => 'user.username.label', |
76 | 76 | 'attr' => ['placeholder' => 'user.username.placeholder'], |
77 | - 'disabled' => ! $this->security->isGranted('edit_username', $entity), |
|
77 | + 'disabled' => !$this->security->isGranted('edit_username', $entity), |
|
78 | 78 | ]) |
79 | 79 | |
80 | 80 | ->add('group', StructuralEntityType::class, [ |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | 'required' => false, |
83 | 83 | 'label' => 'group.label', |
84 | 84 | 'disable_not_selectable' => true, |
85 | - 'disabled' => ! $this->security->isGranted('change_group', $entity), ]) |
|
85 | + 'disabled' => !$this->security->isGranted('change_group', $entity), ]) |
|
86 | 86 | |
87 | 87 | ->add('first_name', TextType::class, [ |
88 | 88 | 'empty_data' => '', |
89 | 89 | 'label' => 'user.firstName.label', |
90 | 90 | 'attr' => ['placeholder' => 'user.firstName.placeholder'], 'required' => false, |
91 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
91 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
92 | 92 | ]) |
93 | 93 | |
94 | 94 | ->add('last_name', TextType::class, [ |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'label' => 'user.lastName.label', |
97 | 97 | 'attr' => ['placeholder' => 'user.lastName.placeholder'], |
98 | 98 | 'required' => false, |
99 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
99 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
100 | 100 | ]) |
101 | 101 | |
102 | 102 | ->add('email', TextType::class, [ |
@@ -104,14 +104,14 @@ discard block |
||
104 | 104 | 'label' => 'user.email.label', |
105 | 105 | 'attr' => ['placeholder' => 'user.email.placeholder'], |
106 | 106 | 'required' => false, |
107 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), ]) |
|
107 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), ]) |
|
108 | 108 | |
109 | 109 | ->add('department', TextType::class, [ |
110 | 110 | 'empty_data' => '', |
111 | 111 | 'label' => 'user.department.label', |
112 | 112 | 'attr' => ['placeholder' => 'user.department.placeholder'], |
113 | 113 | 'required' => false, |
114 | - 'disabled' => ! $this->security->isGranted('edit_infos', $entity), |
|
114 | + 'disabled' => !$this->security->isGranted('edit_infos', $entity), |
|
115 | 115 | ]) |
116 | 116 | |
117 | 117 | //Config section |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'placeholder' => 'user_settings.language.placeholder', |
122 | 122 | 'label' => 'user.language_select', |
123 | 123 | 'preferred_choices' => ['en', 'de'], |
124 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
124 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
125 | 125 | ]) |
126 | 126 | ->add('timezone', TimezoneType::class, [ |
127 | 127 | 'required' => false, |
@@ -129,23 +129,23 @@ discard block |
||
129 | 129 | 'placeholder' => 'user_settings.timezone.placeholder', |
130 | 130 | 'label' => 'user.timezone.label', |
131 | 131 | 'preferred_choices' => ['Europe/Berlin'], |
132 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
132 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
133 | 133 | ]) |
134 | 134 | ->add('theme', ChoiceType::class, [ |
135 | 135 | 'required' => false, |
136 | 136 | 'choices' => User::AVAILABLE_THEMES, |
137 | - 'choice_label' => function ($entity, $key, $value) { |
|
137 | + 'choice_label' => function($entity, $key, $value) { |
|
138 | 138 | return $value; |
139 | 139 | }, |
140 | 140 | 'attr' => ['class' => 'selectpicker'], |
141 | 141 | 'placeholder' => 'user_settings.theme.placeholder', |
142 | 142 | 'label' => 'user.theme.label', |
143 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
143 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
144 | 144 | ]) |
145 | 145 | ->add('currency', CurrencyEntityType::class, [ |
146 | 146 | 'required' => false, |
147 | 147 | 'label' => 'user.currency.label', |
148 | - 'disabled' => ! $this->security->isGranted('change_user_settings', $entity), |
|
148 | + 'disabled' => !$this->security->isGranted('change_user_settings', $entity), |
|
149 | 149 | ]) |
150 | 150 | |
151 | 151 | ->add('new_password', RepeatedType::class, [ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | 'invalid_message' => 'password_must_match', |
156 | 156 | 'required' => false, |
157 | 157 | 'mapped' => false, |
158 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
158 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
159 | 159 | 'constraints' => [new Length([ |
160 | 160 | 'min' => 6, |
161 | 161 | 'max' => 128, |
@@ -166,14 +166,14 @@ discard block |
||
166 | 166 | 'required' => false, |
167 | 167 | 'label_attr' => ['class' => 'checkbox-custom'], |
168 | 168 | 'label' => 'user.edit.needs_pw_change', |
169 | - 'disabled' => ! $this->security->isGranted('set_password', $entity), |
|
169 | + 'disabled' => !$this->security->isGranted('set_password', $entity), |
|
170 | 170 | ]) |
171 | 171 | |
172 | 172 | ->add('disabled', CheckboxType::class, [ |
173 | 173 | 'required' => false, |
174 | 174 | 'label_attr' => ['class' => 'checkbox-custom'], |
175 | 175 | 'label' => 'user.edit.user_disabled', |
176 | - 'disabled' => ! $this->security->isGranted('set_password', $entity) |
|
176 | + 'disabled' => !$this->security->isGranted('set_password', $entity) |
|
177 | 177 | || $entity === $this->security->getUser(), |
178 | 178 | ]) |
179 | 179 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ->add('permissions', PermissionsType::class, [ |
182 | 182 | 'mapped' => false, |
183 | 183 | 'data' => $builder->getData(), |
184 | - 'disabled' => ! $this->security->isGranted('edit_permissions', $entity), |
|
184 | + 'disabled' => !$this->security->isGranted('edit_permissions', $entity), |
|
185 | 185 | ]) |
186 | 186 | ; |
187 | 187 | /*->add('comment', CKEditorType::class, ['required' => false, |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'data_class' => $options['attachment_class'], |
201 | 201 | ], |
202 | 202 | 'by_reference' => false, |
203 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
203 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
204 | 204 | ]); |
205 | 205 | |
206 | 206 | //Buttons |
@@ -43,14 +43,14 @@ |
||
43 | 43 | 'required' => false, |
44 | 44 | 'label' => 'supplier.edit.default_currency', |
45 | 45 | 'disable_not_selectable' => true, |
46 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); |
|
46 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]); |
|
47 | 47 | |
48 | 48 | $builder->add('shipping_costs', MoneyType::class, [ |
49 | 49 | 'required' => false, |
50 | 50 | 'currency' => $this->params->get('default_currency'), |
51 | 51 | 'scale' => 3, |
52 | 52 | 'label' => 'supplier.shipping_costs.label', |
53 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
53 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
54 | 54 | ]); |
55 | 55 | } |
56 | 56 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | //Disable import if user is not allowed to create elements. |
49 | 49 | $entity = new $data['entity_class'](); |
50 | 50 | $perm_name = 'create'; |
51 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
51 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
52 | 52 | |
53 | 53 | $builder |
54 | 54 | ->add('lines', TextareaType::class, ['data' => '', |