Commit 8eaa589c678d15b59dfef08ab8375f71feb5b2ca
1 parent
003137a607
Exists in
master
añadida la solicitud de PFG al Docente en la solicitud de Registro
Showing
7 changed files
with
156 additions
and
43 deletions
Show diff stats
app/Resources/views/cea/solicitudes.html.twig
1 | {% extends 'base_app.html.twig' %} | 1 | {% extends 'base_app.html.twig' %} |
2 | 2 | ||
3 | {%block body %} | 3 | {%block body %} |
4 | - | 4 | + <div class="container"> |
5 | <div class="widget widget-table action-table"> | 5 | <div class="widget widget-table action-table"> |
6 | <div class="widget-header"> <i class="icon-th-list"></i> | 6 | <div class="widget-header"> <i class="icon-th-list"></i> |
7 | <h3>Listado de solicitudes de Adscripción Al CEA</h3> | 7 | <h3>Listado de solicitudes de Adscripción Al CEA</h3> |
@@ -12,20 +12,25 @@ | @@ -12,20 +12,25 @@ | ||
12 | <thead> | 12 | <thead> |
13 | <tr> | 13 | <tr> |
14 | <th> Datos del Docente </th> | 14 | <th> Datos del Docente </th> |
15 | - <th> Cantidad de Documentos</th> | ||
16 | - <th class="td-actions"> Acciones Rápidas </th> | 15 | + <th> Eje del Docente</th> |
17 | </tr> | 16 | </tr> |
18 | </thead> | 17 | </thead> |
19 | <tbody> | 18 | <tbody> |
20 | {% for adscripcion in adscripciones %} | 19 | {% for adscripcion in adscripciones %} |
21 | <tr> | 20 | <tr> |
22 | - <td> | ||
23 | - {{adscripcion.idRolInstitucion}} | 21 | + <td> |
24 | {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerNombre}} | 22 | {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerNombre}} |
25 | {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerApellido}} | 23 | {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerApellido}} |
24 | + ( {{adscripcion.idRolInstitucion}} ) | ||
25 | + <a href="javascript:;" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a> | ||
26 | + <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a> | ||
27 | + <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a></td> | ||
26 | </td> | 28 | </td> |
27 | - <td> http://www.egrappler.com/ </td> | ||
28 | - <td class="td-actions"><a href="javascript:;" class="btn btn-small btn-success"><i class="fa fa-"> </i></a><a href="javascript:;" class="btn btn-danger btn-small"><i class="btn-icon-only icon-remove"> </i></a></td> | 29 | + <td> |
30 | + <strong>Eje:</strong>{{adscripcion.idRolInstitucion.idInstitucion.idEjeParroquia.IdEje}} | ||
31 | + <strong>Estado:</strong> {{adscripcion.idRolInstitucion.idInstitucion.idEjeParroquia.idParroquia.idMunicipio.idEstado}} | ||
32 | + </td> | ||
33 | + | ||
29 | </tr> | 34 | </tr> |
30 | {% endfor %} | 35 | {% endfor %} |
31 | 36 | ||
@@ -35,5 +40,6 @@ | @@ -35,5 +40,6 @@ | ||
35 | <!-- /widget-content --> | 40 | <!-- /widget-content --> |
36 | </div> | 41 | </div> |
37 | <!-- /widget --> | 42 | <!-- /widget --> |
38 | - | 43 | + </div> |
44 | + <!-- /container --> | ||
39 | {% endblock %} | 45 | {% endblock %} |
src/AppBundle/Controller/DefaultController.php
@@ -31,7 +31,7 @@ class DefaultController extends Controller | @@ -31,7 +31,7 @@ class DefaultController extends Controller | ||
31 | //si no existe el rol del docente, enviar correo al encargado de la región para verificar. | 31 | //si no existe el rol del docente, enviar correo al encargado de la región para verificar. |
32 | if (!$rol) { | 32 | if (!$rol) { |
33 | throw $this->createNotFoundException( | 33 | throw $this->createNotFoundException( |
34 | - 'No product found for id '. $form->get('cedula')->getData() | 34 | + 'Docente no registrado en la UBV '. $form->get('cedula')->getData() |
35 | ); | 35 | ); |
36 | } | 36 | } |
37 | 37 | ||
@@ -49,8 +49,16 @@ class DefaultController extends Controller | @@ -49,8 +49,16 @@ class DefaultController extends Controller | ||
49 | $login->setIdRolInstitucion($rol); | 49 | $login->setIdRolInstitucion($rol); |
50 | $permiso = $this->getDoctrine()->getRepository('AppBundle:Role')->findOneById(1); | 50 | $permiso = $this->getDoctrine()->getRepository('AppBundle:Role')->findOneById(1); |
51 | $login->addRol($permiso); //le añade la permisología básica de docente | 51 | $login->addRol($permiso); //le añade la permisología básica de docente |
52 | + | ||
53 | + $rep = $this->getDoctrine()->getRepository('AppBundle:Rol'); | ||
54 | + //Actualizar el PFG de la persona | ||
55 | + $actualizarRol = $rep->findOneByIdPersona($rol->getIdRol()->getIdPersona()); | ||
56 | + $actualizarRol->setIdAreaPersona($form->get('pfg')->getData() ); | ||
57 | + | ||
52 | $em = $this->getDoctrine()->getManager(); | 58 | $em = $this->getDoctrine()->getManager(); |
53 | $em->persist($login); | 59 | $em->persist($login); |
60 | + $em->persist($actualizarRol); | ||
61 | + | ||
54 | $em->flush(); //guarda en la base de datos | 62 | $em->flush(); //guarda en la base de datos |
55 | 63 | ||
56 | 64 | ||
@@ -94,37 +102,7 @@ class DefaultController extends Controller | @@ -94,37 +102,7 @@ class DefaultController extends Controller | ||
94 | throw $this->createNotFoundException( | 102 | throw $this->createNotFoundException( |
95 | 'Docente Encontrado '. $form->get('cedula')->getData() | 103 | 'Docente Encontrado '. $form->get('cedula')->getData() |
96 | ); | 104 | ); |
97 | - | ||
98 | - | ||
99 | - | ||
100 | - $message = \Swift_Message::newInstance() | ||
101 | - ->setSubject('Hello Email') | ||
102 | - ->setFrom('send@example.com') | ||
103 | - ->setTo('wilmer.ramones@gmail.com') | ||
104 | - ->setBody( | ||
105 | - $this->renderView( | ||
106 | - 'correos/solicitud_adscripcion.html.twig', | ||
107 | - array( | ||
108 | - 'nombres' => $form->get('nombres')->getData(), | ||
109 | - 'apellidos' => $form->get('apellidos')->getData(), | ||
110 | - | ||
111 | - ) | ||
112 | - ), | ||
113 | - 'text/html' | ||
114 | - ) | ||
115 | - /* | ||
116 | - * If you also want to include a plaintext version of the message | ||
117 | - ->addPart( | ||
118 | - $this->renderView( | ||
119 | - 'Emails/registration.txt.twig', | ||
120 | - array('name' => $name) | ||
121 | - ), | ||
122 | - 'text/plain' | ||
123 | - ) | ||
124 | - */ | ||
125 | - ; | ||
126 | - //$this->get('mailer')->send($message); | ||
127 | - | 105 | + |
128 | //$request->getSession()->getFlashBag()->add('success', 'Your email has been sent! Thanks!'); | 106 | //$request->getSession()->getFlashBag()->add('success', 'Your email has been sent! Thanks!'); |
129 | } | 107 | } |
130 | 108 |
src/AppBundle/Entity/AreaPersona.php
@@ -36,6 +36,16 @@ class AreaPersona | @@ -36,6 +36,16 @@ class AreaPersona | ||
36 | * @ORM\SequenceGenerator(sequenceName="area_persona_id_seq", allocationSize=1, initialValue=1) | 36 | * @ORM\SequenceGenerator(sequenceName="area_persona_id_seq", allocationSize=1, initialValue=1) |
37 | */ | 37 | */ |
38 | private $id; | 38 | private $id; |
39 | + | ||
40 | + /** | ||
41 | + * @var \AppBundle\Entity\TipoArea | ||
42 | + * | ||
43 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoArea") | ||
44 | + * @ORM\JoinColumns({ | ||
45 | + * @ORM\JoinColumn(name="id_tipo_area", referencedColumnName="id", nullable=false) | ||
46 | + * }) | ||
47 | + */ | ||
48 | + private $idTipoArea; | ||
39 | 49 | ||
40 | 50 | ||
41 | 51 | ||
@@ -82,6 +92,30 @@ class AreaPersona | @@ -82,6 +92,30 @@ class AreaPersona | ||
82 | { | 92 | { |
83 | return $this->nombre; | 93 | return $this->nombre; |
84 | } | 94 | } |
95 | + | ||
96 | + | ||
97 | + /** | ||
98 | + * Set idTipoArea | ||
99 | + * | ||
100 | + * @param \AppBundle\Entity\Estado $idTipoArea | ||
101 | + * @return TipoArea | ||
102 | + */ | ||
103 | + public function setIdTipoArea(\AppBundle\Entity\TipoArea $idTipoArea = null) | ||
104 | + { | ||
105 | + $this->idEstado = $idTipoArea; | ||
106 | + | ||
107 | + return $this; | ||
108 | + } | ||
109 | + | ||
110 | + /** | ||
111 | + * Get idTipoArea | ||
112 | + * | ||
113 | + * @return \AppBundle\Entity\TipoArea | ||
114 | + */ | ||
115 | + public function getIdTipoArea() | ||
116 | + { | ||
117 | + return $this->idTipoArea; | ||
118 | + } | ||
85 | 119 | ||
86 | 120 | ||
87 | } | 121 | } |
88 | \ No newline at end of file | 122 | \ No newline at end of file |
src/AppBundle/Entity/Rol.php
@@ -56,7 +56,7 @@ class Rol | @@ -56,7 +56,7 @@ class Rol | ||
56 | * | 56 | * |
57 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\AreaPersona") | 57 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\AreaPersona") |
58 | * @ORM\JoinColumns({ | 58 | * @ORM\JoinColumns({ |
59 | - * @ORM\JoinColumn(name="id_area_persona", referencedColumnName="id", nullable=false) | 59 | + * @ORM\JoinColumn(name="id_area_persona", referencedColumnName="id", nullable=true) |
60 | * }) | 60 | * }) |
61 | */ | 61 | */ |
62 | private $idAreaPersona; | 62 | private $idAreaPersona; |
src/AppBundle/Entity/TipoArea.php
@@ -0,0 +1,84 @@ | @@ -0,0 +1,84 @@ | ||
1 | +<?php | ||
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: Wilmer Ramones | ||
5 | + * Date: 29/06/16 | ||
6 | + * Time: 07:52 AM | ||
7 | + */ | ||
8 | + | ||
9 | +namespace AppBundle\Entity; | ||
10 | + | ||
11 | +use Doctrine\ORM\Mapping as ORM; | ||
12 | + | ||
13 | +/** | ||
14 | + * TipoArea | ||
15 | + * | ||
16 | + * @ORM\Table(name="tipo_area", uniqueConstraints={@ORM\UniqueConstraint(name="uq_nombre_area", columns={"nombre"})}) | ||
17 | + * @ORM\Entity | ||
18 | + */ | ||
19 | +class TipoArea | ||
20 | +{ | ||
21 | + /** | ||
22 | + * @var string | ||
23 | + * | ||
24 | + * @ORM\Column(name="nombre", type="string", length=100, nullable=false, options={"comment" = "Nombre del tipo de area"}) | ||
25 | + */ | ||
26 | + private $nombre; | ||
27 | + | ||
28 | + /** | ||
29 | + * @var integer | ||
30 | + * | ||
31 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador del tipo de area"}) | ||
32 | + * @ORM\Id | ||
33 | + * @ORM\GeneratedValue(strategy="IDENTITY") | ||
34 | + * @ORM\SequenceGenerator(sequenceName="tipo_ascenso_id_seq", allocationSize=1, initialValue=1) | ||
35 | + */ | ||
36 | + private $id; | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + /** | ||
41 | + * Set nombre | ||
42 | + * | ||
43 | + * @param string $nombre | ||
44 | + * @return TipoArea | ||
45 | + */ | ||
46 | + public function setNombre($nombre) | ||
47 | + { | ||
48 | + $this->nombre = $nombre; | ||
49 | + | ||
50 | + return $this; | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * Get nombre | ||
55 | + * | ||
56 | + * @return string | ||
57 | + */ | ||
58 | + public function getNombre() | ||
59 | + { | ||
60 | + return $this->nombre; | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * Get id | ||
65 | + * | ||
66 | + * @return integer | ||
67 | + */ | ||
68 | + public function getId() | ||
69 | + { | ||
70 | + return $this->id; | ||
71 | + } | ||
72 | + | ||
73 | + /** | ||
74 | + * Get nombre | ||
75 | + * | ||
76 | + * @return string | ||
77 | + */ | ||
78 | + public function __toString() | ||
79 | + { | ||
80 | + return $this->nombre; | ||
81 | + } | ||
82 | + | ||
83 | + | ||
84 | +} |
src/AppBundle/Form/SolicitarType.php
@@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; | @@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||
19 | use Symfony\Component\Validator\Constraints\Email; | 19 | use Symfony\Component\Validator\Constraints\Email; |
20 | use Symfony\Component\Validator\Constraints\Length; | 20 | use Symfony\Component\Validator\Constraints\Length; |
21 | use Symfony\Component\Validator\Constraints\NotBlank; | 21 | use Symfony\Component\Validator\Constraints\NotBlank; |
22 | +use Doctrine\ORM\EntityRepository; | ||
22 | 23 | ||
23 | 24 | ||
24 | 25 | ||
@@ -54,6 +55,17 @@ class SolicitarType extends AbstractType | @@ -54,6 +55,17 @@ class SolicitarType extends AbstractType | ||
54 | ), | 55 | ), |
55 | 'label' => 'Cédula' | 56 | 'label' => 'Cédula' |
56 | )) | 57 | )) |
58 | + | ||
59 | + ->add('pfg', EntityType::class, array( | ||
60 | + 'placeholder' => 'Seleccione PFG al cual está adscrito', | ||
61 | + 'class' => 'AppBundle:AreaPersona', | ||
62 | + 'query_builder' => function(EntityRepository $er){ | ||
63 | + return $er->createQueryBuilder('pfg') | ||
64 | + ->where('pfg.idTipoArea = 1'); | ||
65 | + }, | ||
66 | + 'choice_label' => 'getNombre', | ||
67 | + )) | ||
68 | + | ||
57 | ->add('correo', EmailType::class, array( | 69 | ->add('correo', EmailType::class, array( |
58 | 'attr' => array('placeholder' => 'Dirección de Correo...'), | 70 | 'attr' => array('placeholder' => 'Dirección de Correo...'), |
59 | 'constraints' => array( | 71 | 'constraints' => array( |
web/assets/vendor/AppBundle/portal.css