Commit 94b8dadb76f909e8f05f95d132c10f4b12a450dc

Authored by Wilmer
1 parent 4bb5b21557
Exists in master

cambiado el reconocimiento de Escala a la nueva version vertical de los documentos

app/Resources/views/cea/reconocimiento_escala_mostrar.html.twig
... ... @@ -2,6 +2,99 @@
2 2 {% block stylesheets %}
3 3 {{ parent() }}
4 4 <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet">
  5 + <style>
  6 + .wrapper {
  7 + width: 6.9rem;
  8 + height: 2rem;
  9 + position: relative;
  10 + margin: 0rem auto;
  11 + border-radius: 2rem;
  12 + background: gray;
  13 + }
  14 +
  15 + .wrapper .toggle {
  16 + width: 1.8rem;
  17 + height: 1.8rem;
  18 + position: absolute;
  19 + left: 2.5rem;
  20 + top: 0.1rem;
  21 + border-radius: 50%;
  22 + box-sizing: border-box;
  23 + border: 0.1rem solid #ff6c00;
  24 + background: #ff8933;
  25 + box-shadow: 0 0 0.2rem 0.1rem #ff6c00 inset, 0 0 0.2rem 0.1rem #ff6c00;
  26 + transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  27 + }
  28 +
  29 + .wrapper label {
  30 + cursor: pointer;
  31 + width: 2rem;
  32 + height: 2rem;
  33 + position: absolute;
  34 + margin: 0;
  35 + padding: 0;
  36 + z-index: 1;
  37 + display: inline-block;
  38 + text-align: center;
  39 + line-height: 2rem;
  40 + text-transform: uppercase;
  41 + font-family: FontAwesome;
  42 + font-style: normal;
  43 + font-weight: normal;
  44 + color: white;
  45 +
  46 + }
  47 +
  48 + .wrapper input {
  49 + position: absolute;
  50 + left: 0;
  51 + margin: 0;
  52 + padding: 0;
  53 + opacity: 0;
  54 + }
  55 +
  56 + .yes_radio:checked ~ .toggle {
  57 + border: 0.1rem solid #008000;
  58 + background: #00b300;
  59 + box-shadow: 0 0 0.2rem 0.1rem #008000 inset, 0 0 0.2rem 0.1rem #008000;
  60 + left: 0.1rem;
  61 + }
  62 +
  63 + .no_radio:checked {
  64 + background: red;
  65 + }
  66 +
  67 + .no_radio:checked ~ .toggle {
  68 + border: 0.1rem solid #ff0000;
  69 + background: #ff3333;
  70 + box-shadow: 0 0 0.2rem 0.1rem #ff0000 inset, 0 0 0.2rem 0.1rem #ff0000;
  71 + left: 4.97rem;
  72 + }
  73 +
  74 + .maybe_radio, .maybe-lbl {
  75 + left: 33.33333%;
  76 + }
  77 +
  78 + .no_radio, .no-lbl {
  79 + left: 66.66667%;
  80 + }
  81 +
  82 + .maybe-lbl {
  83 + -webkit-animation-delay: 2s;
  84 + -o-animation-delay: 2s;
  85 + -moz-animation-delay: 2s;
  86 + animation-delay: 2s;
  87 + }
  88 +
  89 + .no-lbl {
  90 + -webkit-animation-delay: 4s;
  91 + -o-animation-delay: 4s;
  92 + -moz-animation-delay: 4s;
  93 + animation-delay: 4s;
  94 + }
  95 +
  96 +
  97 + </style>
5 98 {% endblock %}
6 99  
7 100 {%block body %}
... ... @@ -15,8 +108,7 @@
15 108 <div class="row">
16 109 <div class="col-md-9">
17 110 <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 }}
  111 + {{ docente }}
20 112 </h4>
21 113 </div>
22 114 <div class="col-md-3">
... ... @@ -44,14 +136,14 @@
44 136  
45 137  
46 138  
47   - {% if escalas is not null %}
  139 + {% if docente.escalafones is not empty %}
48 140 <div class="form-group">
49 141 <label for="Escalafones">Escalafones Obtenidos:</label>
50 142 <table class="table table-striped table-bordered">
51 143 <th>Escalafรณn</th>
52 144 <th>Fecha</th>
53 145 <th>Tipo</th>
54   - {% for escala in escalas %}
  146 + {% for escala in docente.escalafones %}
55 147  
56 148 <tr>
57 149 <td>{{escala.idEscala }}</td>
... ... @@ -62,10 +154,10 @@
62 154 </table>
63 155 <p><strong>Tipo de Reconocimiento:</strong>{% if not ascenso %} Concurso de oposiciรณn {% else %} Ascenso {% endif %} </p>
64 156 </div>
65   - {% endif %}
66   -
  157 + {% endif %}
  158 + <form name="input" action="{{ path('cea_escala_actualizar', { 'id': servicio.id, 'escala': 'escalafones', 'estatus' : 'true' }) }}" method="post">
67 159 {% if servicio.idEstatus.id == 2 %}
68   - <form name="input" action="{{ path('cea_escala_actualizar', { 'id': servicio.id, 'escala': 'escalafones', 'estatus' : 'true' }) }}" method="post">
  160 +
69 161 {% if not ascenso %}
70 162  
71 163 <select name="escala" required>
... ... @@ -83,7 +175,7 @@
83 175 <br><label for="fecha_escala"> Fecha de Escalafรณn: </label> <input type="date" name="fecha_escala" />
84 176 <br><button type="submit" class="btn btn-success btn-sm" ><span class="fa fa-check"></span>&nbsp;Aprobar</button>
85 177  
86   - </form>
  178 +
87 179 {% endif %}
88 180  
89 181 </div>
... ... @@ -94,80 +186,39 @@
94 186 <h3>Documentos Consignados</h3>
95 187 <div class="widget-content">
96 188  
97   -
98   - {% if not ascenso %}
  189 + {% for documento in docente.documentosVerificados %}
  190 + {% if documento.idServicio.id == 5 and documento.idEstatus.id == 2 %}
99 191 <div class="col-xs-4">
100 192 <div class="thumbnail">
101   - <a href="{{asset('uploads/ascenso/'~ adscripcion.oposicion)}}" data-lightbox="adscripcion">
102   - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.oposicion) }}" />
103   - </a>
104   - <div class="caption">
105   - <p>Constancia de Aprobaciรณn de Concurso.</p>
106   - </div>
107   - </div>
108   - </div>
109   - {% else %}
110   -
111   - {% if escalafones == "ASISTENTE" %}
112   - <div class="col-xs-4">
113   - <div class="thumbnail">
114   - <a href="{{asset('uploads/ascenso/'~ adscripcion.asistente)}}" data-lightbox="adscripcion">
115   - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.asistente) }}" />
116   - </a>
117   - <div class="caption">
118   - <p>Constancia de Aprobaciรณn de Ascenso.</p>
119   - </div>
120   - </div>
121   - </div>
122   - {% endif %}
123   -
124   -
125   - {% if escalafones == "AGREGADO" %}
126   - <div class="col-xs-4">
127   - <div class="thumbnail">
128   - <a href="{{asset('uploads/ascenso/'~ adscripcion.agreado)}}" data-lightbox="adscripcion">
129   - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.agreado) }}" />
130   - </a>
131   - <div class="caption">
132   - <p>Constancia de Aprobaciรณn de Ascenso.</p>
133   - </div>
134   - </div>
135   - </div>
136   - {% endif %}
137   -
138   -
139   - {% if escalafones == "ASOCIADO" %}
140   - <div class="col-xs-4">
141   - <div class="thumbnail">
142   - <a href="{{asset('uploads/ascenso/'~ adscripcion.asociado)}}" data-lightbox="adscripcion">
143   - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.asociado) }}" />
  193 + <a href="{{asset('uploads/adscripcion/'~ documento.ubicacion)}}" data-lightbox="adscripcion">
  194 + <img src="{{ asset('uploads/adscripcion/thumb/'~ documento.ubicacion) }}" />
144 195 </a>
145 196 <div class="caption">
146   - <p>Constancia de Aprobaciรณn de Ascenso.</p>
147   - </div>
148   - </div>
149   - </div>
150   - {% endif %}
151   -
152   -
153   - {% if escalafones == "TITULAR" %}
154   - <div class="col-xs-4">
155   - <div class="thumbnail">
156   - <a href="{{asset('uploads/ascenso/'~ adscripcion.titular)}}" data-lightbox="adscripcion">
157   - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.titular) }}" />
158   - </a>
159   - <div class="caption">
160   - <p>Constancia de Aprobaciรณn de Ascenso.</p>
  197 + <p>{{ documento.idTipoDocumentos.nombre }}</p>
  198 + <div class="wrapper">
  199 + <label for="yes_radio" class="yes-lbl"><i class="fa fa-check"></i>
  200 + </label>
  201 + <input type="radio" value="1" name="{{ documento.idTipoDocumentos.identificador }}" class="yes_radio" id="yes_radio" {% if documento.idEstatus.id == 1 %} checked="checked" {% endif %}>
  202 + <label for="maybe_radio" class="maybe-lbl">
  203 + <i class="fa fa-question"></i>
  204 + </label>
  205 + <input type="radio" value="" name="{{ documento.idTipoDocumentos.identificador }}" class="maybe_radio" id="maybe_radio" {% if documento.idEstatus.id == 2 %} checked="checked" {% endif %} disabled>
  206 + <label for="no_radio" class="no-lbl"><i
  207 + class="fa fa-close"></i></label><input type="radio" value="3"
  208 + name="{{ documento.idTipoDocumentos.identificador }}"
  209 + class="no_radio"
  210 + id="no_radio" {% if documento.idEstatus.id == 3 %} checked="checked" {% endif %}>
  211 +
  212 + <div class="toggle"></div>
  213 + </div>
161 214 </div>
162 215 </div>
163 216 </div>
164   - {% endif %}
165   -
166   -
167   -
168   - {% endif %}
169 217  
170   - </div>
  218 + {% endif %}
  219 + {% endfor %}
  220 + </form>
  221 + </div>
171 222  
172 223 </div>
173 224  
... ...
src/AppBundle/Controller/AntiguedadController.php
... ... @@ -45,7 +45,8 @@ class AntiguedadController extends Controller {
45 45  
46 46 $oposicion = $this->getDoctrine()->getRepository("AppBundle:DocumentosVerificados")->findOneBy(array(
47 47 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
48   - 'idTipoDocumentos' => 4
  48 + 'idTipoDocumentos' => 4,
  49 + 'idEstatus' => 1
49 50 ));
50 51  
51 52 if (!$oposicion ){
... ...
src/AppBundle/Controller/AscensoController.php
... ... @@ -9,6 +9,7 @@
9 9 namespace AppBundle\Controller;
10 10  
11 11  
  12 +use AppBundle\Entity\DocumentosVerificados;
12 13 use Symfony\Component\HttpFoundation\File\UploadedFile;
13 14 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
14 15 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
... ... @@ -17,7 +18,6 @@ use AppBundle\Entity\Ascenso;
17 18 use AppBundle\Entity\DocenteEscala;
18 19 use AppBundle\Entity\Memorando;
19 20 use AppBundle\Entity\DocenteServicio;
20   -use AppBundle\Entity\AdscripcionPida;
21 21 use AppBundle\Entity\TutoresAscenso;
22 22  
23 23  
... ... @@ -317,9 +317,10 @@ class AscensoController extends Controller
317 317  
318 318  
319 319  
320   - $concurso = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneBy(
321   - array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion())
322   - );
  320 + $concurso = $this->getDoctrine()->getRepository('AppBundle:DocumentosVerificados')->findOneBy(array(
  321 + 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(),
  322 + 'idTipoDocumentos' => 4
  323 + ));
323 324  
324 325  
325 326 $solicitudAscenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(
... ... @@ -333,7 +334,7 @@ class AscensoController extends Controller
333 334 $form = $this->createForm('AppBundle\Form\ReconocimientoEscalaType');
334 335  
335 336 $form->handleRequest($request);
336   -
  337 + $em = $this->getDoctrine()->getManager();
337 338 if ($form->isSubmitted() && $form->isValid()) {
338 339  
339 340  
... ... @@ -343,13 +344,14 @@ class AscensoController extends Controller
343 344 $nombreAscenso = md5(uniqid()).'.'.$constanciaAscenso->guessExtension();
344 345  
345 346 // Guardar el archivo y crear la miniatura de cada uno
346   - if (!$concurso->getOposicion()){
347   - $adscripcion->setOposicion($nombreAscenso);
  347 + if (!$concurso){
348 348 $constanciaAscenso->move(
349 349 $this->container->getParameter('adscripcion_directory'),
350 350 $nombreAscenso
351 351 );
352   - thumbnail2($nombreAscenso, $this->container->getParameter('adscripcion_directory'), $this->container->getParameter('ascenso_thumb_directory'));
  352 + thumbnail2($nombreAscenso, $this->container->getParameter('adscripcion_directory'), $this->container->getParameter('adscripcion_thumb_directory'));
  353 +
  354 + verificar_documentos2($adscripcion->getIdRolInstitucion(),4,2,$em,$nombreAscenso, 5);
353 355 }else{
354 356 $constanciaAscenso->move(
355 357 $this->container->getParameter('ascenso_directory'),
... ... @@ -357,13 +359,13 @@ class AscensoController extends Controller
357 359 );
358 360 thumbnail2($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory'));
359 361 switch ($solicitudAscenso->getIdEscalafones()->getId()){
360   - case 2: $adscripcion->setAsistente($nombreAscenso);
  362 + case 2: verificar_documentos2($adscripcion->getIdRolInstitucion(),5,2,$em,$nombreAscenso, 5);
361 363 break;
362   - case 3: $adscripcion->setAgreado($nombreAscenso);
  364 + case 3: verificar_documentos2($adscripcion->getIdRolInstitucion(),6,2,$em,$nombreAscenso, 5);
363 365 break;
364   - case 4: $adscripcion->setAsociado($nombreAscenso);
  366 + case 4: verificar_documentos2($adscripcion->getIdRolInstitucion(),7,2,$em,$nombreAscenso, 5);
365 367 break;
366   - case 5: $adscripcion->setTitular($nombreAscenso);
  368 + case 5: verificar_documentos2($adscripcion->getIdRolInstitucion(),8,2,$em,$nombreAscenso, 5);
367 369 break;
368 370 default:
369 371 break;
... ... @@ -378,7 +380,6 @@ class AscensoController extends Controller
378 380 $servicios->setIdRolInstitucion($this->getUser()->getIdRolInstitucion());
379 381 $servicios->setIdServicioCe($this->getDoctrine()->getRepository('AppBundle:ServiciosCe')->findOneById(6));
380 382 $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:estatus')->findOneById(2));
381   - $em = $this->getDoctrine()->getManager();
382 383 $em->persist($servicios);
383 384 $em->persist($adscripcion);
384 385  
... ... @@ -388,7 +389,7 @@ class AscensoController extends Controller
388 389 }
389 390  
390 391  
391   - if(!$concurso->getOposicion()){
  392 + if(!$concurso){
392 393 return $this->render(
393 394 'solicitudes/reconocimientoEscala.html.twig',
394 395 array(
... ... @@ -482,7 +483,10 @@ class AscensoController extends Controller
482 483 * @Security("has_role('ROLE_COORDINADOR_REGIONAL')")
483 484 */
484 485 public function reconocimientoEscalaShowAction(DocenteServicio $servicio)
485   - {
  486 + {
  487 + $em = $this->getDoctrine()->getManager();
  488 + $docente = $em->getRepository("AppBundle:RolInstitucion")->findOneById($servicio->getIdRolInstitucion()->getId());
  489 +
486 490 $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array(
487 491 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId()
488 492 ));
... ... @@ -511,7 +515,8 @@ class AscensoController extends Controller
511 515 'servicio' => $servicio,
512 516 'escalas' => $escala,
513 517 'pida' => $pida,
514   - 'escalafones' => $escalafones
  518 + 'escalafones' => $escalafones,
  519 + 'docente' => $docente
515 520  
516 521 ));
517 522 }
... ... @@ -613,9 +618,8 @@ class AscensoController extends Controller
613 618 $escala_docente->setidEscala($this->getDoctrine()->getRepository('AppBundle:Escalafones')->findOneById($this->get('request')->request->get('escala')));
614 619 $escala_docente->setFechaEscala(new \DateTime($this->get('request')->request->get('fecha_escala')));
615 620 $escala_docente->setIdTipoEscala($this->getDoctrine()->getRepository('AppBundle:TipoAscenso')->findOneById($this->get('request')->request->get('tipo')));
616   -
617   -
618   -
  621 +
  622 +
619 623 $em = $this->getDoctrine()->getManager();
620 624 $em->persist($escala_docente);
621 625  
... ... @@ -638,9 +642,18 @@ class AscensoController extends Controller
638 642 $em->persist($ServicioAscenso);
639 643 $em->persist($ascenso);
640 644 }
  645 +
  646 + $documento = $em->getRepository("AppBundle:DocumentosVerificados")->findOneBy(array(
  647 + 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
  648 + 'idServicio' => 5,
  649 + 'idEstatus' => 2
  650 + ));
  651 +
  652 + $documento->setIdEstatus($em->getRepository("AppBundle:Estatus")->findOneById($this->get('request')->request->get('oposicion')));
641 653  
642 654 $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(4));
643 655 $em->persist($servicio);
  656 + $em->persist($documento);
644 657  
645 658 $em->flush();
646 659 }
... ... @@ -763,3 +776,26 @@ function thumbnail2 ($filename, $fuente, $destino){
763 776 }
764 777 }
765 778  
  779 +
  780 +function verificar_documentos2($idRolInstitucion, $tipo, $estatus, $em, $ubicacion="", $servicio = 2){
  781 + $existe = $em->getRepository("AppBundle:DocumentosVerificados")->findOneBy(array(
  782 + 'idRolInstitucion' => $idRolInstitucion,
  783 + 'idTipoDocumentos' => $tipo
  784 + ));
  785 +
  786 + if(!$existe) {
  787 + $verificacion = new DocumentosVerificados();
  788 + $verificacion->setIdEstatus($em->getRepository("AppBundle:Estatus")->findOneById($estatus));
  789 + $verificacion->setIdRolInstitucion($idRolInstitucion);
  790 + $verificacion->setIdServicio($em->getRepository("AppBundle:ServiciosCe")->findOneById($servicio));
  791 + $verificacion->setIdTipoDocumentos($em->getRepository("AppBundle:TipoDocumentos")->findOneById($tipo));
  792 + $verificacion->setUbicacion($ubicacion);
  793 + $em->persist($verificacion);
  794 + $em->flush();
  795 + }else{
  796 + $existe->setIdEstatus($em->getRepository("AppBundle:Estatus")->findOneById($estatus));
  797 + $em->persist($existe);
  798 + $em->flush();
  799 + }
  800 +
  801 +}
766 802 \ No newline at end of file
... ...