Commit c23d5dc94897e7f4c2d206c797976927d41130d5
1 parent
673a88cac3
Exists in
master
mejorada la solicitud de reconocimiento de escala
Showing
4 changed files
with
68 additions
and
25 deletions
Show diff stats
app/Resources/views/cea/ascenso_mostar.html.twig
@@ -59,8 +59,10 @@ | @@ -59,8 +59,10 @@ | ||
59 | <td>{{escala.idTipoEscala }}</td> | 59 | <td>{{escala.idTipoEscala }}</td> |
60 | </tr> | 60 | </tr> |
61 | {%endfor %} | 61 | {%endfor %} |
62 | - </table> | 62 | + </table> |
63 | + | ||
63 | <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> | 64 | <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> |
65 | + | ||
64 | </div> | 66 | </div> |
65 | {% endif %} | 67 | {% endif %} |
66 | 68 | ||
@@ -71,15 +73,7 @@ | @@ -71,15 +73,7 @@ | ||
71 | El Docente ya ha formalizado su Antiguedad ante la UBV | 73 | El Docente ya ha formalizado su Antiguedad ante la UBV |
72 | {% endif %} | 74 | {% endif %} |
73 | {% endif %} | 75 | {% endif %} |
74 | - | ||
75 | - {% if ascenso is not null %} | ||
76 | - <button class="btn btn-success btn-sm">Añadir Ascenso {{ ascenso.idEscalafones.nombre }} </button> | ||
77 | - {% endif %} | ||
78 | - | ||
79 | - | ||
80 | - | ||
81 | - | ||
82 | - | 76 | + |
83 | {% if ascenso.tituloTrabajo is not null %} | 77 | {% if ascenso.tituloTrabajo is not null %} |
84 | <div class="form-group"> | 78 | <div class="form-group"> |
85 | <label for="titulo">Título del Trabajo:</label> | 79 | <label for="titulo">Título del Trabajo:</label> |
app/Resources/views/cea/reconocimiento_escala_mostrar.html.twig
@@ -107,8 +107,8 @@ | @@ -107,8 +107,8 @@ | ||
107 | 107 | ||
108 | <div class="col-xs-4"> | 108 | <div class="col-xs-4"> |
109 | <div class="thumbnail"> | 109 | <div class="thumbnail"> |
110 | - <a href="{{asset('uploads/ascenso/'~ adscripcion.oposicion)}}" data-lightbox="adscripcion"> | ||
111 | - <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.oposicion) }}" /> | 110 | + <a href="{{asset('uploads/ascenso/'~ adscripcion.agreado)}}" data-lightbox="adscripcion"> |
111 | + <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.agreado) }}" /> | ||
112 | </a> | 112 | </a> |
113 | <div class="caption"> | 113 | <div class="caption"> |
114 | <p>Constancia de Aprobación de Ascenso.</p> | 114 | <p>Constancia de Aprobación de Ascenso.</p> |
app/Resources/views/cea/solicitudes_mostar.html.twig
@@ -155,8 +155,21 @@ | @@ -155,8 +155,21 @@ | ||
155 | {% if adscripcion.asistente is not null %} | 155 | {% if adscripcion.asistente is not null %} |
156 | <div class="col-xs-4"> | 156 | <div class="col-xs-4"> |
157 | <div class="thumbnail"> | 157 | <div class="thumbnail"> |
158 | - <a href="{{asset('uploads/adscripcion/'~ adscripcion.asistente)}}" data-lightbox="adscripcion"> | ||
159 | - <img src="{{ asset('uploads/adscripcion/thumb/'~ adscripcion.asistente) }}" /> | 158 | + <a href="{{asset('uploads/ascenso/'~ adscripcion.asistente)}}" data-lightbox="adscripcion"> |
159 | + <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.asistente) }}" /> | ||
160 | + </a> | ||
161 | + <div class="caption"> | ||
162 | + <p>Ascenso Asistente</p> | ||
163 | + </div> | ||
164 | + </div> | ||
165 | + </div> | ||
166 | + {% endif %} | ||
167 | + | ||
168 | + {% if adscripcion.agreado is not null %} | ||
169 | + <div class="col-xs-4"> | ||
170 | + <div class="thumbnail"> | ||
171 | + <a href="{{asset('uploads/ascenso/'~ adscripcion.agreado)}}" data-lightbox="adscripcion"> | ||
172 | + <img src="{{ asset('uploads/ascenso/thumb/'~ adscripcion.agreado) }}" /> | ||
160 | </a> | 173 | </a> |
161 | <div class="caption"> | 174 | <div class="caption"> |
162 | <p>Ascenso Asistente</p> | 175 | <p>Ascenso Asistente</p> |
src/AppBundle/Controller/AscensoController.php
@@ -96,27 +96,27 @@ class AscensoController extends Controller | @@ -96,27 +96,27 @@ class AscensoController extends Controller | ||
96 | $this->container->getParameter('ascenso_directory'), | 96 | $this->container->getParameter('ascenso_directory'), |
97 | $nombreTrabajo | 97 | $nombreTrabajo |
98 | ); | 98 | ); |
99 | - thumbnail($nombreTrabajo, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 99 | + thumbnail2($nombreTrabajo, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
100 | 100 | ||
101 | 101 | ||
102 | $constanciaExpediente->move( | 102 | $constanciaExpediente->move( |
103 | $this->container->getParameter('ascenso_directory'), | 103 | $this->container->getParameter('ascenso_directory'), |
104 | $nombreExpediente | 104 | $nombreExpediente |
105 | ); | 105 | ); |
106 | - thumbnail($nombreExpediente, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 106 | + thumbnail2($nombreExpediente, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
107 | 107 | ||
108 | $constanciaPida->move( | 108 | $constanciaPida->move( |
109 | $this->container->getParameter('ascenso_directory'), | 109 | $this->container->getParameter('ascenso_directory'), |
110 | $nombrePida | 110 | $nombrePida |
111 | ); | 111 | ); |
112 | - thumbnail($nombrePida, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 112 | + thumbnail2($nombrePida, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
113 | 113 | ||
114 | 114 | ||
115 | $constanciaNai->move( | 115 | $constanciaNai->move( |
116 | $this->container->getParameter('ascenso_directory'), | 116 | $this->container->getParameter('ascenso_directory'), |
117 | $nombreNai | 117 | $nombreNai |
118 | ); | 118 | ); |
119 | - thumbnail($nombreNai, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 119 | + thumbnail2($nombreNai, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
120 | 120 | ||
121 | if($form->get('investigacion')->getData()) { | 121 | if($form->get('investigacion')->getData()) { |
122 | /** @var UploadedFile $constanciaPostgrado */ | 122 | /** @var UploadedFile $constanciaPostgrado */ |
@@ -126,7 +126,7 @@ class AscensoController extends Controller | @@ -126,7 +126,7 @@ class AscensoController extends Controller | ||
126 | $this->container->getParameter('ascenso_directory'), | 126 | $this->container->getParameter('ascenso_directory'), |
127 | $nombreInvestigacion | 127 | $nombreInvestigacion |
128 | ); | 128 | ); |
129 | - thumbnail($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 129 | + thumbnail2($nombreInvestigacion, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
130 | $ascenso->setInvestigacion($nombreInvestigacion); | 130 | $ascenso->setInvestigacion($nombreInvestigacion); |
131 | } | 131 | } |
132 | $em = $this->getDoctrine()->getManager(); | 132 | $em = $this->getDoctrine()->getManager(); |
@@ -150,7 +150,7 @@ class AscensoController extends Controller | @@ -150,7 +150,7 @@ class AscensoController extends Controller | ||
150 | $this->container->getParameter('ascenso_directory'), | 150 | $this->container->getParameter('ascenso_directory'), |
151 | $nombrePertinencia | 151 | $nombrePertinencia |
152 | ); | 152 | ); |
153 | - thumbnail($nombrePertinencia, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 153 | + thumbnail2($nombrePertinencia, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
154 | $ascenso->setPertinencia($nombrePertinencia); | 154 | $ascenso->setPertinencia($nombrePertinencia); |
155 | $ascenso->setIdLineaInvestigacion($form->get('lineas_investigacion')->getData()); | 155 | $ascenso->setIdLineaInvestigacion($form->get('lineas_investigacion')->getData()); |
156 | 156 | ||
@@ -225,6 +225,7 @@ class AscensoController extends Controller | @@ -225,6 +225,7 @@ class AscensoController extends Controller | ||
225 | 225 | ||
226 | if ($form->isSubmitted() && $form->isValid()) { | 226 | if ($form->isSubmitted() && $form->isValid()) { |
227 | 227 | ||
228 | + | ||
228 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | 229 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
229 | $constanciaAscenso = $form->get('reconocimiento')->getData(); | 230 | $constanciaAscenso = $form->get('reconocimiento')->getData(); |
230 | 231 | ||
@@ -235,16 +236,16 @@ class AscensoController extends Controller | @@ -235,16 +236,16 @@ class AscensoController extends Controller | ||
235 | $this->container->getParameter('ascenso_directory'), | 236 | $this->container->getParameter('ascenso_directory'), |
236 | $nombreAscenso | 237 | $nombreAscenso |
237 | ); | 238 | ); |
238 | - thumbnail($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); | 239 | + thumbnail2($nombreAscenso, $this->container->getParameter('ascenso_directory'), $this->container->getParameter('ascenso_thumb_directory')); |
239 | if (!$concurso->getOposicion()){ | 240 | if (!$concurso->getOposicion()){ |
240 | $adscripcion->setOposicion($nombreAscenso); | 241 | $adscripcion->setOposicion($nombreAscenso); |
241 | }else{ | 242 | }else{ |
242 | switch ($solicitudAscenso->getIdEscalafones()->getId()){ | 243 | switch ($solicitudAscenso->getIdEscalafones()->getId()){ |
243 | case 2: $adscripcion->setAsistente($nombreAscenso); | 244 | case 2: $adscripcion->setAsistente($nombreAscenso); |
244 | break; | 245 | break; |
245 | - case 3: $adscripcion->setAsociado($nombreAscenso); | 246 | + case 3: $adscripcion->setAgreado($nombreAscenso); |
246 | break; | 247 | break; |
247 | - case 4: $adscripcion->setAgregado($nombreAscenso); | 248 | + case 4: $adscripcion->setAsociado($nombreAscenso); |
248 | break; | 249 | break; |
249 | case 5: $adscripcion->setTitular($nombreAscenso); | 250 | case 5: $adscripcion->setTitular($nombreAscenso); |
250 | break; | 251 | break; |
@@ -323,7 +324,11 @@ class AscensoController extends Controller | @@ -323,7 +324,11 @@ class AscensoController extends Controller | ||
323 | 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId() | 324 | 'idRolInstitucion' => $servicio->getIdRolInstitucion()->getId() |
324 | )); | 325 | )); |
325 | 326 | ||
326 | - $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 327 | + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( |
328 | + 'idRolInstitucion' => $servicio->getIdRolInstitucion(), | ||
329 | + 'idEstatus' => 2 | ||
330 | + )); | ||
331 | + | ||
327 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 332 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
328 | $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( | 333 | $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( |
329 | 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), | 334 | 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), |
@@ -357,7 +362,12 @@ class AscensoController extends Controller | @@ -357,7 +362,12 @@ class AscensoController extends Controller | ||
357 | 362 | ||
358 | 363 | ||
359 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 364 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
360 | - $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 365 | + |
366 | + $ascenso = $this->getDoctrine()->getRepository('AppBundle:Ascenso')->findOneBy(array( | ||
367 | + 'idRolInstitucion' => $servicio->getIdRolInstitucion(), | ||
368 | + 'idEstatus' => 1 | ||
369 | + )); | ||
370 | + | ||
361 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); | 371 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
362 | 372 | ||
363 | if($ascenso == NULL){ | 373 | if($ascenso == NULL){ |
@@ -519,3 +529,29 @@ class AscensoController extends Controller | @@ -519,3 +529,29 @@ class AscensoController extends Controller | ||
519 | 529 | ||
520 | } | 530 | } |
521 | 531 | ||
532 | +/*funcion para crear miniaturas de las imagenes y carga más rapido la página */ | ||
533 | + | ||
534 | +function thumbnail2 ($filename, $fuente, $destino){ | ||
535 | + if(preg_match('/[.](jpeg)$/', $filename)) { | ||
536 | + $im = imagecreatefromjpeg($fuente . "/" . $filename); | ||
537 | + } else if (preg_match('/[.](jpg)$/', $filename)) { | ||
538 | + $im = imagecreatefromjpeg($fuente . "/" . $filename); | ||
539 | + }else if (preg_match('/[.](gif)$/', $filename)) { | ||
540 | + $im = imagecreatefromgif($fuente . "/" . $filename); | ||
541 | + } else if (preg_match('/[.](png)$/', $filename)) { | ||
542 | + $im = imagecreatefrompng($fuente . "/" . $filename); | ||
543 | + } | ||
544 | + | ||
545 | + $ox = imagesx($im); | ||
546 | + $oy = imagesy($im); | ||
547 | + | ||
548 | + $nx = 80; | ||
549 | + $ny = 80; | ||
550 | + | ||
551 | + $nm = imagecreatetruecolor($nx, $ny); | ||
552 | + | ||
553 | + imagecopyresized($nm, $im, 0,0,0,0,$nx,$ny,$ox,$oy); | ||
554 | + | ||
555 | + imagejpeg($nm, $destino . "/" . $filename); | ||
556 | +} | ||
557 | + |