diff --git a/app/Resources/views/cea/ascenso_mostar.html.twig b/app/Resources/views/cea/ascenso_mostar.html.twig new file mode 100644 index 0000000..eb692bf --- /dev/null +++ b/app/Resources/views/cea/ascenso_mostar.html.twig @@ -0,0 +1,214 @@ +{% extends 'base_app.html.twig' %} +{% block stylesheets %} + {{ parent() }} + +{% endblock %} + +{%block body %} + +
+
+ {% for message in app.session.flashBag.get('notice') %} +

{{ message }}

+ + {%endfor %} +
+
+

Solicitud de Ascenso número {{ascenso.id}}: + {{ ascenso.idRolInstitucion.idRol.idPersona.primerNombre }}, + {{ ascenso.idRolInstitucion.idRol.idPersona.primerApellido }} +

+
+
+ {% 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 }}

+
+ {% 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 %} +
+ + +
+ {% endif %} + +
+
+ +
+

Documentos Consignados

+
+ + + +
+
+ + + +
+

Constancia de Trabajo Act.

+
+
+
+ + +
+
+ + + +
+

Constancia Actualización Expediente

+
+
+
+ + +
+
+ + + +
+

Constancia Socialización del PIDA

+
+
+
+ + + +
+
+ + + +
+

Constancia Aval del NAI

+
+
+
+ + + +
+
+ + + +
+

Trabajo de Investigación / Tesis

+
+
+
+ + {% if ascenso.pertinencia is not null %} +
+
+ + + +
+

Informe de Pertinencia de la Tesis

+
+
+
+ {% endif %} + + + + + + + + + + + + +
+
+ + + +
+ + {% if not pida %} +

El Docente no ha registrado todavía su actividad PIDA

+ {% else %} +
+ +
    +
  • Objetivo Estratégico: {{pida.idPlanHistoricoNacionalEstrategico.nombre}}
  • +
  • Ámbito: {{ pida.idActividadDocente.nombre }}
  • +
  • Objetivo Específico: {{ pida.ObjetivoEspecifico }}
  • +
  • Fecha inicio: {{ pida.fechaInicio | date('d-m-Y') }}
  • +
  • Fecha final: {{ pida.fechaFinal | date('d-m-Y') }}
  • + +
+
+ {% endif %} +  Aprobar +  Rechazar +
+ +
+ +{% endblock %} + + +{% block javascripts %} + {{ parent() }} + + {% endblock %} \ No newline at end of file diff --git a/app/Resources/views/cea/servicios.html.twig b/app/Resources/views/cea/servicios.html.twig index a53d404..6d6d766 100644 --- a/app/Resources/views/cea/servicios.html.twig +++ b/app/Resources/views/cea/servicios.html.twig @@ -73,7 +73,9 @@ {% elseif servicio.idServicioCe.id == 2 %} {% elseif servicio.idServicioCe.id == 3 %} - + + {% elseif servicio.idServicioCe.id == 5 %} + {% endif %} diff --git a/app/Resources/views/correos/actualizar_ascenso.html.twig b/app/Resources/views/correos/actualizar_ascenso.html.twig new file mode 100644 index 0000000..41fad47 --- /dev/null +++ b/app/Resources/views/correos/actualizar_ascenso.html.twig @@ -0,0 +1,9 @@ +

Estimado(a) Docente {{ nombres }} {{ apellidos }} El Centro de Estudios Ambientales a través del sistema CEA@UBV + le informa:

+ +

El estatus de tu solicitud de Ascenso de Escalafon ha cambiado de estatus y ahora se encuentra: + {{ estatus }}

+ + +Para hacer login dirigete simplemente a la página de ingreso del Portal del Centro de Estudios Ambientales +: Login CEA@UBV. diff --git a/src/AppBundle/Controller/AscensoController.php b/src/AppBundle/Controller/AscensoController.php index b8862f1..9b44913 100644 --- a/src/AppBundle/Controller/AscensoController.php +++ b/src/AppBundle/Controller/AscensoController.php @@ -31,15 +31,17 @@ class AscensoController extends Controller public function ascensoAction(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) + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5, 'idEstatus' => 2) ); if($solicitud){ return $this->redirect($this->generateUrl('servicios_index')); } + + //obtener su ultimo escalafon $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy( array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion()), array('id' => 'DESC') @@ -118,7 +120,7 @@ class AscensoController extends Controller $this->container->getParameter('ascenso_directory'), $nombreInvestigacion ); - thumbnail($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); + thumbnail($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); $ascenso->setInvestigacion($nombreInvestigacion); } $em = $this->getDoctrine()->getManager(); @@ -180,6 +182,110 @@ class AscensoController extends Controller } + + /** + * Encuentra y muestra una entidad de tipo Adscripción. + * + * @Route("/ascenso/{id}", name="cea_ascenso_show") + * @Method("GET") + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')") + */ + public function solicitudesAscensoShowAction(DocenteServicio $servicio) + { + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( + 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId() + )); + + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); + $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), + 'idServicioCe' => 1 + )); + + return $this->render('cea/ascenso_mostar.html.twig', array( + 'ascenso' => $ascenso, + 'servicio' => $servicio, + 'escalas' => $escala, + 'pida' => $pida, + 'antiguedad' => $antiguedad + )); + } + + + /** + * Encuentra y muestra una entidad de tipo Adscripción. + * + * @Route("/solicitudes/ascenso/{id}/{estatus}", name="cea_ascenso_actualizar") + * @Method({"GET", "POST"}) + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')") + */ + public function solicitudesAscensoEditAction(Ascenso $ascenso, $estatus) + { + + //$adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneById($adscripcion->getId()); + $serviciosAscenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( + 'idRolInstitucion' => $ascenso->getIdRolInstitucion(), + 'idServicioCe' => 5 + )); + + + $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($ascenso->getIdRolInstitucion()); + if($estatus == "true") { + $serviciosAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); + + }else{ + $serviciosAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); + } + + $em = $this->getDoctrine()->getManager(); + $em->persist($serviciosAscenso); + $em->flush(); + + $message = \Swift_Message::newInstance() + ->setSubject('Resultado Ascenso CEA@UBV') + ->setFrom('wilmer.ramones@gmail.com') + ->setTo($user->getEmail()) + ->setBody( + $this->renderView( + 'correos/actualizar_ascenso.html.twig', + array( + 'nombres' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerNombre(), + 'apellidos' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerApellido(), + 'estatus' => $serviciosAscenso->getIdEstatus() + ) + ), + 'text/html' + ) + ; + $this->get('mailer')->send($message); + + $this->addFlash('notice', 'Solicitud Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.'); + + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( + 'idRolInstitucion' => $ascenso->getIdRolInstitucion()->getId() + )); + + $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), + 'idServicioCe' => 1 + )); + + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($serviciosAscenso->getIdRolInstitucion()); + + return $this->render('cea/ascenso_mostar.html.twig', array( + 'ascenso' => $ascenso, + 'servicio' => $serviciosAscenso, + 'escalas' => $escala, + 'pida' => $pida, + 'antiguedad' => $antiguedad + )); + + } + + + + }