From 5f66c42d38694ab5bebe7452699073a91e3f6ab1 Mon Sep 17 00:00:00 2001 From: Wilmer Date: Mon, 17 Apr 2017 09:54:25 -0400 Subject: [PATCH] crea la solicitud de envio de acta de defensa --- app/Resources/views/base_app.html.twig | 10 +- .../views/cea/acta_defensa_mostar.html.twig | 488 +++++++++++++++++++++ app/Resources/views/cea/ascenso_mostar.html.twig | 4 +- app/Resources/views/cea/servicios.html.twig | 4 + .../views/correos/actualizar_ascenso.html.twig | 2 +- .../views/solicitudes/acta_defensa.html.twig | 27 ++ src/AppBundle/Controller/AscensoController.php | 157 ++++++- src/AppBundle/Form/ActaDefensaType.php | 65 +++ 8 files changed, 746 insertions(+), 11 deletions(-) create mode 100644 app/Resources/views/cea/acta_defensa_mostar.html.twig create mode 100644 app/Resources/views/solicitudes/acta_defensa.html.twig create mode 100644 src/AppBundle/Form/ActaDefensaType.php diff --git a/app/Resources/views/base_app.html.twig b/app/Resources/views/base_app.html.twig index 911cc02..4a92fa4 100644 --- a/app/Resources/views/base_app.html.twig +++ b/app/Resources/views/base_app.html.twig @@ -7,12 +7,11 @@ - {% endblock %} @@ -267,6 +266,7 @@
  • Estado Académico
  • Antiguedad
  • Reconocer Ascenso
  • +
  • Acta Defensa
  • {% else %} diff --git a/app/Resources/views/cea/acta_defensa_mostar.html.twig b/app/Resources/views/cea/acta_defensa_mostar.html.twig new file mode 100644 index 0000000..ccfcb40 --- /dev/null +++ b/app/Resources/views/cea/acta_defensa_mostar.html.twig @@ -0,0 +1,488 @@ +{% extends 'base_app.html.twig' %} +{% block stylesheets %} + {{ parent() }} + + + +{% endblock %} + +{%block body %} + {% set cantidadJurado = 6 %} +
    +
    + {% for message in app.session.flashBag.get('notice') %} +

    {{ message }}

    + {%endfor %} +
    +
    +

    Solicitud de Ascenso número {{ascenso.id}}: + {{ docente }} +

    +
    +
    + {% if servicio.idEstatus.id == 1 %} +

    Estatus {{servicio.idEstatus}}

    + {% elseif servicio.idEstatus.id == 3 %} +

    Estatus {{servicio.idEstatus}}

    + {% else %} +

    Estatus {{servicio.idEstatus}}

    + {% endif %} + +
    +
    +
    + +
    + +
    + +
    + +
    + + + + + {% if escalas is not null %} +
    + + + + + + {% for escala in escalas %} + + + + + + + {%endfor %} +
    EscalafónFechaTipo
    {{escala.idEscala }}{{escala.fechaEscala | date('d-m-Y') }}{{escala.idTipoEscala }}
    + +

    Escalafón Solicita: {{ ascenso.idEscalafones.nombre }}

    + {% set anadirJurado = false %} + {% if (ascenso.tesisUbv or ascenso.tipoTrabajoInvestigacion == 'investigacion') %} +

    Jurados propuestos por el Docente

    + {% set anadirJurado = true %} + {% set cantidadJurado = 6 %} +
    +
      + {% for tutor in ascenso.tutoresAscenso %} + {% if loop.length == 6 %} + {% set anadirJurado = false %} + {% else %} + {% set cantidadJurado = cantidadJurado - 1 %} + {% endif %} + +
    • + + {{ tutor.nombres }} {{ tutor.apellidos }}: + {{ tutor.institucion }} -> {{ tutor.idEscala.nombre }} + + +
    • + + {% endfor %} +
    +
    + {% endif %} + {% if anadirJurado and ascenso.idEstatus.id == 2 %} +

    + El docente no tiene o le faltó completar posibles jurados +

    + {% form_theme form 'bootstrap_3_layout.html.twig' %} + {{ form_start(form) }} + {{ form_widget(form) }} + {{ form_end(form) }} + + {% else %} +

    + El docente completó los 6 Jurados Propuestos +

    + {% form_theme form 'bootstrap_3_layout.html.twig' %} + {{ form_start(form) }} + {{ form_widget(form) }} + {{ form_end(form) }} + + {% endif %} + + +
    + {% endif %} + + {% if antiguedad is not null %} + {% if antiguedad.idEstatus.id != 4 %} + + {% else %} + El Docente ya ha formalizado su Antiguedad ante la UBV + {% endif %} + {% endif %} + + {% if ascenso.tituloTrabajo is not null %} +
    + + +

    Tipo de Trabajo de Ascneso: {{ ascenso.tipoTrabajoInvestigacion }}

    + {% if ascenso.tipoTrabajoInvestigacion == 'tesis' %} + {% if ascenso.tesisUbv %} +

    Debe tener informe de pertinencia debido a que + es una tesis fuera de UBV

    + {% else %} +

    La Tesis fue hecha dentro de UBV

    + + {% endif %} + {% endif %} +
    + {% endif %} + +
    +
    +
    +
    +

    Documentos Consignados

    +
    + + + {% for documento in docente.documentosVerificados %} + {% if documento.idServicio.id == servicio.id %} + {% set extension = documento.ubicacion | split('.') | last %} +
    +
    + + {% if extension != "pdf" %} + + + + {% else %} + + {% endif %} +
    +

    {{ documento.idTipoDocumentos.nombre }}

    + {% if documento.idEstatus.id == 2 or documento.idEstatus.id == 3 %} +
    + + + + + + +
    +
    + {% endif %} +
    +
    +
    + {% endif %} + {% endfor %} + +
    +
    + + {% if not docente.pida %} +

    El Docente no ha registrado todavía su actividad PIDA

    + {% else %} +
    + +
    + {% endif %} + + + + + +
    + + + {% if servicio.idEstatus.id == 3 %} + + {% elseif servicio.idEstatus.id == 2 %} + +  Rechazar + {% endif %} + +
    + + +
    +{% endblock %} + + +{% block javascripts %} + {{ parent() }} + + + + + + {% endblock %} \ No newline at end of file diff --git a/app/Resources/views/cea/ascenso_mostar.html.twig b/app/Resources/views/cea/ascenso_mostar.html.twig index 79b6c06..0765560 100644 --- a/app/Resources/views/cea/ascenso_mostar.html.twig +++ b/app/Resources/views/cea/ascenso_mostar.html.twig @@ -354,8 +354,8 @@ {% endif %} - - + + diff --git a/app/Resources/views/cea/servicios.html.twig b/app/Resources/views/cea/servicios.html.twig index b44e533..8037a78 100644 --- a/app/Resources/views/cea/servicios.html.twig +++ b/app/Resources/views/cea/servicios.html.twig @@ -49,6 +49,8 @@ {% elseif servicio.idServicioCe.id == 6 %} + {% elseif servicio.idServicioCe.id == 7 %} + {% endif %} @@ -82,6 +84,8 @@ {% elseif servicio.idServicioCe.id == 6 %} + {% elseif servicio.idServicioCe.id == 7 %} + {% endif %} diff --git a/app/Resources/views/correos/actualizar_ascenso.html.twig b/app/Resources/views/correos/actualizar_ascenso.html.twig index f6ec356..6ffffa4 100644 --- a/app/Resources/views/correos/actualizar_ascenso.html.twig +++ b/app/Resources/views/correos/actualizar_ascenso.html.twig @@ -7,7 +7,7 @@ {% if estatus == "Rechazada" %}

    Motivo del Rechazo:

    {{ mensaje }}

    - {% else if estatus == "Aprobado" %} + {% else %}

    Ahora que su solicitud ha sido aprobada, debe estar al tanto que al recibir la aprobación por parte de concejo universitario aprobando los jurados y la fecha de defensa, debe subir diff --git a/app/Resources/views/solicitudes/acta_defensa.html.twig b/app/Resources/views/solicitudes/acta_defensa.html.twig new file mode 100644 index 0000000..f6f4583 --- /dev/null +++ b/app/Resources/views/solicitudes/acta_defensa.html.twig @@ -0,0 +1,27 @@ +{% extends 'base_app.html.twig' %} + + +{% block body %} +

    +

    + Estimado (a) Docente + {{app.user.idRolInstitucion.idRol.idPersona.primerNombre}} + {{app.user.idRolInstitucion.idRol.idPersona.primerApellido}}, + Aqui podra enviar el Digital de la resolución de Consejo Universitario. + +

    + +
    +
    +

    Enviar Resolución

    +

    Por favor adjunte digital de la aprobación de Defensa a {{ tipo }} por parte de Consejo Universitario

    + {% form_theme form 'bootstrap_3_layout.html.twig' %} + {{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }} + {{ form_widget(form) }} + {{ form_end(form) }} +
    + +
    +
    + +{% endblock %} diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index 86cb9a0..9d1a465 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -354,12 +354,15 @@ class AscensoController extends Controller //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios - $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( + $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5, 'idEstatus' => 1) ); - + if (!$solicitud){ + $this->addFlash('danger', 'Debe tener una solicitud de Ascenso Activa para poder utilizar este servicio'); + return $this->redirect($this->generateUrl('cea_index')); + } $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array( 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), @@ -471,6 +474,98 @@ class AscensoController extends Controller } + + + + + + + + /** + * @Route("/solicitud/reconocimiento/acta_defensa", name="cea_solicitud_acta_defensa") + */ + public function actaDefensaAction(Request $request) + { + + + //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios + $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5, 'idEstatus' => 1) + ); + + + if (!$solicitud){ + $this->addFlash('danger', 'Debe tener una solicitud de Ascenso Activa para poder utilizar este servicio'); + return $this->redirect($this->generateUrl('cea_index')); + } + + + $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy( + array( + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), + 'idEstatus' => 1 + ) + ); + + + if(!$solicitudAscenso){ + $this->addFlash('danger', 'Estimado Docente, No posee ninguna solicitud de Ascenso Activa.'); + return $this->redirect($this->generateUrl('cea_index')); + } + + + $form = $this->createForm('AppBundle\Form\ActaDefensaType'); + + $form->handleRequest($request); + $em = $this->getDoctrine()->getManager(); + if ($form->isSubmitted() && $form->isValid()) { + //Crear la solicitud de Servicio + $servicios = new DocenteServicio(); + + $servicios->setIdRolInstitucion($this->getUser()->getIdRolInstitucion()); + $servicios->setIdServicioCe($this->getDoctrine()->getRepository('AppBundle:ServiciosCe')->findOneById(7)); + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:estatus')->findOneById(2)); + $em->persist($servicios); + $em->flush(); + + + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); + $constanciaActa = $form->get('acta')->getData(); + + $nombreActa = md5(uniqid()).'.'.$constanciaActa->guessExtension(); + + // Guardar el archivo y crear la miniatura de cada uno + + $constanciaActa->move( + $this->container->getParameter('ascenso_directory'), + $nombreActa + ); + thumbnail2($nombreActa, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); + verificar_documentos2($adscripcion->getIdRolInstitucion(),17,2,$em,$nombreActa, $servicios); + + $em->persist($adscripcion); + + $em->flush(); + $this->addFlash('success', 'Solicitud de verificar Acta de Defensa Registrada Satisfactoriamente'); + return $this->redirect($this->generateUrl('cea_index')); + } + + return $this->render( + 'solicitudes/acta_defensa.html.twig', + array( + 'form' => $form->createView(), + 'tipo' => 'Ascenso ' . $solicitudAscenso->getIdEscalafones()->getNombre() + ) + ); + + + + + + + } + + @@ -647,6 +742,62 @@ class AscensoController extends Controller )); } + + + + + + /** + * Encuentra y muestra una entidad de tipo Adscripción. + * + * @Route("/acta_defensa/{id}", name="cea_acta_defensa_show") + * @Method({"GET", "POST"}) + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')") + */ + public function actaDefensaShowAction(DocenteServicio $servicio, Request $request) + { + $docente = $this->getDoctrine()->getRepository("AppBundle:RolInstitucion")->findOneById($servicio->getIdRolInstitucion()->getId()); + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId() + )); + + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion(), + 'idEstatus' => 2 + )); + + if(!$ascenso){ + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion()), + array('id' => 'DESC') + ); + } + + $servicioPida = $this->getDoctrine()->getRepository("AppBundle:DocenteServicio")->findOneBy(array( + 'idRolInstitucion' => $docente, + 'idServicioCe' => 4), + array('id' => 'DESC') + ); + //$pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); + $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion(), + 'idServicioCe' => 1 + )); + + $form = $this->createForm('AppBundle\Form\AddTutorType'); + + return $this->render('cea/acta_defensa_mostar.html.twig', array( + 'ascenso' => $ascenso, + 'servicio' => $servicio, + 'escalas' => $escala, + 'servicioPida' => $servicioPida, + 'antiguedad' => $antiguedad, + 'form' => $form->createView(), + 'docente' => $docente + )); + + + } /** @@ -731,7 +882,7 @@ class AscensoController extends Controller $this->addFlash('notice', 'Solicitud Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.'); - return $this->redirect($this->generateUrl('cea_ascenso_show', array('id' => $ascenso->getId()))); + return $this->redirect($this->generateUrl('cea_ascenso_show', array('id' => $serviciosAscenso->getId()))); } diff --git a/src/AppBundle/Form/ActaDefensaType.php b/src/AppBundle/Form/ActaDefensaType.php new file mode 100644 index 0000000..59736f3 --- /dev/null +++ b/src/AppBundle/Form/ActaDefensaType.php @@ -0,0 +1,65 @@ +add('acta', FileType::class, array( + 'label' => 'Digital Resolución', + 'constraints' => array( + new NotBlank(), + new File(array( + 'maxSize' => '1024K', + 'mimeTypes' => [ + 'application/pdf', + 'application/x-pdf', + 'image/png', + 'image/jpg', + 'image/jpeg' + ], + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' + )) + ) + )) + ->add('send', SubmitType::class, array( + 'label' => 'Enviar Resolución', + 'attr' => array( + 'class' => 'btn btn-success btn-block', + 'data-loading-text' => " Procesando Solicitud..." + ) + )) + + ; + + + } + + + + + + + +} -- 2.0.0