Commit 2784f4d935f66d32ab6abf68428dd8f6270d968b

Authored by Wilmer Ramones
1 parent 390ad14e76
Exists in master

se le muestra al coordinador los datos de la solicitud de ascenso y le permite a…

…probarla o rechazarla
app/Resources/views/cea/ascenso_mostar.html.twig
@@ -0,0 +1,214 @@ @@ -0,0 +1,214 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +{% block stylesheets %}
  3 + {{ parent() }}
  4 + <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet">
  5 +{% endblock %}
  6 +
  7 +{%block body %}
  8 +
  9 + <div class="content-wrapper">
  10 + <div class="container">
  11 + {% for message in app.session.flashBag.get('notice') %}
  12 + <h4 class="alert alert-success">{{ message }}</h4>
  13 +
  14 + {%endfor %}
  15 + <div class="row">
  16 + <div class="col-md-9">
  17 + <h4 class="page-head-line">Solicitud de Ascenso número <code>{{ascenso.id}}</code>:
  18 + {{ ascenso.idRolInstitucion.idRol.idPersona.primerNombre }},
  19 + {{ ascenso.idRolInstitucion.idRol.idPersona.primerApellido }}
  20 + </h4>
  21 + </div>
  22 + <div class="col-md-3">
  23 + {% if servicio.idEstatus.id == 1 %}
  24 + <h4 class="alert alert-success">Estatus <strong>{{servicio.idEstatus}}</strong>
  25 + {% elseif servicio.idEstatus.id == 3 %}
  26 + <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong>
  27 + {% else %}
  28 + <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong>
  29 + {% endif %}
  30 + </h4>
  31 + </div>
  32 +
  33 + </div>
  34 + <div class="row">
  35 +
  36 + <div class="col-md-6">
  37 +
  38 + <div class="col-md-4">
  39 + <img src="{{ asset('bundles/framework/images/portal/logo_ubv.png') }}" />
  40 + </div>
  41 +
  42 + <div class="col-md-8">
  43 +
  44 +
  45 +
  46 +
  47 + {% if escalas is not null %}
  48 + <div class="form-group">
  49 + <label for="Escalafones">Escalafones Obtenidos:</label>
  50 + <table class="table table-striped table-bordered">
  51 + <th>Escalafón</th>
  52 + <th>Fecha</th>
  53 + <th>Tipo</th>
  54 + {% for escala in escalas %}
  55 +
  56 + <tr>
  57 + <td>{{escala.idEscala }}</td>
  58 + <td>{{escala.fechaEscala | date('d-m-Y') }}</td>
  59 + <td>{{escala.idTipoEscala }}</td>
  60 + </tr>
  61 + {%endfor %}
  62 + </table>
  63 + <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p>
  64 + </div>
  65 + {% endif %}
  66 +
  67 + {% if antiguedad is not null %}
  68 + {% if antiguedad.idEstatus.id != 4 %}
  69 + <button class="alert alert-info"> El docente tiene una solicitud de antiguedad en estatus {{ antiguedad.idEstatus.nombre }} que no ha formalizado Todavía</button>
  70 + {% else %}
  71 + El Docente ya ha formalizado su Antiguedad ante la UBV
  72 + {% endif %}
  73 + {% endif %}
  74 +
  75 +
  76 +
  77 +
  78 +
  79 + {% if ascenso.tituloTrabajo is not null %}
  80 + <div class="form-group">
  81 + <label for="titulo">Título del Trabajo:</label>
  82 + <input type="text" class="form-control" value="{{ascenso.tituloTrabajo}}" />
  83 + </div>
  84 + {% endif %}
  85 +
  86 + </div>
  87 + </div>
  88 +
  89 + <div class="col-md-5">
  90 + <h3>Documentos Consignados</h3>
  91 + <div class="widget-content">
  92 +
  93 +
  94 +
  95 + <div class="col-xs-4">
  96 + <div class="thumbnail">
  97 + <a href="{{asset('uploads/ascenso/'~ ascenso.trabajo)}}" data-lightbox="adscripcion">
  98 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.trabajo) }}" />
  99 + </a>
  100 + <div class="caption">
  101 + <p>Constancia de Trabajo Act.</p>
  102 + </div>
  103 + </div>
  104 + </div>
  105 +
  106 +
  107 + <div class="col-xs-4">
  108 + <div class="thumbnail">
  109 + <a href="{{asset('uploads/ascenso/'~ ascenso.expediente)}}" data-lightbox="adscripcion">
  110 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.expediente) }}" />
  111 + </a>
  112 + <div class="caption">
  113 + <p>Constancia Actualización Expediente</p>
  114 + </div>
  115 + </div>
  116 + </div>
  117 +
  118 +
  119 + <div class="col-xs-4">
  120 + <div class="thumbnail">
  121 + <a href="{{asset('uploads/ascenso/'~ ascenso.pida)}}" data-lightbox="adscripcion">
  122 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.pida) }}" />
  123 + </a>
  124 + <div class="caption">
  125 + <p>Constancia Socialización del PIDA</p>
  126 + </div>
  127 + </div>
  128 + </div>
  129 +
  130 +
  131 +
  132 + <div class="col-xs-4">
  133 + <div class="thumbnail">
  134 + <a href="{{asset('uploads/ascenso/'~ ascenso.nai)}}" data-lightbox="adscripcion">
  135 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.nai) }}" />
  136 + </a>
  137 + <div class="caption">
  138 + <p>Constancia Aval del NAI</p>
  139 + </div>
  140 + </div>
  141 + </div>
  142 +
  143 +
  144 +
  145 + <div class="col-xs-4">
  146 + <div class="thumbnail">
  147 + <a href="{{asset('uploads/ascenso/'~ ascenso.investigacion)}}" data-lightbox="adscripcion">
  148 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.investigacion) }}" />
  149 + </a>
  150 + <div class="caption">
  151 + <p>Trabajo de Investigación / Tesis</p>
  152 + </div>
  153 + </div>
  154 + </div>
  155 +
  156 + {% if ascenso.pertinencia is not null %}
  157 + <div class="col-xs-4">
  158 + <div class="thumbnail">
  159 + <a href="{{asset('uploads/adscripcion/'~ adscripcion.pertinencia)}}" data-lightbox="adscripcion">
  160 + <img src="{{ asset('uploads/adscripcion/thumb/'~ adscripcion.pertinencia) }}" />
  161 + </a>
  162 + <div class="caption">
  163 + <p>Informe de Pertinencia de la Tesis</p>
  164 + </div>
  165 + </div>
  166 + </div>
  167 + {% endif %}
  168 +
  169 +
  170 +
  171 +
  172 +
  173 +
  174 +
  175 +
  176 +
  177 +
  178 +
  179 +
  180 + </div>
  181 + </div>
  182 +
  183 +
  184 +
  185 + </div>
  186 + <!-- MOSTRAR ACTIVIDAD PIDA DEL DOCENTE -->
  187 + {% if not pida %}
  188 + <p class="alert alert-warning">El Docente no ha registrado todavía su actividad PIDA</p>
  189 + {% else %}
  190 + <div class="form-group">
  191 + <label for="pida">PIDA:</label>
  192 + <ul>
  193 + <li>Objetivo Estratégico: {{pida.idPlanHistoricoNacionalEstrategico.nombre}}</li>
  194 + <li>Ámbito: {{ pida.idActividadDocente.nombre }}</li>
  195 + <li>Objetivo Específico: {{ pida.ObjetivoEspecifico }}</li>
  196 + <li>Fecha inicio: {{ pida.fechaInicio | date('d-m-Y') }} </li>
  197 + <li>Fecha final: {{ pida.fechaFinal | date('d-m-Y') }} </li>
  198 +
  199 + </ul>
  200 + </div>
  201 + {% endif %}
  202 + <a class="btn btn-success btn-sm" href="{{ path('cea_ascenso_actualizar', { 'id': ascenso.id, 'estatus' : 'true' }) }}" ><span class="fa fa-check"></span>&nbsp;Aprobar</a>
  203 + <a class="btn btn-danger btn-sm" href="{{ path('cea_ascenso_actualizar', { 'id': ascenso.id, 'estatus' : 'false' }) }}" ><span class="fa fa-close"></span>&nbsp;Rechazar</a>
  204 + </div>
  205 +
  206 + </div>
  207 +
  208 +{% endblock %}
  209 +
  210 +
  211 +{% block javascripts %}
  212 + {{ parent() }}
  213 + <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script>
  214 + {% endblock %}
0 \ No newline at end of file 215 \ No newline at end of file
app/Resources/views/cea/servicios.html.twig
@@ -73,7 +73,9 @@ @@ -73,7 +73,9 @@
73 {% elseif servicio.idServicioCe.id == 2 %} 73 {% elseif servicio.idServicioCe.id == 2 %}
74 <a href="{{ path('cea_adscripcion_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> 74 <a href="{{ path('cea_adscripcion_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
75 {% elseif servicio.idServicioCe.id == 3 %} 75 {% elseif servicio.idServicioCe.id == 3 %}
76 - <a href="{{ path('cea_estado_academico_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> 76 + <a href="{{ path('cea_estado_academico_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
  77 + {% elseif servicio.idServicioCe.id == 5 %}
  78 + <a href="{{ path('cea_ascenso_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
77 {% endif %} 79 {% endif %}
78 </td> 80 </td>
79 </tr> 81 </tr>
app/Resources/views/correos/actualizar_ascenso.html.twig
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +<h2>Estimado(a) Docente {{ nombres }} {{ apellidos }} El Centro de Estudios Ambientales a través del sistema CEA@UBV
  2 + le informa:</h2>
  3 +
  4 + <p>El estatus de tu solicitud de Ascenso de Escalafon ha cambiado de estatus y ahora se encuentra:
  5 + <strong> {{ estatus }} </strong></p>
  6 +
  7 +
  8 +Para hacer login dirigete simplemente a la página de ingreso del Portal del Centro de Estudios Ambientales
  9 +: <a href="{{ url('login') }}">Login CEA@UBV</a>.
src/AppBundle/Controller/AscensoController.php
@@ -31,15 +31,17 @@ class AscensoController extends Controller @@ -31,15 +31,17 @@ class AscensoController extends Controller
31 public function ascensoAction(Request $request) 31 public function ascensoAction(Request $request)
32 { 32 {
33 33
34 - 34 + //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios
35 $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( 35 $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(
36 - array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5) 36 + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5, 'idEstatus' => 2)
37 ); 37 );
38 38
39 if($solicitud){ 39 if($solicitud){
40 return $this->redirect($this->generateUrl('servicios_index')); 40 return $this->redirect($this->generateUrl('servicios_index'));
41 } 41 }
42 42
  43 +
  44 + //obtener su ultimo escalafon
43 $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy( 45 $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy(
44 array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion()), 46 array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion()),
45 array('id' => 'DESC') 47 array('id' => 'DESC')
@@ -118,7 +120,7 @@ class AscensoController extends Controller @@ -118,7 +120,7 @@ class AscensoController extends Controller
118 $this->container->getParameter('ascenso_directory'), 120 $this->container->getParameter('ascenso_directory'),
119 $nombreInvestigacion 121 $nombreInvestigacion
120 ); 122 );
121 - thumbnail($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); 123 + thumbnail($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory'));
122 $ascenso->setInvestigacion($nombreInvestigacion); 124 $ascenso->setInvestigacion($nombreInvestigacion);
123 } 125 }
124 $em = $this->getDoctrine()->getManager(); 126 $em = $this->getDoctrine()->getManager();
@@ -180,6 +182,110 @@ class AscensoController extends Controller @@ -180,6 +182,110 @@ class AscensoController extends Controller
180 } 182 }
181 183
182 184
  185 +
  186 + /**
  187 + * Encuentra y muestra una entidad de tipo Adscripción.
  188 + *
  189 + * @Route("/ascenso/{id}", name="cea_ascenso_show")
  190 + * @Method("GET")
  191 + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')")
  192 + */
  193 + public function solicitudesAscensoShowAction(DocenteServicio $servicio)
  194 + {
  195 + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array(
  196 + 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId()
  197 + ));
  198 +
  199 + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  200 + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  201 + $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
  202 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  203 + 'idServicioCe' => 1
  204 + ));
  205 +
  206 + return $this->render('cea/ascenso_mostar.html.twig', array(
  207 + 'ascenso' => $ascenso,
  208 + 'servicio' => $servicio,
  209 + 'escalas' => $escala,
  210 + 'pida' => $pida,
  211 + 'antiguedad' => $antiguedad
  212 + ));
  213 + }
  214 +
  215 +
  216 + /**
  217 + * Encuentra y muestra una entidad de tipo Adscripción.
  218 + *
  219 + * @Route("/solicitudes/ascenso/{id}/{estatus}", name="cea_ascenso_actualizar")
  220 + * @Method({"GET", "POST"})
  221 + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')")
  222 + */
  223 + public function solicitudesAscensoEditAction(Ascenso $ascenso, $estatus)
  224 + {
  225 +
  226 + //$adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneById($adscripcion->getId());
  227 + $serviciosAscenso = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
  228 + 'idRolInstitucion' => $ascenso->getIdRolInstitucion(),
  229 + 'idServicioCe' => 5
  230 + ));
  231 +
  232 +
  233 + $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($ascenso->getIdRolInstitucion());
  234 + if($estatus == "true") {
  235 + $serviciosAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1));
  236 +
  237 + }else{
  238 + $serviciosAscenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3));
  239 + }
  240 +
  241 + $em = $this->getDoctrine()->getManager();
  242 + $em->persist($serviciosAscenso);
  243 + $em->flush();
  244 +
  245 + $message = \Swift_Message::newInstance()
  246 + ->setSubject('Resultado Ascenso CEA@UBV')
  247 + ->setFrom('wilmer.ramones@gmail.com')
  248 + ->setTo($user->getEmail())
  249 + ->setBody(
  250 + $this->renderView(
  251 + 'correos/actualizar_ascenso.html.twig',
  252 + array(
  253 + 'nombres' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerNombre(),
  254 + 'apellidos' => $user->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerApellido(),
  255 + 'estatus' => $serviciosAscenso->getIdEstatus()
  256 + )
  257 + ),
  258 + 'text/html'
  259 + )
  260 + ;
  261 + $this->get('mailer')->send($message);
  262 +
  263 + $this->addFlash('notice', 'Solicitud Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.');
  264 +
  265 + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array(
  266 + 'idRolInstitucion' => $ascenso->getIdRolInstitucion()->getId()
  267 + ));
  268 +
  269 + $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array(
  270 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  271 + 'idServicioCe' => 1
  272 + ));
  273 +
  274 + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($serviciosAscenso->getIdRolInstitucion());
  275 +
  276 + return $this->render('cea/ascenso_mostar.html.twig', array(
  277 + 'ascenso' => $ascenso,
  278 + 'servicio' => $serviciosAscenso,
  279 + 'escalas' => $escala,
  280 + 'pida' => $pida,
  281 + 'antiguedad' => $antiguedad
  282 + ));
  283 +
  284 + }
  285 +
  286 +
  287 +
  288 +
183 289
184 } 290 }
185 291