diff --git a/app/Resources/views/cea/solicitudes.html.twig b/app/Resources/views/cea/solicitudes.html.twig index 91ee0a9..df383de 100644 --- a/app/Resources/views/cea/solicitudes.html.twig +++ b/app/Resources/views/cea/solicitudes.html.twig @@ -1,7 +1,7 @@ {% extends 'base_app.html.twig' %} {%block body %} - +

Listado de solicitudes de Adscripción Al CEA

@@ -12,20 +12,25 @@ Datos del Docente - Cantidad de Documentos - Acciones Rápidas + Eje del Docente {% for adscripcion in adscripciones %} - - {{adscripcion.idRolInstitucion}} + {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerNombre}} {{adscripcion.idRolInstitucion.idRol.idPersona.PrimerApellido}} + ( {{adscripcion.idRolInstitucion}} ) + + + - http://www.egrappler.com/ - + + Eje:{{adscripcion.idRolInstitucion.idInstitucion.idEjeParroquia.IdEje}} + Estado: {{adscripcion.idRolInstitucion.idInstitucion.idEjeParroquia.idParroquia.idMunicipio.idEstado}} + + {% endfor %} @@ -35,5 +40,6 @@
- +
+ {% endblock %} diff --git a/src/AppBundle/Controller/DefaultController.php b/src/AppBundle/Controller/DefaultController.php index 2772d97..28af19c 100644 --- a/src/AppBundle/Controller/DefaultController.php +++ b/src/AppBundle/Controller/DefaultController.php @@ -31,7 +31,7 @@ class DefaultController extends Controller //si no existe el rol del docente, enviar correo al encargado de la región para verificar. if (!$rol) { throw $this->createNotFoundException( - 'No product found for id '. $form->get('cedula')->getData() + 'Docente no registrado en la UBV '. $form->get('cedula')->getData() ); } @@ -49,8 +49,16 @@ class DefaultController extends Controller $login->setIdRolInstitucion($rol); $permiso = $this->getDoctrine()->getRepository('AppBundle:Role')->findOneById(1); $login->addRol($permiso); //le añade la permisología básica de docente + + $rep = $this->getDoctrine()->getRepository('AppBundle:Rol'); + //Actualizar el PFG de la persona + $actualizarRol = $rep->findOneByIdPersona($rol->getIdRol()->getIdPersona()); + $actualizarRol->setIdAreaPersona($form->get('pfg')->getData() ); + $em = $this->getDoctrine()->getManager(); $em->persist($login); + $em->persist($actualizarRol); + $em->flush(); //guarda en la base de datos @@ -94,37 +102,7 @@ class DefaultController extends Controller throw $this->createNotFoundException( 'Docente Encontrado '. $form->get('cedula')->getData() ); - - - - $message = \Swift_Message::newInstance() - ->setSubject('Hello Email') - ->setFrom('send@example.com') - ->setTo('wilmer.ramones@gmail.com') - ->setBody( - $this->renderView( - 'correos/solicitud_adscripcion.html.twig', - array( - 'nombres' => $form->get('nombres')->getData(), - 'apellidos' => $form->get('apellidos')->getData(), - - ) - ), - 'text/html' - ) - /* - * If you also want to include a plaintext version of the message - ->addPart( - $this->renderView( - 'Emails/registration.txt.twig', - array('name' => $name) - ), - 'text/plain' - ) - */ - ; - //$this->get('mailer')->send($message); - + //$request->getSession()->getFlashBag()->add('success', 'Your email has been sent! Thanks!'); } diff --git a/src/AppBundle/Entity/AreaPersona.php b/src/AppBundle/Entity/AreaPersona.php index c7ad6f8..b164dc0 100644 --- a/src/AppBundle/Entity/AreaPersona.php +++ b/src/AppBundle/Entity/AreaPersona.php @@ -36,6 +36,16 @@ class AreaPersona * @ORM\SequenceGenerator(sequenceName="area_persona_id_seq", allocationSize=1, initialValue=1) */ private $id; + + /** + * @var \AppBundle\Entity\TipoArea + * + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoArea") + * @ORM\JoinColumns({ + * @ORM\JoinColumn(name="id_tipo_area", referencedColumnName="id", nullable=false) + * }) + */ + private $idTipoArea; @@ -82,6 +92,30 @@ class AreaPersona { return $this->nombre; } + + + /** + * Set idTipoArea + * + * @param \AppBundle\Entity\Estado $idTipoArea + * @return TipoArea + */ + public function setIdTipoArea(\AppBundle\Entity\TipoArea $idTipoArea = null) + { + $this->idEstado = $idTipoArea; + + return $this; + } + + /** + * Get idTipoArea + * + * @return \AppBundle\Entity\TipoArea + */ + public function getIdTipoArea() + { + return $this->idTipoArea; + } } \ No newline at end of file diff --git a/src/AppBundle/Entity/Rol.php b/src/AppBundle/Entity/Rol.php index e383406..e7738e2 100644 --- a/src/AppBundle/Entity/Rol.php +++ b/src/AppBundle/Entity/Rol.php @@ -56,7 +56,7 @@ class Rol * * @ORM\ManyToOne(targetEntity="AppBundle\Entity\AreaPersona") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="id_area_persona", referencedColumnName="id", nullable=false) + * @ORM\JoinColumn(name="id_area_persona", referencedColumnName="id", nullable=true) * }) */ private $idAreaPersona; diff --git a/src/AppBundle/Entity/TipoArea.php b/src/AppBundle/Entity/TipoArea.php new file mode 100644 index 0000000..008d4d5 --- /dev/null +++ b/src/AppBundle/Entity/TipoArea.php @@ -0,0 +1,84 @@ +nombre = $nombre; + + return $this; + } + + /** + * Get nombre + * + * @return string + */ + public function getNombre() + { + return $this->nombre; + } + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Get nombre + * + * @return string + */ + public function __toString() + { + return $this->nombre; + } + + +} diff --git a/src/AppBundle/Form/SolicitarType.php b/src/AppBundle/Form/SolicitarType.php index b9baf58..5fb7b87 100644 --- a/src/AppBundle/Form/SolicitarType.php +++ b/src/AppBundle/Form/SolicitarType.php @@ -19,6 +19,7 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Validator\Constraints\Email; use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; +use Doctrine\ORM\EntityRepository; @@ -54,6 +55,17 @@ class SolicitarType extends AbstractType ), 'label' => 'Cédula' )) + + ->add('pfg', EntityType::class, array( + 'placeholder' => 'Seleccione PFG al cual está adscrito', + 'class' => 'AppBundle:AreaPersona', + 'query_builder' => function(EntityRepository $er){ + return $er->createQueryBuilder('pfg') + ->where('pfg.idTipoArea = 1'); + }, + 'choice_label' => 'getNombre', + )) + ->add('correo', EmailType::class, array( 'attr' => array('placeholder' => 'Dirección de Correo...'), 'constraints' => array( diff --git a/web/assets/vendor/AppBundle/portal.css b/web/assets/vendor/AppBundle/portal.css index ef9b68e..81d69cd 100644 --- a/web/assets/vendor/AppBundle/portal.css +++ b/web/assets/vendor/AppBundle/portal.css @@ -1,5 +1,4 @@ -/*noinspection CssUnknownTarget*/ -@import url('http://fonts.googleapis.com/css?family=Montserrat:400,700'); + body { font-family: 'Montserrat', sans-serif; font-size: 14px;