Commit aca9a4fcb29316d351380290dd853d66c4a6a220

Authored by Wilmer Ramones
1 parent 1521546b1c
Exists in master

trabajando con la solicitud de constancia de antiguedad, creada la entidad de se…

…rvicios, tipo de servicios, creada la solicitud por parte del docente, la aprobación por parte del coordinador, y empezando a trabajar con el reporte
app/Resources/views/base_app.html.twig
... ... @@ -61,6 +61,16 @@
61 61 <li><a href="{{ path('cea_adscripciones', { 'estatus': 3 })}}">Rechazadas</a></li>
62 62 </ul>
63 63 </li>
  64 +
  65 + <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-dashboard"></i><span>Ver Solicitudes</span> <b class="caret"></b></a>
  66 + <ul class="dropdown-menu">
  67 + <li> <a data-toggle="modal" data-target="#buscarServicios">Buscar Servicios</a></li>
  68 + <li><a href="{{ path('cea_servicios', {'tipo' : 'antiguedad'})}}">En espera de Aprobación</a></li>
  69 + <li><a href="{{ path('cea_servicios', { 'tipo' : 'antiguedad', 'estatus': 1 })}}">Aprobadas</a></li>
  70 + <li><a href="{{ path('cea_servicios', { 'tipo' : 'antiguedad', 'estatus': 3 })}}">Rechazadas</a></li>
  71 + </ul>
  72 + </li>
  73 +
64 74 {% endif %}
65 75 {% if is_granted('ROLE_ADSCRITO') %}
66 76 <li class="dropdown">
... ... @@ -70,7 +80,7 @@
70 80 <ul class="dropdown-menu">
71 81 <li><a href="icons.html">Adscripción</a></li>
72 82 <li><a href="faq.html">Ascenso</a></li>
73   - <li><a href="pricing.html">Tiempo Deuda</a></li>
  83 + <li><a href="{{ path('cea_solicitudes_recocimiento_antiguedad') }}">Reconocimiento de Antiguedad</a></li>
74 84 </ul>
75 85 </li>
76 86 {% endif %}
... ... @@ -124,5 +134,41 @@
124 134 </div><!-- Fin de la ventanta modal buscar adscripcion -->
125 135  
126 136  
  137 +
  138 + <!-- Ventana de buscar adscripcion -->
  139 + <div class="modal fade bs-example-modal-sm" id="buscarServicios" tabindex="-1" role="dialog">
  140 + <form action="{{ path('cea_servicios') }}" method="post" role="form">
  141 + <div class="modal-dialog" role="document">
  142 + <div class="modal-content">
  143 + <div class="modal-header">
  144 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  145 + <h4 class="modal-title" id="myModalLabel">Busqueda de Servicios...</h4>
  146 + </div>
  147 + <div class="modal-body">
  148 +
  149 + <div class="form-group">
  150 + <label for="numero">Cédula del Docente:</label>
  151 + <input type="number" class="form-control" id="docente" name="docente" value="" />
  152 + </div>
  153 +
  154 + <div class="form-group">
  155 + <label for="numero">Tipo de Servicio:</label>
  156 + <select class="form-control" id="tipo" name="tipo">
  157 + <option value="0">Todos</option>
  158 + <option value="1">Reconocimiento Antiguedad</option>
  159 + </select>
  160 + </div>
  161 +
  162 + </div>
  163 + <div class="modal-footer">
  164 + <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
  165 + <button class="btn btn-primary" type="submit">Buscar Adscripcion</button>
  166 + </div>
  167 + </div>
  168 + </div>
  169 + </form>
  170 + </div><!-- Fin de la ventanta modal buscar adscripcion -->
  171 +
  172 +
127 173 </body>
128 174 </html>
... ...
app/Resources/views/base_memo.html.twig
... ... @@ -0,0 +1,39 @@
  1 +<!DOCTYPE html>
  2 +<html>
  3 + <head>
  4 + <meta charset="UTF-8" />
  5 + <title>{% block title %}CEA | UBV!{% endblock %}</title>
  6 + {% block stylesheets %}
  7 + <link rel="stylesheet" href="{{ asset('assets/vendor/bootstrap/dist/css/bootstrap.min.css') }}">
  8 + <link rel="stylesheet" href="{{ asset('assets/vendor/font-awesome/css/font-awesome.min.css') }}">
  9 + {% endblock %}
  10 + <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
  11 + </head>
  12 + <body >
  13 + {% block encabezado %}
  14 + <header>
  15 + <div class="row">
  16 + <div class="col-sm-4">
  17 + <img src="{{ asset('bundles/framework/images/portal/ubv_logo.png')}}" />
  18 + </div>
  19 + <div class="col-sm-4 col-lg-offset-3">
  20 + <p>República Bolivariana de Venezuela</p>
  21 + <p>Universidad Bolivariana de Venezuela</p>
  22 + <p>Rectorado</p>
  23 + <p>Dirección General de Apoyo Socio Administrativo</p>
  24 + </div>
  25 + </div>
  26 + </header>
  27 + {% endblock %}
  28 + {% block body %}
  29 +
  30 + {% block principal %} {% endblock %}
  31 +
  32 + {% endblock %}
  33 +
  34 + {% block javascripts %}
  35 + <script type="text/javascript" src="{{ asset('assets/vendor/jquery/dist/jquery.min.js') }}"></script>
  36 + <script type="text/javascript" src="{{ asset('assets/vendor/bootstrap/dist/js/bootstrap.min.js') }}" ></script>
  37 + {% endblock %}
  38 + </body>
  39 +</html>
... ...
app/Resources/views/cea/servicios.html.twig
... ... @@ -0,0 +1,57 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +
  3 +{%block body %}
  4 + <div class="container">
  5 + <div class="widget widget-table action-table">
  6 + <div class="widget-header"> <i class="icon-th-list"></i>
  7 + <h3>Solicitudes de {{ tipo }}: Estatus {{ estatus_servicio }}</h3>
  8 + </div>
  9 + <!-- /widget-header -->
  10 + <div class="widget-content">
  11 + <table class="table table-striped table-bordered">
  12 + <thead>
  13 + <tr>
  14 + <th> Id </th>
  15 + <th> Datos del Docente </th>
  16 + <th> Area de Adscripción</th>
  17 + <th> Eje Adscripción</th>
  18 + <th> Estado</th>
  19 + <th> Acciones</th>
  20 + </tr>
  21 + </thead>
  22 + <tbody>
  23 + {% for servicio in servicios %}
  24 + <tr>
  25 + <td>{{servicio.id}}</td>
  26 + <td>
  27 + {{servicio.idRolInstitucion.idRol.idPersona.PrimerNombre}}
  28 + {{servicio.idRolInstitucion.idRol.idPersona.PrimerApellido}}
  29 + ( {{servicio.idRolInstitucion}} )
  30 +
  31 +
  32 + </td>
  33 + <td>
  34 + {{servicio.idRolInstitucion.IdRol.IdAreaPersona.nombre}}
  35 + </td>
  36 + <td>
  37 + {{servicio.idRolInstitucion.idInstitucion.idEjeParroquia.IdEje}}
  38 + </td>
  39 + <td>{{servicio.idRolInstitucion.idInstitucion.idEjeParroquia.idParroquia.idMunicipio.idEstado}} </td>
  40 + <td>
  41 + <a href="{{ path('cea_servicio_show', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
  42 + <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a>
  43 + <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a></td>
  44 + </td>
  45 +
  46 + </tr>
  47 + {% endfor %}
  48 +
  49 + </tbody>
  50 + </table>
  51 + </div>
  52 + <!-- /widget-content -->
  53 + </div>
  54 + <!-- /widget -->
  55 + </div>
  56 + <!-- /container -->
  57 +{% endblock %}
... ...
app/Resources/views/cea/servicios_mostar.html.twig
... ... @@ -0,0 +1,121 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +{% block stylesheets %}
  3 + {{ parent() }}
  4 + <link href="{{ asset('assets/vendor/lightbox2/dist/css/lightbox.css') }}" rel="stylesheet">
  5 +{% endblock %}
  6 +
  7 +{%block body %}
  8 +
  9 + <div class="content-wrapper">
  10 + <div class="container">
  11 + {% for message in app.session.flashBag.get('notice') %}
  12 + <h4 class="alert alert-success">{{ message }}</h4>
  13 +
  14 + {%endfor %}
  15 + <div class="row">
  16 + <div class="col-md-9">
  17 + <h4 class="page-head-line">Servicio número <code>{{servicio.id}}</code>:
  18 + {{ servicio.idRolInstitucion.idRol.idPersona.primerNombre }},
  19 + {{ servicio.idRolInstitucion.idRol.idPersona.primerApellido }}
  20 + </h4>
  21 + </div>
  22 + <div class="col-md-3">
  23 + {% if servicio.idEstatus.id == 1 %}
  24 + <h4 class="alert alert-success">Estatus <strong>{{servicio.idEstatus}}</strong>
  25 + {% elseif servicio.idEstatus.id == 3 %}
  26 + <h4 class="alert alert-danger">Estatus <strong>{{servicio.idEstatus}}</strong>
  27 + {% else %}
  28 + <h4 class="alert alert-warning">Estatus <strong>{{servicio.idEstatus}}</strong>
  29 + {% endif %}
  30 + </h4>
  31 + </div>
  32 +
  33 + </div>
  34 + <div class="row">
  35 +
  36 + <div class="col-md-6">
  37 +
  38 + <div class="col-md-4">
  39 + <img src="{{ asset('bundles/framework/images/portal/logo_ubv.png') }}" />
  40 + </div>
  41 +
  42 + <div class="col-md-8">
  43 +
  44 + <form action="{{ path('login') }}" method="post" role="form" >
  45 +
  46 + <div class="form-group">
  47 + <label for="username">Fecha de Solicitud:</label>
  48 + <input type="date" class="form-control" value="{{ servicio.fechaSolicitud |date('Y-m-d') }}" />
  49 + </div>
  50 +
  51 + <div class="form-group">
  52 + <label for="Escalafones">Solicitud:</label>
  53 + {{servicio.idServicioCe.Nombre}}
  54 + </div>
  55 +
  56 + {% if servicio.idServicioCe.id == 1 %}
  57 + <div class="form-group">
  58 + <label for="Escalafones">Fecha de Ingreso UBV:</label>
  59 + {{ adscripcion.fechaIngreso|date('d/m/Y') }}
  60 + </div>
  61 +
  62 + <div class="form-group">
  63 + <label for="Escalafones">Fecha de Oposicion:</label>
  64 + {{ oposicion.fechaEscala|date('d/m/Y') }}
  65 + </div>
  66 +
  67 +
  68 + {% endif %}
  69 +
  70 +
  71 +
  72 + <a class="btn btn-success btn-sm" href="{{ path('cea_servicios_actualizar', { 'id': servicio.id, 'estatus' : 'true' }) }}" ><span class="fa fa-check"></span>&nbsp;Aprobar</a>
  73 + <a class="btn btn-danger btn-sm" href="{{ path('cea_servicios_actualizar', { 'id': servicio.id, 'estatus' : 'false' }) }}" ><span class="fa fa-close"></span>&nbsp;Rechazar</a>
  74 + </form>
  75 + <hr />
  76 + </div>
  77 + </div>
  78 +
  79 + <div class="col-md-5">
  80 + <h3>Documentos Para confirmar</h3>
  81 + <div class="widget-content">
  82 +
  83 +
  84 +
  85 + <div class="col-xs-4">
  86 + <div class="thumbnail">
  87 + <a href="{{asset('uploads/adscripcion/'~ adscripcion.trabajo)}}" data-lightbox="adscripcion">
  88 + <img src="{{ asset('uploads/adscripcion/thumb/'~ adscripcion.trabajo) }}" />
  89 + </a>
  90 + <div class="caption">
  91 + <p>Constancia de Trabajo</p>
  92 + </div>
  93 + </div>
  94 + </div>
  95 +
  96 + <div class="col-xs-4">
  97 + <div class="thumbnail">
  98 + <a href="{{asset('uploads/adscripcion/'~ adscripcion.oposicion)}}" data-lightbox="adscripcion">
  99 + <img src="{{ asset('uploads/adscripcion/thumb/'~ adscripcion.oposicion) }}" />
  100 + </a>
  101 + <div class="caption">
  102 + <p>Concurso Oposición</p>
  103 + </div>
  104 + </div>
  105 + </div>
  106 +
  107 +
  108 + </div>
  109 + </div>
  110 +
  111 + </div>
  112 + </div>
  113 + </div>
  114 +
  115 +{% endblock %}
  116 +
  117 +
  118 +{% block javascripts %}
  119 + {{ parent() }}
  120 + <script type="text/javascript" src="{{ asset('assets/vendor/lightbox2/dist/js/lightbox.min.js') }}"></script>
  121 + {% endblock %}
0 122 \ No newline at end of file
... ...
app/Resources/views/memorando/antiguedad.html.twig
... ... @@ -0,0 +1,3 @@
  1 +{% extends 'base_memo.html.twig' %}
  2 +
  3 +
... ...
app/Resources/views/solicitudes/index.html.twig
... ... @@ -0,0 +1,51 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +
  3 +{% block body %}
  4 + <div class="main">
  5 +
  6 + <div class="main-inner">
  7 + <div class="container">
  8 +
  9 + {% for message in app.session.flashBag.get('notice') %}
  10 + <div class="alert alert-warning">{{ message }}</div>
  11 + {%endfor %}
  12 +
  13 + <div class="widget widget-table action-table">
  14 + <div class="widget-header"> <i class="icon-th-list"></i>
  15 + <h3>Mis Servicios Solicitados</h3>
  16 + </div>
  17 + <div class="widget-content">
  18 + <table class="table table-striped table-bordered">
  19 + <thead>
  20 + <tr>
  21 + <th> Solicitud N° </th>
  22 + <th> Descripción </th>
  23 + <th> Fecha Solicitud</th>
  24 + <th> Estatus Solicitud</th>
  25 + <th> Acciones</th>
  26 + </tr>
  27 + </thead>
  28 + <tbody>
  29 + {% for servicio in servicios %}
  30 + <tr>
  31 + <td>{{servicio.id}}</td>
  32 + <td>{{servicio.idServicioCe.Nombre}}</td>
  33 + <td>{{servicio.fechaSolicitud | date('Y-m-d')}}</td>
  34 + <td>{{servicio.idEstatus}}</td>
  35 + <td>
  36 + <a href="{{ path('servicio_antiguedad_imprimir', { 'id': servicio.id }) }}" class="btn btn-xs btn-info"><i class="fa fa-eye"> </i></a>
  37 + <a href="javascript:;" class="btn btn-xs btn-success"><i class="fa fa-check"> </i></a>
  38 + <a href="javascript:;" class="btn btn-danger btn-xs"><i class="fa fa-times"> </i></a>
  39 + </td>
  40 + </tr>
  41 + {% endfor %}
  42 + </tbody>
  43 + </table>
  44 + </div>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +{% endblock %}
0 52 \ No newline at end of file
... ...
app/Resources/views/solicitudes/reconocimiento_antiguedad.html.twig
... ... @@ -0,0 +1,36 @@
  1 +{% extends 'base_app.html.twig' %}
  2 +{% block body %}
  3 + <div class="main">
  4 + <div class="main-inner">
  5 + <div class="container">
  6 + {% for message in app.session.flashBag.get('notice') %}
  7 + <h4 class="alert alert-success">{{ message }}</h4>
  8 + {%endfor %}
  9 + <div class="widget widget-nopad">
  10 + <div class="widget-header"> <i class="fa fa-list-alt"></i>
  11 + <h3> CEA@UBV Reconocimiento de Antiguedad</h3>
  12 + </div>
  13 + <div class="widget-content">
  14 + <div class="widget big-stats-container">
  15 + <div class="widget-content">
  16 + <h6 class="bigstats">
  17 + A través de esta solicitud, el Centro de Estudios ambientales, previa verificación de la documentación enviada,
  18 + reconocerá su antigüedad con fines de ascenso en escalafones de la carrera universitaria en esta Institución
  19 + tomando en cuenta la resolución de <strong>Consejo Universitario Nº11-42-2015 de fecha 08/07/2015</strong>
  20 + que establece en su primer resuelve “Aprobar que la antigüedad administrativa total, acumulada en el lapso
  21 + transcurrido entre el primer contrato como trabajador académico y el Concurso de Oposición.
  22 + </h6>
  23 +
  24 + </div>
  25 + <div class="pull-right">
  26 + <a href="{{ path('cea_crear_servicio_antiguedad')}}" class="btn btn-sm btn-success"><span class="fa fa-check">Crear Solicitud</span></a>
  27 + <a href="{{ path('cea_index')}}" class="btn btn-sm btn-default"><span class="fa fa-arrow-left">Regresar</span></a>
  28 + </div>
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </div>
  33 + </div>
  34 + </div>
  35 +
  36 +{% endblock %}
... ...
src/AppBundle/Controller/AppController.php
... ... @@ -14,6 +14,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
14 14 use Symfony\Component\HttpFoundation\Request;
15 15  
16 16 use AppBundle\Entity\Adscripcion;
  17 +use AppBundle\Entity\DocenteServicio;
17 18  
18 19  
19 20 /**
... ... @@ -49,13 +50,13 @@ class AppController extends Controller {
49 50 }
50 51  
51 52 /**
52   - * Pagina principal de inicio de la session Docente.
  53 + * Muestra las Solicitudes de Adscripción. Por defecto las creadas (estatus = 2)
53 54 *
54 55 * @Route("/solicitudes/adscripcion/{estatus}", name="cea_adscripciones")
55 56 * @Method({"GET", "POST"})
56 57 * @Security("has_role('ROLE_COORDINADOR_NACIONAL')")
57 58 */
58   - public function verSolicitudesAction($estatus = 2, Request $request)
  59 + public function verSolicitudesAdscripcionAction($estatus = 2, Request $request)
59 60 {
60 61  
61 62 if ($request->getMethod() != 'POST') {
... ... @@ -111,7 +112,7 @@ class AppController extends Controller {
111 112 * @Route("/solicitudes/{id}", name="cea_solicitudes_show")
112 113 * @Method("GET")
113 114 */
114   - public function solicitudesShowAction(Adscripcion $adscripcion)
  115 + public function solicitudesAdscripcionShowAction(Adscripcion $adscripcion)
115 116 {
116 117 //$deleteForm = $this->createDeleteForm($usuario);
117 118 $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findBy(array(
... ... @@ -131,7 +132,7 @@ class AppController extends Controller {
131 132 * @Route("/solicitudes/actualizar/{id}/{estatus}", name="cea_solicitudes_actualizar")
132 133 * @Method({"GET", "POST"})
133 134 */
134   - public function solicitudesEditAction(Adscripcion $adscripcion, $estatus)
  135 + public function solicitudesAdscripcionEditAction(Adscripcion $adscripcion, $estatus)
135 136 {
136 137  
137 138 $adscripciones = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneById($adscripcion->getId());
... ... @@ -182,5 +183,237 @@ class AppController extends Controller {
182 183  
183 184 }
184 185  
  186 +
  187 + /**
  188 + * Muestra la página Puede ver los estatus de las solicitudes realizadas
  189 + * y permite realizar la solicitud
  190 + *
  191 + * @Route("/servicios/{tipo}/{estatus}", name="cea_servicios")
  192 + * @Method({"GET", "POST"})
  193 + */
  194 + public function verServiciosAction(Request $request, $tipo="antiguedad", $estatus=2){
  195 +
  196 + if ($tipo == "antiguedad") $tipo_servicio = 1;
  197 + if ($request->getMethod() != 'POST') {
  198 + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findBy(array(
  199 + 'idEstatus' => $estatus,
  200 + 'idServicioCe' => $tipo_servicio,
  201 + ));
  202 + switch ($estatus){
  203 + case 1:
  204 + $mensaje = "activas";
  205 + break;
  206 + case 2:
  207 + $mensaje = "en espera";
  208 + break;
  209 + case 3:
  210 + $mensaje = "rechazadas";
  211 + break;
  212 + }
  213 + }else{
  214 +
  215 + $persona = $this->getDoctrine()->getRepository('AppBundle:Persona')
  216 + ->findOneByCedulaPasaporte($request->get('docente'));
  217 +
  218 + if (!$persona) {
  219 + $this->addFlash('danger', 'Docente ' . $request->get('docente') . ' no Registrado en la Base de Datos del Centro de Estudios.');
  220 + return $this->render('cea/index.html.twig', array (
  221 + 'adscrito' => true
  222 + ));
  223 + }
  224 +
  225 + //1. obtener el rol-institucion-persona
  226 + $rol = $this->getDoctrine()->getRepository(
  227 + 'AppBundle:RolInstitucion')->findOneByIdRol(
  228 + $this->getDoctrine()->getRepository(
  229 + 'AppBundle:Rol')->findOneByIdPersona($persona));
  230 +
  231 + //si no existe el rol del docente, enviar correo al encargado de la región para verificar.
  232 + if (!$rol) {
  233 + $this->addFlash('danger', 'Docente no Registrado en la Base de Datos del Centro de Estudios. Por Favor');
  234 + return $this->render('cea/index.html.twig');
  235 + }
  236 +
  237 +
  238 + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findByIdRolInstitucion($rol->getId());
  239 + $mensaje = "Busqueda : " . $request->get('docente');
  240 + }
  241 + return $this->render('cea/servicios.html.twig', array(
  242 + 'servicios' => $servicios,
  243 + 'estatus_servicio' => $mensaje,
  244 + 'tipo' => $tipo
  245 + ));
  246 +
  247 +
  248 + }
  249 +
  250 +
  251 + /**
  252 + * Encuentra y muestra una entidad de tipo Servicios Docente.
  253 + *
  254 + * @Route("/ver_servicio/{id}", name="cea_servicio_show")
  255 + * @Method("GET")
  256 + */
  257 + public function serviciosShowAction(DocenteServicio $servicio)
  258 + {
  259 + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  260 + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy(array(
  261 + 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
  262 + 'idTipoEscala' => 1
  263 + ));
  264 + return $this->render('cea/servicios_mostar.html.twig', array(
  265 + 'servicio' => $servicio,
  266 + 'oposicion' => $escala,
  267 + 'adscripcion' => $adscripcion
  268 + ));
  269 + }
  270 +
  271 +
  272 + /**
  273 + * Muestra la página donde explica brevemente el reconocimiento de Antiguedad
  274 + * y permite realizar la solicitud
  275 + *
  276 + * @Route("/mis_servicios/", name="servicios_index")
  277 + * @Method({"GET", "POST"})
  278 + */
  279 + public function serviciosIndexAction(){
  280 +
  281 + $servicios = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  282 + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findByIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  283 +
  284 +
  285 + return $this->render('solicitudes/index.html.twig', array(
  286 + 'servicios' => $servicios,
  287 + 'adscripcion' => $adscripcion
  288 + ));
  289 + }
  290 +
  291 +
  292 + /**
  293 + * Encuentra y muestra una entidad de tipo Adscripción.
  294 + *
  295 + * @Route("/servicios/actualizar/{id}/{estatus}", name="cea_servicios_actualizar")
  296 + * @Method({"GET", "POST"})
  297 + */
  298 + public function serviciosEditAction(DocenteServicio $servicios, $estatus)
  299 + {
  300 +
  301 + $servicio = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneById($servicios->getId());
  302 +
  303 + if($estatus == "true") {
  304 + $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(1));
  305 +
  306 + }else{
  307 + $servicio->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:Estatus')->findOneById(3));
  308 + }
  309 +
  310 + $em = $this->getDoctrine()->getManager();
  311 + $em->persist($servicio);
  312 + $em->flush();
  313 +
  314 + $user = $this->getDoctrine()->getRepository('AppBundle:Usuarios')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  315 +
  316 + $message = \Swift_Message::newInstance()
  317 + ->setSubject('Resultado Adscripcion CEA@UBV')
  318 + ->setFrom('wilmer.ramones@gmail.com')
  319 + ->setTo($user->getEmail())
  320 + ->setBody(
  321 + $this->renderView(
  322 + 'correos/actualizar_adscripcion.html.twig',
  323 + array(
  324 + 'nombres' => $user->getUserName(),
  325 + 'estatus' => $servicio->getIdEstatus()
  326 + )
  327 + ),
  328 + 'text/html'
  329 + )
  330 + ;
  331 + $this->get('mailer')->send($message);
  332 +
  333 + $this->addFlash('notice', 'Servicio Actualizada Correctamente, hemos enviado un correo al docente notificandole los cambios.');
  334 +
  335 + $escala = $this->getDoctrine()->getRepository('AppBundle:DocenteEscala')->findOneBy(array(
  336 + 'idRolInstitucion' => $servicio->getIdRolInstitucion(),
  337 + 'idTipoEscala' => 1
  338 + ));
  339 +
  340 + $adscripcion = $this->getDoctrine()->getRepository('AppBundle:Adscripcion')->findOneByIdRolInstitucion($servicio->getIdRolInstitucion());
  341 + return $this->render('cea/servicios_mostar.html.twig', array(
  342 + 'servicio' => $servicio,
  343 + 'oposicion' => $escala,
  344 + 'adscripcion' => $adscripcion
  345 + ));
  346 +
  347 + }
  348 +
  349 +
  350 + /**
  351 + * Muestra la página donde explica brevemente el reconocimiento de Antiguedad
  352 + * y permite realizar la solicitud
  353 + *
  354 + * @Route("/solicitudes/antiguedad/", name="cea_solicitudes_recocimiento_antiguedad")
  355 + * @Method({"GET", "POST"})
  356 + */
  357 + public function solicitudesAntiguedadIndexAction(){
  358 +
  359 + $servicio = $this->getDoctrine()->getRepository('AppBundle:DocenteServicio')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  360 +
  361 + if(!$servicio){
  362 + return $this->render('solicitudes/reconocimiento_antiguedad.html.twig');
  363 + }else{
  364 + $this->addFlash('notice', 'Ya usted ha realizado la solicitud de reconocimiento de antiguedad.');
  365 + return $this->redirect($this->generateUrl('servicios_index'));
  366 + }
  367 +
  368 +
  369 +
  370 + }
  371 +
  372 +
  373 + /**
  374 + * Muestra la página donde explica brevemente el reconocimiento de Antiguedad
  375 + * y permite realizar la solicitud
  376 + *
  377 + * @Route("/mis_servicios/antiguedad/imprimir", name="servicio_antiguedad_imprimir")
  378 + * @Method({"GET", "POST"})
  379 + */
  380 + public function solicitudesAntiguedadImprimirAction(){
  381 +
  382 + return $this->render('memorando/antiguedad.html.twig');
  383 +
  384 +
  385 +
  386 + }
  387 +
  388 +
  389 +
  390 +
  391 + /**
  392 + * Muestra la página donde explica brevemente el reconocimiento de Antiguedad
  393 + * y permite realizar la solicitud
  394 + *
  395 + * @Route("/solicitudes/antiguedad/crear/", name="cea_crear_servicio_antiguedad")
  396 + * @Method({"GET", "POST"})
  397 + */
  398 + public function solicitudesAntiguedadCrearAction(){
  399 +
  400 + $servicios = new DocenteServicio();
  401 +
  402 + $servicios->setIdRolInstitucion($this->getUser()->getIdRolInstitucion());
  403 + $servicios->setIdServicioCe($this->getDoctrine()->getRepository('AppBundle:ServiciosCe')->findOneById(1));
  404 + $servicios->setIdEstatus($this->getDoctrine()->getRepository('AppBundle:estatus')->findOneById(2));
  405 +
  406 + $em = $this->getDoctrine()->getManager();
  407 + $em->persist($servicios);
  408 + $em->flush();
  409 +
  410 + $this->addFlash('notice', 'Solicitud Creada Correctamente, en lo que la solicitud sea aprobada, se le notificará por correo.');
  411 +
  412 + return $this->render('solicitudes/reconocimiento_antiguedad.html.twig');
  413 +
  414 + }
  415 +
  416 +
  417 +
185 418 }
186 419  
187 420 \ No newline at end of file
... ...
src/AppBundle/Entity/Adscripcion.php
... ... @@ -22,7 +22,7 @@ use Doctrine\Common\Collections\ArrayCollection;
22 22 class Adscripcion
23 23 {
24 24  
25   - /**
  25 + /**
26 26 * @var integer
27 27 *
28 28 * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador de la Adscripcion"})
... ...
src/AppBundle/Entity/DocenteServicio.php
... ... @@ -0,0 +1,194 @@
  1 +<?php
  2 +
  3 +/*
  4 + * Copyright (C) 2016 ubv-cipee
  5 + *
  6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +
  20 +namespace AppBundle\Entity;
  21 +use Doctrine\ORM\Mapping as ORM;
  22 +use Symfony\Component\Validator\Constraints as Assert;
  23 +
  24 +/**
  25 + * DocenteServicio
  26 + *
  27 + * @ORM\Table(name="docente_servicio", uniqueConstraints={@ORM\UniqueConstraint(name="docente_servicio_id_rol_institucion_key", columns={"id_rol_institucion"})})
  28 + * @ORM\Entity
  29 + * @ORM\HasLifecycleCallbacks()
  30 + */
  31 +class DocenteServicio {
  32 +
  33 + /**
  34 + * @var integer
  35 + *
  36 + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador de la Adscripcion"})
  37 + * @ORM\Id
  38 + * @ORM\GeneratedValue(strategy="IDENTITY")
  39 + * @ORM\SequenceGenerator(sequenceName="adscripcion_id_seq", allocationSize=1, initialValue=1)
  40 + */
  41 + private $id;
  42 +
  43 +
  44 +
  45 + /**
  46 + * @var \AppBundle\Entity\RolInstitucion
  47 + *
  48 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion")
  49 + * @ORM\JoinColumns({
  50 + * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false)
  51 + * })
  52 + */
  53 + protected $idRolInstitucion;
  54 +
  55 +
  56 + /**
  57 + * @var \AppBundle\Entity\ServiciosCe
  58 + *
  59 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\ServiciosCe")
  60 + * @ORM\JoinColumns({
  61 + * @ORM\JoinColumn(name="id_servicio_ce", referencedColumnName="id", nullable=false)
  62 + * })
  63 + */
  64 + protected $idServicioCe;
  65 +
  66 + /** @ORM\Column(type="date", nullable=false, options={"comment" = "Fecha de creación de la solicitud"})
  67 + /**
  68 + * @Assert\Date()
  69 + */
  70 + private $fecha_solicitud;
  71 +
  72 + /** @ORM\Column(type="date", nullable=false, options={"comment" = "Fecha de actualizada la solicitud"})
  73 + /**
  74 + * @Assert\Date()
  75 + */
  76 + private $fecha_ultima_actualizacion;
  77 +
  78 +
  79 + /**
  80 + * @var \AppBundle\Entity\Estatus
  81 + *
  82 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Estatus")
  83 + * @ORM\JoinColumns({
  84 + * @ORM\JoinColumn(name="id_estatus", referencedColumnName="id", nullable=false)
  85 + * })
  86 + */
  87 + protected $idEstatus;
  88 +
  89 +
  90 + /**
  91 + * Get id
  92 + *
  93 + * @return integer
  94 + */
  95 + public function getId()
  96 + {
  97 + return $this->id;
  98 + }
  99 +
  100 +
  101 + /**
  102 + * Set idRolInstitucion
  103 + *
  104 + * @param \AppBundle\Entity\RolInstitucion $idRolInstitucion
  105 + * @return Usuarios
  106 + */
  107 + public function setIdRolInstitucion(\AppBundle\Entity\RolInstitucion $idRolInstitucion = null)
  108 + {
  109 + $this->idRolInstitucion = $idRolInstitucion;
  110 +
  111 + return $this;
  112 + }
  113 +
  114 + /**
  115 + * Get idRolInstitucion
  116 + *
  117 + * @return \AppBundle\Entity\RolInstitucion
  118 + */
  119 + public function getIdRolInstitucion()
  120 + {
  121 + return $this->idRolInstitucion;
  122 + }
  123 +
  124 +
  125 + /**
  126 + * @ORM\PrePersist
  127 + */
  128 + public function setFechaSolicitud()
  129 + {
  130 + $this->fecha_solicitud = new \DateTime();
  131 + $this->fecha_ultima_actualizacion = new \DateTime();
  132 + }
  133 +
  134 + public function getFechaSolicitud()
  135 + {
  136 + return $this->fecha_solicitud;
  137 + }
  138 +
  139 + /**
  140 + * @ORM\PreUpdate
  141 + */
  142 + public function setFechaUltimaActualizacion()
  143 + {
  144 + $this->fecha_utlima_actualizacion = new \DateTime();
  145 + }
  146 +
  147 +
  148 + /**
  149 + * Set idEstatus
  150 + *
  151 + * @param \AppBundle\Entity\Estatus $idEstatus
  152 + * @return Estatus
  153 + */
  154 + public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus = null)
  155 + {
  156 + $this->idEstatus = $idEstatus;
  157 +
  158 + return $this;
  159 + }
  160 +
  161 + /**
  162 + * Get idEstatus
  163 + *
  164 + * @return \AppBundle\Entity\Estatus
  165 + */
  166 + public function getIdEstatus()
  167 + {
  168 + return $this->idEstatus;
  169 + }
  170 +
  171 +
  172 + /**
  173 + * Set $idServicioCe
  174 + *
  175 + * @param \AppBundle\Entity\ServiciosCe $idEstatus
  176 + * @return ServicioCe
  177 + */
  178 + public function setIdServicioCe(\AppBundle\Entity\ServiciosCe $idServicioCe = null)
  179 + {
  180 + $this->idServicioCe = $idServicioCe;
  181 +
  182 + return $this;
  183 + }
  184 +
  185 + /**
  186 + * Get $idServicioCe
  187 + *
  188 + * @return \AppBundle\Entity\ServiciosCe
  189 + */
  190 + public function getIdServicioCe()
  191 + {
  192 + return $this->idServicioCe;
  193 + }
  194 +}
... ...
src/AppBundle/Entity/ServiciosCe.php
... ... @@ -0,0 +1,117 @@
  1 +<?php
  2 +
  3 +/*
  4 + * Copyright (C) 2016 ubv-cipee
  5 + *
  6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18 + */
  19 +
  20 +namespace AppBundle\Entity;
  21 +
  22 +use Doctrine\ORM\Mapping as ORM;
  23 +
  24 +/**
  25 + * Description of ServiciosCe
  26 + *
  27 + * @author ubv-cipee
  28 + * @ORM\Table(name="servicios_ce", uniqueConstraints={@ORM\UniqueConstraint(name="uq_servjcios_ce", columns={"nombre"})}, indexes={@ORM\Index(name="fki_centro_estudio_servicios", columns={"id_centro_estudio"})})
  29 + * @ORM\Entity
  30 + */
  31 +class ServiciosCe {
  32 +
  33 + /**
  34 + * @var string
  35 + *
  36 + * @ORM\Column(name="nombre", type="string", length=100, nullable=false, options={"comment" = "Nombre del servicio prestado por el Centro de Estudios"})
  37 + */
  38 + private $nombre;
  39 +
  40 + /**
  41 + * @var integer
  42 + *
  43 + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador del servicio"})
  44 + * @ORM\Id
  45 + * @ORM\GeneratedValue(strategy="IDENTITY")
  46 + * @ORM\SequenceGenerator(sequenceName="servicio_id_seq", allocationSize=1, initialValue=1)
  47 + */
  48 + private $id;
  49 +
  50 + /**
  51 + * @var \AppBundle\Entity\CentroEstudios
  52 + *
  53 + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\CentroEstudios")
  54 + * @ORM\JoinColumns({
  55 + * @ORM\JoinColumn(name="id_centro_estudio", referencedColumnName="id", nullable=false)
  56 + * })
  57 + */
  58 + private $idCentroEstudio;
  59 +
  60 +
  61 + /**
  62 + * Set nombre
  63 + *
  64 + * @param string $nombre
  65 + * @return ServiciosCe
  66 + */
  67 + public function setNombre($nombre)
  68 + {
  69 + $this->nombre = $nombre;
  70 +
  71 + return $this;
  72 + }
  73 +
  74 + /**
  75 + * Get nombre
  76 + *
  77 + * @return string
  78 + */
  79 + public function getNombre()
  80 + {
  81 + return $this->nombre;
  82 + }
  83 +
  84 +
  85 + /**
  86 + * Get id
  87 + *
  88 + * @return integer
  89 + */
  90 + public function getId()
  91 + {
  92 + return $this->id;
  93 + }
  94 +
  95 + /**
  96 + * Set idCentroEstudio
  97 + *
  98 + * @param \AppBundle\Entity\CentroEstudios $idEstado
  99 + * @return CentroEstudios
  100 + */
  101 + public function setIdEstado(\AppBundle\Entity\CentroEstudios $idCentroEstudio = null)
  102 + {
  103 + $this->idCentroEstudio = $idCentroEstudio;
  104 +
  105 + return $this;
  106 + }
  107 +
  108 + /**
  109 + * Get idCentroEstudio
  110 + *
  111 + * @return \AppBundle\Entity\CentroEstudios
  112 + */
  113 + public function getIdCentroEstudio()
  114 + {
  115 + return $this->idCentroEstudio;
  116 + }
  117 +}
... ...