mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 21:16: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')]
|
#[Route(path: '/{_locale}/3party/{thirdparty_id}/find-manually', name: 'chill_thirdparty_find_duplicate')]
|
||||||
public function findManuallyDuplicateAction(ThirdParty $thirdparty, Request $request)
|
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);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ use Chill\ThirdPartyBundle\Form\Type\PickThirdpartyDynamicType;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
class ThirdpartyFindDuplicateType extends AbstractType
|
class ThirdpartyFindDuplicateType extends AbstractType
|
||||||
{
|
{
|
||||||
@ -24,9 +25,17 @@ class ThirdpartyFindDuplicateType extends AbstractType
|
|||||||
->add('thirdparty', PickThirdpartyDynamicType::class, [
|
->add('thirdparty', PickThirdpartyDynamicType::class, [
|
||||||
'label' => 'Find duplicate',
|
'label' => 'Find duplicate',
|
||||||
'mapped' => false,
|
'mapped' => false,
|
||||||
|
'suggested' => $options['suggested'],
|
||||||
])
|
])
|
||||||
->add('direction', HiddenType::class, [
|
->add('direction', HiddenType::class, [
|
||||||
'data' => 'starting',
|
'data' => 'starting',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
{
|
||||||
|
$resolver->setDefaults([
|
||||||
|
'suggested' => [],
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface
|
|||||||
'showContacts' => $options['showContacts'] ?? false,
|
'showContacts' => $options['showContacts'] ?? false,
|
||||||
'showParent' => $options['showParent'] ?? true,
|
'showParent' => $options['showParent'] ?? true,
|
||||||
'isConfidential' => $options['isConfidential'] ?? false,
|
'isConfidential' => $options['isConfidential'] ?? false,
|
||||||
|
'showFusion' => $options['showFusion'] ?? false,
|
||||||
];
|
];
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user