public function addUserAction(Client $client)
 {
     $em = $this->getDoctrine()->getManager();
     $session = $this->getRequest()->getSession();
     if (is_null($client->getUser())) {
         $user = new User();
         $user->setEmail($client->getEmail());
         $form = $this->createForm(new RegistrationFormType(), $user, array('validation_groups' => array('Registration')))->remove('groups');
     } else {
         $user = $client->getUser();
         $form = $this->createForm(new RegistrationFormType(), $user, array('validation_groups' => array('Profile')))->remove('plainPassword')->remove('groups');
     }
     if ($this->getRequest()->isMethod('POST')) {
         $form->submit($this->getRequest());
         if ($form->isValid()) {
             $user = $form->getData();
             $em->persist($user->setEnabled(TRUE)->setClient($client));
             $em->flush();
             $session->getFlashBag()->add('success', " Client traité avec succès ");
             return $this->redirect($this->generateUrl('back_crm_client_profil_user', array('id' => $client->getId())));
         }
     }
     return $this->render('BackUserBundle:client:profil\\user.html.twig', array('form' => $form->createView(), 'client' => $client));
 }