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 | 59 | <td>{{escala.idTipoEscala }}</td> |
60 | 60 | </tr> |
61 | 61 | {%endfor %} |
62 | - </table> | |
62 | + </table> | |
63 | + | |
63 | 64 | <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> |
65 | + | |
64 | 66 | </div> |
65 | 67 | {% endif %} |
66 | 68 | |
... | ... | @@ -71,15 +73,7 @@ |
71 | 73 | El Docente ya ha formalizado su Antiguedad ante la UBV |
72 | 74 | {% endif %} |
73 | 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 | 77 | {% if ascenso.tituloTrabajo is not null %} |
84 | 78 | <div class="form-group"> |
85 | 79 | <label for="titulo">Título del Trabajo:</label> | ... | ... |
app/Resources/views/cea/reconocimiento_escala_mostrar.html.twig
... | ... | @@ -107,8 +107,8 @@ |
107 | 107 | |
108 | 108 | <div class="col-xs-4"> |
109 | 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 | 112 | </a> |
113 | 113 | <div class="caption"> |
114 | 114 | <p>Constancia de Aprobación de Ascenso.</p> | ... | ... |
app/Resources/views/cea/solicitudes_mostar.html.twig
... | ... | @@ -155,8 +155,21 @@ |
155 | 155 | {% if adscripcion.asistente is not null %} |
156 | 156 | <div class="col-xs-4"> |
157 | 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 | 173 | </a> |
161 | 174 | <div class="caption"> |
162 | 175 | <p>Ascenso Asistente</p> | ... | ... |
src/AppBundle/Controller/AscensoController.php
... | ... | @@ -96,27 +96,27 @@ class AscensoController extends Controller |
96 | 96 | $this->container->getParameter('ascenso_directory'), |
97 | 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 | 102 | $constanciaExpediente->move( |
103 | 103 | $this->container->getParameter('ascenso_directory'), |
104 | 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 | 108 | $constanciaPida->move( |
109 | 109 | $this->container->getParameter('ascenso_directory'), |
110 | 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 | 115 | $constanciaNai->move( |
116 | 116 | $this->container->getParameter('ascenso_directory'), |
117 | 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 | 121 | if($form->get('investigacion')->getData()) { |
122 | 122 | /** @var UploadedFile $constanciaPostgrado */ |
... | ... | @@ -126,7 +126,7 @@ class AscensoController extends Controller |
126 | 126 | $this->container->getParameter('ascenso_directory'), |
127 | 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 | 130 | $ascenso->setInvestigacion($nombreInvestigacion); |
131 | 131 | } |
132 | 132 | $em = $this->getDoctrine()->getManager(); |
... | ... | @@ -150,7 +150,7 @@ class AscensoController extends Controller |
150 | 150 | $this->container->getParameter('ascenso_directory'), |
151 | 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 | 154 | $ascenso->setPertinencia($nombrePertinencia); |
155 | 155 | $ascenso->setIdLineaInvestigacion($form->get('lineas_investigacion')->getData()); |
156 | 156 | |
... | ... | @@ -225,6 +225,7 @@ class AscensoController extends Controller |
225 | 225 | |
226 | 226 | if ($form->isSubmitted() && $form->isValid()) { |
227 | 227 | |
228 | + | |
228 | 229 | $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); |
229 | 230 | $constanciaAscenso = $form->get('reconocimiento')->getData(); |
230 | 231 | |
... | ... | @@ -235,16 +236,16 @@ class AscensoController extends Controller |
235 | 236 | $this->container->getParameter('ascenso_directory'), |
236 | 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 | 240 | if (!$concurso->getOposicion()){ |
240 | 241 | $adscripcion->setOposicion($nombreAscenso); |
241 | 242 | }else{ |
242 | 243 | switch ($solicitudAscenso->getIdEscalafones()->getId()){ |
243 | 244 | case 2: $adscripcion->setAsistente($nombreAscenso); |
244 | 245 | break; |
245 | - case 3: $adscripcion->setAsociado($nombreAscenso); | |
246 | + case 3: $adscripcion->setAgreado($nombreAscenso); | |
246 | 247 | break; |
247 | - case 4: $adscripcion->setAgregado($nombreAscenso); | |
248 | + case 4: $adscripcion->setAsociado($nombreAscenso); | |
248 | 249 | break; |
249 | 250 | case 5: $adscripcion->setTitular($nombreAscenso); |
250 | 251 | break; |
... | ... | @@ -323,7 +324,11 @@ class AscensoController extends Controller |
323 | 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 | 332 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
328 | 333 | $antiguedad = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy(array( |
329 | 334 | 'idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), |
... | ... | @@ -357,7 +362,12 @@ class AscensoController extends Controller |
357 | 362 | |
358 | 363 | |
359 | 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 | 371 | $pida = $this->getDoctrine()->getRepository('AppBundle:AdscripcionPida')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion()); |
362 | 372 | |
363 | 373 | if($ascenso == NULL){ |
... | ... | @@ -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 | + | ... | ... |