Commit 41e0ab84707ad3848121b3698f8c9d66d3851f1b
1 parent
d744ae8570
Exists in
master
se solicita ademas del documento de oposición su area y su linea de investigacio…
…n junto con el titulo del trabajo a la hora de solicitar el reconocimiento de escala
Showing
2 changed files
with
99 additions
and
18 deletions
Show diff stats
src/AppBundle/Controller/AscensoController.php
| ... | ... | @@ -221,8 +221,12 @@ class AscensoController extends Controller |
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | |
| 224 | - | |
| 225 | - $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType'); | |
| 224 | + if (!$concurso->getOposicion()){ | |
| 225 | + $form = $this->createForm('AppBundle\Form\ReconocimientoConcursoType'); | |
| 226 | + }else{ | |
| 227 | + $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType'); | |
| 228 | + } | |
| 229 | + | |
| 226 | 230 | $form->handleRequest($request); |
| 227 | 231 | |
| 228 | 232 | if ($form->isSubmitted() && $form->isValid()) { |
| ... | ... | @@ -234,22 +238,21 @@ class AscensoController extends Controller |
| 234 | 238 | $nombreAscenso = md5(uniqid()).'.'.$constanciaAscenso->guessExtension(); |
| 235 | 239 | |
| 236 | 240 | // Guardar el archivo y crear la miniatura de cada uno |
| 237 | - if (!$concurso->getOposicion()){ | |
| 238 | - $constanciaAscenso->move( | |
| 239 | - $this->container->getParameter('adscripcion_directory'), | |
| 240 | - $nombreAscenso | |
| 241 | - ); | |
| 242 | - thumbnail2($nombreAscenso, $this->container->getParameter('adscripcion_directory'), $this->container->getParameter('ascenso_thumb_directory')); | |
| 243 | - }else{ | |
| 244 | - $constanciaAscenso->move( | |
| 245 | - $this->container->getParameter('ascenso_directory'), | |
| 246 | - $nombreAscenso | |
| 247 | - ); | |
| 248 | - thumbnail2($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | |
| 249 | - } | |
| 250 | - if (!$concurso->getOposicion()){ | |
| 241 | + if (!$concurso->getOposicion()){ | |
| 251 | 242 | $adscripcion->setOposicion($nombreAscenso); |
| 243 | + $adscripcion->setIdLineaInvestigacion($form['lineas_investigacion']->getData()); | |
| 244 | + $adscripcion->setTituloTrabajo($form['titulo_trabajo']->getData()); | |
| 245 | + $constanciaAscenso->move( | |
| 246 | + $this->container->getParameter('adscripcion_directory'), | |
| 247 | + $nombreAscenso | |
| 248 | + ); | |
| 249 | + thumbnail2($nombreAscenso, $this->container->getParameter('adscripcion_directory'), $this->container->getParameter('ascenso_thumb_directory')); | |
| 252 | 250 | }else{ |
| 251 | + $constanciaAscenso->move( | |
| 252 | + $this->container->getParameter('ascenso_directory'), | |
| 253 | + $nombreAscenso | |
| 254 | + ); | |
| 255 | + thumbnail2($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | |
| 253 | 256 | switch ($solicitudAscenso->getIdEscalafones()->getId()){ |
| 254 | 257 | case 2: $adscripcion->setAsistente($nombreAscenso); |
| 255 | 258 | break; |
| ... | ... | @@ -262,9 +265,8 @@ class AscensoController extends Controller |
| 262 | 265 | default: |
| 263 | 266 | break; |
| 264 | 267 | } |
| 265 | - | |
| 266 | 268 | } |
| 267 | - | |
| 269 | + | |
| 268 | 270 | |
| 269 | 271 | |
| 270 | 272 | //Crear la solicitud de Servicio |
| ... | ... | @@ -278,6 +280,7 @@ class AscensoController extends Controller |
| 278 | 280 | $em->persist($adscripcion); |
| 279 | 281 | |
| 280 | 282 | $em->flush(); |
| 283 | + $this->addFlash('success', 'Solicitud de Reconocimiento de escala Registrada Satisfactoriamente'); | |
| 281 | 284 | return $this->redirect($this->generateUrl('cea_index')); |
| 282 | 285 | } |
| 283 | 286 | ... | ... |
src/AppBundle/Form/ReconocimientoConcursoType.php
| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Created by Netbeans. | |
| 4 | + * User: Wilmer Ramones | |
| 5 | + * Date: 29/06/16 | |
| 6 | + * Time: 09:07 AM | |
| 7 | + * Modificado: 07/07/2016 | |
| 8 | + */ | |
| 9 | + | |
| 10 | +namespace AppBundle\Form; | |
| 11 | + | |
| 12 | +use Symfony\Component\Form\AbstractType; | |
| 13 | +use Symfony\Component\Form\FormBuilderInterface; | |
| 14 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
| 15 | +use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
| 16 | + | |
| 17 | +use Symfony\Component\Validator\Constraints\File; | |
| 18 | +use Symfony\Component\Validator\Constraints\NotBlank; | |
| 19 | +use Symfony\Component\Form\Extension\Core\Type\FileType; | |
| 20 | +use Symfony\Component\Form\Extension\Core\Type\TextType; | |
| 21 | + | |
| 22 | +use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
| 23 | + | |
| 24 | +class ReconocimientoConcursoType extends AbstractType | |
| 25 | +{ | |
| 26 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
| 27 | + { | |
| 28 | + $builder | |
| 29 | + | |
| 30 | + ->add('reconocimiento', FileType::class, array( | |
| 31 | + 'label' => 'Digital Aprobación de Escala', | |
| 32 | + 'constraints' => array( | |
| 33 | + new NotBlank(), | |
| 34 | + new File(array( | |
| 35 | + 'maxSize' => '1024K', | |
| 36 | + 'mimeTypes' => [ | |
| 37 | + 'application/pdf', | |
| 38 | + 'application/x-pdf', | |
| 39 | + 'image/png', | |
| 40 | + 'image/jpg', | |
| 41 | + 'image/jpeg' | |
| 42 | + ], | |
| 43 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 44 | + )) | |
| 45 | + ) | |
| 46 | + )) | |
| 47 | + ->add('titulo_trabajo', TextType::class, array( | |
| 48 | + 'label' => 'Título del Trabajo de Investigación', | |
| 49 | + | |
| 50 | + 'required' => true, | |
| 51 | + | |
| 52 | + )) | |
| 53 | + ->add('lineas_investigacion', EntityType::class, array( | |
| 54 | + 'label' => false, | |
| 55 | + 'placeholder' => 'Seleccione Área y Línea de Investigación', | |
| 56 | + 'required' => false, | |
| 57 | + 'class' => 'AppBundle:LineasInvestigacion', | |
| 58 | + | |
| 59 | + 'choice_label' => 'getNombre', | |
| 60 | + 'group_by' => 'getIdAreaInvestigacion' | |
| 61 | + )) | |
| 62 | + ->add('send', SubmitType::class, array( | |
| 63 | + 'label' => 'Enviar reconocimiento de Escala', | |
| 64 | + 'attr' => array('class' => 'btn btn-success btn-block') | |
| 65 | + )) | |
| 66 | + | |
| 67 | + ; | |
| 68 | + | |
| 69 | + | |
| 70 | + } | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | +} | ... | ... |