@@ -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' => '', |
@@ -68,22 +68,22 @@ discard block |
||
| 68 | 68 | $builder |
| 69 | 69 | ->add('name', TextType::class, ['empty_data' => '', 'label' => 'name.label', |
| 70 | 70 | 'attr' => ['placeholder' => 'part.name.placeholder'], |
| 71 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 71 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 72 | 72 | |
| 73 | 73 | ->add('parent', StructuralEntityType::class, ['class' => \get_class($entity), |
| 74 | 74 | 'required' => false, 'label' => 'parent.label', |
| 75 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), ]) |
|
| 75 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), ]) |
|
| 76 | 76 | |
| 77 | 77 | ->add('not_selectable', CheckboxType::class, ['required' => false, |
| 78 | 78 | 'label' => 'entity.edit.not_selectable', |
| 79 | 79 | 'help' => 'entity.edit.not_selectable.help', |
| 80 | 80 | 'label_attr' => ['class' => 'checkbox-custom'], |
| 81 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 81 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 82 | 82 | |
| 83 | 83 | ->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '', |
| 84 | 84 | 'label' => 'comment.label', |
| 85 | 85 | 'attr' => ['rows' => 4], 'help' => 'bbcode.hint', |
| 86 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 86 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 87 | 87 | |
| 88 | 88 | $this->additionalFormElements($builder, $options, $entity); |
| 89 | 89 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | 'allow_add' => true, |
| 94 | 94 | 'allow_delete' => true, |
| 95 | 95 | 'label' => false, |
| 96 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 96 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 97 | 97 | 'entry_options' => [ |
| 98 | 98 | 'data_class' => $options['attachment_class'], |
| 99 | 99 | ], |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $builder->add('master_picture_attachment', MasterPictureAttachmentType::class, [ |
| 104 | 104 | 'required' => false, |
| 105 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 105 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 106 | 106 | 'label' => 'part.edit.master_attachment', |
| 107 | 107 | 'entity' => $entity, |
| 108 | 108 | ]); |
@@ -111,9 +111,9 @@ discard block |
||
| 111 | 111 | $builder->add('save', SubmitType::class, [ |
| 112 | 112 | 'label' => $is_new ? 'entity.create' : 'entity.edit.save', |
| 113 | 113 | 'attr' => ['class' => $is_new ? 'btn-success' : ''], |
| 114 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 114 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]) |
|
| 115 | 115 | ->add('reset', ResetType::class, ['label' => 'entity.edit.reset', |
| 116 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 116 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function additionalFormElements(FormBuilderInterface $builder, array $options, NamedDBElement $entity): void |
@@ -39,13 +39,13 @@ |
||
| 39 | 39 | 'label' => 'group.edit.enforce_2fa', |
| 40 | 40 | 'help' => 'entity.edit.enforce_2fa.help', |
| 41 | 41 | 'label_attr' => ['class' => 'checkbox-custom'], |
| 42 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 42 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 43 | 43 | ]); |
| 44 | 44 | |
| 45 | 45 | $builder->add('permissions', PermissionsType::class, [ |
| 46 | 46 | 'mapped' => false, |
| 47 | 47 | 'data' => $builder->getData(), |
| 48 | - 'disabled' => ! $this->security->isGranted('edit_permissions', $entity), |
|
| 48 | + 'disabled' => !$this->security->isGranted('edit_permissions', $entity), |
|
| 49 | 49 | ]); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $builder->add('address', TextareaType::class, [ |
| 41 | 41 | 'label' => 'company.edit.address', |
| 42 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 42 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 43 | 43 | 'attr' => ['placeholder' => 'company.edit.address.placeholder'], 'required' => false, |
| 44 | 44 | 'empty_data' => '', |
| 45 | 45 | ]); |
| 46 | 46 | |
| 47 | 47 | $builder->add('phone_number', TelType::class, [ |
| 48 | 48 | 'label' => 'company.edit.phone_number', |
| 49 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 49 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 50 | 50 | 'attr' => ['placeholder' => 'company.edit.phone_number.placeholder'], |
| 51 | 51 | 'required' => false, |
| 52 | 52 | 'empty_data' => '', |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $builder->add('fax_number', TelType::class, [ |
| 56 | 56 | 'label' => 'company.edit.fax_number', |
| 57 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 57 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 58 | 58 | 'attr' => ['placeholder' => 'company.fax_number.placeholder'], 'required' => false, |
| 59 | 59 | 'empty_data' => '', |
| 60 | 60 | ]); |
| 61 | 61 | |
| 62 | 62 | $builder->add('email_address', EmailType::class, [ |
| 63 | 63 | 'label' => 'company.edit.email', |
| 64 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 64 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 65 | 65 | 'attr' => ['placeholder' => 'company.edit.email.placeholder'], 'required' => false, |
| 66 | 66 | 'empty_data' => '', |
| 67 | 67 | ]); |
| 68 | 68 | |
| 69 | 69 | $builder->add('website', UrlType::class, [ |
| 70 | 70 | 'label' => 'company.edit.website', |
| 71 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 71 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 72 | 72 | 'attr' => ['placeholder' => 'company.edit.website.placeholder'], 'required' => false, |
| 73 | 73 | 'empty_data' => '', |
| 74 | 74 | ]); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $builder->add('auto_product_url', UrlType::class, [ |
| 77 | 77 | 'label' => 'company.edit.auto_product_url', |
| 78 | 78 | 'help' => 'company.edit.auto_product_url.help', |
| 79 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 79 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
| 80 | 80 | 'attr' => ['placeholder' => 'company.edit.auto_product_url.placeholder'], |
| 81 | 81 | 'required' => false, |
| 82 | 82 | 'empty_data' => '', |
@@ -39,17 +39,17 @@ |
||
| 39 | 39 | 'label' => 'measurement_unit.edit.is_integer', |
| 40 | 40 | 'help' => 'measurement_unit.edit.is_integer.help', |
| 41 | 41 | 'label_attr' => ['class' => 'checkbox-custom'], |
| 42 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 42 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 43 | 43 | |
| 44 | 44 | $builder->add('use_si_prefix', CheckboxType::class, ['required' => false, |
| 45 | 45 | 'label' => 'measurement_unit.edit.use_si_prefix', |
| 46 | 46 | 'help' => 'measurement_unit.edit.use_si_prefix.help', |
| 47 | 47 | 'label_attr' => ['class' => 'checkbox-custom'], |
| 48 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 48 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 49 | 49 | |
| 50 | 50 | $builder->add('unit', TextType::class, ['required' => false, |
| 51 | 51 | 'label' => 'measurement_unit.edit.unit_symbol', |
| 52 | 52 | 'attr' => ['placeholder' => 'measurement_unit.edit.unit_symbol.placeholder'], |
| 53 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 53 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), ]); |
|
| 54 | 54 | } |
| 55 | 55 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | //Disable import if user is not allowed to create elements. |
| 52 | 52 | $entity = new $data['entity_class'](); |
| 53 | 53 | $perm_name = 'create'; |
| 54 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
| 54 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
| 55 | 55 | |
| 56 | 56 | $builder |
| 57 | 57 | |