mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Merge remote-tracking branch 'origin/master' into rector/rules-up-to-php74
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
|
@@ -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)) {
|
||||
|
@@ -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')
|
||||
|
Reference in New Issue
Block a user