Commit 7580ea2f94f5c08702a9012c6ea8be57b1e6fd41
1 parent
a805aeb27d
Exists in
master
Creado la relacion entre la malla curricular y la inscripcion en las entidades y…
… el crud inicial para la inscripcion
Showing
16 changed files
with
772 additions
and
9 deletions
Show diff stats
app/Resources/views/base_app.html.twig
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | <span>Serv. Estudiante</span> <b class="caret"></b> |
| 74 | 74 | </a> |
| 75 | 75 | <ul class="dropdown-menu"> |
| 76 | - <li><a href="#">Inscripción</a></li> | |
| 76 | + <li><a href="{{ path('inscripcion_index') }}">Inscripción</a></li> | |
| 77 | 77 | <li><a href="#">Notas</a></li> |
| 78 | 78 | </ul> |
| 79 | 79 | </li> |
| ... | ... | @@ -88,7 +88,7 @@ |
| 88 | 88 | <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> |
| 89 | 89 | <i class="fa fa-calendar-plus-o"></i><span>Adm. Academica</span> <b class="caret"></b></a> |
| 90 | 90 | <ul class="dropdown-menu"> |
| 91 | - <li><a href="#">Oferta Academica</a></li> | |
| 91 | + <li><a href="{{ path('oferta_academica_index') }}">Oferta Academica</a></li> | |
| 92 | 92 | </ul> |
| 93 | 93 | </li> |
| 94 | 94 | ... | ... |
app/Resources/views/cea/inscripcion/crear.html.twig
| ... | ... | @@ -0,0 +1,58 @@ |
| 1 | +{% extends 'base_app.html.twig' %} | |
| 2 | + | |
| 3 | +{% block body %} | |
| 4 | + | |
| 5 | + <div class="container"> | |
| 6 | + <div class="widget widget-table action-table"> | |
| 7 | + <div class="widget-header"> <i class="icon-th-list"></i> | |
| 8 | + <h3>Oferta Academica Activa para el Eje</h3> | |
| 9 | + </div> | |
| 10 | + <!-- /widget-header --> | |
| 11 | + <div class="widget-content"> | |
| 12 | + <table class="table table-striped table-bordered table-hover table-condensed table-responsive"> | |
| 13 | + <thead> | |
| 14 | + <tr> | |
| 15 | + <th>Malla</th> | |
| 16 | + <th>Codigo UC</th> | |
| 17 | + <th>Unidad Curricular</th> | |
| 18 | + <th>Seccion</th> | |
| 19 | + <th>Tipo</th> | |
| 20 | + <th>Actions</th> | |
| 21 | + </tr> | |
| 22 | + </thead> | |
| 23 | + <tbody> | |
| 24 | + | |
| 25 | + {% for oa in ofertaAcademicas %} | |
| 26 | + <tr> | |
| 27 | + | |
| 28 | + <td>{{oa.idMallaCurricularUc.idMallaCurricular.codigo}}</td> | |
| 29 | + <td>{{oa.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular.codigo}}</td> | |
| 30 | + <td>{{oa.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular}}</td> | |
| 31 | + <td>{{oa.idSeccion}}</td> | |
| 32 | + <td>{{oa.idMallaCurricularUc.idTrayectoTramoModalidadTipoUc.idTipoUc}}</td> | |
| 33 | + <td> | |
| 34 | + <ul> | |
| 35 | + <li> | |
| 36 | + <a href="{{ path('ceapp_gestion_oferta_academica_show', { 'id': oa.id }) }}">show</a> | |
| 37 | + </li> | |
| 38 | + <li> | |
| 39 | + <a href="{{ path('ceapp_gestion_oferta_academica_edit', { 'id': oa.id }) }}">edit</a> | |
| 40 | + </li> | |
| 41 | + </ul> | |
| 42 | + </td> | |
| 43 | + </tr> | |
| 44 | + {% endfor %} | |
| 45 | + </tbody> | |
| 46 | + </table> | |
| 47 | + | |
| 48 | + <ul> | |
| 49 | + <li> | |
| 50 | + <a href="{{ path('ceapp_gestion_oferta_academica_new') }}">Create a new entry</a> | |
| 51 | + </li> | |
| 52 | + </ul> | |
| 53 | + </div> | |
| 54 | + | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + | |
| 58 | +{% endblock %} | ... | ... |
app/Resources/views/inscripcion/edit.html.twig
| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | +{% extends 'base.html.twig' %} | |
| 2 | + | |
| 3 | +{% block body %} | |
| 4 | + <h1>Inscripcion edit</h1> | |
| 5 | + | |
| 6 | + {{ form_start(edit_form) }} | |
| 7 | + {{ form_widget(edit_form) }} | |
| 8 | + <input type="submit" value="Edit" /> | |
| 9 | + {{ form_end(edit_form) }} | |
| 10 | + | |
| 11 | + <ul> | |
| 12 | + <li> | |
| 13 | + <a href="{{ path('ceapp_estudiante_inscripcion_index') }}">Back to the list</a> | |
| 14 | + </li> | |
| 15 | + <li> | |
| 16 | + {{ form_start(delete_form) }} | |
| 17 | + <input type="submit" value="Delete"> | |
| 18 | + {{ form_end(delete_form) }} | |
| 19 | + </li> | |
| 20 | + </ul> | |
| 21 | +{% endblock %} | ... | ... |
app/Resources/views/inscripcion/index.html.twig
| ... | ... | @@ -0,0 +1,75 @@ |
| 1 | +{% extends 'base_app.html.twig' %} | |
| 2 | +{% block body %} | |
| 3 | + | |
| 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 %} | |
| 37 | + | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + <!-- /widget --> | |
| 42 | + </div> | |
| 43 | + | |
| 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 | + | |
| 55 | + <h6 class="bigstats alert alert-warning"> | |
| 56 | + Debe Formalizar primero una inscripcion para | |
| 57 | + poder revisar la planificacion de la/s UC | |
| 58 | + | |
| 59 | + </h6> | |
| 60 | + </div> | |
| 61 | + {% endif %} | |
| 62 | + <!-- /widget-content --> | |
| 63 | + | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + <!-- /widget --> | |
| 68 | + </div> | |
| 69 | + | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + | |
| 75 | +{% endblock %} | ... | ... |
app/Resources/views/inscripcion/new.html.twig
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +{% extends 'base.html.twig' %} | |
| 2 | + | |
| 3 | +{% block body %} | |
| 4 | + <h1>Inscripcion creation</h1> | |
| 5 | +{% form_theme form 'bootstrap_3_horizontal_layout.html.twig' %} | |
| 6 | + {{ form_start(form) }} | |
| 7 | + {{ form_widget(form) }} | |
| 8 | + <input type="submit" value="Create" /> | |
| 9 | + {{ form_end(form) }} | |
| 10 | + | |
| 11 | + <ul> | |
| 12 | + <li> | |
| 13 | + <a href="{{ path('inscripcion_index') }}">Back to the list</a> | |
| 14 | + </li> | |
| 15 | + </ul> | |
| 16 | +{% endblock %} | ... | ... |
app/Resources/views/inscripcion/show.html.twig
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +{% extends 'base.html.twig' %} | |
| 2 | + | |
| 3 | +{% block body %} | |
| 4 | + <h1>Inscripcion</h1> | |
| 5 | + | |
| 6 | + <table> | |
| 7 | + <tbody> | |
| 8 | + <tr> | |
| 9 | + <th>Id</th> | |
| 10 | + <td>{{ inscripcion.id }}</td> | |
| 11 | + </tr> | |
| 12 | + </tbody> | |
| 13 | + </table> | |
| 14 | + | |
| 15 | + <ul> | |
| 16 | + <li> | |
| 17 | + <a href="{{ path('ceapp_estudiante_inscripcion_index') }}">Back to the list</a> | |
| 18 | + </li> | |
| 19 | + <li> | |
| 20 | + <a href="{{ path('ceapp_estudiante_inscripcion_edit', { 'id': inscripcion.id }) }}">Edit</a> | |
| 21 | + </li> | |
| 22 | + <li> | |
| 23 | + {{ form_start(delete_form) }} | |
| 24 | + <input type="submit" value="Delete"> | |
| 25 | + {{ form_end(delete_form) }} | |
| 26 | + </li> | |
| 27 | + </ul> | |
| 28 | +{% endblock %} | ... | ... |
app/Resources/views/ofertaacademica/new.html.twig
app/Resources/views/ofertaacademica/show.html.twig
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | |
| 23 | 23 | <ul> |
| 24 | 24 | <li> |
| 25 | - <a href="{{ path('ceapp_gestion_oferta_academica_index') }}">Back to the list</a> | |
| 25 | + <a href="{{ path('oferta_academica_index') }}">Back to the list</a> | |
| 26 | 26 | </li> |
| 27 | 27 | <li> |
| 28 | 28 | <a href="{{ path('ceapp_gestion_oferta_academica_edit', { 'id': ofertaAcademica.id }) }}">Edit</a> | ... | ... |
src/AppBundle/Controller/InscripcionController.php
| ... | ... | @@ -0,0 +1,140 @@ |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace AppBundle\Controller; | |
| 4 | + | |
| 5 | +use Symfony\Component\HttpFoundation\Request; | |
| 6 | +use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| 7 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
| 8 | +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
| 9 | +use AppBundle\Entity\Inscripcion; | |
| 10 | +use AppBundle\Form\InscripcionType; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Inscripcion controller. | |
| 14 | + * | |
| 15 | + * @Route("/ceapp/estudiante/inscripcion") | |
| 16 | + */ | |
| 17 | +class InscripcionController extends Controller | |
| 18 | +{ | |
| 19 | + /** | |
| 20 | + * Lists all Inscripcion entities. | |
| 21 | + * | |
| 22 | + * @Route("/", name="inscripcion_index") | |
| 23 | + * @Method("GET") | |
| 24 | + */ | |
| 25 | + public function indexAction() | |
| 26 | + { | |
| 27 | + $em = $this->getDoctrine()->getManager(); | |
| 28 | + | |
| 29 | + $inscripcions = $em->getRepository('AppBundle:Inscripcion')->findAll(); | |
| 30 | + | |
| 31 | + return $this->render('inscripcion/index.html.twig', array( | |
| 32 | + 'inscripcion' => $inscripcions, | |
| 33 | + )); | |
| 34 | + } | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * Creates a new Inscripcion entity. | |
| 38 | + * | |
| 39 | + * @Route("/new", name="ceapp_estudiante_inscripcion_new") | |
| 40 | + * @Method({"GET", "POST"}) | |
| 41 | + */ | |
| 42 | + public function newAction(Request $request) | |
| 43 | + { | |
| 44 | + $inscripcion = new Inscripcion(); | |
| 45 | + $form = $this->createForm('AppBundle\Form\InscripcionType', $inscripcion); | |
| 46 | + $form->handleRequest($request); | |
| 47 | + | |
| 48 | + if ($form->isSubmitted() && $form->isValid()) { | |
| 49 | + $em = $this->getDoctrine()->getManager(); | |
| 50 | + $em->persist($inscripcion); | |
| 51 | + $em->flush(); | |
| 52 | + | |
| 53 | + return $this->redirectToRoute('ceapp_estudiante_inscripcion_show', array('id' => $inscripcion->getId())); | |
| 54 | + } | |
| 55 | + | |
| 56 | + return $this->render('inscripcion/new.html.twig', array( | |
| 57 | + 'inscripcion' => $inscripcion, | |
| 58 | + 'form' => $form->createView(), | |
| 59 | + )); | |
| 60 | + } | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * Finds and displays a Inscripcion entity. | |
| 64 | + * | |
| 65 | + * @Route("/{id}", name="ceapp_estudiante_inscripcion_show") | |
| 66 | + * @Method("GET") | |
| 67 | + */ | |
| 68 | + public function showAction(Inscripcion $inscripcion) | |
| 69 | + { | |
| 70 | + $deleteForm = $this->createDeleteForm($inscripcion); | |
| 71 | + | |
| 72 | + return $this->render('inscripcion/show.html.twig', array( | |
| 73 | + 'inscripcion' => $inscripcion, | |
| 74 | + 'delete_form' => $deleteForm->createView(), | |
| 75 | + )); | |
| 76 | + } | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * Displays a form to edit an existing Inscripcion entity. | |
| 80 | + * | |
| 81 | + * @Route("/{id}/edit", name="ceapp_estudiante_inscripcion_edit") | |
| 82 | + * @Method({"GET", "POST"}) | |
| 83 | + */ | |
| 84 | + public function editAction(Request $request, Inscripcion $inscripcion) | |
| 85 | + { | |
| 86 | + $deleteForm = $this->createDeleteForm($inscripcion); | |
| 87 | + $editForm = $this->createForm('AppBundle\Form\InscripcionType', $inscripcion); | |
| 88 | + $editForm->handleRequest($request); | |
| 89 | + | |
| 90 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | |
| 91 | + $em = $this->getDoctrine()->getManager(); | |
| 92 | + $em->persist($inscripcion); | |
| 93 | + $em->flush(); | |
| 94 | + | |
| 95 | + return $this->redirectToRoute('ceapp_estudiante_inscripcion_edit', array('id' => $inscripcion->getId())); | |
| 96 | + } | |
| 97 | + | |
| 98 | + return $this->render('inscripcion/edit.html.twig', array( | |
| 99 | + 'inscripcion' => $inscripcion, | |
| 100 | + 'edit_form' => $editForm->createView(), | |
| 101 | + 'delete_form' => $deleteForm->createView(), | |
| 102 | + )); | |
| 103 | + } | |
| 104 | + | |
| 105 | + /** | |
| 106 | + * Deletes a Inscripcion entity. | |
| 107 | + * | |
| 108 | + * @Route("/{id}", name="ceapp_estudiante_inscripcion_delete") | |
| 109 | + * @Method("DELETE") | |
| 110 | + */ | |
| 111 | + public function deleteAction(Request $request, Inscripcion $inscripcion) | |
| 112 | + { | |
| 113 | + $form = $this->createDeleteForm($inscripcion); | |
| 114 | + $form->handleRequest($request); | |
| 115 | + | |
| 116 | + if ($form->isSubmitted() && $form->isValid()) { | |
| 117 | + $em = $this->getDoctrine()->getManager(); | |
| 118 | + $em->remove($inscripcion); | |
| 119 | + $em->flush(); | |
| 120 | + } | |
| 121 | + | |
| 122 | + return $this->redirectToRoute('ceapp_estudiante_inscripcion_index'); | |
| 123 | + } | |
| 124 | + | |
| 125 | + /** | |
| 126 | + * Creates a form to delete a Inscripcion entity. | |
| 127 | + * | |
| 128 | + * @param Inscripcion $inscripcion The Inscripcion entity | |
| 129 | + * | |
| 130 | + * @return \Symfony\Component\Form\Form The form | |
| 131 | + */ | |
| 132 | + private function createDeleteForm(Inscripcion $inscripcion) | |
| 133 | + { | |
| 134 | + return $this->createFormBuilder() | |
| 135 | + ->setAction($this->generateUrl('ceapp_estudiante_inscripcion_delete', array('id' => $inscripcion->getId()))) | |
| 136 | + ->setMethod('DELETE') | |
| 137 | + ->getForm() | |
| 138 | + ; | |
| 139 | + } | |
| 140 | +} | ... | ... |
src/AppBundle/Controller/OfertaAcademicaController.php
| ... | ... | @@ -19,7 +19,7 @@ class OfertaAcademicaController extends Controller |
| 19 | 19 | /** |
| 20 | 20 | * Lists all OfertaAcademica entities. |
| 21 | 21 | * |
| 22 | - * @Route("/", name="ceapp_gestion_oferta_academica_index") | |
| 22 | + * @Route("/", name="oferta_academica_index") | |
| 23 | 23 | * @Method("GET") |
| 24 | 24 | */ |
| 25 | 25 | public function indexAction() | ... | ... |
src/AppBundle/Entity/Inscripcion.php
| ... | ... | @@ -41,6 +41,11 @@ class Inscripcion |
| 41 | 41 | * }) |
| 42 | 42 | */ |
| 43 | 43 | private $idOfertaAcademica; |
| 44 | + | |
| 45 | + /** | |
| 46 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\OfertaAcademica", mappedBy="idMallaCurricularUc") | |
| 47 | + */ | |
| 48 | + private $uc; | |
| 44 | 49 | |
| 45 | 50 | /** |
| 46 | 51 | * @var \AppBundle\Entity\Estatus |
| ... | ... | @@ -132,4 +137,44 @@ class Inscripcion |
| 132 | 137 | { |
| 133 | 138 | return $this->idEstatus; |
| 134 | 139 | } |
| 140 | + /** | |
| 141 | + * Constructor | |
| 142 | + */ | |
| 143 | + public function __construct() | |
| 144 | + { | |
| 145 | + $this->uc = new \Doctrine\Common\Collections\ArrayCollection(); | |
| 146 | + } | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * Add uc | |
| 150 | + * | |
| 151 | + * @param \AppBundle\Entity\OfertaAcademica $uc | |
| 152 | + * @return Inscripcion | |
| 153 | + */ | |
| 154 | + public function addUc(\AppBundle\Entity\OfertaAcademica $uc) | |
| 155 | + { | |
| 156 | + $this->uc[] = $uc; | |
| 157 | + | |
| 158 | + return $this; | |
| 159 | + } | |
| 160 | + | |
| 161 | + /** | |
| 162 | + * Remove uc | |
| 163 | + * | |
| 164 | + * @param \AppBundle\Entity\OfertaAcademica $uc | |
| 165 | + */ | |
| 166 | + public function removeUc(\AppBundle\Entity\OfertaAcademica $uc) | |
| 167 | + { | |
| 168 | + $this->uc->removeElement($uc); | |
| 169 | + } | |
| 170 | + | |
| 171 | + /** | |
| 172 | + * Get uc | |
| 173 | + * | |
| 174 | + * @return \Doctrine\Common\Collections\Collection | |
| 175 | + */ | |
| 176 | + public function getUc() | |
| 177 | + { | |
| 178 | + return $this->uc; | |
| 179 | + } | |
| 135 | 180 | } | ... | ... |
src/AppBundle/Entity/Inscripcion.php~
| ... | ... | @@ -41,6 +41,11 @@ class Inscripcion |
| 41 | 41 | * }) |
| 42 | 42 | */ |
| 43 | 43 | private $idOfertaAcademica; |
| 44 | + | |
| 45 | + /** | |
| 46 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\OfertaAcademica", mappedBy="id_malla_curricular_uc") | |
| 47 | + */ | |
| 48 | + private $uc; | |
| 44 | 49 | |
| 45 | 50 | /** |
| 46 | 51 | * @var \AppBundle\Entity\Estatus |
| ... | ... | @@ -53,4 +58,83 @@ class Inscripcion |
| 53 | 58 | private $idEstatus; |
| 54 | 59 | |
| 55 | 60 | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * Get id | |
| 64 | + * | |
| 65 | + * @return integer | |
| 66 | + */ | |
| 67 | + public function getId() | |
| 68 | + { | |
| 69 | + return $this->id; | |
| 70 | + } | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * Set idEstadoAcademico | |
| 74 | + * | |
| 75 | + * @param \AppBundle\Entity\EstadoAcademico $idEstadoAcademico | |
| 76 | + * @return Inscripcion | |
| 77 | + */ | |
| 78 | + public function setIdEstadoAcademico(\AppBundle\Entity\EstadoAcademico $idEstadoAcademico) | |
| 79 | + { | |
| 80 | + $this->idEstadoAcademico = $idEstadoAcademico; | |
| 81 | + | |
| 82 | + return $this; | |
| 83 | + } | |
| 84 | + | |
| 85 | + /** | |
| 86 | + * Get idEstadoAcademico | |
| 87 | + * | |
| 88 | + * @return \AppBundle\Entity\EstadoAcademico | |
| 89 | + */ | |
| 90 | + public function getIdEstadoAcademico() | |
| 91 | + { | |
| 92 | + return $this->idEstadoAcademico; | |
| 93 | + } | |
| 94 | + | |
| 95 | + /** | |
| 96 | + * Set idOfertaAcademica | |
| 97 | + * | |
| 98 | + * @param \AppBundle\Entity\OfertaAcademica $idOfertaAcademica | |
| 99 | + * @return Inscripcion | |
| 100 | + */ | |
| 101 | + public function setIdOfertaAcademica(\AppBundle\Entity\OfertaAcademica $idOfertaAcademica) | |
| 102 | + { | |
| 103 | + $this->idOfertaAcademica = $idOfertaAcademica; | |
| 104 | + | |
| 105 | + return $this; | |
| 106 | + } | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * Get idOfertaAcademica | |
| 110 | + * | |
| 111 | + * @return \AppBundle\Entity\OfertaAcademica | |
| 112 | + */ | |
| 113 | + public function getIdOfertaAcademica() | |
| 114 | + { | |
| 115 | + return $this->idOfertaAcademica; | |
| 116 | + } | |
| 117 | + | |
| 118 | + /** | |
| 119 | + * Set idEstatus | |
| 120 | + * | |
| 121 | + * @param \AppBundle\Entity\Estatus $idEstatus | |
| 122 | + * @return Inscripcion | |
| 123 | + */ | |
| 124 | + public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus) | |
| 125 | + { | |
| 126 | + $this->idEstatus = $idEstatus; | |
| 127 | + | |
| 128 | + return $this; | |
| 129 | + } | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * Get idEstatus | |
| 133 | + * | |
| 134 | + * @return \AppBundle\Entity\Estatus | |
| 135 | + */ | |
| 136 | + public function getIdEstatus() | |
| 137 | + { | |
| 138 | + return $this->idEstatus; | |
| 139 | + } | |
| 56 | 140 | } | ... | ... |
src/AppBundle/Entity/OfertaAcademica.php
| ... | ... | @@ -43,6 +43,8 @@ class OfertaAcademica |
| 43 | 43 | * @ORM\JoinColumns({ |
| 44 | 44 | * @ORM\JoinColumn(name="id_malla_curricular_uc", referencedColumnName="id", nullable=false) |
| 45 | 45 | * }) |
| 46 | + * | |
| 47 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Inscripcion", inversedBy="uc") | |
| 46 | 48 | */ |
| 47 | 49 | private $idMallaCurricularUc; |
| 48 | 50 | |
| ... | ... | @@ -257,4 +259,31 @@ class OfertaAcademica |
| 257 | 259 | { |
| 258 | 260 | return $this->idOfertaMallaCurricular; |
| 259 | 261 | } |
| 262 | + | |
| 263 | + public function __toString() { | |
| 264 | + return $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); | |
| 265 | + } | |
| 266 | + | |
| 267 | + /** | |
| 268 | + * Set inscripcion | |
| 269 | + * | |
| 270 | + * @param \AppBundle\Entity\MallaCurricularUc $inscripcion | |
| 271 | + * @return OfertaAcademica | |
| 272 | + */ | |
| 273 | + public function setInscripcion(\AppBundle\Entity\MallaCurricularUc $inscripcion) | |
| 274 | + { | |
| 275 | + $this->inscripcion = $inscripcion; | |
| 276 | + | |
| 277 | + return $this; | |
| 278 | + } | |
| 279 | + | |
| 280 | + /** | |
| 281 | + * Get inscripcion | |
| 282 | + * | |
| 283 | + * @return \AppBundle\Entity\MallaCurricularUc | |
| 284 | + */ | |
| 285 | + public function getInscripcion() | |
| 286 | + { | |
| 287 | + return $this->inscripcion; | |
| 288 | + } | |
| 260 | 289 | } | ... | ... |
src/AppBundle/Entity/OfertaAcademica.php~
| ... | ... | @@ -39,12 +39,14 @@ class OfertaAcademica |
| 39 | 39 | /** |
| 40 | 40 | * @var \AppBundle\Entity\MallaCurricularUC |
| 41 | 41 | * |
| 42 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\MallaCurricularUC") | |
| 42 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\MallaCurricularUc") | |
| 43 | 43 | * @ORM\JoinColumns({ |
| 44 | 44 | * @ORM\JoinColumn(name="id_malla_curricular_uc", referencedColumnName="id", nullable=false) |
| 45 | 45 | * }) |
| 46 | + * | |
| 47 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Inscripcion", inversedBy="uc") | |
| 46 | 48 | */ |
| 47 | - private $idMallaCurricularUc; | |
| 49 | + private $inscripcion; | |
| 48 | 50 | |
| 49 | 51 | /** |
| 50 | 52 | * @var \AppBundle\Entity\Turno |
| ... | ... | @@ -87,7 +89,178 @@ class OfertaAcademica |
| 87 | 89 | private $idOfertaMallaCurricular; |
| 88 | 90 | |
| 89 | 91 | |
| 90 | - | |
| 92 | + /** | |
| 93 | + * Set aula | |
| 94 | + * | |
| 95 | + * @param string $aula | |
| 96 | + * @return OfertaAcademica | |
| 97 | + */ | |
| 98 | + public function setAula($aula) | |
| 99 | + { | |
| 100 | + $this->aula = $aula; | |
| 91 | 101 | |
| 92 | - | |
| 102 | + return $this; | |
| 103 | + } | |
| 104 | + | |
| 105 | + /** | |
| 106 | + * Get aula | |
| 107 | + * | |
| 108 | + * @return string | |
| 109 | + */ | |
| 110 | + public function getAula() | |
| 111 | + { | |
| 112 | + return $this->aula; | |
| 113 | + } | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * Set cupo | |
| 117 | + * | |
| 118 | + * @param string $cupo | |
| 119 | + * @return OfertaAcademica | |
| 120 | + */ | |
| 121 | + public function setCupo($cupo) | |
| 122 | + { | |
| 123 | + $this->cupo = $cupo; | |
| 124 | + | |
| 125 | + return $this; | |
| 126 | + } | |
| 127 | + | |
| 128 | + /** | |
| 129 | + * Get cupo | |
| 130 | + * | |
| 131 | + * @return string | |
| 132 | + */ | |
| 133 | + public function getCupo() | |
| 134 | + { | |
| 135 | + return $this->cupo; | |
| 136 | + } | |
| 137 | + | |
| 138 | + /** | |
| 139 | + * Get id | |
| 140 | + * | |
| 141 | + * @return integer | |
| 142 | + */ | |
| 143 | + public function getId() | |
| 144 | + { | |
| 145 | + return $this->id; | |
| 146 | + } | |
| 147 | + | |
| 148 | + /** | |
| 149 | + * Set idMallaCurricularUc | |
| 150 | + * | |
| 151 | + * @param \AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc | |
| 152 | + * @return OfertaAcademica | |
| 153 | + */ | |
| 154 | + public function setIdMallaCurricularUc(\AppBundle\Entity\MallaCurricularUC $idMallaCurricularUc) | |
| 155 | + { | |
| 156 | + $this->idMallaCurricularUc = $idMallaCurricularUc; | |
| 157 | + | |
| 158 | + return $this; | |
| 159 | + } | |
| 160 | + | |
| 161 | + /** | |
| 162 | + * Get idMallaCurricularUc | |
| 163 | + * | |
| 164 | + * @return \AppBundle\Entity\MallaCurricularUC | |
| 165 | + */ | |
| 166 | + public function getIdMallaCurricularUc() | |
| 167 | + { | |
| 168 | + return $this->idMallaCurricularUc; | |
| 169 | + } | |
| 170 | + | |
| 171 | + /** | |
| 172 | + * Set idTurno | |
| 173 | + * | |
| 174 | + * @param \AppBundle\Entity\Turno $idTurno | |
| 175 | + * @return OfertaAcademica | |
| 176 | + */ | |
| 177 | + public function setIdTurno(\AppBundle\Entity\Turno $idTurno) | |
| 178 | + { | |
| 179 | + $this->idTurno = $idTurno; | |
| 180 | + | |
| 181 | + return $this; | |
| 182 | + } | |
| 183 | + | |
| 184 | + /** | |
| 185 | + * Get idTurno | |
| 186 | + * | |
| 187 | + * @return \AppBundle\Entity\Turno | |
| 188 | + */ | |
| 189 | + public function getIdTurno() | |
| 190 | + { | |
| 191 | + return $this->idTurno; | |
| 192 | + } | |
| 193 | + | |
| 194 | + /** | |
| 195 | + * Set idSeccion | |
| 196 | + * | |
| 197 | + * @param \AppBundle\Entity\Seccion $idSeccion | |
| 198 | + * @return OfertaAcademica | |
| 199 | + */ | |
| 200 | + public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion) | |
| 201 | + { | |
| 202 | + $this->idSeccion = $idSeccion; | |
| 203 | + | |
| 204 | + return $this; | |
| 205 | + } | |
| 206 | + | |
| 207 | + /** | |
| 208 | + * Get idSeccion | |
| 209 | + * | |
| 210 | + * @return \AppBundle\Entity\Seccion | |
| 211 | + */ | |
| 212 | + public function getIdSeccion() | |
| 213 | + { | |
| 214 | + return $this->idSeccion; | |
| 215 | + } | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * Set idRolInstitucion | |
| 219 | + * | |
| 220 | + * @param \AppBundle\Entity\RolInstitucion $idRolInstitucion | |
| 221 | + * @return OfertaAcademica | |
| 222 | + */ | |
| 223 | + public function setIdRolInstitucion(\AppBundle\Entity\RolInstitucion $idRolInstitucion) | |
| 224 | + { | |
| 225 | + $this->idRolInstitucion = $idRolInstitucion; | |
| 226 | + | |
| 227 | + return $this; | |
| 228 | + } | |
| 229 | + | |
| 230 | + /** | |
| 231 | + * Get idRolInstitucion | |
| 232 | + * | |
| 233 | + * @return \AppBundle\Entity\RolInstitucion | |
| 234 | + */ | |
| 235 | + public function getIdRolInstitucion() | |
| 236 | + { | |
| 237 | + return $this->idRolInstitucion; | |
| 238 | + } | |
| 239 | + | |
| 240 | + /** | |
| 241 | + * Set idOfertaMallaCurricular | |
| 242 | + * | |
| 243 | + * @param \AppBundle\Entity\OfertaMallaCurricular $idOfertaMallaCurricular | |
| 244 | + * @return OfertaAcademica | |
| 245 | + */ | |
| 246 | + public function setIdOfertaMallaCurricular(\AppBundle\Entity\OfertaMallaCurricular $idOfertaMallaCurricular) | |
| 247 | + { | |
| 248 | + $this->idOfertaMallaCurricular = $idOfertaMallaCurricular; | |
| 249 | + | |
| 250 | + return $this; | |
| 251 | + } | |
| 252 | + | |
| 253 | + /** | |
| 254 | + * Get idOfertaMallaCurricular | |
| 255 | + * | |
| 256 | + * @return \AppBundle\Entity\OfertaMallaCurricular | |
| 257 | + */ | |
| 258 | + public function getIdOfertaMallaCurricular() | |
| 259 | + { | |
| 260 | + return $this->idOfertaMallaCurricular; | |
| 261 | + } | |
| 262 | + | |
| 263 | + public function __toString() { | |
| 264 | + return $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); | |
| 265 | + } | |
| 93 | 266 | } | ... | ... |
src/AppBundle/Form/InscripcionType.php
| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace AppBundle\Form; | |
| 4 | + | |
| 5 | +use Symfony\Component\Form\AbstractType; | |
| 6 | +use Symfony\Component\Form\FormBuilderInterface; | |
| 7 | +use Symfony\Component\OptionsResolver\OptionsResolver; | |
| 8 | +use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
| 9 | + | |
| 10 | +class InscripcionType extends AbstractType | |
| 11 | +{ | |
| 12 | + /** | |
| 13 | + * @param FormBuilderInterface $builder | |
| 14 | + * @param array $options | |
| 15 | + */ | |
| 16 | + public function buildForm(FormBuilderInterface $builder, array $options) | |
| 17 | + { | |
| 18 | + $builder | |
| 19 | + /*->add('idEstadoAcademico') | |
| 20 | + ->add('idOfertaAcademica') | |
| 21 | + ->add('idEstatus')*/ | |
| 22 | + ->add('uc', EntityType::class, array( | |
| 23 | + 'class' => 'AppBundle:OfertaAcademica', | |
| 24 | + 'expanded' => true, | |
| 25 | + 'multiple' => true | |
| 26 | + )) | |
| 27 | + ; | |
| 28 | + } | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * @param OptionsResolver $resolver | |
| 32 | + */ | |
| 33 | + public function configureOptions(OptionsResolver $resolver) | |
| 34 | + { | |
| 35 | + $resolver->setDefaults(array( | |
| 36 | + 'data_class' => 'AppBundle\Entity\Inscripcion', | |
| 37 | + )); | |
| 38 | + } | |
| 39 | +} | ... | ... |
src/AppBundle/Tests/Controller/InscripcionControllerTest.php
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace AppBundle\Tests\Controller; | |
| 4 | + | |
| 5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
| 6 | + | |
| 7 | +class InscripcionControllerTest extends WebTestCase | |
| 8 | +{ | |
| 9 | + /* | |
| 10 | + public function testCompleteScenario() | |
| 11 | + { | |
| 12 | + // Create a new client to browse the application | |
| 13 | + $client = static::createClient(); | |
| 14 | + | |
| 15 | + // Create a new entry in the database | |
| 16 | + $crawler = $client->request('GET', '/ceapp/estudiante/inscripcion/'); | |
| 17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /ceapp/estudiante/inscripcion/"); | |
| 18 | + $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); | |
| 19 | + | |
| 20 | + // Fill in the form and submit it | |
| 21 | + $form = $crawler->selectButton('Create')->form(array( | |
| 22 | + 'appbundle_inscripcion[field_name]' => 'Test', | |
| 23 | + // ... other fields to fill | |
| 24 | + )); | |
| 25 | + | |
| 26 | + $client->submit($form); | |
| 27 | + $crawler = $client->followRedirect(); | |
| 28 | + | |
| 29 | + // Check data in the show view | |
| 30 | + $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); | |
| 31 | + | |
| 32 | + // Edit the entity | |
| 33 | + $crawler = $client->click($crawler->selectLink('Edit')->link()); | |
| 34 | + | |
| 35 | + $form = $crawler->selectButton('Update')->form(array( | |
| 36 | + 'appbundle_inscripcion[field_name]' => 'Foo', | |
| 37 | + // ... other fields to fill | |
| 38 | + )); | |
| 39 | + | |
| 40 | + $client->submit($form); | |
| 41 | + $crawler = $client->followRedirect(); | |
| 42 | + | |
| 43 | + // Check the element contains an attribute with value equals "Foo" | |
| 44 | + $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); | |
| 45 | + | |
| 46 | + // Delete the entity | |
| 47 | + $client->submit($crawler->selectButton('Delete')->form()); | |
| 48 | + $crawler = $client->followRedirect(); | |
| 49 | + | |
| 50 | + // Check the entity has been delete on the list | |
| 51 | + $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); | |
| 52 | + } | |
| 53 | + | |
| 54 | + */ | |
| 55 | +} | ... | ... |