Commit 06b5782b9a17c45afaf347cd2c512792317f8615
1 parent
4ed5aa66b1
Exists in
master
validando los datos obligatorios principales desde el formType de Ascenso
Showing
1 changed file
with
133 additions
and
152 deletions
Show diff stats
src/AppBundle/Form/AscensoType.php
... | ... | @@ -29,234 +29,215 @@ class AscensoType extends AbstractType |
29 | 29 | public function buildForm(FormBuilderInterface $builder, array $options) |
30 | 30 | { |
31 | 31 | $builder |
32 | - | |
33 | 32 | ->add('trabajo', FileType::class, array( |
34 | 33 | 'label' => 'Digital Constancia Trabajo Actualizada', |
35 | - 'constraints' => array( | |
36 | - new NotBlank(), | |
37 | - new File(array( | |
38 | - 'maxSize' => '1024K', | |
39 | - 'mimeTypes' => [ | |
40 | - 'application/pdf', | |
41 | - 'application/x-pdf', | |
42 | - 'image/png', | |
43 | - 'image/jpg', | |
44 | - 'image/jpeg' | |
34 | + 'constraints' => array( | |
35 | + new NotBlank(), | |
36 | + new File(array( | |
37 | + 'maxSize' => '1024K', | |
38 | + 'mimeTypes' => [ | |
39 | + 'application/pdf', | |
40 | + 'application/x-pdf', | |
41 | + 'image/png', | |
42 | + 'image/jpg', | |
43 | + 'image/jpeg' | |
45 | 44 | ], |
46 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
47 | - )) | |
48 | - ) | |
49 | - )) | |
45 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
46 | + )) | |
47 | + ) | |
48 | + )) | |
50 | 49 | ->add('expediente', FileType::class, array( |
51 | 50 | 'label' => 'Digital Actualización de Expediente', |
52 | 51 | 'constraints' => array( |
53 | 52 | new NotBlank(), |
54 | - new File(array( | |
55 | - 'maxSize' => '1024K', | |
56 | - 'mimeTypes' => [ | |
57 | - 'application/pdf', | |
58 | - 'application/x-pdf', | |
59 | - 'image/png', | |
60 | - 'image/jpg', | |
61 | - 'image/jpeg' | |
53 | + new File(array( | |
54 | + 'maxSize' => '1024K', | |
55 | + 'mimeTypes' => [ | |
56 | + 'application/pdf', | |
57 | + 'application/x-pdf', | |
58 | + 'image/png', | |
59 | + 'image/jpg', | |
60 | + 'image/jpeg' | |
62 | 61 | ], |
63 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
64 | - )) | |
62 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
63 | + )) | |
65 | 64 | ) |
66 | 65 | )) |
67 | - | |
68 | 66 | ->add('pida', FileType::class, array( |
69 | 67 | 'label' => 'Digital Socialización del PIDA', |
70 | - 'required' => true, | |
68 | + 'required' => true, | |
71 | 69 | 'constraints' => array( |
72 | - new File(array( | |
73 | - 'maxSize' => '1024K', | |
74 | - 'mimeTypes' => [ | |
75 | - 'application/pdf', | |
76 | - 'application/x-pdf', | |
77 | - 'image/png', | |
78 | - 'image/jpg', | |
79 | - 'image/jpeg' | |
70 | + new NotBlank(), | |
71 | + new File(array( | |
72 | + 'maxSize' => '1024K', | |
73 | + 'mimeTypes' => [ | |
74 | + 'application/pdf', | |
75 | + 'application/x-pdf', | |
76 | + 'image/png', | |
77 | + 'image/jpg', | |
78 | + 'image/jpeg' | |
80 | 79 | ], |
81 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
82 | - )) | |
80 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
81 | + )) | |
83 | 82 | ) |
84 | - )) | |
85 | - | |
83 | + )) | |
86 | 84 | ->add('nai', FileType::class, array( |
87 | 85 | 'label' => 'Digital Aval del NAI', |
88 | - 'required' => true, | |
86 | + 'required' => true, | |
89 | 87 | 'constraints' => array( |
90 | - new File(array( | |
91 | - 'maxSize' => '1024K', | |
92 | - 'mimeTypes' => [ | |
93 | - 'application/pdf', | |
94 | - 'application/x-pdf', | |
95 | - 'image/png', | |
96 | - 'image/jpg', | |
97 | - 'image/jpeg' | |
88 | + new NotBlank(), | |
89 | + new File(array( | |
90 | + 'maxSize' => '1024K', | |
91 | + 'mimeTypes' => [ | |
92 | + 'application/pdf', | |
93 | + 'application/x-pdf', | |
94 | + 'image/png', | |
95 | + 'image/jpg', | |
96 | + 'image/jpeg' | |
98 | 97 | ], |
99 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
100 | - )) | |
98 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
99 | + )) | |
100 | + ) | |
101 | + )) | |
102 | + ->add('tipoTrabajoInvestigacion', ChoiceType::class, array( | |
103 | + 'placeholder' => 'Seleccione el Tipo de Trabajo de Investigación', | |
104 | + 'choices' => array( | |
105 | + 'Tesis (Trabajo de 4to nivel)' => 'tesis', | |
106 | + 'Trabajo de Investigacion' => 'investigacion', | |
107 | + ), | |
108 | + // *esto es muy importante* | |
109 | + 'choices_as_values' => true, | |
110 | + 'constraints' => array( | |
111 | + new NotBlank(), | |
101 | 112 | ) |
102 | - )) | |
103 | - | |
104 | - ->add('tipoTrabajoInvestigacion', ChoiceType::class, array( | |
105 | - 'placeholder' => 'Seleccione el Tipo de Trabajo de Investigación', | |
106 | - 'choices' => array( | |
107 | - 'Tesis (Trabajo de 4to nivel)' => 'tesis', | |
108 | - 'Trabajo de Investigacion' => 'investigacion', | |
109 | - ), | |
110 | - // *this line is important* | |
111 | - 'choices_as_values' => true, | |
112 | - )) | |
113 | - | |
114 | - | |
113 | + )) | |
115 | 114 | ->add('tesisUbv', CheckboxType::class, array( |
116 | - 'label' => '¿La tesis fue realizada FUERA de la UBV?', | |
117 | - 'label_attr' => array( 'class' => 'esc_tesis', 'style' => 'display:none;'), | |
115 | + 'label' => '¿La tesis fue realizada FUERA de la UBV?', | |
116 | + 'label_attr' => array('class' => 'esc_tesis', 'style' => 'display:none;'), | |
118 | 117 | 'required' => false, |
118 | + 'mapped' => false, | |
119 | 119 | 'attr' => array( |
120 | 120 | 'style' => 'display:none;', |
121 | - 'class' => 'esc_tesis' | |
121 | + 'class' => 'esc_tesis' | |
122 | 122 | ) |
123 | 123 | )) |
124 | - | |
125 | - | |
126 | - | |
127 | 124 | ->add('titulo_trabajo', TextType::class, array( |
128 | - 'label' => 'Título del Trabajo de Ascenso', | |
129 | - 'required' => true, | |
125 | + 'label' => 'Título del Trabajo de Ascenso', | |
126 | + 'required' => true, | |
127 | + 'constraints' => array( | |
128 | + new NotBlank(), | |
129 | + ) | |
130 | 130 | )) |
131 | - | |
132 | - | |
133 | - ->add('aprobacion', FileType::class, array( | |
131 | + ->add('aprobacion', FileType::class, array( | |
134 | 132 | 'label' => 'Acta de Aprobación de la Tesis', |
135 | - 'label_attr' => array( 'class' => 'esc_tesis', 'style' => 'display:none;'), | |
133 | + 'label_attr' => array('class' => 'esc_tesis', 'style' => 'display:none;'), | |
136 | 134 | 'required' => false, |
137 | 135 | 'attr' => array( |
138 | 136 | 'style' => 'display:none;', |
139 | - 'class' => 'esc_tesis' | |
137 | + 'class' => 'esc_tesis' | |
140 | 138 | ), |
141 | 139 | 'constraints' => array( |
142 | - new File(array( | |
143 | - 'maxSize' => '1024K', | |
144 | - 'mimeTypes' => [ | |
145 | - 'application/pdf', | |
146 | - 'application/x-pdf', | |
147 | - 'image/png', | |
148 | - 'image/jpg', | |
149 | - 'image/jpeg' | |
140 | + new File(array( | |
141 | + 'maxSize' => '1024K', | |
142 | + 'mimeTypes' => [ | |
143 | + 'application/pdf', | |
144 | + 'application/x-pdf', | |
145 | + 'image/png', | |
146 | + 'image/jpg', | |
147 | + 'image/jpeg' | |
150 | 148 | ], |
151 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
152 | - )) | |
149 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
150 | + )) | |
153 | 151 | ) |
154 | 152 | )) |
155 | - | |
156 | - | |
157 | 153 | ->add('investigacion', FileType::class, array( |
158 | 154 | 'label' => 'Digital Trabajo de investigación / Tesis', |
159 | - 'required' => true, | |
155 | + 'required' => true, | |
160 | 156 | 'constraints' => array( |
161 | - new File(array( | |
162 | - 'maxSize' => '1024K', | |
163 | - 'mimeTypes' => [ | |
164 | - 'application/pdf', | |
165 | - 'application/x-pdf', | |
166 | - 'image/png', | |
167 | - 'image/jpg', | |
168 | - 'image/jpeg' | |
157 | + new File(array( | |
158 | + 'maxSize' => '1024K', | |
159 | + 'mimeTypes' => [ | |
160 | + 'application/pdf', | |
161 | + 'application/x-pdf', | |
162 | + 'image/png', | |
163 | + 'image/jpg', | |
164 | + 'image/jpeg' | |
169 | 165 | ], |
170 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
171 | - )) | |
166 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
167 | + )) | |
172 | 168 | ) |
173 | - )) | |
174 | - | |
175 | - | |
176 | - | |
177 | - | |
178 | - ->add('tutores_ascenso', EntityType::class, array( | |
179 | - 'placeholder' => 'Añadir Posibles Jurados...', | |
169 | + )) | |
170 | + ->add('tutores_ascenso', EntityType::class, array( | |
171 | + 'placeholder' => 'Añadir Posibles Jurados...', | |
180 | 172 | 'class' => 'AppBundle:TutoresAscenso', |
181 | 173 | 'required' => false, |
182 | 174 | 'label' => 'Asigne Posibles Jurados', |
183 | - 'label_attr' => array( 'class' => 'esc_investigacion'), | |
184 | - 'multiple' => true, | |
185 | - 'group_by' => 'institucion', | |
186 | - | |
175 | + 'label_attr' => array('class' => 'esc_investigacion'), | |
176 | + 'multiple' => true, | |
177 | + 'group_by' => 'institucion', | |
178 | + | |
187 | 179 | /*'attr' => array( |
188 | 180 | 'disabled' => 'true', |
189 | 181 | )*/ |
190 | 182 | )) |
191 | - | |
192 | - | |
193 | - ->add('curriculo', FileType::class, array( | |
183 | + ->add('curriculo', FileType::class, array( | |
194 | 184 | 'label' => 'Digital de la síntesis curricular de los jurados', |
195 | - 'label_attr' => array( 'class' => 'esc_investigacion', 'style' => 'display:none;'), | |
185 | + 'label_attr' => array('class' => 'esc_investigacion', 'style' => 'display:none;'), | |
196 | 186 | 'required' => false, |
197 | - 'attr' => array( | |
187 | + 'attr' => array( | |
198 | 188 | 'style' => 'display:none;', |
199 | - 'class' => 'esc_investigacion' | |
189 | + 'class' => 'esc_investigacion' | |
200 | 190 | ), |
201 | 191 | 'constraints' => array( |
202 | - new File(array( | |
203 | - 'maxSize' => '1024K', | |
204 | - 'mimeTypes' => [ | |
205 | - 'application/pdf', | |
206 | - 'application/x-pdf', | |
192 | + new File(array( | |
193 | + 'maxSize' => '1024K', | |
194 | + 'mimeTypes' => [ | |
195 | + 'application/pdf', | |
196 | + 'application/x-pdf', | |
207 | 197 | ], |
208 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones pdf' | |
209 | - )) | |
198 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones pdf' | |
199 | + )) | |
210 | 200 | ) |
211 | 201 | )) |
212 | - | |
213 | - | |
214 | 202 | ->add('pertinencia', FileType::class, array( |
215 | 203 | 'label' => 'Informe de Pertinencia', |
216 | - 'label_attr' => array( 'class' => 'esc_pertinencia'), | |
204 | + 'label_attr' => array('class' => 'esc_pertinencia'), | |
217 | 205 | 'required' => false, |
218 | 206 | 'attr' => array( |
219 | 207 | 'style' => 'display:none;', |
220 | - 'class' => 'esc_pertinencia' | |
208 | + 'class' => 'esc_pertinencia' | |
221 | 209 | ), |
222 | 210 | 'constraints' => array( |
223 | - new File(array( | |
224 | - 'maxSize' => '1024K', | |
225 | - 'mimeTypes' => [ | |
226 | - 'application/pdf', | |
227 | - 'application/x-pdf', | |
228 | - 'image/png', | |
229 | - 'image/jpg', | |
230 | - 'image/jpeg' | |
211 | + new File(array( | |
212 | + 'maxSize' => '1024K', | |
213 | + 'mimeTypes' => [ | |
214 | + 'application/pdf', | |
215 | + 'application/x-pdf', | |
216 | + 'image/png', | |
217 | + 'image/jpg', | |
218 | + 'image/jpeg' | |
231 | 219 | ], |
232 | - 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
233 | - )) | |
220 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
221 | + )) | |
234 | 222 | ) |
235 | 223 | )) |
236 | - | |
237 | - | |
238 | 224 | ->add('nombreNucleo', TextType::class, array( |
239 | 225 | 'label' => 'Nombre del Núcleo al cual pertenece', |
240 | - | |
241 | - 'required' => true, | |
242 | - | |
243 | - )) | |
244 | 226 | |
245 | - | |
227 | + 'required' => true, | |
228 | + 'constraints' => array( | |
229 | + new NotBlank(), | |
230 | + ) | |
246 | 231 | |
247 | - | |
232 | + )) | |
248 | 233 | ->add('send', SubmitType::class, array( |
249 | 234 | 'label' => 'Crear Solicitud de Ascenso', |
250 | - 'attr' => array('class' => 'btn btn-success btn-block') | |
251 | - )) | |
252 | - | |
253 | - | |
254 | - ; | |
235 | + 'attr' => array('class' => 'btn btn-success btn-block'), | |
236 | + 'data-loading-text' => "<i class='fa fa-circle-o-notch fa-spin'></i> Procesando Solicitud..." | |
237 | + )); | |
255 | 238 | |
256 | 239 | |
257 | 240 | } |
258 | - | |
259 | - | |
260 | 241 | |
261 | 242 | |
262 | 243 | } | ... | ... |