mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
Add suggested thirdparties, with same parent, for thirdparties of kind 'child'
This commit is contained in:
parent
3d397c0145
commit
58291c7402
@ -31,7 +31,13 @@ class ThirdpartyDuplicateController extends AbstractController
|
||||
#[Route(path: '/{_locale}/3party/{thirdparty_id}/find-manually', name: 'chill_thirdparty_find_duplicate')]
|
||||
public function findManuallyDuplicateAction(ThirdParty $thirdparty, Request $request)
|
||||
{
|
||||
$form = $this->createForm(ThirdpartyFindDuplicateType::class);
|
||||
$suggested = [];
|
||||
|
||||
if ('child' === $thirdparty->getKind()) {
|
||||
$suggested = $thirdparty->getParent()->getChildren();
|
||||
}
|
||||
|
||||
$form = $this->createForm(ThirdpartyFindDuplicateType::class, null, ['suggested' => $suggested]);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
|
@ -15,6 +15,7 @@ use Chill\ThirdPartyBundle\Form\Type\PickThirdpartyDynamicType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ThirdpartyFindDuplicateType extends AbstractType
|
||||
{
|
||||
@ -24,9 +25,17 @@ class ThirdpartyFindDuplicateType extends AbstractType
|
||||
->add('thirdparty', PickThirdpartyDynamicType::class, [
|
||||
'label' => 'Find duplicate',
|
||||
'mapped' => false,
|
||||
'suggested' => $options['suggested'],
|
||||
])
|
||||
->add('direction', HiddenType::class, [
|
||||
'data' => 'starting',
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'suggested' => [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface
|
||||
'showContacts' => $options['showContacts'] ?? false,
|
||||
'showParent' => $options['showParent'] ?? true,
|
||||
'isConfidential' => $options['isConfidential'] ?? false,
|
||||
'showFusion' => $options['showFusion'] ?? false,
|
||||
];
|
||||
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user