| @@ 49-65 (lines=17) @@ | ||
| 46 | $form = $this->createForm(InstitutionSelectionType::class, $command); | |
| 47 | $form->handleRequest($request); | |
| 48 | ||
| 49 |         if ($form->isSubmitted() && $form->isValid()) { | |
| 50 |             $institutionConfigurationOptions = $this->get('ra.service.institution_configuration_options') | |
| 51 | ->getInstitutionConfigurationOptionsFor($command->institution); | |
| 52 | $token->changeInstitutionScope($command->institution, $institutionConfigurationOptions); | |
| 53 | ||
| 54 |             $flashMessage = $this->get('translator') | |
| 55 |                 ->trans('ra.sraa.changed_institution', ['%institution%' => $command->institution]); | |
| 56 |             $this->get('session')->getFlashBag()->add('success', $flashMessage); | |
| 57 | ||
| 58 | $logger->notice(sprintf( | |
| 59 | 'SRAA "%s" successfully switched to institution "%s"', | |
| 60 | $identity->id, | |
| 61 | $command->institution | |
| 62 | )); | |
| 63 | ||
| 64 |             return $this->redirect($this->generateUrl('ra_vetting_search')); | |
| 65 | } | |
| 66 | ||
| 67 |         $logger->notice(sprintf('Showing select institution form for SRAA "%s"', $identity->id)); | |
| 68 | ||
| @@ 58-74 (lines=17) @@ | ||
| 55 | $form = $this->createForm(RaaInstitutionSelectionType::class, $command); | |
| 56 | $form->handleRequest($request); | |
| 57 | ||
| 58 |         if ($form->isSubmitted() && $form->isValid()) { | |
| 59 | $institutionConfigurationOptions = $this->getInstitutionConfigurationOptionsService() | |
| 60 | ->getInstitutionConfigurationOptionsFor($command->institution); | |
| 61 | $token->changeInstitutionScope($command->institution, $institutionConfigurationOptions); | |
| 62 | ||
| 63 |             $flashMessage = $this->get('translator') | |
| 64 |                 ->trans('ra.sraa.changed_institution', ['%institution%' => $command->institution]); | |
| 65 |             $this->get('session')->getFlashBag()->add('success', $flashMessage); | |
| 66 | ||
| 67 | $logger->notice(sprintf( | |
| 68 | 'RAA "%s" successfully switched to institution "%s"', | |
| 69 | $identity->id, | |
| 70 | $command->institution | |
| 71 | )); | |
| 72 | ||
| 73 |             return $this->redirect($this->generateUrl('ra_vetting_search')); | |
| 74 | } | |
| 75 | ||
| 76 |         $logger->notice(sprintf('Showing select institution form for RAA "%s"', $identity->id)); | |
| 77 | ||