Commit 276b2330019667a0343a2363cb3e640a3c80a862

Authored by Wilmer Ramones
1 parent d2454b0a45
Exists in master

creada la interfaz para subir documentos de escala y ser vistos, aprobados por el coordinador

app/Resources/views/base_app.html.twig
... ... @@ -60,8 +60,9 @@
60 60 <ul class="dropdown-menu">
61 61 <li><a href="{{ path('servicios_index') }}">Mis Servicios</a></li>
62 62 <li><a href="{{ path('cea_solicitud_ascenso') }}">Solicitar Ascenso</a></li>
63   - <li><a href="{{ path( 'cea_solicitudes_estado_academico' ) }}">Solicitar Estado Académico</a></li>
64   - <li><a href="{{ path('cea_solicitudes_recocimiento_antiguedad') }}">Reconocimiento de Antiguedad</a></li>
  63 + <li><a href="{{ path('cea_solicitudes_estado_academico' ) }}">Solicitar Estado Académico</a></li>
  64 + <li><a href="{{ path('cea_solicitudes_recocimiento_antiguedad') }}">Reconocimiento de Antiguedad</a></li>
  65 + <li><a href="{{ path('cea_solicitud_recocimiento_escala') }}">Reconocimiento de Escala</a></li>
65 66 </ul>
66 67 </li>
67 68 {% endif %}
... ...
app/Resources/views/cea/reconocimiento_escala_mostrar.html.twig
... ... @@ -0,0 +1,141 @@
  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 Reconocimiento Escala <code>{{servicio.id}}</code>:
  18 + {{ servicio.idRolInstitucion.idRol.idPersona.primerNombre }},
  19 + {{ servicio.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>Tipo de Reconocimiento:</strong>{% if not ascenso %} Concurso de oposición {% else %} Ascenso {% endif %} </p>
  64 + </div>
  65 + {% endif %}
  66 +
  67 + <form name="input" action="{{ path('cea_escala_actualizar', { 'id': servicio.id, 'escala': 'escalafones', 'estatus' : 'true' }) }}" method="post">
  68 + {% if not ascenso %}
  69 + <select name="escala" required>
  70 + <option value="">Escalafón al cual aprobó Concurso</option>
  71 + {% for esc in escalafones %}
  72 + <option value="{{ esc.id }}">{{ esc.nombre }}</option>
  73 + {% endfor %}
  74 + <input type="hidden" name="tipo" value="1" />
  75 + </select>
  76 + {% else %}
  77 + <input type="hidden" name="tipo" value="2" />
  78 + <input type="text" value="{{ escalafones }}" readonly />
  79 + <input type="hidden" name="escala" value="{{ escalafones.id }}" />
  80 + {% endif %}
  81 + <br><label for="fecha_escala"> Fecha de Escalafón: </label> <input type="date" name="fecha_escala" />
  82 + <br><button type="submit" class="btn btn-success btn-sm" ><span class="fa fa-check"></span>&nbsp;Aprobar</button>
  83 + </form>
  84 +
  85 + </div>
  86 +
  87 + </div>
  88 +
  89 + <div class="col-md-5">
  90 + <h3>Documentos Consignados</h3>
  91 + <div class="widget-content">
  92 +
  93 +
  94 + {% if not ascenso %}
  95 + <div class="col-xs-4">
  96 + <div class="thumbnail">
  97 + <a href="{{asset('uploads/ascenso/'~ adscripcion.oposicion)}}" data-lightbox="adscripcion">
  98 + <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.oposicion) }}" />
  99 + </a>
  100 + <div class="caption">
  101 + <p>Constancia de Aprobación de Concurso.</p>
  102 + </div>
  103 + </div>
  104 + </div>
  105 + {% else %}
  106 +
  107 +
  108 + <div class="col-xs-4">
  109 + <div class="thumbnail">
  110 + <a href="{{asset('uploads/ascenso/'~ adscripcion.oposicion)}}" data-lightbox="adscripcion">
  111 + <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.oposicion) }}" />
  112 + </a>
  113 + <div class="caption">
  114 + <p>Constancia de Aprobación de Ascenso.</p>
  115 + </div>
  116 + </div>
  117 + </div>
  118 +
  119 +
  120 +
  121 + {% endif %}
  122 +
  123 + </div>
  124 +
  125 + </div>
  126 +
  127 +
  128 +
  129 + </div>
  130 +
  131 + </div>
  132 +
  133 + </div>
  134 +
  135 +{% endblock %}
  136 +
  137 +
  138 +{% block javascripts %}
  139 + {{ parent() }}
  140 + <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script>
  141 + {% endblock %}
0 142 \ No newline at end of file
... ...
app/Resources/views/cea/servicios.html.twig
... ... @@ -76,6 +76,8 @@
76 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 77 {% elseif servicio.idServicioCe.id == 5 %}
78 78 <a href="{{ path('cea_ascenso_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
  79 + {% elseif servicio.idServicioCe.id == 6 %}
  80 + <a href="{{ path('cea_reconocimientoEscala_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
79 81 {% endif %}
80 82 </td>
81 83 </tr>
... ...
app/Resources/views/solicitudes/reconocimientoEscala.html.twig
... ... @@ -0,0 +1,124 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +
  3 +{% block stylesheets %}
  4 + {{ parent() }}
  5 +
  6 + <style>
  7 + .esc_oposicion, .esc_asistente, .esc_agregado, .esc_asociado, .esc_titular{
  8 + display: none;
  9 + }
  10 +
  11 + h1, h4{
  12 + margin:0;
  13 + }
  14 +
  15 + .container{
  16 + margin-bottom: 0;
  17 + }
  18 + </style>
  19 +{% endblock %}
  20 +
  21 +
  22 +
  23 +{% block body %}
  24 + <div class="container">
  25 + <h4 class="alert alert-info"><i class="fa fa-info-circle"></i>
  26 + Estimado (a) Docente
  27 + <strong>{{app.user.idRolInstitucion.idRol.idPersona.primerNombre}}
  28 + {{app.user.idRolInstitucion.idRol.idPersona.primerApellido}}</strong>,
  29 + Aqui podra enviar la solicitud de reconocimiento de Escalafon.
  30 +
  31 + </h4>
  32 + </div>
  33 + <div class="account-container register">
  34 + <div class="content clearfix">
  35 + <h1>Reconocimiento Escala</h1>
  36 + <p>Por favor adjunte el digital de la aprobación de {{ tipo }}</p>
  37 + {% form_theme form 'bootstrap_3_layout.html.twig' %}
  38 + {{ form_start(form) }}
  39 + {{ form_widget(form) }}
  40 + {{ form_end(form) }}
  41 + </div>
  42 +
  43 + </div>
  44 +
  45 +
  46 +{% endblock %}
  47 +
  48 +
  49 +
  50 +
  51 +{% block javascripts %}
  52 + {{ parent() }}
  53 + <script type="text/javascript">
  54 + $('#user_oposicion').click(function() {
  55 + $('.esc_oposicion')[this.checked ? "show" : "hide"]();
  56 + $("#user_escala").prop('required', $(this).prop("checked"));
  57 + $("#user_fecha_oposicion_day").prop('required', $(this).prop("checked"));
  58 + $("#user_fecha_oposicion_month").prop('required', $(this).prop("checked"));
  59 + $("#user_fecha_oposicion_year").prop('required', $(this).prop("checked"));
  60 + $("#user_documento_oposicion").prop('required', $(this).prop("checked"));
  61 + $("#user_lineas_investigacion").prop('required', $(this).prop("checked"));
  62 + $("#user_titulo_trabajo").prop('required', $(this).prop("checked"));
  63 + });
  64 +
  65 + $('#user_ascenso').click(function() {
  66 +
  67 + if($("#user_escala").val() == 1)
  68 + $('.esc_asistente')[this.checked ? "show" : "hide"]();
  69 + if($("#user_escala").val() == 2)
  70 + $('.esc_asociado')[this.checked ? "show" : "hide"]();
  71 + if($("#user_escala").val() == 3)
  72 + $('.esc_agregado')[this.checked ? "show" : "hide"]();
  73 + if($("#user_escala").val() == 4)
  74 + $('.esc_titular')[this.checked ? "show" : "hide"]();
  75 +
  76 + });
  77 +
  78 +
  79 +
  80 +
  81 +
  82 + $("#user_fecha_oposicion_year").change(function(){
  83 + if ($("#user_fecha_oposicion_year").val() < $("#user_fecha_ingreso_year").val()){
  84 + alert('la fecha de concurso debe ser mayor a la fecha de ingreso');
  85 + $("#user_fecha_oposicion_year").val("");
  86 +
  87 + }
  88 + });
  89 +
  90 + $("#user_fecha_ascenso_asistente_year").change(function(){
  91 + if ($("#user_fecha_ascenso_asistente_year").val() < $("#user_fecha_oposicion_year").val()){
  92 + alert('la fecha de ascenso debe ser mayor a la del Concurso de oposición');
  93 + $("#user_fecha_asistente_year").val("");
  94 +
  95 + }
  96 + });
  97 +
  98 +
  99 +
  100 +
  101 + $('#user_ascenso2').click(function() {
  102 + $('.esc_asociado')[this.checked ? "show" : "hide"]();
  103 +
  104 + });
  105 +
  106 + $('#user_ascenso3').click(function() {
  107 +
  108 + $('.esc_agregado')[this.checked ? "show" : "hide"]();
  109 +
  110 + });
  111 +
  112 + $('#user_ascenso4').click(function() {
  113 +
  114 + $('.esc_titular')[this.checked ? "show" : "hide"]();
  115 + });
  116 +
  117 +
  118 + $('#user_escala').change(function(){
  119 + if ($('#user_escala').val() >= 1) $('#user_oposicion').attr('disabled',true);
  120 + else $('#user_oposicion').attr('disabled',false);
  121 + });
  122 +
  123 + </script>
  124 +{% endblock %}
... ...
src/AppBundle/Controller/AscensoController.php
... ... @@ -189,6 +189,127 @@ class AscensoController extends Controller
189 189  
190 190  
191 191  
  192 +
  193 +
  194 + /**
  195 + * @Route("/solicitud/reconocimiento/escala", name="cea_solicitud_recocimiento_escala")
  196 + */
  197 + public function reconocimientoEscalaAction(Request $request)
  198 + {
  199 +
  200 +
  201 + //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios
  202 + $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(
  203 + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 6)
  204 + );
  205 + if($solicitud){
  206 + if($solicitud->getIdEstatus()->getId() != 5 ){
  207 + return $this->redirect($this->generateUrl('servicios_index'));
  208 + }
  209 + }
  210 +
  211 + $concurso = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneBy(
  212 + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion())
  213 + );
  214 +
  215 +
  216 + $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
  217 + array(
  218 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  219 + 'idEstatus' => 1
  220 + )
  221 + );
  222 +
  223 + $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType');
  224 + $form->handleRequest($request);
  225 +
  226 + if ($form->isSubmitted() && $form->isValid()) {
  227 +
  228 + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  229 + $constanciaAscenso = $form->get('reconocimiento')->getData();
  230 +
  231 + $nombreAscenso = md5(uniqid()).'.'.$constanciaAscenso->guessExtension();
  232 +
  233 + // Guardar el archivo y crear la miniatura de cada uno
  234 + $constanciaAscenso->move(
  235 + $this->container->getParameter('ascenso_directory'),
  236 + $nombreAscenso
  237 + );
  238 + thumbnail($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory'));
  239 + if (!$concurso->getOposicion()){
  240 + $adscripcion->setOposicion($nombreAscenso);
  241 + }else{
  242 + switch ($solicitudAscenso->getIdEscalafones()->getId()){
  243 + case 2: $adscripcion->setAsistente($nombreAscenso);
  244 + break;
  245 + case 3: $adscripcion->setAsociado($nombreAscenso);
  246 + break;
  247 + case 4: $adscripcion->setAgregado($nombreAscenso);
  248 + break;
  249 + case 5: $adscripcion->setTitular($nombreAscenso);
  250 + break;
  251 + default:
  252 + break;
  253 + }
  254 +
  255 + }
  256 +
  257 +
  258 +
  259 + //Crear la solicitud de Servicio
  260 + $servicios = new DocenteServicio();
  261 +
  262 + $servicios->setIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  263 + $servicios->setIdServicioCe($this->getDoctrine()->getRepository('AppBundle:ServiciosCe')->findOneById(6));
  264 + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:estatus')->findOneById(2));
  265 + $em = $this->getDoctrine()->getManager();
  266 + $em->persist($servicios);
  267 + $em->persist($adscripcion);
  268 +
  269 + $em->flush();
  270 + return $this->redirect($this->generateUrl('cea_index'));
  271 + }
  272 +
  273 +
  274 + if(!$concurso->getOposicion()){
  275 + return $this->render(
  276 + 'solicitudes/reconocimientoEscala.html.twig',
  277 + array(
  278 + 'form' => $form->createView(),
  279 + 'tipo' => 'Concurso de Oposición'
  280 + )
  281 + );
  282 + }
  283 +
  284 +
  285 +
  286 + if(!$solicitudAscenso){
  287 + $this->addFlash('danger', 'Estimado Docente, No posee ninguna solicitud de Ascenso Activa.');
  288 + return $this->redirect($this->generateUrl('cea_index'));
  289 + }
  290 +
  291 +
  292 +
  293 +
  294 +
  295 +
  296 + return $this->render(
  297 + 'solicitudes/reconocimientoEscala.html.twig',
  298 + array(
  299 + 'form' => $form->createView(),
  300 + 'tipo' => 'Ascenso ' . $solicitudAscenso->getIdEscalafones()->getNombre()
  301 + )
  302 + );
  303 +
  304 +
  305 +
  306 +
  307 +
  308 +
  309 + }
  310 +
  311 +
  312 +
192 313 /**
193 314 * Encuentra y muestra una entidad de tipo Adscripción.
194 315 *
... ... @@ -219,6 +340,46 @@ class AscensoController extends Controller
219 340 }
220 341  
221 342  
  343 +
  344 +
  345 + /**
  346 + * Encuentra y muestra una entidad de tipo Adscripción.
  347 + *
  348 + * @Route("/reconocimientoEscala/{id}", name="cea_reconocimientoEscala_show")
  349 + * @Method("GET")
  350 + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')")
  351 + */
  352 + public function reconocimientoEscalaShowAction(DocenteServicio $servicio)
  353 + {
  354 + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array(
  355 + 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId()
  356 + ));
  357 +
  358 +
  359 + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  360 + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  361 + $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  362 +
  363 + if($ascenso == NULL){
  364 + $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findAll();
  365 + }else{
  366 + $escalafones = $this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($ascenso->getIdEscalafones()->getId());
  367 + }
  368 +
  369 +
  370 +
  371 + return $this->render('cea/reconocimiento_escala_mostrar.html.twig', array(
  372 + 'ascenso' => $ascenso,
  373 + 'adscripcion' => $adscripcion,
  374 + 'servicio' => $servicio,
  375 + 'escalas' => $escala,
  376 + 'pida' => $pida,
  377 + 'escalafones' => $escalafones
  378 +
  379 + ));
  380 + }
  381 +
  382 +
222 383 /**
223 384 * Encuentra y muestra una entidad de tipo Adscripción.
224 385 *
... ... @@ -296,6 +457,43 @@ class AscensoController extends Controller
296 457  
297 458  
298 459  
  460 +
  461 + /**
  462 + * Encuentra y muestra una entidad de tipo Adscripción.
  463 + *
  464 + * @Route("/reconocimiento/escala/{id}/{escala}/{estatus}", name="cea_escala_actualizar")
  465 + * @Method({"GET", "POST"})
  466 + * @Security("has_role('ROLE_COORDINADOR_REGIONAL')")
  467 + */
  468 + public function actualizarEscalaAction(DocenteServicio $servicio, $escala, $estatus, Request $request)
  469 + {
  470 + $escala_docente = new DocenteEscala();
  471 + if ($request->getMethod() == 'POST') {
  472 + $escala_docente->setIdRolInstitucion($servicio->getIdRolInstitucion());
  473 + $escala_docente->setidEscala($this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($this->get('request')->request->get('escala')));
  474 + $escala_docente->setFechaEscala(new \DateTime($this->get('request')->request->get('fecha_escala')));
  475 + $escala_docente->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById($this->get('request')->request->get('tipo')));
  476 +
  477 +
  478 +
  479 + $em = $this->getDoctrine()->getManager();
  480 + $em->persist($escala_docente);
  481 +
  482 + $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
  483 + $em->persist($servicio);
  484 +
  485 + $em->flush();
  486 + }
  487 +
  488 +
  489 + $this->addFlash('success', 'Escala Agregada Satisfactoriamente');
  490 + return $this->redirect($this->generateUrl('cea_index'));
  491 +
  492 + }
  493 +
  494 +
  495 +
  496 +
299 497  
300 498 }
301 499  
... ...
src/AppBundle/Form/ReconocimientoEscalaType.php
... ... @@ -0,0 +1,62 @@
  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 +
  21 +use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  22 +
  23 +class ReconocimientoEscalaType extends AbstractType
  24 +{
  25 + public function buildForm(FormBuilderInterface $builder, array $options)
  26 + {
  27 + $builder
  28 +
  29 + ->add('reconocimiento', FileType::class, array(
  30 + 'label' => 'Digital Aprobación de Escala',
  31 + 'constraints' => array(
  32 + new NotBlank(),
  33 + new File(array(
  34 + 'maxSize' => '1024K',
  35 + 'mimeTypes' => [
  36 + 'application/pdf',
  37 + 'application/x-pdf',
  38 + 'image/png',
  39 + 'image/jpg',
  40 + 'image/jpeg'
  41 + ],
  42 + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf'
  43 + ))
  44 + )
  45 + ))
  46 + ->add('send', SubmitType::class, array(
  47 + 'label' => 'Enviar reconocimiento de Escala',
  48 + 'attr' => array('class' => 'btn btn-success btn-block')
  49 + ))
  50 +
  51 + ;
  52 +
  53 +
  54 + }
  55 +
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +}
... ...