Commit ea1d2e4279cd7f881c8c3aef97c1a92803ac7c9e

Authored by wilmer
1 parent 9a9b1d9fba
Exists in master

añadido tipos de trabajo a la base de datos para mayor control del coordinador

app/Resources/views/cea/ascenso_mostar.html.twig
... ... @@ -215,6 +215,21 @@
215 215 </div>
216 216 </div>
217 217 {% endif %}
  218 +
  219 +
  220 +
  221 + {% if ascenso.curriculo is not null %}
  222 + <div class="col-xs-4">
  223 + <div class="thumbnail">
  224 + <a href="{{asset('uploads/ascenso/'~ ascenso.curriculo)}}" data-lightbox="adscripcion">
  225 + <img src="{{ asset('uploads/ascenso/thumb/'~ ascenso.curriculo) }}" />
  226 + </a>
  227 + <div class="caption">
  228 + <p>Síntesis Curricular de los posibles Jurados</p>
  229 + </div>
  230 + </div>
  231 + </div>
  232 + {% endif %}
218 233  
219 234  
220 235  
... ...
app/Resources/views/solicitudes/ascenso.html.twig
... ... @@ -142,10 +142,9 @@
142 142  
143 143 $('#ascenso_tipoTrabajoInvestigacion').click(function() {
144 144 alert("click");
145   -
146   - $('.esc_oposicion')[this.checked ? "show" : "hide"]();
147 145  
148   - if($('#ascenso_tipoTrabajoInvestigacion').val() == false){
  146 +
  147 + if($('#ascenso_tipoTrabajoInvestigacion').val() === 'investigacion'){
149 148 $('.esc_investigacion').show();
150 149 $('.esc_tesis').hide();
151 150 $("#ascenso_tutores_ascenso_chosen").show();
... ...
src/AppBundle/Controller/AscensoController.php
... ... @@ -199,6 +199,8 @@ class AscensoController extends Controller
199 199 $ascenso->setNai($nombreNai);
200 200 $ascenso->setInvestigacion($nombreInvestigacion);
201 201 $ascenso->setTituloTrabajo($form->get('titulo_trabajo')->getData());
  202 + $ascenso->setTipoTrabajoInvestigacion($form->get('tipoTrabajoInvestigacion')->getData());
  203 + $ascenso->setTesisUbv($form->get('tesisUbv')->getData());
202 204 $ascenso->setNombreNucelo($form->get('nombreNucleo')->getData());
203 205 $ascenso->setIdEscalafones($nueva_escala);
204 206 $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(2));
... ... @@ -729,7 +731,8 @@ class AscensoController extends Controller
729 731  
730 732 /*funcion para crear miniaturas de las imagenes y carga más rapido la página */
731 733  
732   -function thumbnail2 ($filename, $fuente, $destino){
  734 +function thumbnail2 ($filename, $fuente, $destino){
  735 + $im = false;
733 736 if(preg_match('/[.](jpeg)$/', $filename)) {
734 737 $im = imagecreatefromjpeg($fuente . "/" . $filename);
735 738 } else if (preg_match('/[.](jpg)$/', $filename)) {
... ... @@ -739,17 +742,18 @@ function thumbnail2 ($filename, $fuente, $destino){
739 742 } else if (preg_match('/[.](png)$/', $filename)) {
740 743 $im = imagecreatefrompng($fuente . "/" . $filename);
741 744 }
  745 + if($im){
  746 + $ox = imagesx($im);
  747 + $oy = imagesy($im);
742 748  
743   - $ox = imagesx($im);
744   - $oy = imagesy($im);
  749 + $nx = 80;
  750 + $ny = 80;
745 751  
746   - $nx = 80;
747   - $ny = 80;
  752 + $nm = imagecreatetruecolor($nx, $ny);
748 753  
749   - $nm = imagecreatetruecolor($nx, $ny);
  754 + imagecopyresized($nm, $im, 0,0,0,0,$nx,$ny,$ox,$oy);
750 755  
751   - imagecopyresized($nm, $im, 0,0,0,0,$nx,$ny,$ox,$oy);
752   -
753   - imagejpeg($nm, $destino . "/" . $filename);
  756 + imagejpeg($nm, $destino . "/" . $filename);
  757 + }
754 758 }
755 759  
... ...
src/AppBundle/Entity/Ascenso.php
... ... @@ -126,6 +126,21 @@ class Ascenso
126 126 * @Assert\NotBlank(message="El nombre del núcleo de investigación es obligatorio.")
127 127 */
128 128 private $nombreNucelo;
  129 +
  130 +
  131 +
  132 + /**
  133 + * @ORM\Column(name="tipo_trabajo_investigacion", type="string", nullable=true, options={"comment" = "tipo de trabajo: tesis/investigacion"})
  134 + * @Assert\NotBlank(message="El nombre del núcleo de investigación es obligatorio.")
  135 + */
  136 + private $tipoTrabajoInvestigacion;
  137 +
  138 +
  139 + /**
  140 + * @ORM\Column(name="tesis_ubv", type="boolean", nullable=true, options={"comment" = "si el trabajo es una tesis, ¿esta hecha dentro de la UBV?"})
  141 + *
  142 + */
  143 + private $tesisUbv;
129 144  
130 145  
131 146 /**
... ... @@ -605,4 +620,50 @@ class Ascenso
605 620 {
606 621 return $this->curriculo;
607 622 }
  623 +
  624 + /**
  625 + * Set tipoTrabajoInvestigacion
  626 + *
  627 + * @param string $tipoTrabajoInvestigacion
  628 + * @return Ascenso
  629 + */
  630 + public function setTipoTrabajoInvestigacion($tipoTrabajoInvestigacion)
  631 + {
  632 + $this->tipoTrabajoInvestigacion = $tipoTrabajoInvestigacion;
  633 +
  634 + return $this;
  635 + }
  636 +
  637 + /**
  638 + * Get tipoTrabajoInvestigacion
  639 + *
  640 + * @return string
  641 + */
  642 + public function getTipoTrabajoInvestigacion()
  643 + {
  644 + return $this->tipoTrabajoInvestigacion;
  645 + }
  646 +
  647 + /**
  648 + * Set tesisUbv
  649 + *
  650 + * @param boolean $tesisUbv
  651 + * @return Ascenso
  652 + */
  653 + public function setTesisUbv($tesisUbv)
  654 + {
  655 + $this->tesisUbv = $tesisUbv;
  656 +
  657 + return $this;
  658 + }
  659 +
  660 + /**
  661 + * Get tesisUbv
  662 + *
  663 + * @return boolean
  664 + */
  665 + public function getTesisUbv()
  666 + {
  667 + return $this->tesisUbv;
  668 + }
608 669 }
... ...
src/AppBundle/Entity/Ascenso.php~
... ... @@ -126,6 +126,21 @@ class Ascenso
126 126 * @Assert\NotBlank(message="El nombre del núcleo de investigación es obligatorio.")
127 127 */
128 128 private $nombreNucelo;
  129 +
  130 +
  131 +
  132 + /**
  133 + * @ORM\Column(name="tipo_trabajo_investigacion", type="string", nullable=true, options={"comment" = "tipo de trabajo: tesis/investigacion"})
  134 + * @Assert\NotBlank(message="El nombre del núcleo de investigación es obligatorio.")
  135 + */
  136 + private $tipoTrabajoInvestigacion;
  137 +
  138 +
  139 + /**
  140 + * @ORM\Column(name="tesis_ubv", type="boolean", nullable=true, options={"comment" = "si el trabajo es una tesis, ¿esta hecha dentro de la UBV?"})
  141 + *
  142 + */
  143 + private $tesisUbv;
129 144  
130 145  
131 146 /**
... ... @@ -582,4 +597,27 @@ class Ascenso
582 597 {
583 598 return $this->nombreNucelo;
584 599 }
  600 +
  601 + /**
  602 + * Set curriculo
  603 + *
  604 + * @param string $curriculo
  605 + * @return Ascenso
  606 + */
  607 + public function setCurriculo($curriculo)
  608 + {
  609 + $this->curriculo = $curriculo;
  610 +
  611 + return $this;
  612 + }
  613 +
  614 + /**
  615 + * Get curriculo
  616 + *
  617 + * @return string
  618 + */
  619 + public function getCurriculo()
  620 + {
  621 + return $this->curriculo;
  622 + }
585 623 }
... ...
src/AppBundle/Form/AscensoType.php
... ... @@ -104,8 +104,8 @@ class AscensoType extends AbstractType
104 104 ->add('tipoTrabajoInvestigacion', ChoiceType::class, array(
105 105 'placeholder' => 'Seleccione el Tipo de Trabajo de Investigación',
106 106 'choices' => array(
107   - 'Tesis (Trabajo de 4to nivel)' => true,
108   - 'Trabajo de Investigacion' => false,
  107 + 'Tesis (Trabajo de 4to nivel)' => 'tesis',
  108 + 'Trabajo de Investigacion' => 'investigacion',
109 109 ),
110 110 // *this line is important*
111 111 'choices_as_values' => true,
... ...