Commit 1ee1f9172526fc8bc41eac29326948a087729d45
1 parent
6d62f27c40
Exists in
master
simplificando el llenado del formulario, solo solicitando la cedula o pasaporte
Showing
3 changed files
with
8 additions
and
32 deletions
Show diff stats
app/Resources/views/portal/index.html.twig
@@ -319,6 +319,8 @@ | @@ -319,6 +319,8 @@ | ||
319 | <script type="text/javascript" src="{{ asset('assets/vendor/smooth-scroll/dist/js/smooth-scroll.js') }}" ></script> | 319 | <script type="text/javascript" src="{{ asset('assets/vendor/smooth-scroll/dist/js/smooth-scroll.js') }}" ></script> |
320 | <script type="text/javascript"> | 320 | <script type="text/javascript"> |
321 | smoothScroll.init(); | 321 | smoothScroll.init(); |
322 | + $('#solicitar_eje_parroquia').empty().append('<option selected="selected" value="">Seleccione el Estado asociado al Eje Adscrito</option>'); | ||
323 | + | ||
322 | 324 | ||
323 | $(function() { | 325 | $(function() { |
324 | $("#solicitar_eje").change(function(){ | 326 | $("#solicitar_eje").change(function(){ |
src/AppBundle/Controller/PortalController.php
@@ -21,9 +21,7 @@ class PortalController extends Controller | @@ -21,9 +21,7 @@ class PortalController extends Controller | ||
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 | ->findOneBy(array( | 23 | ->findOneBy(array( |
24 | - 'cedulaPasaporte' => $form->get('cedula')->getData(), | ||
25 | - 'primerNombre' => ucwords($form->get('nombres')->getData()), | ||
26 | - 'primerApellido' => ucwords($form->get('apellidos')->getData()), | 24 | + 'cedulaPasaporte' => $form->get('cedula')->getData() |
27 | )); | 25 | )); |
28 | 26 | ||
29 | if (!$persona) { | 27 | if (!$persona) { |
@@ -85,8 +83,8 @@ class PortalController extends Controller | @@ -85,8 +83,8 @@ class PortalController extends Controller | ||
85 | $this->renderView( | 83 | $this->renderView( |
86 | 'correos/solicitud_adscripcion.html.twig', | 84 | 'correos/solicitud_adscripcion.html.twig', |
87 | array( | 85 | array( |
88 | - 'nombres' => $form->get('nombres')->getData(), | ||
89 | - 'apellidos' => $form->get('apellidos')->getData(), | 86 | + 'nombres' => $persona->getPrimerNombre(), |
87 | + 'apellidos' => $persona->getPrimerApellido(), | ||
90 | 'usuario' => $login->getUsername(), | 88 | 'usuario' => $login->getUsername(), |
91 | 'contra' => $login->getPlainPassword(), | 89 | 'contra' => $login->getPlainPassword(), |
92 | 'centro_estudios' => 'Centro de Estudios Ambientales', | 90 | 'centro_estudios' => 'Centro de Estudios Ambientales', |
src/AppBundle/Form/SolicitarType.php
@@ -33,32 +33,8 @@ class SolicitarType extends AbstractType | @@ -33,32 +33,8 @@ class SolicitarType extends AbstractType | ||
33 | public function buildForm(FormBuilderInterface $builder, array $options) | 33 | public function buildForm(FormBuilderInterface $builder, array $options) |
34 | { | 34 | { |
35 | $builder | 35 | $builder |
36 | - ->add('nombres', TextType::class, array( | ||
37 | - 'attr' => array('placeholder' => 'Primer Nombre...'), | ||
38 | - 'label' => 'Primer Nombre', | ||
39 | - 'constraints' => array( | ||
40 | - new NotBlank(), | ||
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 | - )) | ||
46 | - ) | ||
47 | - )) | ||
48 | - ->add('apellidos', TextType::class, array( | ||
49 | - 'attr' => array('placeholder' => 'Primer Apellido...'), | ||
50 | - 'label' => 'Primer Apellido', | ||
51 | - 'constraints' => array( | ||
52 | - new NotBlank(), | ||
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 | - )) | ||
58 | - ) | ||
59 | - )) | ||
60 | ->add('cedula', NumberType::class, array( | 36 | ->add('cedula', NumberType::class, array( |
61 | - 'attr' => array('placeholder' => 'Cédula o Pasaporte...'), | 37 | + 'attr' => array('placeholder' => 'Cédula o Pasaporte del docente...'), |
62 | 'constraints' => array( | 38 | 'constraints' => array( |
63 | new NotBlank(), | 39 | new NotBlank(), |
64 | new Length(array('min' => 7)), | 40 | new Length(array('min' => 7)), |
@@ -81,7 +57,7 @@ class SolicitarType extends AbstractType | @@ -81,7 +57,7 @@ class SolicitarType extends AbstractType | ||
81 | )) | 57 | )) |
82 | 58 | ||
83 | ->add('correo', EmailType::class, array( | 59 | ->add('correo', EmailType::class, array( |
84 | - 'attr' => array('placeholder' => 'Dirección de Correo...'), | 60 | + 'attr' => array('placeholder' => 'Dirección de Correo Electrónico...'), |
85 | 'constraints' => array( | 61 | 'constraints' => array( |
86 | new NotBlank(), | 62 | new NotBlank(), |
87 | new Email() | 63 | new Email() |
@@ -98,7 +74,7 @@ class SolicitarType extends AbstractType | @@ -98,7 +74,7 @@ class SolicitarType extends AbstractType | ||
98 | )) | 74 | )) |
99 | 75 | ||
100 | ->add('eje_parroquia', EntityType::class, array( | 76 | ->add('eje_parroquia', EntityType::class, array( |
101 | - 'placeholder' => 'Seleccione Estado del Eje', | 77 | + 'placeholder' => 'Seleccione Estado del Eje Adscrito', |
102 | 'label' => 'Estado', | 78 | 'label' => 'Estado', |
103 | 'class' => 'AppBundle:EjeParroquia', | 79 | 'class' => 'AppBundle:EjeParroquia', |
104 | 'choice_label' => 'estado', | 80 | 'choice_label' => 'estado', |