Commit 158864c8d009e535ce1a44d72d142c4508a90747
1 parent
1c3c46d679
Exists in
master
mostrando la inscripcion del estudiante
Showing
4 changed files
with
100 additions
and
71 deletions
Show diff stats
app/Resources/views/inscripcion/index.html.twig
| ... | ... | @@ -2,74 +2,94 @@ |
| 2 | 2 | {% block body %} |
| 3 | 3 | |
| 4 | 4 | <div class="main"> |
| 5 | - | |
| 6 | - <div class="main-inner"> | |
| 7 | - <div class="container"> | |
| 8 | - | |
| 9 | - {% for message in app.session.flashBag.get('danger') %} | |
| 10 | - <div class="alert alert-danger">{{ message }}</div> | |
| 11 | - {%endfor %} | |
| 12 | - | |
| 13 | - | |
| 14 | - <div class="row"> | |
| 15 | - <div class="col-md-6"> | |
| 16 | - <div class="widget widget-nopad"> | |
| 17 | - <div class="widget-header"> <i class="fa fa-list-alt"></i> | |
| 18 | - <h3> Unidades Curriculares Inscritas</h3> | |
| 19 | - </div> | |
| 20 | - <!-- /widget-header --> | |
| 21 | - {% if not inscripcion %} | |
| 22 | - <div class="widget-content"> | |
| 23 | - <div class="widget big-stats-container"> | |
| 24 | - <div class="widget-content"> | |
| 25 | - | |
| 26 | - <h6 class="bigstats"> | |
| 27 | - No ha formalizado su inscripcion para este periodo | |
| 28 | - academico. | |
| 29 | - | |
| 30 | - </h6> | |
| 31 | - <div class="col-md-2"> | |
| 32 | - <a class="btn btn-primary" href="{{ path('ceapp_estudiante_inscripcion_new') }}">Inscribirme</a> | |
| 33 | - </div> | |
| 34 | - </div> | |
| 35 | - <!-- /widget-content --> | |
| 36 | - {% endif %} | |
| 5 | + <div class="main-inner"> | |
| 6 | + <div class="container"> | |
| 7 | + {% for message in app.session.flashBag.get('danger') %} | |
| 8 | + <div class="alert alert-danger">{{ message }}</div> | |
| 9 | + {%endfor %} | |
| 10 | + | |
| 11 | + <div class="row"> | |
| 12 | + <div class="col-md-6"> | |
| 13 | + <div class="widget widget-nopad"> | |
| 14 | + <div class="widget-header"> <i class="fa fa-list-alt"></i> | |
| 15 | + <h3> Unidades Curriculares Inscritas</h3> | |
| 16 | + </div> | |
| 17 | + <!-- /widget-header --> | |
| 18 | + {% if not estado_academico.hasInscripcion %} | |
| 19 | + <div class="widget-content"> | |
| 20 | + <div class="widget big-stats-container"> | |
| 21 | + <div class="widget-content"> | |
| 22 | + <h6 class="bigstats"> | |
| 23 | + No ha formalizado su inscripcion para este periodo | |
| 24 | + academico. | |
| 25 | + </h6> | |
| 26 | + <div class="col-md-2"> | |
| 27 | + <a class="btn btn-primary" href="{{ path('ceapp_estudiante_inscripcion_new') }}">Inscribirme</a> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + <!-- /widget-content --> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + {% else %} | |
| 34 | + <div class="widget-content"> | |
| 35 | + <div class="widget big-stats-container"> | |
| 36 | + <div class="widget-content"> | |
| 37 | + <h6 class="bigstats"> | |
| 38 | + {% for inscrita in estado_academico.hasInscripcion %} | |
| 39 | + <p>{{ inscrita.idOfertaAcademica.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular.nombre }}</p> | |
| 40 | + {% endfor %} | |
| 41 | + </h6> | |
| 42 | + <div class="col-md-2"> | |
| 43 | + <a class="btn btn-primary" href="{{ path('ceapp_estudiante_inscripcion_new') }}">Inscribirme</a> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + <!-- /widget-content --> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + {% endif %} | |
| 37 | 50 | |
| 38 | - </div> | |
| 39 | - </div> | |
| 40 | - </div> | |
| 41 | - <!-- /widget --> | |
| 42 | - </div> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 43 | 53 | |
| 44 | - <div class="col-md-6"> | |
| 45 | - <div class="widget widget-nopad"> | |
| 46 | - <div class="widget-header"> <i class="fa fa-list-alt"></i> | |
| 47 | - <h3> Cumplimiento de la programacion</h3> | |
| 48 | - </div> | |
| 49 | - <!-- /widget-header --> | |
| 50 | - <div class="widget-content"> | |
| 51 | - <div class="widget big-stats-container"> | |
| 52 | - {% if not inscripcion %} | |
| 53 | - <div class="widget-content"> | |
| 54 | + <div class="col-md-6"> | |
| 55 | + <div class="widget widget-nopad"> | |
| 56 | + <div class="widget-header"> <i class="fa fa-list-alt"></i> | |
| 57 | + <h3> Cumplimiento de la programacion</h3> | |
| 58 | + </div> | |
| 59 | + <!-- /widget-header --> | |
| 60 | + <div class="widget-content"> | |
| 61 | + <div class="widget big-stats-container"> | |
| 62 | + {% if not estado_academico.hasInscripcion %} | |
| 63 | + <div class="widget-content"> | |
| 54 | 64 | |
| 55 | - <h6 class="bigstats alert alert-warning"> | |
| 56 | - Debe Formalizar primero una inscripcion para | |
| 57 | - poder revisar la planificacion de la/s UC | |
| 65 | + <h6 class="bigstats alert alert-warning"> | |
| 66 | + Debe Formalizar primero una inscripcion para | |
| 67 | + poder revisar la planificacion de la/s UC | |
| 58 | 68 | |
| 59 | - </h6> | |
| 60 | - </div> | |
| 61 | - {% endif %} | |
| 62 | - <!-- /widget-content --> | |
| 63 | - | |
| 64 | - </div> | |
| 65 | - </div> | |
| 66 | - </div> | |
| 67 | - <!-- /widget --> | |
| 68 | - </div> | |
| 69 | + </h6> | |
| 70 | + </div> | |
| 71 | + {% else %} | |
| 72 | + <div class="widget-content"> | |
| 73 | + <h6 class="bigstats"> | |
| 74 | + No ha formalizado su inscripcion para este periodo | |
| 75 | + academico. | |
| 76 | + </h6> | |
| 77 | + </div> | |
| 78 | + | |
| 79 | + | |
| 80 | + {% endif %} | |
| 81 | + <!-- /widget-content --> | |
| 82 | + | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + <!-- /widget --> | |
| 87 | + </div> | |
| 69 | 88 | |
| 70 | 89 | </div> |
| 71 | 90 | </div> |
| 72 | 91 | </div> |
| 92 | + | |
| 73 | 93 | </div> |
| 74 | 94 | |
| 75 | 95 | {% endblock %} | ... | ... |
app/Resources/views/inscripcion/show.html.twig
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | |
| 15 | 15 | <ul> |
| 16 | 16 | <li> |
| 17 | - <a href="{{ path('ceapp_estudiante_inscripcion_index') }}">Back to the list</a> | |
| 17 | + <a href="{{ path('inscripcion_index') }}">Back to the list</a> | |
| 18 | 18 | </li> |
| 19 | 19 | <li> |
| 20 | 20 | <a href="{{ path('ceapp_estudiante_inscripcion_edit', { 'id': inscripcion.id }) }}">Edit</a> | ... | ... |
src/AppBundle/Controller/InscripcionController.php
| ... | ... | @@ -26,10 +26,10 @@ class InscripcionController extends Controller |
| 26 | 26 | { |
| 27 | 27 | $em = $this->getDoctrine()->getManager(); |
| 28 | 28 | |
| 29 | - $inscripcions = $em->getRepository('AppBundle:Inscripcion')->findAll(); | |
| 30 | - | |
| 29 | + $estado_academico = $em->getRepository('AppBundle:EstadoAcademico')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); | |
| 30 | + | |
| 31 | 31 | return $this->render('inscripcion/index.html.twig', array( |
| 32 | - 'inscripcion' => $inscripcions, | |
| 32 | + 'estado_academico' => $estado_academico | |
| 33 | 33 | )); |
| 34 | 34 | } |
| 35 | 35 | ... | ... |
src/AppBundle/Entity/EstadoAcademico.php
| ... | ... | @@ -84,7 +84,7 @@ class EstadoAcademico |
| 84 | 84 | * */ |
| 85 | 85 | protected $hasInscripcion; |
| 86 | 86 | |
| 87 | - protected $OfertaAcademica; | |
| 87 | + private $OfertaAcademica; | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
| ... | ... | @@ -279,27 +279,36 @@ class EstadoAcademico |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
| 282 | - // Important | |
| 282 | + /** | |
| 283 | + * Get OfertaAcademica | |
| 284 | + * | |
| 285 | + * @return \Doctrine\Common\Collections\Collection | |
| 286 | + */ | |
| 283 | 287 | public function getOfertaAcademica() |
| 284 | 288 | { |
| 285 | 289 | $ofertaAcademica = new \Doctrine\Common\Collections\ArrayCollection(); |
| 286 | 290 | |
| 287 | - foreach($this->hasInscripcion as $p) | |
| 291 | + foreach($this->hasInscripcion as $inscrita) | |
| 288 | 292 | { |
| 289 | - $ofertaAcademica[] = $p->getOfertaAcademica(); | |
| 293 | + $ofertaAcademica[] = $inscrita->getOfertaAcademica(); | |
| 290 | 294 | } |
| 291 | 295 | |
| 292 | 296 | return $ofertaAcademica; |
| 293 | 297 | } |
| 294 | - // Important | |
| 298 | + | |
| 299 | + | |
| 300 | + /** | |
| 301 | + * Set OfertaAcademica | |
| 302 | + * | |
| 303 | + */ | |
| 295 | 304 | public function setOfertaAcademica($ofertaAcademica) |
| 296 | 305 | { |
| 297 | - foreach($ofertaAcademica as $o) | |
| 306 | + foreach($ofertaAcademica as $inscrita) | |
| 298 | 307 | { |
| 299 | 308 | $inscripcion = new Inscripcion(); |
| 300 | 309 | |
| 301 | 310 | $inscripcion->setIdEstadoAcademico($this); |
| 302 | - $inscripcion->setIdOfertaAcademica($o); | |
| 311 | + $inscripcion->setIdOfertaAcademica($inscrita); | |
| 303 | 312 | $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); |
| 304 | 313 | |
| 305 | 314 | $this->addHasInscripcion($inscripcion); | ... | ... |