Commit 966bfd16148023c419233d0270d7e3146aa4455e
1 parent
27205cddf7
Exists in
master
mejorar la validacion de primer nombre y segundo nombre en la solicitud de ingre…
…so al cea; mejora la visualizacion del estado asociado al eje
Showing
3 changed files
with
32 additions
and
7 deletions
Show diff stats
src/AppBundle/Controller/PortalController.php
@@ -20,7 +20,11 @@ class PortalController extends Controller | @@ -20,7 +20,11 @@ class PortalController extends Controller | ||
20 | 20 | ||
21 | if ($form->isSubmitted() && $form->isValid()) { | 21 | if ($form->isSubmitted() && $form->isValid()) { |
22 | $persona = $this->getDoctrine()->getRepository('AppBundle:Persona') | 22 | $persona = $this->getDoctrine()->getRepository('AppBundle:Persona') |
23 | - ->findOneByCedulaPasaporte($form->get('cedula')->getData()); | 23 | + ->findOneBy(array( |
24 | + 'cedulaPasaporte' => $form->get('cedula')->getData(), | ||
25 | + 'primerNombre' => ucwords($form->get('nombres')->getData()), | ||
26 | + 'primerApellido' => ucwords($form->get('apellidos')->getData()), | ||
27 | + )); | ||
24 | 28 | ||
25 | if (!$persona) { | 29 | if (!$persona) { |
26 | $this->addFlash('danger', 'Docente no Registrado en la Base de Datos del Centro de Estudios. Por Favor consulte con el Coordinador Regional del CEA'); | 30 | $this->addFlash('danger', 'Docente no Registrado en la Base de Datos del Centro de Estudios. Por Favor consulte con el Coordinador Regional del CEA'); |
src/AppBundle/Entity/EjeParroquia.php
@@ -109,6 +109,17 @@ class EjeParroquia | @@ -109,6 +109,17 @@ class EjeParroquia | ||
109 | 109 | ||
110 | 110 | ||
111 | /** | 111 | /** |
112 | + * Get estado | ||
113 | + * | ||
114 | + * @return string | ||
115 | + */ | ||
116 | + public function getEstado() | ||
117 | + { | ||
118 | + return $this->getIdParroquia()->getIdMunicipio()->getIdEstado()->getNombre(); | ||
119 | + } | ||
120 | + | ||
121 | + | ||
122 | + /** | ||
112 | * Get nombre | 123 | * Get nombre |
113 | * | 124 | * |
114 | * @return string | 125 | * @return string |
src/AppBundle/Form/SolicitarType.php
@@ -21,7 +21,7 @@ use Symfony\Component\Validator\Constraints\Email; | @@ -21,7 +21,7 @@ use Symfony\Component\Validator\Constraints\Email; | ||
21 | use Symfony\Component\Validator\Constraints\Length; | 21 | use Symfony\Component\Validator\Constraints\Length; |
22 | use Symfony\Component\Validator\Constraints\NotBlank; | 22 | use Symfony\Component\Validator\Constraints\NotBlank; |
23 | use Doctrine\ORM\EntityRepository; | 23 | use Doctrine\ORM\EntityRepository; |
24 | - | 24 | +use Symfony\Component\Validator\Constraints\Regex; |
25 | 25 | ||
26 | 26 | ||
27 | class SolicitarType extends AbstractType | 27 | class SolicitarType extends AbstractType |
@@ -34,17 +34,27 @@ class SolicitarType extends AbstractType | @@ -34,17 +34,27 @@ class SolicitarType extends AbstractType | ||
34 | { | 34 | { |
35 | $builder | 35 | $builder |
36 | ->add('nombres', TextType::class, array( | 36 | ->add('nombres', TextType::class, array( |
37 | - 'attr' => array('placeholder' => 'Nombres...'), | 37 | + 'attr' => array('placeholder' => 'Primer Nombre...'), |
38 | + 'label' => 'Primer Nombre', | ||
38 | 'constraints' => array( | 39 | 'constraints' => array( |
39 | new NotBlank(), | 40 | new NotBlank(), |
40 | - new Length(array('min' => 3)), | 41 | + new Regex(array( |
42 | + 'pattern' => '/^([a-zA-ZáéíóúÁÉÍÓÚñÑ\']{2,30}\S+)$/', | ||
43 | + 'match' => true, | ||
44 | + 'message' => 'no debe contener espacios ni números y tener mínino tres caracteres.' | ||
45 | + )) | ||
41 | ) | 46 | ) |
42 | )) | 47 | )) |
43 | ->add('apellidos', TextType::class, array( | 48 | ->add('apellidos', TextType::class, array( |
44 | - 'attr' => array('placeholder' => 'Apellidos...'), | 49 | + 'attr' => array('placeholder' => 'Primer Apellido...'), |
50 | + 'label' => 'Primer Apellido', | ||
45 | 'constraints' => array( | 51 | 'constraints' => array( |
46 | new NotBlank(), | 52 | new NotBlank(), |
47 | - new Length(array('min' => 3)), | 53 | + new Regex(array( |
54 | + 'pattern' => '/^([a-zA-ZáéíóúÁÉÍÓÚñÑ\']{2,30}\S+)$/', | ||
55 | + 'match' => true, | ||
56 | + 'message' => 'no debe contener espacios ni números y tener mínino tres caracteres.' | ||
57 | + )) | ||
48 | ) | 58 | ) |
49 | )) | 59 | )) |
50 | ->add('cedula', NumberType::class, array( | 60 | ->add('cedula', NumberType::class, array( |
@@ -91,7 +101,7 @@ class SolicitarType extends AbstractType | @@ -91,7 +101,7 @@ class SolicitarType extends AbstractType | ||
91 | 'placeholder' => 'Seleccione Estado del Eje', | 101 | 'placeholder' => 'Seleccione Estado del Eje', |
92 | 'label' => 'Estado', | 102 | 'label' => 'Estado', |
93 | 'class' => 'AppBundle:EjeParroquia', | 103 | 'class' => 'AppBundle:EjeParroquia', |
94 | - | 104 | + 'choice_label' => 'estado', |
95 | 'constraints' => array( | 105 | 'constraints' => array( |
96 | new NotBlank() | 106 | new NotBlank() |
97 | ) | 107 | ) |