| @@ 89-106 (lines=18) @@ | ||
| 86 | ||
| 87 | $form = $this->createForm(CreateRaLocationType::class, $command)->handleRequest($request);  | 
                                |
| 88 | ||
| 89 |         if ($form->isSubmitted() && $form->isValid()) { | 
                                |
| 90 |             $logger->debug('RA Location form submitted, start processing command'); | 
                                |
| 91 | ||
| 92 | $success = $this->getRaLocationService()->create($command);  | 
                                |
| 93 | ||
| 94 |             if ($success) { | 
                                |
| 95 | $this->addFlash(  | 
                                |
| 96 | 'success',  | 
                                |
| 97 |                     $this->get('translator')->trans('ra.create_ra_location.created') | 
                                |
| 98 | );  | 
                                |
| 99 | ||
| 100 |                 $logger->debug('RA Location added, redirecting to the RA location overview'); | 
                                |
| 101 |                 return $this->redirectToRoute('ra_locations_manage'); | 
                                |
| 102 | }  | 
                                |
| 103 | ||
| 104 |             $logger->debug('RA Location creation failed, adding error to form'); | 
                                |
| 105 |             $this->addFlash('error', 'ra.create_ra_location.error.middleware_command_failed'); | 
                                |
| 106 | }  | 
                                |
| 107 | ||
| 108 |         return $this->render('SurfnetStepupRaRaBundle:RaLocation:create.html.twig', [ | 
                                |
| 109 | 'form' => $form->createView()  | 
                                |
| @@ 150-167 (lines=18) @@ | ||
| 147 | ||
| 148 | $form = $this->createForm(ChangeRaLocationType::class, $command)->handleRequest($request);  | 
                                |
| 149 | ||
| 150 |         if ($form->isSubmitted() && $form->isValid()) { | 
                                |
| 151 |             $logger->debug('RA Location form submitted, start processing command'); | 
                                |
| 152 | ||
| 153 | $success = $this->getRaLocationService()->change($command);  | 
                                |
| 154 | ||
| 155 |             if ($success) { | 
                                |
| 156 | $this->addFlash(  | 
                                |
| 157 | 'success',  | 
                                |
| 158 |                     $this->get('translator')->trans('ra.create_ra_location.changed') | 
                                |
| 159 | );  | 
                                |
| 160 | ||
| 161 |                 $logger->debug('RA Location added, redirecting to the RA location overview'); | 
                                |
| 162 |                 return $this->redirectToRoute('ra_locations_manage'); | 
                                |
| 163 | }  | 
                                |
| 164 | ||
| 165 |             $logger->debug('RA Location creation failed, adding error to form'); | 
                                |
| 166 |             $this->addFlash('error', 'ra.create_ra_location.error.middleware_command_failed'); | 
                                |
| 167 | }  | 
                                |
| 168 | ||
| 169 |         return $this->render('SurfnetStepupRaRaBundle:RaLocation:change.html.twig', [ | 
                                |
| 170 | 'form' => $form->createView()  | 
                                |
| @@ 191-208 (lines=18) @@ | ||
| 188 | ||
| 189 | // todo: make choicelist configurable  | 
                                |
| 190 | $form = $this->createForm(CreateRaType::class, $command)->handleRequest($request);  | 
                                |
| 191 |         if ($form->isSubmitted() && $form->isValid()) { | 
                                |
| 192 |             $logger->debug('Accreditation form submitted, start processing command'); | 
                                |
| 193 | ||
| 194 | $success = $this->getRaCandidateService()->accreditCandidate($command);  | 
                                |
| 195 | ||
| 196 |             if ($success) { | 
                                |
| 197 | $this->addFlash(  | 
                                |
| 198 | 'success',  | 
                                |
| 199 |                     $this->get('translator')->trans('ra.management.create_ra.identity_accredited') | 
                                |
| 200 | );  | 
                                |
| 201 | ||
| 202 |                 $logger->debug('Identity Accredited, redirecting to candidate overview'); | 
                                |
| 203 |                 return $this->redirectToRoute('ra_management_ra_candidate_search'); | 
                                |
| 204 | }  | 
                                |
| 205 | ||
| 206 |             $logger->debug('Identity Accreditation failed, adding error to form'); | 
                                |
| 207 |             $this->addFlash('error', 'ra.management.create_ra.error.middleware_command_failed'); | 
                                |
| 208 | }  | 
                                |
| 209 | ||
| 210 |         return $this->render('SurfnetStepupRaRaBundle:RaManagement:createRa.html.twig', [ | 
                                |
| 211 | 'raCandidate' => $raCandidate,  | 
                                |