Merge remote-tracking branch 'origin/master' into rector/rules-up-to-php74

This commit is contained in:
2023-04-27 23:32:31 +02:00
64 changed files with 584 additions and 577 deletions

View File

@@ -87,6 +87,7 @@ class ComposedRoleScopeType extends AbstractType
->add('scope', EntityType::class, [
'class' => Scope::class,
'choice_label' => static fn (Scope $scope) => $translatableStringHelper->localize($scope->getName()),
'placeholder' => 'Choose amongst scopes',
'required' => false,
'data' => null,
]);

View File

@@ -60,13 +60,15 @@ class ScopePickerType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$items = array_filter(
$this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
$options['center']
),
static fn (Scope $s) => $s->isActive()
$items = array_values(
array_filter(
$this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
$options['role'] instanceof Role ? $options['role']->getRole() : $options['role'],
$options['center']
),
static fn (Scope $s) => $s->isActive()
)
);
if (0 === count($items)) {

View File

@@ -241,7 +241,7 @@ class WorkflowStepType extends AbstractType
function ($step, ExecutionContextInterface $context, $payload) {
$form = $context->getObject();
foreach($form->get('future_dest_users')->getData() as $u) {
foreach ($form->get('future_dest_users')->getData() as $u) {
if (in_array($u, $form->get('future_cc_users')->getData(), true)) {
$context
->buildViolation('workflow.The user in cc cannot be a dest user in the same workflow step')