Commit 1521546b1c47646edf4fec488322e3ef31b2ec3b
1 parent
a10b2c5279
Exists in
master
se mejoró la validación de la adscripcion, se guradó la dirección de correo del …
…docente, se envian correos al cambiar el estatus de la adscripcion, se deja libre la parte de administracion mientras se hacen pruebas
Showing
9 changed files
with
223 additions
and
23 deletions
Show diff stats
app/Resources/views/cea/solicitudes_mostar.html.twig
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | |
| 33 | 33 | </div> |
| 34 | 34 | <div class="row"> |
| 35 | - {% if adscripcion.postgrado is null %} | |
| 35 | + {% if adscripcion.oposicion is null %} | |
| 36 | 36 | <div class="form-group"> |
| 37 | 37 | <h4 class="alert alert-warning">El Docente al momento de la solicitud informa no haber realizado Concurso de oposición</h4> |
| 38 | 38 | </div> |
| ... | ... | @@ -151,6 +151,21 @@ |
| 151 | 151 | </div> |
| 152 | 152 | </div> |
| 153 | 153 | {% endif %} |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + {% if adscripcion.asistente is not null %} | |
| 158 | + <div class="col-xs-4"> | |
| 159 | + <div class="thumbnail"> | |
| 160 | + <a href="{{asset('uploads/adscripcion/'~ adscripcion.asistente)}}" data-lightbox="adscripcion"> | |
| 161 | + <img src="{{ asset('uploads/adscripcion/thumb/'~ adscripcion.asistente) }}" /> | |
| 162 | + </a> | |
| 163 | + <div class="caption"> | |
| 164 | + <p>Ascenso Asistente</p> | |
| 165 | + </div> | |
| 166 | + </div> | |
| 167 | + </div> | |
| 168 | + {% endif %} | |
| 154 | 169 | |
| 155 | 170 | |
| 156 | 171 | ... | ... |
app/Resources/views/correos/actualizar_adscripcion.html.twig
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | +<h3>Bienvido al CEA@UBV {{ nombres }}Tu adscripcion ha sido {{ estatus }}</h3> | |
| 2 | + | |
| 3 | + | |
| 4 | +Para hacer login dirigete simplemente a la página de ingreso del Portal del Centro de Estudios Avanzados: <a href="{{ url('login') }}">Login</a>. | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | +{# Makes an absolute URL to the /images/logo.png file #} | |
| 9 | +<img src="{{ absolute_url(asset('bundles/framework/images/portal/logo_ubv.png')) }}"> | |
| 0 | 10 | \ No newline at end of file | ... | ... |
app/Resources/views/portal/index.html.twig
| ... | ... | @@ -248,7 +248,7 @@ |
| 248 | 248 | <div class="col-md-6 wow fadeInRight"> |
| 249 | 249 | <div class="social-links"> |
| 250 | 250 | <a class="social" href="#" target="_blank"><i class="fa fa-facebook fa-2x"></i></a> |
| 251 | - <a class="social" href="#" target="_blank"><i class="fa fa-twitter fa-2x"></i></a> | |
| 251 | + <a class="social" href="https://twitter.com/ubv?lang=es" target="_blank"><i class="fa fa-twitter fa-2x"></i></a> | |
| 252 | 252 | <a class="social" href="#" target="_blank"><i class="fa fa-google-plus fa-2x"></i></a> |
| 253 | 253 | <a class="social" href="#" target="_blank"><i class="fa fa-linkedin fa-2x"></i></a> |
| 254 | 254 | </div> | ... | ... |
app/Resources/views/solicitudes/adscripcion.html.twig
| ... | ... | @@ -39,25 +39,47 @@ |
| 39 | 39 | $("#user_fecha_oposicion_month").prop('required', $(this).prop("checked")); |
| 40 | 40 | $("#user_fecha_oposicion_year").prop('required', $(this).prop("checked")); |
| 41 | 41 | $("#user_documento_oposicion").prop('required', $(this).prop("checked")); |
| 42 | + $("#user_lineas_investigacion").prop('required', $(this).prop("checked")); | |
| 43 | + $("#user_titulo_trabajo").prop('required', $(this).prop("checked")); | |
| 42 | 44 | }); |
| 43 | 45 | |
| 44 | 46 | $('#user_ascenso').click(function() { |
| 45 | - alert($("#user_escala").val()); | |
| 47 | + | |
| 46 | 48 | if($("#user_escala").val() == 1) |
| 47 | 49 | $('.esc_asistente')[this.checked ? "show" : "hide"](); |
| 48 | 50 | if($("#user_escala").val() == 2) |
| 49 | 51 | $('.esc_asociado')[this.checked ? "show" : "hide"](); |
| 50 | - if($("#user_escala").val() == 3) | |
| 51 | - $('.esc_agregado')[this.checked ? "show" : "hide"](); | |
| 52 | - if($("#user_escala").val() == 4) | |
| 53 | - $('.esc_titular')[this.checked ? "show" : "hide"](); | |
| 54 | - | |
| 52 | + if($("#user_escala").val() == 3) | |
| 53 | + $('.esc_agregado')[this.checked ? "show" : "hide"](); | |
| 54 | + if($("#user_escala").val() == 4) | |
| 55 | + $('.esc_titular')[this.checked ? "show" : "hide"](); | |
| 55 | 56 | |
| 56 | 57 | }); |
| 57 | 58 | |
| 58 | 59 | |
| 59 | - $('#user_ascenso2').click(function() { | |
| 60 | - alert($("#user_escala").val()); | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + $("#user_fecha_oposicion_year").change(function(){ | |
| 64 | + if ($("#user_fecha_oposicion_year").val() < $("#user_fecha_ingreso_year").val()){ | |
| 65 | + alert('la fecha de concurso debe ser mayor a la fecha de ingreso'); | |
| 66 | + $("#user_fecha_oposicion_year").val(""); | |
| 67 | + | |
| 68 | + } | |
| 69 | + }); | |
| 70 | + | |
| 71 | + $("#user_fecha_ascenso_asistente_year").change(function(){ | |
| 72 | + if ($("#user_fecha_ascenso_asistente_year").val() < $("#user_fecha_oposicion_year").val()){ | |
| 73 | + alert('la fecha de ascenso debe ser mayor a la del Concurso de oposición'); | |
| 74 | + $("#user_fecha_asistente_year").val(""); | |
| 75 | + | |
| 76 | + } | |
| 77 | + }); | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + $('#user_ascenso2').click(function() { | |
| 61 | 83 | $('.esc_asociado')[this.checked ? "show" : "hide"](); |
| 62 | 84 | |
| 63 | 85 | }); |
| ... | ... | @@ -74,8 +96,7 @@ |
| 74 | 96 | }); |
| 75 | 97 | |
| 76 | 98 | |
| 77 | - $('#user_escala').change(function(){ | |
| 78 | - alert($('#user_escala').val()) | |
| 99 | + $('#user_escala').change(function(){ | |
| 79 | 100 | if ($('#user_escala').val() >= 1) $('#user_oposicion').attr('disabled',true); |
| 80 | 101 | else $('#user_oposicion').attr('disabled',false); |
| 81 | 102 | }); | ... | ... |
app/config/security.yml
| ... | ... | @@ -37,5 +37,5 @@ security: |
| 37 | 37 | - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } |
| 38 | 38 | - { path: ^/register, roles: ROLE_DOCENTE } |
| 39 | 39 | - { path: ^/ceapp, roles: ROLE_DOCENTE } |
| 40 | - - { path: ^/admin, roles: ROLE_ADMINISTRADOR } | |
| 40 | + - { path: ^/admin, roles: IS_AUTHENTICATED_ANONYMOUSLY } | |
| 41 | 41 | - { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY } | ... | ... |
src/AppBundle/Controller/AppController.php
| ... | ... | @@ -140,6 +140,7 @@ class AppController extends Controller { |
| 140 | 140 | $adscripciones->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1)); |
| 141 | 141 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
| 142 | 142 | $user->addRol($this->getDoctrine()->getRepository('AppBundle:Role')->findOneByName("ROLE_ADSCRITO")); |
| 143 | + | |
| 143 | 144 | }else{ |
| 144 | 145 | $adscripciones->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3)); |
| 145 | 146 | $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($adscripcion->getIdRolInstitucion()); |
| ... | ... | @@ -151,7 +152,24 @@ class AppController extends Controller { |
| 151 | 152 | $em->persist($user); |
| 152 | 153 | $em->flush(); |
| 153 | 154 | |
| 154 | - $this->addFlash('notice', 'Solicitud Actualizada Correctamente'); | |
| 155 | + $message = \Swift_Message::newInstance() | |
| 156 | + ->setSubject('Resultado Adscripcion CEA@UBV') | |
| 157 | + ->setFrom('wilmer.ramones@gmail.com') | |
| 158 | + ->setTo($user->getEmail()) | |
| 159 | + ->setBody( | |
| 160 | + $this->renderView( | |
| 161 | + 'correos/actualizar_adscripcion.html.twig', | |
| 162 | + array( | |
| 163 | + 'nombres' => $user->getUsername(), | |
| 164 | + 'estatus' => $adscripciones->getIdEstatus() | |
| 165 | + ) | |
| 166 | + ), | |
| 167 | + 'text/html' | |
| 168 | + ) | |
| 169 | + ; | |
| 170 | + $this->get('mailer')->send($message); | |
| 171 | + | |
| 172 | + $this->addFlash('notice', 'Solicitud Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.'); | |
| 155 | 173 | |
| 156 | 174 | $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array( |
| 157 | 175 | 'idRolInstitucion' => $adscripciones->getIdRolInstitucion()->getId() | ... | ... |
src/AppBundle/Controller/PortalController.php
| ... | ... | @@ -51,6 +51,7 @@ class PortalController extends Controller |
| 51 | 51 | if(!$credenciales){ //si no existe, procede a crear usuario y contraseña. |
| 52 | 52 | $login = new Usuarios(); |
| 53 | 53 | $login->setUsername($usuario); |
| 54 | + $login->setEmail($form->get('correo')->getData()); | |
| 54 | 55 | $login->setPlainPassword($form->get('cedula')->getData()); |
| 55 | 56 | $password = $this->get('security.password_encoder') |
| 56 | 57 | ->encodePassword($login, $login->getPlainPassword()); //encripta la contraseña | ... | ... |
src/AppBundle/Entity/Usuarios.php
| ... | ... | @@ -30,6 +30,14 @@ class Usuarios implements UserInterface, \Serializable |
| 30 | 30 | * @ORM\Column(name="username", type="string", length=255, nullable=false, options={"comment" = "nombre de usuariro"}) |
| 31 | 31 | */ |
| 32 | 32 | protected $username; |
| 33 | + | |
| 34 | + /** | |
| 35 | + * @ORM\Column(type="string") | |
| 36 | + * @Assert\NotBlank() | |
| 37 | + * @Assert\Email | |
| 38 | + * @var string | |
| 39 | + */ | |
| 40 | + protected $email; | |
| 33 | 41 | |
| 34 | 42 | /** |
| 35 | 43 | * @var string |
| ... | ... | @@ -112,6 +120,32 @@ class Usuarios implements UserInterface, \Serializable |
| 112 | 120 | { |
| 113 | 121 | return $this->username; |
| 114 | 122 | } |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + /** | |
| 127 | + * Set username | |
| 128 | + * | |
| 129 | + * @param string $email | |
| 130 | + * @return Usuarios | |
| 131 | + */ | |
| 132 | + public function setEmail($email) | |
| 133 | + { | |
| 134 | + $this->email = $email; | |
| 135 | + | |
| 136 | + return $this; | |
| 137 | + } | |
| 138 | + | |
| 139 | + /** | |
| 140 | + * Get email | |
| 141 | + * | |
| 142 | + * @return string | |
| 143 | + */ | |
| 144 | + public function getEmail() | |
| 145 | + { | |
| 146 | + return $this->email; | |
| 147 | + } | |
| 148 | + | |
| 115 | 149 | |
| 116 | 150 | /** |
| 117 | 151 | * Set password | ... | ... |
src/AppBundle/Form/UserType.php
| ... | ... | @@ -30,21 +30,43 @@ class UserType extends AbstractType |
| 30 | 30 | { |
| 31 | 31 | $builder |
| 32 | 32 | ->add('fecha_ingreso', BirthdayType::class, array( |
| 33 | + 'widget' => 'choice', | |
| 33 | 34 | 'label' => 'Fecha de Ingreso UBV', |
| 34 | - 'data' => new \DateTime("01/01/2003") | |
| 35 | + 'data' => new \DateTime("01/01/2003"), | |
| 36 | + 'years' => range(2003, date("Y")) | |
| 35 | 37 | )) |
| 36 | 38 | ->add('trabajo', FileType::class, array( |
| 37 | 39 | 'label' => 'Digital Constancia Trabajo', |
| 38 | 40 | 'constraints' => array( |
| 39 | 41 | new NotBlank(), |
| 40 | - new File(array('maxSize' => '1024K')) | |
| 42 | + new File(array( | |
| 43 | + 'maxSize' => '1024K', | |
| 44 | + 'mimeTypes' => [ | |
| 45 | + 'application/pdf', | |
| 46 | + 'application/x-pdf', | |
| 47 | + 'image/png', | |
| 48 | + 'image/jpg', | |
| 49 | + 'image/jpeg' | |
| 50 | + ], | |
| 51 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 52 | + )) | |
| 41 | 53 | ) |
| 42 | 54 | )) |
| 43 | 55 | ->add('pregrado', FileType::class, array( |
| 44 | 56 | 'label' => 'Digital Título de Pregrado', |
| 45 | 57 | 'constraints' => array( |
| 46 | 58 | new NotBlank(), |
| 47 | - new File(array('maxSize' => '1024K')) | |
| 59 | + new File(array( | |
| 60 | + 'maxSize' => '1024K', | |
| 61 | + 'mimeTypes' => [ | |
| 62 | + 'application/pdf', | |
| 63 | + 'application/x-pdf', | |
| 64 | + 'image/png', | |
| 65 | + 'image/jpg', | |
| 66 | + 'image/jpeg' | |
| 67 | + ], | |
| 68 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 69 | + )) | |
| 48 | 70 | ) |
| 49 | 71 | )) |
| 50 | 72 | |
| ... | ... | @@ -52,7 +74,17 @@ class UserType extends AbstractType |
| 52 | 74 | 'label' => 'Digital Título de Postgrado', |
| 53 | 75 | 'required' => false, |
| 54 | 76 | 'constraints' => array( |
| 55 | - new File(array('maxSize' => '1024K')) | |
| 77 | + new File(array( | |
| 78 | + 'maxSize' => '1024K', | |
| 79 | + 'mimeTypes' => [ | |
| 80 | + 'application/pdf', | |
| 81 | + 'application/x-pdf', | |
| 82 | + 'image/png', | |
| 83 | + 'image/jpg', | |
| 84 | + 'image/jpeg' | |
| 85 | + ], | |
| 86 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 87 | + )) | |
| 56 | 88 | ) |
| 57 | 89 | )) |
| 58 | 90 | ->add('oposicion', CheckboxType::class, array( |
| ... | ... | @@ -75,7 +107,8 @@ class UserType extends AbstractType |
| 75 | 107 | 'required' => false, |
| 76 | 108 | 'attr' => array( |
| 77 | 109 | 'class' => 'esc_oposicion' |
| 78 | - ) | |
| 110 | + ), | |
| 111 | + 'years' => range(2003, date("Y")) | |
| 79 | 112 | )) |
| 80 | 113 | ->add('documento_oposicion', FileType::class, array( |
| 81 | 114 | 'label' => 'Digital Documento Oposición', |
| ... | ... | @@ -84,6 +117,19 @@ class UserType extends AbstractType |
| 84 | 117 | 'attr' => array( |
| 85 | 118 | 'style' => 'display:none;', |
| 86 | 119 | 'class' => 'esc_oposicion' |
| 120 | + ), | |
| 121 | + 'constraints' => array( | |
| 122 | + new File(array( | |
| 123 | + 'maxSize' => '1024K', | |
| 124 | + 'mimeTypes' => [ | |
| 125 | + 'application/pdf', | |
| 126 | + 'application/x-pdf', | |
| 127 | + 'image/png', | |
| 128 | + 'image/jpg', | |
| 129 | + 'image/jpeg' | |
| 130 | + ], | |
| 131 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 132 | + )) | |
| 87 | 133 | ) |
| 88 | 134 | )) |
| 89 | 135 | |
| ... | ... | @@ -125,7 +171,8 @@ class UserType extends AbstractType |
| 125 | 171 | 'label_attr' => array( 'class' => 'esc_asistente'), |
| 126 | 172 | 'attr' => array( |
| 127 | 173 | 'class' => 'esc_asistente' |
| 128 | - ) | |
| 174 | + ), | |
| 175 | + 'years' => range(2003, date("Y")) | |
| 129 | 176 | )) |
| 130 | 177 | |
| 131 | 178 | ->add('documento_asistente', FileType::class, array( |
| ... | ... | @@ -135,6 +182,19 @@ class UserType extends AbstractType |
| 135 | 182 | 'attr' => array( |
| 136 | 183 | 'style' => 'display:none;', |
| 137 | 184 | 'class' => 'esc_asistente' |
| 185 | + ), | |
| 186 | + 'constraints' => array( | |
| 187 | + new File(array( | |
| 188 | + 'maxSize' => '1024K', | |
| 189 | + 'mimeTypes' => [ | |
| 190 | + 'application/pdf', | |
| 191 | + 'application/x-pdf', | |
| 192 | + 'image/png', | |
| 193 | + 'image/jpg', | |
| 194 | + 'image/jpeg' | |
| 195 | + ], | |
| 196 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 197 | + )) | |
| 138 | 198 | ) |
| 139 | 199 | )) |
| 140 | 200 | |
| ... | ... | @@ -156,7 +216,8 @@ class UserType extends AbstractType |
| 156 | 216 | 'required' => false, |
| 157 | 217 | 'attr' => array( |
| 158 | 218 | 'class' => 'esc_asociado' |
| 159 | - ) | |
| 219 | + ), | |
| 220 | + 'years' => range(2003, date("Y")) | |
| 160 | 221 | )) |
| 161 | 222 | |
| 162 | 223 | ->add('documento_asociado', FileType::class, array( |
| ... | ... | @@ -166,6 +227,19 @@ class UserType extends AbstractType |
| 166 | 227 | 'attr' => array( |
| 167 | 228 | 'style' => 'display:none;', |
| 168 | 229 | 'class' => 'esc_asociado' |
| 230 | + ), | |
| 231 | + 'constraints' => array( | |
| 232 | + new File(array( | |
| 233 | + 'maxSize' => '1024K', | |
| 234 | + 'mimeTypes' => [ | |
| 235 | + 'application/pdf', | |
| 236 | + 'application/x-pdf', | |
| 237 | + 'image/png', | |
| 238 | + 'image/jpg', | |
| 239 | + 'image/jpeg' | |
| 240 | + ], | |
| 241 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 242 | + )) | |
| 169 | 243 | ) |
| 170 | 244 | )) |
| 171 | 245 | |
| ... | ... | @@ -185,7 +259,8 @@ class UserType extends AbstractType |
| 185 | 259 | 'required' => false, |
| 186 | 260 | 'attr' => array( |
| 187 | 261 | 'class' => 'esc_agregado' |
| 188 | - ) | |
| 262 | + ), | |
| 263 | + 'years' => range(2003, date("Y")) | |
| 189 | 264 | )) |
| 190 | 265 | |
| 191 | 266 | ->add('documento_agregado', FileType::class, array( |
| ... | ... | @@ -195,6 +270,19 @@ class UserType extends AbstractType |
| 195 | 270 | 'attr' => array( |
| 196 | 271 | 'style' => 'display:none;', |
| 197 | 272 | 'class' => 'esc_agregado' |
| 273 | + ), | |
| 274 | + 'constraints' => array( | |
| 275 | + new File(array( | |
| 276 | + 'maxSize' => '1024K', | |
| 277 | + 'mimeTypes' => [ | |
| 278 | + 'application/pdf', | |
| 279 | + 'application/x-pdf', | |
| 280 | + 'image/png', | |
| 281 | + 'image/jpg', | |
| 282 | + 'image/jpeg' | |
| 283 | + ], | |
| 284 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 285 | + )) | |
| 198 | 286 | ) |
| 199 | 287 | )) |
| 200 | 288 | |
| ... | ... | @@ -215,7 +303,8 @@ class UserType extends AbstractType |
| 215 | 303 | 'required' => false, |
| 216 | 304 | 'attr' => array( |
| 217 | 305 | 'class' => 'esc_titular' |
| 218 | - ) | |
| 306 | + ), | |
| 307 | + 'years' => range(2003, date("Y")) | |
| 219 | 308 | )) |
| 220 | 309 | |
| 221 | 310 | ->add('documento_titular', FileType::class, array( |
| ... | ... | @@ -225,6 +314,19 @@ class UserType extends AbstractType |
| 225 | 314 | 'attr' => array( |
| 226 | 315 | 'style' => 'display:none;', |
| 227 | 316 | 'class' => 'esc_titular' |
| 317 | + ), | |
| 318 | + 'constraints' => array( | |
| 319 | + new File(array( | |
| 320 | + 'maxSize' => '1024K', | |
| 321 | + 'mimeTypes' => [ | |
| 322 | + 'application/pdf', | |
| 323 | + 'application/x-pdf', | |
| 324 | + 'image/png', | |
| 325 | + 'image/jpg', | |
| 326 | + 'image/jpeg' | |
| 327 | + ], | |
| 328 | + 'mimeTypesMessage' => 'Sólo se permiten extensiones png, jpeg y pdf' | |
| 329 | + )) | |
| 228 | 330 | ) |
| 229 | 331 | )) |
| 230 | 332 | ... | ... |