Commit 4719fa38 by Damien Moulard

hide profile choice for comptoir in adherent update

parent 0945f68e
......@@ -173,7 +173,22 @@ class AdherentAdmin extends AbstractAdmin
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$formMapper
// For Comptoir role in edit mode, hide profile choice
$displayProfilChoice = true;
$isComptoirOnly =
$this->security->isGranted('ROLE_COMPTOIR')
&& !$this->isGranted('ROLE_ADMIN')
&& !$this->isGranted('ROLE_SUPER_ADMIN')
&& !$this->isGranted('ROLE_ADMIN_SIEGE');
if ($isComptoirOnly && $this->isCurrentRoute('edit')) {
$displayProfilChoice = false;
}
print_r($displayProfilChoice);
if ($displayProfilChoice) {
$formMapper
->tab('General')
->with('Informations de cotisation', ['class' => 'col-md-5'])
->add('profilDeCotisation', ChoiceType::class, [
......@@ -190,6 +205,13 @@ class AdherentAdmin extends AbstractAdmin
return $choice->__toString();
}
])
->end()
->end();
}
$formMapper
->tab('General')
->with('Informations de cotisation', ['class' => 'col-md-5'])
->add('moyenDePaiement', ChoiceType::class, [
'required' => true,
'label' => 'Moyen de paiement :',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment