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 refactor-using-rector-202303
This commit is contained in:
@@ -43,11 +43,13 @@ class AddressDataMapper implements DataMapperInterface
|
||||
/** @var FormInterface $form */
|
||||
switch ($key) {
|
||||
case 'streetAddress1':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress1());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$form->setData($address->getStreetAddress2());
|
||||
|
||||
break;
|
||||
@@ -110,11 +112,13 @@ class AddressDataMapper implements DataMapperInterface
|
||||
|
||||
return;
|
||||
}
|
||||
/** @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress1($form->getData());
|
||||
|
||||
break;
|
||||
|
||||
case 'streetAddress2':
|
||||
/** @phpstan-ignore-next-line */
|
||||
$address->setStreetAddress2($form->getData());
|
||||
|
||||
break;
|
||||
|
@@ -38,7 +38,7 @@ class RollingDateDataMapper implements DataMapperInterface
|
||||
$forms = iterator_to_array($forms);
|
||||
|
||||
$viewData = new RollingDate(
|
||||
$forms['roll']->getData(),
|
||||
($forms['roll']->getData() ?? RollingDate::T_TODAY),
|
||||
$forms['fixedDate']->getData()
|
||||
);
|
||||
}
|
||||
|
@@ -31,8 +31,6 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface
|
||||
* Transforms a string (id) to an object (item).
|
||||
*
|
||||
* @param mixed $array
|
||||
*
|
||||
* @return ArrayCollection
|
||||
*/
|
||||
public function reverseTransform($array)
|
||||
{
|
||||
@@ -53,10 +51,8 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface
|
||||
* Transforms an object (use) to a string (id).
|
||||
*
|
||||
* @param array $array
|
||||
*
|
||||
* @return ArrayCollection
|
||||
*/
|
||||
public function transform($array)
|
||||
public function transform($array): array
|
||||
{
|
||||
$ret = [];
|
||||
|
||||
|
@@ -156,6 +156,13 @@ class WorkflowStepType extends AbstractType
|
||||
'mapped' => false,
|
||||
'suggested' => $options['suggested_users'],
|
||||
])
|
||||
->add('future_cc_users', PickUserDynamicType::class, [
|
||||
'label' => 'workflow.cc for next steps',
|
||||
'multiple' => true,
|
||||
'mapped' => false,
|
||||
'required' => false,
|
||||
'suggested' => $options['suggested_users'],
|
||||
])
|
||||
->add('future_dest_emails', ChillCollectionType::class, [
|
||||
'label' => 'workflow.dest by email',
|
||||
'help' => 'workflow.dest by email help',
|
||||
@@ -236,6 +243,20 @@ class WorkflowStepType extends AbstractType
|
||||
}
|
||||
}
|
||||
),
|
||||
new Callback(
|
||||
function ($step, ExecutionContextInterface $context, $payload) {
|
||||
$form = $context->getObject();
|
||||
|
||||
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')
|
||||
->atPath('ccUsers')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user