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 | 319 | <script type="text/javascript" src="{{ asset('assets/vendor/smooth-scroll/dist/js/smooth-scroll.js') }}" ></script> |
320 | 320 | <script type="text/javascript"> |
321 | 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 | 325 | $(function() { |
324 | 326 | $("#solicitar_eje").change(function(){ | ... | ... |
src/AppBundle/Controller/PortalController.php
... | ... | @@ -21,9 +21,7 @@ class PortalController extends Controller |
21 | 21 | if ($form->isSubmitted() && $form->isValid()) { |
22 | 22 | $persona = $this->getDoctrine()->getRepository('AppBundle:Persona') |
23 | 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 | 27 | if (!$persona) { |
... | ... | @@ -85,8 +83,8 @@ class PortalController extends Controller |
85 | 83 | $this->renderView( |
86 | 84 | 'correos/solicitud_adscripcion.html.twig', |
87 | 85 | array( |
88 | - 'nombres' => $form->get('nombres')->getData(), | |
89 | - 'apellidos' => $form->get('apellidos')->getData(), | |
86 | + 'nombres' => $persona->getPrimerNombre(), | |
87 | + 'apellidos' => $persona->getPrimerApellido(), | |
90 | 88 | 'usuario' => $login->getUsername(), |
91 | 89 | 'contra' => $login->getPlainPassword(), |
92 | 90 | 'centro_estudios' => 'Centro de Estudios Ambientales', | ... | ... |
src/AppBundle/Form/SolicitarType.php
... | ... | @@ -33,32 +33,8 @@ class SolicitarType extends AbstractType |
33 | 33 | public function buildForm(FormBuilderInterface $builder, array $options) |
34 | 34 | { |
35 | 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 | 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 | 38 | 'constraints' => array( |
63 | 39 | new NotBlank(), |
64 | 40 | new Length(array('min' => 7)), |
... | ... | @@ -81,7 +57,7 @@ class SolicitarType extends AbstractType |
81 | 57 | )) |
82 | 58 | |
83 | 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 | 61 | 'constraints' => array( |
86 | 62 | new NotBlank(), |
87 | 63 | new Email() |
... | ... | @@ -98,7 +74,7 @@ class SolicitarType extends AbstractType |
98 | 74 | )) |
99 | 75 | |
100 | 76 | ->add('eje_parroquia', EntityType::class, array( |
101 | - 'placeholder' => 'Seleccione Estado del Eje', | |
77 | + 'placeholder' => 'Seleccione Estado del Eje Adscrito', | |
102 | 78 | 'label' => 'Estado', |
103 | 79 | 'class' => 'AppBundle:EjeParroquia', |
104 | 80 | 'choice_label' => 'estado', | ... | ... |