Commit 6b1e43af11c4d173f84decb896426e4c9485b000
1 parent
26d06cf947
Exists in
master
creada el registro de tutores, asignacion de tutores al ascenso y mostrar los re…
…sultados al coordinador en la solicitud de ascenso
Showing
10 changed files
with
353 additions
and
95 deletions
Show diff stats
app/Resources/views/cea/ascenso_mostar.html.twig
| ... | ... | @@ -60,7 +60,15 @@ |
| 60 | 60 | {%endfor %} |
| 61 | 61 | </table> |
| 62 | 62 | |
| 63 | - <p><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> | |
| 63 | + <p ><strong>Escalafón Solicita:</strong> {{ ascenso.idEscalafones.nombre }} </p> | |
| 64 | + {% for tutor in ascenso.tutoresAscenso %} | |
| 65 | + <h4>Tutores propuestos</h4> | |
| 66 | + <p class="well"> | |
| 67 | + <strong>{{ tutor.nombres }} {{ tutor.apellidos }}:</strong> | |
| 68 | + {{ tutor.institucion }} -> {{ tutor.idEscala.nombre }} | |
| 69 | + </p> | |
| 70 | + {% endfor %} | |
| 71 | + | |
| 64 | 72 | |
| 65 | 73 | </div> |
| 66 | 74 | {% endif %} | ... | ... |
app/Resources/views/solicitudes/ascenso.html.twig
| ... | ... | @@ -59,19 +59,65 @@ |
| 59 | 59 | <div class="modal-body"> |
| 60 | 60 | |
| 61 | 61 | <h2>Introduzla la cedula y presione buscar</h2> |
| 62 | - {% form_theme tutorForm 'bootstrap_3_layout.html.twig' %} | |
| 62 | + {% form_theme tutorForm 'bootstrap_3_layout.html.twig' %} | |
| 63 | 63 | |
| 64 | - | |
| 65 | - | |
| 66 | - {{ form_start(tutorForm) }} | |
| 67 | - | |
| 68 | - {{ form_widget(tutorForm) }} | |
| 69 | - {{ form_end(tutorForm) }} | |
| 64 | + {{ form_start(tutorForm, {'attr': {'class': 'tutorForm', 'novalidate': 'novalidate'}}) }} | |
| 65 | + <div class="row"> | |
| 66 | + <div class="col-lg-3"> | |
| 67 | + {{ form_label(tutorForm.idDocumentoIdentidad) }} | |
| 68 | + {{ form_widget(tutorForm.idDocumentoIdentidad) }} | |
| 69 | + </div> | |
| 70 | + <div class="col-lg-4"> | |
| 71 | + {{ form_label(tutorForm.cedulaPasaporte) }} | |
| 72 | + {{ form_widget(tutorForm.cedulaPasaporte) }} | |
| 73 | + </div> | |
| 74 | + <div class="col-lg-5"> | |
| 75 | + {{ form_widget(tutorForm.buscarTutor) }} | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + <div class="row"> | |
| 79 | + | |
| 80 | + <div class="col-lg-6"> | |
| 81 | + {{ form_label(tutorForm.nombres) }} | |
| 82 | + {{ form_widget(tutorForm.nombres) }} | |
| 83 | + </div> | |
| 84 | + <div class="col-lg-6"> | |
| 85 | + {{ form_label(tutorForm.apellidos) }} | |
| 86 | + {{ form_widget(tutorForm.apellidos) }} | |
| 87 | + </div> | |
| 88 | + <div class="col-lg-6"> | |
| 89 | + {{ form_label(tutorForm.institucion) }} | |
| 90 | + {{ form_widget(tutorForm.institucion) }} | |
| 91 | + </div> | |
| 92 | + | |
| 93 | + <div class="col-lg-6"> | |
| 94 | + {{ form_label(tutorForm.idEstado) }} | |
| 95 | + {{ form_widget(tutorForm.idEstado) }} | |
| 96 | + </div> | |
| 97 | + | |
| 98 | + <div class="col-lg-6"> | |
| 99 | + {{ form_label(tutorForm.idEscala) }} | |
| 100 | + {{ form_widget(tutorForm.idEscala) }} | |
| 101 | + </div> | |
| 102 | + | |
| 103 | + <div class="col-lg-6"> | |
| 104 | + {{ form_label(tutorForm.correoElectronico) }} | |
| 105 | + {{ form_widget(tutorForm.correoElectronico) }} | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + <div class="row"> | |
| 109 | + <div class="col-lg-6 text-left"> | |
| 110 | + <br> | |
| 111 | + {{ form_widget(tutorForm.registrar) }} | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + | |
| 115 | + {{ form_end(tutorForm) }} | |
| 70 | 116 | |
| 71 | 117 | </div> |
| 72 | 118 | <div class="modal-footer"> |
| 73 | 119 | <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button> |
| 74 | - <button class="btn btn-primary" type="submit">Buscar Adscripcion</button> | |
| 120 | + | |
| 75 | 121 | </div> |
| 76 | 122 | </div> |
| 77 | 123 | </div> |
| ... | ... | @@ -93,7 +139,46 @@ |
| 93 | 139 | |
| 94 | 140 | $('.esc_oposicion')[this.checked ? "show" : "hide"](); |
| 95 | 141 | |
| 96 | - }); | |
| 142 | + }); | |
| 143 | + | |
| 144 | + | |
| 145 | + $(".tutorForm").submit(function(e){ | |
| 146 | + alert("funciona"); | |
| 147 | + e.preventDefault(); | |
| 148 | + | |
| 149 | + var formSerialize = $(this).serialize(); | |
| 150 | + alert(formSerialize); | |
| 151 | + $.ajax({ | |
| 152 | + method: "POST", | |
| 153 | + url: "{{ url('ajax_registrar_tutor') }}", | |
| 154 | + data: formSerialize | |
| 155 | + }) | |
| 156 | + .done(function (data) { | |
| 157 | + if (typeof data.message !== 'undefined') { | |
| 158 | + alert(data.message); | |
| 159 | + } | |
| 160 | + }) | |
| 161 | + .fail(function (jqXHR, textStatus, errorThrown) { | |
| 162 | + if (typeof jqXHR.responseJSON !== 'undefined') { | |
| 163 | + if (jqXHR.responseJSON.hasOwnProperty('form')) { | |
| 164 | + console.log(jqXHR.responseJSON.form); | |
| 165 | + } | |
| 166 | + | |
| 167 | + console.log(jqXHR.responseJSON.message); | |
| 168 | + | |
| 169 | + } else { | |
| 170 | + alert(errorThrown); | |
| 171 | + } | |
| 172 | + | |
| 173 | + }); | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + }); | |
| 97 | 182 | |
| 98 | 183 | $( "#tutores_ascenso_buscarTutor" ).click(function() { |
| 99 | 184 | if($("#tutores_ascenso_cedulaPasaporte").val() == ""){ |
| ... | ... | @@ -107,16 +192,13 @@ |
| 107 | 192 | cache: false, |
| 108 | 193 | data: ({cedula: $("#tutores_ascenso_cedulaPasaporte").val(), documento: $("#tutores_ascenso_idDocumentoIdentidad").val()}), |
| 109 | 194 | success: function (data) { |
| 110 | - | |
| 195 | + console.log(data); | |
| 111 | 196 | var posts = JSON.parse(data.posts); |
| 112 | 197 | console.log(posts); |
| 113 | - if (posts == ""){ | |
| 198 | + if (!posts){ | |
| 114 | 199 | $('.oculto').removeClass('hidden'); |
| 115 | 200 | }else{ |
| 116 | - $('#ascenso_tutores_asignados').append($('<option>', { | |
| 117 | - value: 1, | |
| 118 | - text: 'My option' | |
| 119 | - })); | |
| 201 | + $('#ascenso_tutores_ascenso option[value="' + posts.nombres + " " + posts.apellidos +'"]').prop("selected", true); | |
| 120 | 202 | } |
| 121 | 203 | |
| 122 | 204 | }, | ... | ... |
src/AppBundle/Controller/AjaxController.php
| ... | ... | @@ -17,6 +17,7 @@ use Symfony\Component\Serializer\Encoder\XmlEncoder; |
| 17 | 17 | use Symfony\Component\Serializer\Encoder\JsonEncoder; |
| 18 | 18 | use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; |
| 19 | 19 | use Symfony\Component\HttpFoundation\Request; |
| 20 | +use AppBundle\Entity\TutoresAscenso; | |
| 20 | 21 | |
| 21 | 22 | |
| 22 | 23 | |
| ... | ... | @@ -77,7 +78,8 @@ class AjaxController extends Controller { |
| 77 | 78 | * @Method({"GET"}) |
| 78 | 79 | */ |
| 79 | 80 | public function buscarTutorAction(Request $request){ |
| 80 | - if($request->isXmlHttpRequest()){ | |
| 81 | + | |
| 82 | + //if($request->isXmlHttpRequest()){ | |
| 81 | 83 | $encoders = array(new JsonEncoder()); |
| 82 | 84 | $normalizers = array(new ObjectNormalizer()); |
| 83 | 85 | |
| ... | ... | @@ -86,24 +88,57 @@ class AjaxController extends Controller { |
| 86 | 88 | $documento = filter_input(INPUT_GET, 'documento', FILTER_SANITIZE_SPECIAL_CHARS); |
| 87 | 89 | |
| 88 | 90 | |
| 89 | - $repository = $this->getDoctrine() | |
| 90 | - ->getRepository('AppBundle:TutoresAscenso'); | |
| 91 | - $query = $repository->createQueryBuilder('p') | |
| 92 | - ->where('p.cedulaPasaporte = :cedula') | |
| 93 | - ->andWhere('p.institucion = :documento') | |
| 94 | - ->setParameters(array('cedula'=> $cedula, 'documento' => $documento)) | |
| 95 | - ->getQuery(); | |
| 96 | - | |
| 97 | - $posts = $query->getResult(); | |
| 91 | + $repository = $this->getDoctrine()->getRepository('AppBundle:TutoresAscenso')->findOneBy(array( | |
| 92 | + 'idDocumentoIdentidad' => $documento, | |
| 93 | + 'cedulaPasaporte' => $cedula | |
| 94 | + )); | |
| 95 | + | |
| 98 | 96 | |
| 99 | 97 | $response = new JsonResponse(); |
| 100 | 98 | $response->setStatusCode(200); |
| 101 | 99 | $response->setData(array( |
| 102 | 100 | 'response' => 'success', |
| 103 | - 'posts' => $serializer->serialize($posts, 'json') | |
| 101 | + 'posts' => $serializer->serialize($repository, 'json') | |
| 104 | 102 | )); |
| 105 | 103 | return $response; |
| 106 | - } | |
| 104 | + //} | |
| 105 | + | |
| 106 | + } | |
| 107 | + | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * @Route("/ajax/registrar_tutor", name="ajax_registrar_tutor") | |
| 111 | + * @Method({"POST"}) | |
| 112 | + */ | |
| 113 | + public function registrarTutorAction(Request $request){ | |
| 114 | + | |
| 115 | + //if($request->isXmlHttpRequest()){ | |
| 116 | + $encoders = array(new JsonEncoder()); | |
| 117 | + $normalizers = array(new ObjectNormalizer()); | |
| 118 | + | |
| 119 | + $serializer = new Serializer($normalizers, $encoders); | |
| 120 | + | |
| 121 | + $nuevoTutor = new TutoresAscenso(); | |
| 122 | + $form = $this->createForm('AppBundle\Form\TutoresAscensoType', $nuevoTutor); | |
| 123 | + $form->handleRequest($request); | |
| 124 | + | |
| 125 | + if ($form->isValid()) { | |
| 126 | + $em = $this->getDoctrine()->getManager(); | |
| 127 | + $em->persist($nuevoTutor); | |
| 128 | + $em->flush(); | |
| 129 | + | |
| 130 | + return new JsonResponse(array('message' => 'Success!'), 200); | |
| 131 | + } | |
| 132 | + echo $form; | |
| 133 | + | |
| 134 | + | |
| 135 | + $response = new JsonResponse( | |
| 136 | + array( | |
| 137 | + 'message' => $form, | |
| 138 | + ), 400); | |
| 139 | + | |
| 140 | + return $response; | |
| 141 | + //} | |
| 107 | 142 | |
| 108 | 143 | } |
| 109 | 144 | ... | ... |
src/AppBundle/Controller/AscensoController.php
| ... | ... | @@ -18,6 +18,7 @@ use AppBundle\Entity\DocenteEscala; |
| 18 | 18 | use AppBundle\Entity\Memorando; |
| 19 | 19 | use AppBundle\Entity\DocenteServicio; |
| 20 | 20 | use AppBundle\Entity\AdscripcionPida; |
| 21 | +use AppBundle\Entity\TutoresAscenso; | |
| 21 | 22 | |
| 22 | 23 | |
| 23 | 24 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
| ... | ... | @@ -33,7 +34,8 @@ class AscensoController extends Controller |
| 33 | 34 | $formalizarTiempo = false; |
| 34 | 35 | //si ya tiene una solicitud en espera, enviarlo a la pagina de los servicios |
| 35 | 36 | $solicitud = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneBy( |
| 36 | - array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5) | |
| 37 | + array('idRolInstitucion' => $this->getUser()->getIdRolInstitucion(), 'idServicioCe' => 5), | |
| 38 | + array('id' => 'DESC') | |
| 37 | 39 | ); |
| 38 | 40 | if($solicitud){ |
| 39 | 41 | if($solicitud->getIdEstatus()->getId() != 4 ){ |
| ... | ... | @@ -120,9 +122,9 @@ class AscensoController extends Controller |
| 120 | 122 | |
| 121 | 123 | |
| 122 | 124 | |
| 123 | - | |
| 125 | + $tutoresAsignados = new TutoresAscenso(); | |
| 124 | 126 | $form = $this->createForm('AppBundle\Form\AscensoType'); |
| 125 | - $tutorForm = $this->createForm('AppBundle\Form\TutoresAscensoType'); | |
| 127 | + $tutorForm = $this->createForm('AppBundle\Form\TutoresAscensoType', $tutoresAsignados); | |
| 126 | 128 | $form->handleRequest($request); |
| 127 | 129 | |
| 128 | 130 | |
| ... | ... | @@ -199,8 +201,14 @@ class AscensoController extends Controller |
| 199 | 201 | $ascenso->setTituloTrabajo($form->get('titulo_trabajo')->getData()); |
| 200 | 202 | $ascenso->setIdEscalafones($nueva_escala); |
| 201 | 203 | $ascenso->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(2)); |
| 202 | - | |
| 203 | - | |
| 204 | + | |
| 205 | + | |
| 206 | + $tutores = $form->get('tutores_ascenso')->getData(); | |
| 207 | + foreach ($tutores as $tutor){ | |
| 208 | + $ascenso->addTutoresAscenso($tutor); | |
| 209 | + } | |
| 210 | + | |
| 211 | + | |
| 204 | 212 | if ($form->get('pertinencia')->getData()){ |
| 205 | 213 | |
| 206 | 214 | $constanciaPertinencia = $form->get('pertinencia')->getData(); | ... | ... |
src/AppBundle/Entity/Ascenso.php
| ... | ... | @@ -140,9 +140,19 @@ class Ascenso |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\TutoresAscenso", mappedBy="ascenso") | |
| 143 | + * @var \Doctrine\Common\Collections\Collection | |
| 144 | + * | |
| 145 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\TutoresAscenso", inversedBy="ascenso") | |
| 146 | + * @ORM\JoinTable(name="ascenso_tutor", | |
| 147 | + * joinColumns={ | |
| 148 | + * @ORM\JoinColumn(name="ascenso_id", referencedColumnName="id", nullable=false) | |
| 149 | + * }, | |
| 150 | + * inverseJoinColumns={ | |
| 151 | + * @ORM\JoinColumn(name="tutor_id", referencedColumnName="id", nullable=false) | |
| 152 | + * } | |
| 153 | + * ) | |
| 144 | 154 | */ |
| 145 | - private $tutoresAscenso; | |
| 155 | + protected $tutoresAscenso; | |
| 146 | 156 | |
| 147 | 157 | |
| 148 | 158 | /** |
| ... | ... | @@ -448,6 +458,8 @@ class Ascenso |
| 448 | 458 | return $this->idEscalafones; |
| 449 | 459 | } |
| 450 | 460 | |
| 461 | + | |
| 462 | + | |
| 451 | 463 | /** |
| 452 | 464 | * Constructor |
| 453 | 465 | */ |
| ... | ... | @@ -488,4 +500,14 @@ class Ascenso |
| 488 | 500 | { |
| 489 | 501 | return $this->tutoresAscenso; |
| 490 | 502 | } |
| 503 | + | |
| 504 | + /** | |
| 505 | + * | |
| 506 | + * @return string | |
| 507 | + */ | |
| 508 | + | |
| 509 | + public function __toString() | |
| 510 | + { | |
| 511 | + return $this->getIdRolInstitucion()->getIdRol()->getIdPersona()->getPrimerNombre(); | |
| 512 | + } | |
| 491 | 513 | } | ... | ... |
src/AppBundle/Entity/Ascenso.php~
| ... | ... | @@ -140,9 +140,19 @@ class Ascenso |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\TutoresAscenso", mappedBy="ascenso") | |
| 143 | + * @var \Doctrine\Common\Collections\Collection | |
| 144 | + * | |
| 145 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\TutoresAscenso", inversedBy="ascenso") | |
| 146 | + * @ORM\JoinTable(name="ascenso_tutor", | |
| 147 | + * joinColumns={ | |
| 148 | + * @ORM\JoinColumn(name="ascenso_id", referencedColumnName="id", nullable=false) | |
| 149 | + * }, | |
| 150 | + * inverseJoinColumns={ | |
| 151 | + * @ORM\JoinColumn(name="tutor_id", referencedColumnName="id", nullable=false) | |
| 152 | + * } | |
| 153 | + * ) | |
| 144 | 154 | */ |
| 145 | - private $tutoresAscenso; | |
| 155 | + protected $tutoresAscenso; | |
| 146 | 156 | |
| 147 | 157 | |
| 148 | 158 | /** |
| ... | ... | @@ -448,4 +458,6 @@ class Ascenso |
| 448 | 458 | return $this->idEscalafones; |
| 449 | 459 | } |
| 450 | 460 | |
| 461 | + | |
| 462 | + | |
| 451 | 463 | } | ... | ... |
src/AppBundle/Entity/Escala.php
src/AppBundle/Entity/TutoresAscenso.php
| ... | ... | @@ -27,7 +27,18 @@ class TutoresAscenso |
| 27 | 27 | * @ORM\JoinColumn(name="id_documento_identidad", referencedColumnName="id", nullable=false) |
| 28 | 28 | * }) |
| 29 | 29 | */ |
| 30 | - private $idDocumentoentidad; | |
| 30 | + private $idDocumentoIdentidad; | |
| 31 | + | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * @var \AppBundle\Entity\Estado | |
| 35 | + * | |
| 36 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Estado") | |
| 37 | + * @ORM\JoinColumns({ | |
| 38 | + * @ORM\JoinColumn(name="id_estado", referencedColumnName="id", nullable=false) | |
| 39 | + * }) | |
| 40 | + */ | |
| 41 | + private $idEstado; | |
| 31 | 42 | |
| 32 | 43 | |
| 33 | 44 | /** |
| ... | ... | @@ -90,10 +101,12 @@ class TutoresAscenso |
| 90 | 101 | |
| 91 | 102 | |
| 92 | 103 | /** |
| 93 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Ascenso", inversedBy="tutoresAscenso") | |
| 94 | - * @ORM\JoinColumn(name="ascenso_id", referencedColumnName="id") | |
| 104 | + * @var \Doctrine\Common\Collections\Collection | |
| 105 | + * | |
| 106 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Ascenso", mappedBy="tutoresAscenso") | |
| 95 | 107 | */ |
| 96 | - private $ascenso; | |
| 108 | + protected $ascenso; | |
| 109 | + | |
| 97 | 110 | |
| 98 | 111 | |
| 99 | 112 | |
| ... | ... | @@ -213,12 +226,12 @@ class TutoresAscenso |
| 213 | 226 | /** |
| 214 | 227 | * Set idDocumentoentidad |
| 215 | 228 | * |
| 216 | - * @param \AppBundle\Entity\DocumentoIdentidad $idDocumentoentidad | |
| 229 | + * @param \AppBundle\Entity\DocumentoIdentidad $idDocumentoIdentidad | |
| 217 | 230 | * @return TutoresAscenso |
| 218 | 231 | */ |
| 219 | - public function setIdDocumentoentidad(\AppBundle\Entity\DocumentoIdentidad $idDocumentoentidad) | |
| 232 | + public function setIdDocumentoIdentidad(\AppBundle\Entity\DocumentoIdentidad $idDocumentoIdentidad) | |
| 220 | 233 | { |
| 221 | - $this->idDocumentoentidad = $idDocumentoentidad; | |
| 234 | + $this->idDocumentoIdentidad = $idDocumentoIdentidad; | |
| 222 | 235 | |
| 223 | 236 | return $this; |
| 224 | 237 | } |
| ... | ... | @@ -228,9 +241,9 @@ class TutoresAscenso |
| 228 | 241 | * |
| 229 | 242 | * @return \AppBundle\Entity\DocumentoIdentidad |
| 230 | 243 | */ |
| 231 | - public function getIdDocumentoentidad() | |
| 244 | + public function getIdDocumentoIdentidad() | |
| 232 | 245 | { |
| 233 | - return $this->idDocumentoentidad; | |
| 246 | + return $this->idDocumentoIdentidad; | |
| 234 | 247 | } |
| 235 | 248 | |
| 236 | 249 | /** |
| ... | ... | @@ -256,49 +269,92 @@ class TutoresAscenso |
| 256 | 269 | return $this->idEscala; |
| 257 | 270 | } |
| 258 | 271 | |
| 272 | + | |
| 273 | + | |
| 259 | 274 | /** |
| 260 | - * Set ascenso | |
| 275 | + * Set institucion | |
| 261 | 276 | * |
| 262 | - * @param \AppBundle\Entity\Ascenso $ascenso | |
| 277 | + * @param string $institucion | |
| 263 | 278 | * @return TutoresAscenso |
| 264 | 279 | */ |
| 265 | - public function setAscenso(\AppBundle\Entity\Ascenso $ascenso = null) | |
| 280 | + public function setInstitucion($institucion) | |
| 266 | 281 | { |
| 267 | - $this->ascenso = $ascenso; | |
| 282 | + $this->institucion = $institucion; | |
| 268 | 283 | |
| 269 | 284 | return $this; |
| 270 | 285 | } |
| 271 | 286 | |
| 272 | 287 | /** |
| 273 | - * Get ascenso | |
| 288 | + * Get institucion | |
| 274 | 289 | * |
| 275 | - * @return \AppBundle\Entity\Ascenso | |
| 290 | + * @return string | |
| 276 | 291 | */ |
| 277 | - public function getAscenso() | |
| 292 | + public function getInstitucion() | |
| 278 | 293 | { |
| 279 | - return $this->ascenso; | |
| 294 | + return $this->institucion; | |
| 280 | 295 | } |
| 281 | 296 | |
| 282 | 297 | /** |
| 283 | - * Set institucion | |
| 298 | + * Set idEstado | |
| 284 | 299 | * |
| 285 | - * @param string $institucion | |
| 300 | + * @param \AppBundle\Entity\Estado $idEstado | |
| 286 | 301 | * @return TutoresAscenso |
| 287 | 302 | */ |
| 288 | - public function setInstitucion($institucion) | |
| 303 | + public function setIdEstado(\AppBundle\Entity\Estado $idEstado) | |
| 289 | 304 | { |
| 290 | - $this->institucion = $institucion; | |
| 305 | + $this->idEstado = $idEstado; | |
| 291 | 306 | |
| 292 | 307 | return $this; |
| 293 | 308 | } |
| 294 | 309 | |
| 295 | 310 | /** |
| 296 | - * Get institucion | |
| 311 | + * Get idEstado | |
| 297 | 312 | * |
| 298 | - * @return string | |
| 313 | + * @return \AppBundle\Entity\Estado | |
| 299 | 314 | */ |
| 300 | - public function getInstitucion() | |
| 315 | + public function getIdEstado() | |
| 301 | 316 | { |
| 302 | - return $this->institucion; | |
| 317 | + return $this->idEstado; | |
| 318 | + } | |
| 319 | + | |
| 320 | + /** | |
| 321 | + * Constructor | |
| 322 | + */ | |
| 323 | + public function __construct() | |
| 324 | + { | |
| 325 | + $this->ascenso = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 326 | + } | |
| 327 | + | |
| 328 | + /** | |
| 329 | + * Add ascenso | |
| 330 | + * | |
| 331 | + * @param \AppBundle\Entity\Ascenso $ascenso | |
| 332 | + * @return TutoresAscenso | |
| 333 | + */ | |
| 334 | + public function addAscenso(\AppBundle\Entity\Ascenso $ascenso) | |
| 335 | + { | |
| 336 | + $this->ascenso[] = $ascenso; | |
| 337 | + | |
| 338 | + return $this; | |
| 339 | + } | |
| 340 | + | |
| 341 | + /** | |
| 342 | + * Remove ascenso | |
| 343 | + * | |
| 344 | + * @param \AppBundle\Entity\Ascenso $ascenso | |
| 345 | + */ | |
| 346 | + public function removeAscenso(\AppBundle\Entity\Ascenso $ascenso) | |
| 347 | + { | |
| 348 | + $this->ascenso->removeElement($ascenso); | |
| 349 | + } | |
| 350 | + | |
| 351 | + /** | |
| 352 | + * Get ascenso | |
| 353 | + * | |
| 354 | + * @return \Doctrine\Common\Collections\Collection | |
| 355 | + */ | |
| 356 | + public function getAscenso() | |
| 357 | + { | |
| 358 | + return $this->ascenso; | |
| 303 | 359 | } |
| 304 | 360 | } | ... | ... |
src/AppBundle/Form/AscensoType.php
| ... | ... | @@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\ButtonType; |
| 19 | 19 | use Symfony\Component\Form\Extension\Core\Type\CheckboxType; |
| 20 | 20 | use Symfony\Component\Form\Extension\Core\Type\FileType; |
| 21 | 21 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
| 22 | +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |
| 22 | 23 | |
| 23 | 24 | use Symfony\Bridge\Doctrine\Form\Type\EntityType; |
| 24 | 25 | use Doctrine\ORM\EntityRepository; |
| ... | ... | @@ -108,14 +109,14 @@ class AscensoType extends AbstractType |
| 108 | 109 | )) |
| 109 | 110 | |
| 110 | 111 | |
| 111 | - ->add('tutores_asignados', EntityType::class, array( | |
| 112 | - 'placeholder' => 'Añadir Tutores...', | |
| 113 | - 'class' => 'AppBundle:TutoresAscenso', | |
| 114 | - 'label' => false, | |
| 112 | + ->add('tutores_ascenso', EntityType::class, array( | |
| 113 | + 'placeholder' => 'Añadir Tutores...', | |
| 114 | + 'class' => 'AppBundle:TutoresAscenso', | |
| 115 | + 'label' => false, | |
| 115 | 116 | 'multiple' => true, |
| 116 | - 'attr' => array( | |
| 117 | + /*'attr' => array( | |
| 117 | 118 | 'disabled' => 'true', |
| 118 | - ) | |
| 119 | + )*/ | |
| 119 | 120 | )) |
| 120 | 121 | |
| 121 | 122 | ->add('añadir_tutor', ButtonType::class, array( | ... | ... |
src/AppBundle/Form/TutoresAscensoType.php
| ... | ... | @@ -9,6 +9,7 @@ use Symfony\Component\Form\Extension\Core\Type\EmailType; |
| 9 | 9 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
| 10 | 10 | use Symfony\Bridge\Doctrine\Form\Type\EntityType; |
| 11 | 11 | use Symfony\Component\Form\Extension\Core\Type\ButtonType; |
| 12 | +use Symfony\Component\Form\Extension\Core\Type\SubmitType; | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | class TutoresAscensoType extends AbstractType |
| ... | ... | @@ -21,63 +22,89 @@ class TutoresAscensoType extends AbstractType |
| 21 | 22 | { |
| 22 | 23 | $builder |
| 23 | 24 | ->add('idDocumentoIdentidad', EntityType::class, array( |
| 24 | - 'label' => false, | |
| 25 | - 'placeholder' => 'Tipo Documento...', | |
| 26 | - 'class' => 'AppBundle:DocumentoIdentidad', | |
| 27 | - 'attr' => array( | |
| 28 | - 'class' => 'col-lg-4', | |
| 29 | - ) | |
| 25 | + 'label' => 'Tipo Documento', | |
| 26 | + 'placeholder' => 'Seleccione...', | |
| 27 | + 'class' => 'AppBundle:DocumentoIdentidad', | |
| 30 | 28 | )) |
| 31 | 29 | ->add('cedulaPasaporte', TextType::class, array( |
| 32 | - 'label' => false, | |
| 30 | + 'label' => 'Cédula/Pasaporte', | |
| 33 | 31 | 'attr' => array( |
| 34 | - 'placeholder' => 'introudzca la cédula', | |
| 32 | + 'placeholder' => 'Cédula Pasaporte ...', | |
| 35 | 33 | 'class' => 'col-lg-4 form-control', |
| 36 | 34 | ) |
| 37 | 35 | )) |
| 38 | 36 | |
| 39 | 37 | ->add('buscarTutor', ButtonType::class, array( |
| 40 | 38 | 'label' => 'Añadir', |
| 41 | - 'attr' => array('class' => 'btn btn-primary col-lg-4'), | |
| 39 | + 'attr' => array('class' => 'btn btn-primary btn-block'), | |
| 42 | 40 | )) |
| 43 | 41 | |
| 44 | - ->add('etiqueta', TextType::class, array( | |
| 45 | - 'label' => false, | |
| 46 | - 'data' => "Tutor no Encontrado, por favor Registre al nuevo Tutor", | |
| 47 | - 'attr' => array( | |
| 48 | - 'placeholder' => 'Nombres del tutor...', | |
| 49 | - 'class' => 'alert alert-warning col-lg-12 hidden oculto', | |
| 50 | - ) | |
| 51 | - )) | |
| 42 | + | |
| 52 | 43 | |
| 53 | 44 | |
| 54 | 45 | ->add('nombres', TextType::class, array( |
| 55 | - 'label' => 'nombres', | |
| 46 | + 'label' => 'Nombres Tutor', | |
| 56 | 47 | 'label_attr' => array('class' => 'hidden oculto'), |
| 57 | - 'attr' => array( | |
| 48 | + 'attr' => array( | |
| 49 | + 'placeholder' => 'Nombres del Tutor...', | |
| 58 | 50 | 'class' => 'col-lg-6 form-control hidden oculto', |
| 59 | 51 | ) |
| 60 | 52 | )) |
| 61 | 53 | |
| 62 | - ->add('apellidos', TextType::class, array( | |
| 63 | - 'label' => false, | |
| 54 | + ->add('apellidos', TextType::class, array( | |
| 55 | + 'label' => 'Apellidos Tutor', | |
| 56 | + 'label_attr' => array('class' => 'hidden oculto'), | |
| 64 | 57 | 'attr' => array( |
| 65 | 58 | 'placeholder' => 'apellidos del tutor...', |
| 66 | 59 | 'class' => 'col-lg-3 form-control hidden oculto', |
| 67 | 60 | ) |
| 68 | 61 | )) |
| 69 | - /*->add('correoElectronico', EmailType::class, array( | |
| 70 | - 'label' => false, | |
| 62 | + | |
| 63 | + ->add('institucion', TextType::class, array( | |
| 64 | + 'label' => 'Institución', | |
| 65 | + 'label_attr' => array('class' => 'hidden oculto'), | |
| 71 | 66 | 'attr' => array( |
| 72 | - 'placeholder' => 'introudzca correo Electrónico del tutor', | |
| 73 | - 'class' => 'col-lg-6 form-group', | |
| 67 | + 'placeholder' => 'UBV, LUZ, UNEFM,', | |
| 68 | + 'class' => 'col-lg-3 form-control hidden oculto', | |
| 74 | 69 | ) |
| 75 | 70 | )) |
| 76 | - ->add('nombres') | |
| 71 | + | |
| 72 | + ->add('idEstado', EntityType::class, array( | |
| 73 | + 'label' => 'Estado', | |
| 74 | + 'label_attr' => array('class' => 'hidden oculto'), | |
| 75 | + 'placeholder' => 'Estado donde Labora...', | |
| 76 | + 'class' => 'AppBundle:Estado', | |
| 77 | + 'attr' => array( | |
| 78 | + 'class' => 'col-lg-3 form-control hidden oculto', | |
| 79 | + ) | |
| 80 | + )) | |
| 81 | + | |
| 82 | + ->add('idEscala', EntityType::class, array( | |
| 83 | + 'label' => 'Escalafón', | |
| 84 | + 'label_attr' => array('class' => 'hidden oculto'), | |
| 85 | + 'placeholder' => 'Escalafón actual...', | |
| 86 | + 'class' => 'AppBundle:Escalafones', | |
| 87 | + 'attr' => array( | |
| 88 | + 'class' => 'col-lg-3 form-control hidden oculto', | |
| 89 | + ) | |
| 90 | + )) | |
| 91 | + ->add('correoElectronico', EmailType::class, array( | |
| 92 | + 'label' => 'Correo E.', | |
| 93 | + 'label_attr' => array('class' => 'hidden oculto'), | |
| 94 | + 'attr' => array( | |
| 95 | + 'placeholder' => 'Dirección de Correo Tutor ...', | |
| 96 | + 'class' => 'col-lg-3 form-control hidden oculto', | |
| 97 | + ) | |
| 98 | + )) | |
| 99 | + ->add('registrar', SubmitType::class, array( | |
| 100 | + 'label' => 'Registrar', | |
| 101 | + 'attr' => array('class' => 'btn btn-success hidden oculto'), | |
| 102 | + )) | |
| 103 | + /*->add('nombres') | |
| 77 | 104 | ->add('apellidos') |
| 78 | 105 | ->add('institucion') |
| 79 | 106 | ->add('idEscala')*/ |
| 80 | - //->add('ascenso') | |
| 107 | + ->add('ascenso') | |
| 81 | 108 | ; |
| 82 | 109 | } |
| 83 | 110 | ... | ... |