Commit 53f174811a21841bbb449dd496d15ca254f71396
1 parent
fda71fafd4
Exists in
master
lograda la inscripcion con exito
Showing
28 changed files
with
781 additions
and
349 deletions
Show diff stats
app/Resources/views/base_app.html.twig
| @@ -88,7 +88,7 @@ | @@ -88,7 +88,7 @@ | ||
| 88 | <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> | 88 | <li class="dropdown"><a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown"> |
| 89 | <i class="fa fa-calendar-plus-o"></i><span>Adm. Academica</span> <b class="caret"></b></a> | 89 | <i class="fa fa-calendar-plus-o"></i><span>Adm. Academica</span> <b class="caret"></b></a> |
| 90 | <ul class="dropdown-menu"> | 90 | <ul class="dropdown-menu"> |
| 91 | - <li><a href="{{ path('oferta_academica_index') }}">Oferta Academica</a></li> | 91 | + <li><a href="{{ path('ceapp_gestion_oferta_academica_index') }}">Oferta Academica</a></li> |
| 92 | </ul> | 92 | </ul> |
| 93 | </li> | 93 | </li> |
| 94 | 94 |
app/Resources/views/inscripcion/index.html.twig
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | <div class="container"> | 37 | <div class="container"> |
| 38 | {% for inscrita in estado_academico.hasInscripcion %} | 38 | {% for inscrita in estado_academico.hasInscripcion %} |
| 39 | <p> | 39 | <p> |
| 40 | - {{ inscrita.idOfertaAcademica.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular.nombre }} | 40 | + {{ inscrita.idSeccion.ofertaAcademica.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular.nombre }} |
| 41 | <a class="btn btn-warning btn-xs" href="{{ path('ceapp_estudiante_inscripcion_edit', { 'id': inscrita.id }) }}"><i class="fa fa-edit"></i></a> | 41 | <a class="btn btn-warning btn-xs" href="{{ path('ceapp_estudiante_inscripcion_edit', { 'id': inscrita.id }) }}"><i class="fa fa-edit"></i></a> |
| 42 | </p> | 42 | </p> |
| 43 | {% endfor %} | 43 | {% endfor %} |
app/Resources/views/inscripcion/new.html.twig
| @@ -2,19 +2,24 @@ | @@ -2,19 +2,24 @@ | ||
| 2 | 2 | ||
| 3 | {% block body %} | 3 | {% block body %} |
| 4 | <h1>Inscripcion creation</h1> | 4 | <h1>Inscripcion creation</h1> |
| 5 | -{{ dump(form.children.idOfertaAcademica.children) }} | 5 | +<form class="form-inline" method="post" name="seccion"> |
| 6 | + <div id="seccion"> | ||
| 7 | + {% for o in oferta %} | ||
| 8 | + <div class="form-group"> | ||
| 9 | + <b>{{ o.idMallaCurricularUc }}</b> | ||
| 10 | + {% for seccion in o.seccion %} | ||
| 11 | + <div class="radio"> | ||
| 12 | + <label> | ||
| 13 | + <input id="seccion_idSeccion_{{seccion.id}}" type="radio" value="{{seccion.id}}" name="seccion[idSeccion][{{o.idMallaCurricularUc}}]"> | ||
| 14 | + {{ seccion.nombre }} | ||
| 15 | + </label> | ||
| 16 | + </div> | ||
| 17 | + </div> | ||
| 18 | + {% endfor %}<br> | ||
| 19 | +{% endfor %} | ||
| 20 | +</div> | ||
| 21 | +<input id="seccion__token" type="hidden" value="WbDyIPXIxm9WxU4oOf2a4_4CnXg3rxuY46e_TbVAggY" name="seccion[_token]"> | ||
| 22 | +<input type="submit" value="Create" /> | ||
| 23 | +</form> | ||
| 6 | 24 | ||
| 7 | -{% form_theme form 'bootstrap_3_horizontal_layout.html.twig' %} | ||
| 8 | - {{ form_start(form) }} | ||
| 9 | - {% for f in form.children.idOfertaAcademica.children %} | ||
| 10 | - {{ form_widget(f) }} | ||
| 11 | - {% endfor %} | ||
| 12 | - <input type="submit" value="Create" /> | ||
| 13 | - {{ form_end(form) }} | ||
| 14 | - | ||
| 15 | - <ul> | ||
| 16 | - <li> | ||
| 17 | - <a href="{{ path('inscripcion_index') }}">Back to the list</a> | ||
| 18 | - </li> | ||
| 19 | - </ul> | ||
| 20 | {% endblock %} | 25 | {% endblock %} |
app/Resources/views/ofertaacademica/index.html.twig
| 1 | -{% extends 'base_app.html.twig' %} | 1 | +{% extends 'base.html.twig' %} |
| 2 | 2 | ||
| 3 | {% block body %} | 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"> | 4 | + <h1>OfertaAcademica list</h1> |
| 5 | + | ||
| 6 | + <table> | ||
| 13 | <thead> | 7 | <thead> |
| 14 | <tr> | 8 | <tr> |
| 15 | - <th>Malla</th> | ||
| 16 | - <th>Codigo UC</th> | ||
| 17 | - <th>Unidad Curricular</th> | ||
| 18 | - <th>Modalidad</th> | ||
| 19 | - <th>Tipo</th> | ||
| 20 | - <th>Aula</th> | ||
| 21 | - <th>Cupo</th> | 9 | + <th>Id</th> |
| 22 | <th>Actions</th> | 10 | <th>Actions</th> |
| 23 | </tr> | 11 | </tr> |
| 24 | </thead> | 12 | </thead> |
| 25 | <tbody> | 13 | <tbody> |
| 26 | {% for ofertaAcademica in ofertaAcademicas %} | 14 | {% for ofertaAcademica in ofertaAcademicas %} |
| 27 | <tr> | 15 | <tr> |
| 28 | - <td>{{ofertaAcademica.idMallaCurricularUc.idMallaCurricular.codigo}}</td> | ||
| 29 | - <td>{{ofertaAcademica.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular.codigo}}</td> | ||
| 30 | - <td>{{ofertaAcademica.idMallaCurricularUc.idUnidadCurricularVolumen.idUnidadCurricular}}</td> | ||
| 31 | - <td>{{ofertaAcademica.idMallaCurricularUc.idTrayectoTramoModalidadTipoUc.idModalidad}}</td> | ||
| 32 | - <td>{{ofertaAcademica.idMallaCurricularUc.idTrayectoTramoModalidadTipoUc.idTipoUc}}</td> | ||
| 33 | - <td><a href="{{ path('ceapp_gestion_oferta_academica_show', { 'id': ofertaAcademica.id }) }}">{{ ofertaAcademica.aula }}</a></td> | ||
| 34 | - <td>{{ ofertaAcademica.cupo }}</td> | 16 | + <td><a href="{{ path('ceapp_gestion_oferta_academica_show', { 'id': ofertaAcademica.id }) }}">{{ ofertaAcademica.id }}</a></td> |
| 35 | <td> | 17 | <td> |
| 36 | <ul> | 18 | <ul> |
| 37 | <li> | 19 | <li> |
| @@ -52,9 +34,4 @@ | @@ -52,9 +34,4 @@ | ||
| 52 | <a href="{{ path('ceapp_gestion_oferta_academica_new') }}">Create a new entry</a> | 34 | <a href="{{ path('ceapp_gestion_oferta_academica_new') }}">Create a new entry</a> |
| 53 | </li> | 35 | </li> |
| 54 | </ul> | 36 | </ul> |
| 55 | - </div> | ||
| 56 | - | ||
| 57 | - </div> | ||
| 58 | - </div> | ||
| 59 | - | ||
| 60 | {% endblock %} | 37 | {% endblock %} |
app/Resources/views/ofertaacademica/new.html.twig
| 1 | -{% extends 'base_app.html.twig' %} | 1 | +{% extends 'base.html.twig' %} |
| 2 | 2 | ||
| 3 | {% block body %} | 3 | {% block body %} |
| 4 | - <div class="container"> | ||
| 5 | - <h1>Creacion de Oferta Academica</h1> | ||
| 6 | -{% form_theme form 'bootstrap_3_horizontal_layout.html.twig' %} | 4 | + <h1>OfertaAcademica creation</h1> |
| 5 | + | ||
| 7 | {{ form_start(form) }} | 6 | {{ form_start(form) }} |
| 8 | {{ form_widget(form) }} | 7 | {{ form_widget(form) }} |
| 9 | <input type="submit" value="Create" /> | 8 | <input type="submit" value="Create" /> |
| @@ -11,8 +10,7 @@ | @@ -11,8 +10,7 @@ | ||
| 11 | 10 | ||
| 12 | <ul> | 11 | <ul> |
| 13 | <li> | 12 | <li> |
| 14 | - <a href="{{ path('oferta_academica_index') }}">Back to the list</a> | 13 | + <a href="{{ path('ceapp_gestion_oferta_academica_index') }}">Back to the list</a> |
| 15 | </li> | 14 | </li> |
| 16 | </ul> | 15 | </ul> |
| 17 | - </div> | ||
| 18 | {% endblock %} | 16 | {% endblock %} |
app/Resources/views/ofertaacademica/show.html.twig
| @@ -6,14 +6,6 @@ | @@ -6,14 +6,6 @@ | ||
| 6 | <table> | 6 | <table> |
| 7 | <tbody> | 7 | <tbody> |
| 8 | <tr> | 8 | <tr> |
| 9 | - <th>Aula</th> | ||
| 10 | - <td>{{ ofertaAcademica.aula }}</td> | ||
| 11 | - </tr> | ||
| 12 | - <tr> | ||
| 13 | - <th>Cupo</th> | ||
| 14 | - <td>{{ ofertaAcademica.cupo }}</td> | ||
| 15 | - </tr> | ||
| 16 | - <tr> | ||
| 17 | <th>Id</th> | 9 | <th>Id</th> |
| 18 | <td>{{ ofertaAcademica.id }}</td> | 10 | <td>{{ ofertaAcademica.id }}</td> |
| 19 | </tr> | 11 | </tr> |
| @@ -22,7 +14,7 @@ | @@ -22,7 +14,7 @@ | ||
| 22 | 14 | ||
| 23 | <ul> | 15 | <ul> |
| 24 | <li> | 16 | <li> |
| 25 | - <a href="{{ path('oferta_academica_index') }}">Back to the list</a> | 17 | + <a href="{{ path('ceapp_gestion_oferta_academica_index') }}">Back to the list</a> |
| 26 | </li> | 18 | </li> |
| 27 | <li> | 19 | <li> |
| 28 | <a href="{{ path('ceapp_gestion_oferta_academica_edit', { 'id': ofertaAcademica.id }) }}">Edit</a> | 20 | <a href="{{ path('ceapp_gestion_oferta_academica_edit', { 'id': ofertaAcademica.id }) }}">Edit</a> |
app/Resources/views/seccion/edit.html.twig
| @@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
| 1 | +{% extends 'base.html.twig' %} | ||
| 2 | + | ||
| 3 | +{% block body %} | ||
| 4 | + <h1>Seccion 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_gestion_oferta_academica_seccion_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/seccion/index.html.twig
| @@ -0,0 +1,43 @@ | @@ -0,0 +1,43 @@ | ||
| 1 | +{% extends 'base.html.twig' %} | ||
| 2 | + | ||
| 3 | +{% block body %} | ||
| 4 | + <h1>Seccion list</h1> | ||
| 5 | + | ||
| 6 | + <table> | ||
| 7 | + <thead> | ||
| 8 | + <tr> | ||
| 9 | + <th>Nombre</th> | ||
| 10 | + <th>Aula</th> | ||
| 11 | + <th>Cupo</th> | ||
| 12 | + <th>Id</th> | ||
| 13 | + <th>Actions</th> | ||
| 14 | + </tr> | ||
| 15 | + </thead> | ||
| 16 | + <tbody> | ||
| 17 | + {% for seccion in seccions %} | ||
| 18 | + <tr> | ||
| 19 | + <td><a href="{{ path('ceapp_gestion_oferta_academica_seccion_show', { 'id': seccion.id }) }}">{{ seccion.nombre }}</a></td> | ||
| 20 | + <td>{{ seccion.aula }}</td> | ||
| 21 | + <td>{{ seccion.cupo }}</td> | ||
| 22 | + <td>{{ seccion.id }}</td> | ||
| 23 | + <td> | ||
| 24 | + <ul> | ||
| 25 | + <li> | ||
| 26 | + <a href="{{ path('ceapp_gestion_oferta_academica_seccion_show', { 'id': seccion.id }) }}">show</a> | ||
| 27 | + </li> | ||
| 28 | + <li> | ||
| 29 | + <a href="{{ path('ceapp_gestion_oferta_academica_seccion_edit', { 'id': seccion.id }) }}">edit</a> | ||
| 30 | + </li> | ||
| 31 | + </ul> | ||
| 32 | + </td> | ||
| 33 | + </tr> | ||
| 34 | + {% endfor %} | ||
| 35 | + </tbody> | ||
| 36 | + </table> | ||
| 37 | + | ||
| 38 | + <ul> | ||
| 39 | + <li> | ||
| 40 | + <a href="{{ path('ceapp_gestion_oferta_academica_seccion_new') }}">Create a new entry</a> | ||
| 41 | + </li> | ||
| 42 | + </ul> | ||
| 43 | +{% endblock %} |
app/Resources/views/seccion/new.html.twig
| @@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
| 1 | +{% extends 'base.html.twig' %} | ||
| 2 | + | ||
| 3 | +{% block body %} | ||
| 4 | + <h1>Seccion creation</h1> | ||
| 5 | + | ||
| 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('ceapp_gestion_oferta_academica_seccion_index') }}">Back to the list</a> | ||
| 14 | + </li> | ||
| 15 | + </ul> | ||
| 16 | +{% endblock %} |
app/Resources/views/seccion/show.html.twig
| @@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
| 1 | +{% extends 'base.html.twig' %} | ||
| 2 | + | ||
| 3 | +{% block body %} | ||
| 4 | + <h1>Seccion</h1> | ||
| 5 | + | ||
| 6 | + <table> | ||
| 7 | + <tbody> | ||
| 8 | + <tr> | ||
| 9 | + <th>Nombre</th> | ||
| 10 | + <td>{{ seccion.nombre }}</td> | ||
| 11 | + </tr> | ||
| 12 | + <tr> | ||
| 13 | + <th>Aula</th> | ||
| 14 | + <td>{{ seccion.aula }}</td> | ||
| 15 | + </tr> | ||
| 16 | + <tr> | ||
| 17 | + <th>Cupo</th> | ||
| 18 | + <td>{{ seccion.cupo }}</td> | ||
| 19 | + </tr> | ||
| 20 | + <tr> | ||
| 21 | + <th>Id</th> | ||
| 22 | + <td>{{ seccion.id }}</td> | ||
| 23 | + </tr> | ||
| 24 | + </tbody> | ||
| 25 | + </table> | ||
| 26 | + | ||
| 27 | + <ul> | ||
| 28 | + <li> | ||
| 29 | + <a href="{{ path('ceapp_gestion_oferta_academica_seccion_index') }}">Back to the list</a> | ||
| 30 | + </li> | ||
| 31 | + <li> | ||
| 32 | + <a href="{{ path('ceapp_gestion_oferta_academica_seccion_edit', { 'id': seccion.id }) }}">Edit</a> | ||
| 33 | + </li> | ||
| 34 | + <li> | ||
| 35 | + {{ form_start(delete_form) }} | ||
| 36 | + <input type="submit" value="Delete"> | ||
| 37 | + {{ form_end(delete_form) }} | ||
| 38 | + </li> | ||
| 39 | + </ul> | ||
| 40 | +{% endblock %} |
src/AppBundle/Controller/InscripcionController.php
| @@ -48,12 +48,21 @@ class InscripcionController extends Controller | @@ -48,12 +48,21 @@ class InscripcionController extends Controller | ||
| 48 | array('idMallaCurricularUc' => 'ASC') | 48 | array('idMallaCurricularUc' => 'ASC') |
| 49 | ); | 49 | ); |
| 50 | 50 | ||
| 51 | + $seccion = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findAll(); | ||
| 51 | 52 | ||
| 53 | + | ||
| 52 | $form = $this->createForm('AppBundle\Form\InscripcionType', $ea, array('inscripcion' => $ea,)); | 54 | $form = $this->createForm('AppBundle\Form\InscripcionType', $ea, array('inscripcion' => $ea,)); |
| 53 | $form->handleRequest($request); | 55 | $form->handleRequest($request); |
| 54 | 56 | ||
| 55 | - if ($form->isSubmitted() && $form->isValid()) { | 57 | + if ($request->isMethod("POST")) { |
| 58 | + //var_dump($request->request->get('seccion')['idSeccion']); exit; | ||
| 56 | $em = $this->getDoctrine()->getManager(); | 59 | $em = $this->getDoctrine()->getManager(); |
| 60 | + | ||
| 61 | + foreach ($request->request->get('seccion')['idSeccion'] as $s ){ | ||
| 62 | + $inscripcion = $this->getDoctrine()->getRepository('AppBundle:Seccion')->findOneById($s); | ||
| 63 | + //var_dump($inscripcion->getId()); exit; | ||
| 64 | + $ea->setIdSeccion($inscripcion); | ||
| 65 | + }; | ||
| 57 | $em->persist($ea); | 66 | $em->persist($ea); |
| 58 | $em->flush(); | 67 | $em->flush(); |
| 59 | 68 | ||
| @@ -62,7 +71,8 @@ class InscripcionController extends Controller | @@ -62,7 +71,8 @@ class InscripcionController extends Controller | ||
| 62 | 71 | ||
| 63 | return $this->render('inscripcion/new.html.twig', array( | 72 | return $this->render('inscripcion/new.html.twig', array( |
| 64 | 'estado_academico' => $ea, | 73 | 'estado_academico' => $ea, |
| 65 | - 'oferta' => $oferta, | 74 | + 'oferta' => $oferta, |
| 75 | + 'seccion' => $seccion, | ||
| 66 | 'form' => $form->createView() | 76 | 'form' => $form->createView() |
| 67 | )); | 77 | )); |
| 68 | } | 78 | } |
src/AppBundle/Controller/OfertaAcademicaController.php
| @@ -19,7 +19,7 @@ class OfertaAcademicaController extends Controller | @@ -19,7 +19,7 @@ class OfertaAcademicaController extends Controller | ||
| 19 | /** | 19 | /** |
| 20 | * Lists all OfertaAcademica entities. | 20 | * Lists all OfertaAcademica entities. |
| 21 | * | 21 | * |
| 22 | - * @Route("/", name="oferta_academica_index") | 22 | + * @Route("/", name="ceapp_gestion_oferta_academica_index") |
| 23 | * @Method("GET") | 23 | * @Method("GET") |
| 24 | */ | 24 | */ |
| 25 | public function indexAction() | 25 | public function indexAction() |
src/AppBundle/Controller/SeccionController.php
| @@ -0,0 +1,140 @@ | @@ -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\Seccion; | ||
| 10 | +use AppBundle\Form\SeccionType; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * Seccion controller. | ||
| 14 | + * | ||
| 15 | + * @Route("/ceapp/gestion/seccion") | ||
| 16 | + */ | ||
| 17 | +class SeccionController extends Controller | ||
| 18 | +{ | ||
| 19 | + /** | ||
| 20 | + * Lists all Seccion entities. | ||
| 21 | + * | ||
| 22 | + * @Route("/", name="ceapp_gestion_oferta_academica_seccion_index") | ||
| 23 | + * @Method("GET") | ||
| 24 | + */ | ||
| 25 | + public function indexAction() | ||
| 26 | + { | ||
| 27 | + $em = $this->getDoctrine()->getManager(); | ||
| 28 | + | ||
| 29 | + $seccions = $em->getRepository('AppBundle:Seccion')->findAll(); | ||
| 30 | + | ||
| 31 | + return $this->render('seccion/index.html.twig', array( | ||
| 32 | + 'seccions' => $seccions, | ||
| 33 | + )); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * Creates a new Seccion entity. | ||
| 38 | + * | ||
| 39 | + * @Route("/new", name="ceapp_gestion_oferta_academica_seccion_new") | ||
| 40 | + * @Method({"GET", "POST"}) | ||
| 41 | + */ | ||
| 42 | + public function newAction(Request $request) | ||
| 43 | + { | ||
| 44 | + $seccion = new Seccion(); | ||
| 45 | + $form = $this->createForm('AppBundle\Form\SeccionType', $seccion); | ||
| 46 | + $form->handleRequest($request); | ||
| 47 | + | ||
| 48 | + if ($form->isSubmitted() && $form->isValid()) { | ||
| 49 | + $em = $this->getDoctrine()->getManager(); | ||
| 50 | + $em->persist($seccion); | ||
| 51 | + $em->flush(); | ||
| 52 | + | ||
| 53 | + return $this->redirectToRoute('ceapp_gestion_oferta_academica_seccion_show', array('id' => $seccion->getId())); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + return $this->render('seccion/new.html.twig', array( | ||
| 57 | + 'seccion' => $seccion, | ||
| 58 | + 'form' => $form->createView(), | ||
| 59 | + )); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * Finds and displays a Seccion entity. | ||
| 64 | + * | ||
| 65 | + * @Route("/{id}", name="ceapp_gestion_oferta_academica_seccion_show") | ||
| 66 | + * @Method("GET") | ||
| 67 | + */ | ||
| 68 | + public function showAction(Seccion $seccion) | ||
| 69 | + { | ||
| 70 | + $deleteForm = $this->createDeleteForm($seccion); | ||
| 71 | + | ||
| 72 | + return $this->render('seccion/show.html.twig', array( | ||
| 73 | + 'seccion' => $seccion, | ||
| 74 | + 'delete_form' => $deleteForm->createView(), | ||
| 75 | + )); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + /** | ||
| 79 | + * Displays a form to edit an existing Seccion entity. | ||
| 80 | + * | ||
| 81 | + * @Route("/{id}/edit", name="ceapp_gestion_oferta_academica_seccion_edit") | ||
| 82 | + * @Method({"GET", "POST"}) | ||
| 83 | + */ | ||
| 84 | + public function editAction(Request $request, Seccion $seccion) | ||
| 85 | + { | ||
| 86 | + $deleteForm = $this->createDeleteForm($seccion); | ||
| 87 | + $editForm = $this->createForm('AppBundle\Form\SeccionType', $seccion); | ||
| 88 | + $editForm->handleRequest($request); | ||
| 89 | + | ||
| 90 | + if ($editForm->isSubmitted() && $editForm->isValid()) { | ||
| 91 | + $em = $this->getDoctrine()->getManager(); | ||
| 92 | + $em->persist($seccion); | ||
| 93 | + $em->flush(); | ||
| 94 | + | ||
| 95 | + return $this->redirectToRoute('ceapp_gestion_oferta_academica_seccion_edit', array('id' => $seccion->getId())); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + return $this->render('seccion/edit.html.twig', array( | ||
| 99 | + 'seccion' => $seccion, | ||
| 100 | + 'edit_form' => $editForm->createView(), | ||
| 101 | + 'delete_form' => $deleteForm->createView(), | ||
| 102 | + )); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + /** | ||
| 106 | + * Deletes a Seccion entity. | ||
| 107 | + * | ||
| 108 | + * @Route("/{id}", name="ceapp_gestion_oferta_academica_seccion_delete") | ||
| 109 | + * @Method("DELETE") | ||
| 110 | + */ | ||
| 111 | + public function deleteAction(Request $request, Seccion $seccion) | ||
| 112 | + { | ||
| 113 | + $form = $this->createDeleteForm($seccion); | ||
| 114 | + $form->handleRequest($request); | ||
| 115 | + | ||
| 116 | + if ($form->isSubmitted() && $form->isValid()) { | ||
| 117 | + $em = $this->getDoctrine()->getManager(); | ||
| 118 | + $em->remove($seccion); | ||
| 119 | + $em->flush(); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + return $this->redirectToRoute('ceapp_gestion_oferta_academica_seccion_index'); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** | ||
| 126 | + * Creates a form to delete a Seccion entity. | ||
| 127 | + * | ||
| 128 | + * @param Seccion $seccion The Seccion entity | ||
| 129 | + * | ||
| 130 | + * @return \Symfony\Component\Form\Form The form | ||
| 131 | + */ | ||
| 132 | + private function createDeleteForm(Seccion $seccion) | ||
| 133 | + { | ||
| 134 | + return $this->createFormBuilder() | ||
| 135 | + ->setAction($this->generateUrl('ceapp_gestion_oferta_academica_seccion_delete', array('id' => $seccion->getId()))) | ||
| 136 | + ->setMethod('DELETE') | ||
| 137 | + ->getForm() | ||
| 138 | + ; | ||
| 139 | + } | ||
| 140 | +} |
src/AppBundle/Entity/EstadoAcademico.php
| @@ -84,7 +84,7 @@ class EstadoAcademico | @@ -84,7 +84,7 @@ class EstadoAcademico | ||
| 84 | * */ | 84 | * */ |
| 85 | protected $hasInscripcion; | 85 | protected $hasInscripcion; |
| 86 | 86 | ||
| 87 | - private $idOfertaAcademica; | 87 | + private $idSeccion; |
| 88 | 88 | ||
| 89 | 89 | ||
| 90 | 90 | ||
| @@ -93,7 +93,7 @@ class EstadoAcademico | @@ -93,7 +93,7 @@ class EstadoAcademico | ||
| 93 | */ | 93 | */ |
| 94 | public function __construct() | 94 | public function __construct() |
| 95 | { | 95 | { |
| 96 | - $this->idOfertaAcademica = new \Doctrine\Common\Collections\ArrayCollection(); | 96 | + $this->idSeccion = new \Doctrine\Common\Collections\ArrayCollection(); |
| 97 | $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); | 97 | $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); |
| 98 | $this->fecha = new \DateTime(); | 98 | $this->fecha = new \DateTime(); |
| 99 | } | 99 | } |
| @@ -285,35 +285,32 @@ class EstadoAcademico | @@ -285,35 +285,32 @@ class EstadoAcademico | ||
| 285 | * | 285 | * |
| 286 | * @return \Doctrine\Common\Collections\Collection | 286 | * @return \Doctrine\Common\Collections\Collection |
| 287 | */ | 287 | */ |
| 288 | - public function getIdOfertaAcademica() | 288 | + public function getIdSeccion() |
| 289 | { | 289 | { |
| 290 | - $idOfertaAcademica = new \Doctrine\Common\Collections\ArrayCollection(); | 290 | + $idSeccion = new \Doctrine\Common\Collections\ArrayCollection(); |
| 291 | 291 | ||
| 292 | foreach($this->hasInscripcion as $inscrita) | 292 | foreach($this->hasInscripcion as $inscrita) |
| 293 | { | 293 | { |
| 294 | - $idOfertaAcademica[] = $inscrita->getIdOfertaAcademica(); | 294 | + $idSeccion[] = $inscrita->getIdSeccion(); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | - return $idOfertaAcademica; | 297 | + return $idSeccion; |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | 300 | ||
| 301 | /** | 301 | /** |
| 302 | - * Set idOfertaAcademica | 302 | + * Set idSeccion |
| 303 | * | 303 | * |
| 304 | */ | 304 | */ |
| 305 | - public function setIdOfertaAcademica($idOfertaAcademica) | 305 | + public function setIdSeccion($idSeccion) |
| 306 | { | 306 | { |
| 307 | - foreach($idOfertaAcademica as $inscrita) | ||
| 308 | - { | ||
| 309 | - $inscripcion = new Inscripcion(); | ||
| 310 | - | 307 | + |
| 308 | + $inscripcion = new Inscripcion(); | ||
| 311 | $inscripcion->setIdEstadoAcademico($this); | 309 | $inscripcion->setIdEstadoAcademico($this); |
| 312 | - $inscripcion->setIdOfertaAcademica($inscrita); | 310 | + $inscripcion->setIdSeccion($idSeccion); |
| 313 | $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); | 311 | $inscripcion->setIdEstatus($this->getIdDocenteServicio()->getIdEstatus()); |
| 314 | - | ||
| 315 | $this->addHasInscripcion($inscripcion); | 312 | $this->addHasInscripcion($inscripcion); |
| 316 | - } | 313 | + |
| 317 | 314 | ||
| 318 | } | 315 | } |
| 319 | } | 316 | } |
src/AppBundle/Entity/Inscripcion.php
| @@ -29,10 +29,10 @@ class Inscripcion | @@ -29,10 +29,10 @@ class Inscripcion | ||
| 29 | private $idEstadoAcademico; | 29 | private $idEstadoAcademico; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") | 32 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Seccion", inversedBy="hasInscripcion") |
| 33 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | 33 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") |
| 34 | * */ | 34 | * */ |
| 35 | - private $idOfertaAcademica; | 35 | + private $idSeccion; |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| @@ -47,6 +47,8 @@ class Inscripcion | @@ -47,6 +47,8 @@ class Inscripcion | ||
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | 49 | ||
| 50 | + | ||
| 51 | + | ||
| 50 | /** | 52 | /** |
| 51 | * Get id | 53 | * Get id |
| 52 | * | 54 | * |
| @@ -81,26 +83,26 @@ class Inscripcion | @@ -81,26 +83,26 @@ class Inscripcion | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | /** | 85 | /** |
| 84 | - * Set idOfertaAcademica | 86 | + * Set idSeccion |
| 85 | * | 87 | * |
| 86 | - * @param \AppBundle\Entity\OfertaAcademica $idOfertaAcademica | 88 | + * @param \AppBundle\Entity\Seccion $idSeccion |
| 87 | * @return Inscripcion | 89 | * @return Inscripcion |
| 88 | */ | 90 | */ |
| 89 | - public function setIdOfertaAcademica(\AppBundle\Entity\OfertaAcademica $idOfertaAcademica = null) | 91 | + public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion = null) |
| 90 | { | 92 | { |
| 91 | - $this->idOfertaAcademica = $idOfertaAcademica; | 93 | + $this->idSeccion = $idSeccion; |
| 92 | 94 | ||
| 93 | return $this; | 95 | return $this; |
| 94 | } | 96 | } |
| 95 | 97 | ||
| 96 | /** | 98 | /** |
| 97 | - * Get idOfertaAcademica | 99 | + * Get idSeccion |
| 98 | * | 100 | * |
| 99 | - * @return \AppBundle\Entity\OfertaAcademica | 101 | + * @return \AppBundle\Entity\Seccion |
| 100 | */ | 102 | */ |
| 101 | - public function getIdOfertaAcademica() | 103 | + public function getIdSeccion() |
| 102 | { | 104 | { |
| 103 | - return $this->idOfertaAcademica; | 105 | + return $this->idSeccion; |
| 104 | } | 106 | } |
| 105 | 107 | ||
| 106 | /** | 108 | /** |
| @@ -125,9 +127,4 @@ class Inscripcion | @@ -125,9 +127,4 @@ class Inscripcion | ||
| 125 | { | 127 | { |
| 126 | return $this->idEstatus; | 128 | return $this->idEstatus; |
| 127 | } | 129 | } |
| 128 | - | ||
| 129 | - | ||
| 130 | - public function __toString() { | ||
| 131 | - return $this->getIdOfertaAcademica()->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); | ||
| 132 | - } | ||
| 133 | } | 130 | } |
src/AppBundle/Entity/Inscripcion.php~
| @@ -32,7 +32,7 @@ class Inscripcion | @@ -32,7 +32,7 @@ class Inscripcion | ||
| 32 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") | 32 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\OfertaAcademica", inversedBy="hasInscripcion") |
| 33 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | 33 | * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") |
| 34 | * */ | 34 | * */ |
| 35 | - private $idOfertaAcademica; | 35 | + private $idSeccion; |
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | /** | 38 | /** |
| @@ -46,4 +46,6 @@ class Inscripcion | @@ -46,4 +46,6 @@ class Inscripcion | ||
| 46 | private $idEstatus; | 46 | private $idEstatus; |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | + | ||
| 50 | + | ||
| 49 | } | 51 | } |
src/AppBundle/Entity/MallaCurricularUc.php
src/AppBundle/Entity/OfertaAcademica.php
| @@ -7,24 +7,23 @@ use Doctrine\ORM\Mapping as ORM; | @@ -7,24 +7,23 @@ use Doctrine\ORM\Mapping as ORM; | ||
| 7 | /** | 7 | /** |
| 8 | * OfertaAcademica | 8 | * OfertaAcademica |
| 9 | * | 9 | * |
| 10 | - * @ORM\Table(name="oferta_academica", uniqueConstraints={@ORM\UniqueConstraint(name="i_oferta_academica", columns={"id_malla_curricular_uc", "id_seccion", "id_oferta_malla_curricular"})}, indexes={@ORM\Index(name="fki_oferta_malla_curricular_oferta_academica", columns={"id_oferta_malla_curricular"}), @ORM\Index(name="fki_seccion_oferta_academica", columns={"id_seccion"}), @ORM\Index(name="fki_turno_oferta_academica", columns={"id_turno"}), @ORM\Index(name="fki_rol_institucion_oferta_academica", columns={"id_rol_institucion"}), @ORM\Index(name="fki_malla_curricular_uc_oferta_academica", columns={"id_malla_curricular_uc"})}) | 10 | + * @ORM\Table(name="oferta_academica", |
| 11 | + * uniqueConstraints= | ||
| 12 | + * {@ORM\UniqueConstraint(name="i_oferta_academica", | ||
| 13 | + * columns={"id_malla_curricular_uc", "id_oferta_malla_curricular"}) | ||
| 14 | + * }, | ||
| 15 | + * indexes={ | ||
| 16 | + * @ORM\Index(name="fki_oferta_malla_curricular_oferta_academica", | ||
| 17 | + * columns={"id_oferta_malla_curricular"}), | ||
| 18 | + * @ORM\Index(name="fki_malla_curricular_uc_oferta_academica", | ||
| 19 | + * columns={"id_malla_curricular_uc"}) | ||
| 20 | + * } | ||
| 21 | + * ) | ||
| 11 | * @ORM\Entity | 22 | * @ORM\Entity |
| 12 | */ | 23 | */ |
| 13 | class OfertaAcademica | 24 | class OfertaAcademica |
| 14 | { | 25 | { |
| 15 | - /** | ||
| 16 | - * @var string | ||
| 17 | - * | ||
| 18 | - * @ORM\Column(name="aula", type="string", length=10, nullable=true, options={"comment" = "Indica el aula donde se va a dictar la unidad curricular (EN OBSERVACION, ESTE VALOR PUEDE SER VARIABLE PARA UNA MISMA OFERTA)"}) | ||
| 19 | - */ | ||
| 20 | - private $aula; | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * @var string | ||
| 24 | - * | ||
| 25 | - * @ORM\Column(name="cupo", type="decimal", precision=2, scale=0, nullable=false, options={"comment" = "Indica el numero de cupos para esa oferta"}) | ||
| 26 | - */ | ||
| 27 | - private $cupo; | 26 | + |
| 28 | 27 | ||
| 29 | /** | 28 | /** |
| 30 | * @var integer | 29 | * @var integer |
| @@ -48,41 +47,14 @@ class OfertaAcademica | @@ -48,41 +47,14 @@ class OfertaAcademica | ||
| 48 | private $idMallaCurricularUc; | 47 | private $idMallaCurricularUc; |
| 49 | 48 | ||
| 50 | 49 | ||
| 51 | - /** | ||
| 52 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idOfertaAcademica" , cascade={"all"}) | ||
| 53 | - * */ | ||
| 54 | - protected $hasInscripcion; | ||
| 55 | 50 | ||
| 56 | 51 | ||
| 57 | /** | 52 | /** |
| 58 | - * @var \AppBundle\Entity\Turno | ||
| 59 | - * | ||
| 60 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Turno") | ||
| 61 | - * @ORM\JoinColumns({ | ||
| 62 | - * @ORM\JoinColumn(name="id_turno", referencedColumnName="id", nullable=false) | ||
| 63 | - * }) | ||
| 64 | - */ | ||
| 65 | - private $idTurno; | ||
| 66 | - | ||
| 67 | - /** | ||
| 68 | - * @var \AppBundle\Entity\Seccion | ||
| 69 | - * | ||
| 70 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Seccion") | ||
| 71 | - * @ORM\JoinColumns({ | ||
| 72 | - * @ORM\JoinColumn(name="id_seccion", referencedColumnName="id", nullable=false) | ||
| 73 | - * }) | 53 | + * @ORM\OneToMany(targetEntity="Seccion", mappedBy="ofertaAcademica") |
| 74 | */ | 54 | */ |
| 75 | - private $idSeccion; | 55 | + private $seccion; |
| 76 | 56 | ||
| 77 | - /** | ||
| 78 | - * @var \AppBundle\Entity\RolInstitucion | ||
| 79 | - * | ||
| 80 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion") | ||
| 81 | - * @ORM\JoinColumns({ | ||
| 82 | - * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false) | ||
| 83 | - * }) | ||
| 84 | - */ | ||
| 85 | - private $idRolInstitucion; | 57 | + |
| 86 | 58 | ||
| 87 | /** | 59 | /** |
| 88 | * @var \AppBundle\Entity\OfertaMallaCurricular | 60 | * @var \AppBundle\Entity\OfertaMallaCurricular |
| @@ -94,60 +66,12 @@ class OfertaAcademica | @@ -94,60 +66,12 @@ class OfertaAcademica | ||
| 94 | */ | 66 | */ |
| 95 | private $idOfertaMallaCurricular; | 67 | private $idOfertaMallaCurricular; |
| 96 | 68 | ||
| 97 | - | ||
| 98 | - | ||
| 99 | /** | 69 | /** |
| 100 | * Constructor | 70 | * Constructor |
| 101 | */ | 71 | */ |
| 102 | public function __construct() | 72 | public function __construct() |
| 103 | { | 73 | { |
| 104 | - $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - /** | ||
| 108 | - * Set aula | ||
| 109 | - * | ||
| 110 | - * @param string $aula | ||
| 111 | - * @return OfertaAcademica | ||
| 112 | - */ | ||
| 113 | - public function setAula($aula) | ||
| 114 | - { | ||
| 115 | - $this->aula = $aula; | ||
| 116 | - | ||
| 117 | - return $this; | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - /** | ||
| 121 | - * Get aula | ||
| 122 | - * | ||
| 123 | - * @return string | ||
| 124 | - */ | ||
| 125 | - public function getAula() | ||
| 126 | - { | ||
| 127 | - return $this->aula; | ||
| 128 | - } | ||
| 129 | - | ||
| 130 | - /** | ||
| 131 | - * Set cupo | ||
| 132 | - * | ||
| 133 | - * @param string $cupo | ||
| 134 | - * @return OfertaAcademica | ||
| 135 | - */ | ||
| 136 | - public function setCupo($cupo) | ||
| 137 | - { | ||
| 138 | - $this->cupo = $cupo; | ||
| 139 | - | ||
| 140 | - return $this; | ||
| 141 | - } | ||
| 142 | - | ||
| 143 | - /** | ||
| 144 | - * Get cupo | ||
| 145 | - * | ||
| 146 | - * @return string | ||
| 147 | - */ | ||
| 148 | - public function getCupo() | ||
| 149 | - { | ||
| 150 | - return $this->cupo; | 74 | + $this->seccion = new \Doctrine\Common\Collections\ArrayCollection(); |
| 151 | } | 75 | } |
| 152 | 76 | ||
| 153 | /** | 77 | /** |
| @@ -184,105 +108,36 @@ class OfertaAcademica | @@ -184,105 +108,36 @@ class OfertaAcademica | ||
| 184 | } | 108 | } |
| 185 | 109 | ||
| 186 | /** | 110 | /** |
| 187 | - * Add hasInscripcion | 111 | + * Add seccion |
| 188 | * | 112 | * |
| 189 | - * @param \AppBundle\Entity\Inscripcion $hasInscripcion | 113 | + * @param \AppBundle\Entity\Seccion $seccion |
| 190 | * @return OfertaAcademica | 114 | * @return OfertaAcademica |
| 191 | */ | 115 | */ |
| 192 | - public function addHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | 116 | + public function addSeccion(\AppBundle\Entity\Seccion $seccion) |
| 193 | { | 117 | { |
| 194 | - $this->hasInscripcion[] = $hasInscripcion; | 118 | + $this->seccion[] = $seccion; |
| 195 | 119 | ||
| 196 | return $this; | 120 | return $this; |
| 197 | } | 121 | } |
| 198 | 122 | ||
| 199 | /** | 123 | /** |
| 200 | - * Remove hasInscripcion | 124 | + * Remove seccion |
| 201 | * | 125 | * |
| 202 | - * @param \AppBundle\Entity\Inscripcion $hasInscripcion | 126 | + * @param \AppBundle\Entity\Seccion $seccion |
| 203 | */ | 127 | */ |
| 204 | - public function removeHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | 128 | + public function removeSeccion(\AppBundle\Entity\Seccion $seccion) |
| 205 | { | 129 | { |
| 206 | - $this->hasInscripcion->removeElement($hasInscripcion); | 130 | + $this->seccion->removeElement($seccion); |
| 207 | } | 131 | } |
| 208 | 132 | ||
| 209 | /** | 133 | /** |
| 210 | - * Get hasInscripcion | 134 | + * Get seccion |
| 211 | * | 135 | * |
| 212 | * @return \Doctrine\Common\Collections\Collection | 136 | * @return \Doctrine\Common\Collections\Collection |
| 213 | */ | 137 | */ |
| 214 | - public function getHasInscripcion() | ||
| 215 | - { | ||
| 216 | - return $this->hasInscripcion; | ||
| 217 | - } | ||
| 218 | - | ||
| 219 | - /** | ||
| 220 | - * Set idTurno | ||
| 221 | - * | ||
| 222 | - * @param \AppBundle\Entity\Turno $idTurno | ||
| 223 | - * @return OfertaAcademica | ||
| 224 | - */ | ||
| 225 | - public function setIdTurno(\AppBundle\Entity\Turno $idTurno) | ||
| 226 | - { | ||
| 227 | - $this->idTurno = $idTurno; | ||
| 228 | - | ||
| 229 | - return $this; | ||
| 230 | - } | ||
| 231 | - | ||
| 232 | - /** | ||
| 233 | - * Get idTurno | ||
| 234 | - * | ||
| 235 | - * @return \AppBundle\Entity\Turno | ||
| 236 | - */ | ||
| 237 | - public function getIdTurno() | ||
| 238 | - { | ||
| 239 | - return $this->idTurno; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - /** | ||
| 243 | - * Set idSeccion | ||
| 244 | - * | ||
| 245 | - * @param \AppBundle\Entity\Seccion $idSeccion | ||
| 246 | - * @return OfertaAcademica | ||
| 247 | - */ | ||
| 248 | - public function setIdSeccion(\AppBundle\Entity\Seccion $idSeccion) | ||
| 249 | - { | ||
| 250 | - $this->idSeccion = $idSeccion; | ||
| 251 | - | ||
| 252 | - return $this; | ||
| 253 | - } | ||
| 254 | - | ||
| 255 | - /** | ||
| 256 | - * Get idSeccion | ||
| 257 | - * | ||
| 258 | - * @return \AppBundle\Entity\Seccion | ||
| 259 | - */ | ||
| 260 | - public function getIdSeccion() | ||
| 261 | - { | ||
| 262 | - return $this->idSeccion; | ||
| 263 | - } | ||
| 264 | - | ||
| 265 | - /** | ||
| 266 | - * Set idRolInstitucion | ||
| 267 | - * | ||
| 268 | - * @param \AppBundle\Entity\RolInstitucion $idRolInstitucion | ||
| 269 | - * @return OfertaAcademica | ||
| 270 | - */ | ||
| 271 | - public function setIdRolInstitucion(\AppBundle\Entity\RolInstitucion $idRolInstitucion) | ||
| 272 | - { | ||
| 273 | - $this->idRolInstitucion = $idRolInstitucion; | ||
| 274 | - | ||
| 275 | - return $this; | ||
| 276 | - } | ||
| 277 | - | ||
| 278 | - /** | ||
| 279 | - * Get idRolInstitucion | ||
| 280 | - * | ||
| 281 | - * @return \AppBundle\Entity\RolInstitucion | ||
| 282 | - */ | ||
| 283 | - public function getIdRolInstitucion() | 138 | + public function getSeccion() |
| 284 | { | 139 | { |
| 285 | - return $this->idRolInstitucion; | 140 | + return $this->seccion; |
| 286 | } | 141 | } |
| 287 | 142 | ||
| 288 | /** | 143 | /** |
| @@ -309,8 +164,6 @@ class OfertaAcademica | @@ -309,8 +164,6 @@ class OfertaAcademica | ||
| 309 | } | 164 | } |
| 310 | 165 | ||
| 311 | public function __toString() { | 166 | public function __toString() { |
| 312 | - return | ||
| 313 | - $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre() | ||
| 314 | - . " Seccion: " . $this->getIdSeccion()->getNombre(); | 167 | + return $this->getIdMallaCurricularUc()->getIdUnidadCurricularVolumen()->getIdUnidadCurricular()->getNombre(); |
| 315 | } | 168 | } |
| 316 | } | 169 | } |
src/AppBundle/Entity/OfertaAcademica.php~
| @@ -12,19 +12,7 @@ use Doctrine\ORM\Mapping as ORM; | @@ -12,19 +12,7 @@ use Doctrine\ORM\Mapping as ORM; | ||
| 12 | */ | 12 | */ |
| 13 | class OfertaAcademica | 13 | class OfertaAcademica |
| 14 | { | 14 | { |
| 15 | - /** | ||
| 16 | - * @var string | ||
| 17 | - * | ||
| 18 | - * @ORM\Column(name="aula", type="string", length=10, nullable=true, options={"comment" = "Indica el aula donde se va a dictar la unidad curricular (EN OBSERVACION, ESTE VALOR PUEDE SER VARIABLE PARA UNA MISMA OFERTA)"}) | ||
| 19 | - */ | ||
| 20 | - private $aula; | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * @var string | ||
| 24 | - * | ||
| 25 | - * @ORM\Column(name="cupo", type="decimal", precision=2, scale=0, nullable=false, options={"comment" = "Indica el numero de cupos para esa oferta"}) | ||
| 26 | - */ | ||
| 27 | - private $cupo; | 15 | + |
| 28 | 16 | ||
| 29 | /** | 17 | /** |
| 30 | * @var integer | 18 | * @var integer |
| @@ -48,41 +36,14 @@ class OfertaAcademica | @@ -48,41 +36,14 @@ class OfertaAcademica | ||
| 48 | private $idMallaCurricularUc; | 36 | private $idMallaCurricularUc; |
| 49 | 37 | ||
| 50 | 38 | ||
| 51 | - /** | ||
| 52 | - * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idOfertaAcademica" , cascade={"all"}) | ||
| 53 | - * */ | ||
| 54 | - protected $hasInscripcion; | ||
| 55 | 39 | ||
| 56 | 40 | ||
| 57 | /** | 41 | /** |
| 58 | - * @var \AppBundle\Entity\Turno | ||
| 59 | - * | ||
| 60 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Turno") | ||
| 61 | - * @ORM\JoinColumns({ | ||
| 62 | - * @ORM\JoinColumn(name="id_turno", referencedColumnName="id", nullable=false) | ||
| 63 | - * }) | ||
| 64 | - */ | ||
| 65 | - private $idTurno; | ||
| 66 | - | ||
| 67 | - /** | ||
| 68 | - * @var \AppBundle\Entity\Seccion | ||
| 69 | - * | ||
| 70 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Seccion") | ||
| 71 | - * @ORM\JoinColumns({ | ||
| 72 | - * @ORM\JoinColumn(name="id_seccion", referencedColumnName="id", nullable=false) | ||
| 73 | - * }) | 42 | + * @ORM\OneToMany(targetEntity="Seccion", mappedBy="ofertaAcademica") |
| 74 | */ | 43 | */ |
| 75 | - private $idSeccion; | 44 | + private $seccion; |
| 76 | 45 | ||
| 77 | - /** | ||
| 78 | - * @var \AppBundle\Entity\RolInstitucion | ||
| 79 | - * | ||
| 80 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion") | ||
| 81 | - * @ORM\JoinColumns({ | ||
| 82 | - * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false) | ||
| 83 | - * }) | ||
| 84 | - */ | ||
| 85 | - private $idRolInstitucion; | 46 | + |
| 86 | 47 | ||
| 87 | /** | 48 | /** |
| 88 | * @var \AppBundle\Entity\OfertaMallaCurricular | 49 | * @var \AppBundle\Entity\OfertaMallaCurricular |
| @@ -94,6 +55,4 @@ class OfertaAcademica | @@ -94,6 +55,4 @@ class OfertaAcademica | ||
| 94 | */ | 55 | */ |
| 95 | private $idOfertaMallaCurricular; | 56 | private $idOfertaMallaCurricular; |
| 96 | 57 | ||
| 97 | - | ||
| 98 | - | ||
| 99 | } | 58 | } |
src/AppBundle/Entity/Seccion.php
| @@ -7,7 +7,19 @@ use Doctrine\ORM\Mapping as ORM; | @@ -7,7 +7,19 @@ use Doctrine\ORM\Mapping as ORM; | ||
| 7 | /** | 7 | /** |
| 8 | * Seccion | 8 | * Seccion |
| 9 | * | 9 | * |
| 10 | - * @ORM\Table(name="seccion", uniqueConstraints={@ORM\UniqueConstraint(name="uq_seccion", columns={"nombre"})}) | 10 | + * @ORM\Table(name="seccion", |
| 11 | + * uniqueConstraints= | ||
| 12 | + * {@ORM\UniqueConstraint(name="uq_seccion", | ||
| 13 | + * columns={"nombre", "id_turno"}) | ||
| 14 | + * }, | ||
| 15 | + * indexes={ | ||
| 16 | + * @ORM\Index(name="fki_turno_oferta_academica", | ||
| 17 | + * columns={"id_turno"}), | ||
| 18 | + * @ORM\Index(name="fki_rol_institucion_oferta_academica", | ||
| 19 | + * columns={"id_rol_institucion"}), | ||
| 20 | + | ||
| 21 | + * } | ||
| 22 | + * ) | ||
| 11 | * @ORM\Entity | 23 | * @ORM\Entity |
| 12 | */ | 24 | */ |
| 13 | class Seccion | 25 | class Seccion |
| @@ -18,6 +30,46 @@ class Seccion | @@ -18,6 +30,46 @@ class Seccion | ||
| 18 | * @ORM\Column(name="nombre", type="string", length=20, nullable=false, options={"comment" = "nombre de la seccion"}) | 30 | * @ORM\Column(name="nombre", type="string", length=20, nullable=false, options={"comment" = "nombre de la seccion"}) |
| 19 | */ | 31 | */ |
| 20 | private $nombre; | 32 | private $nombre; |
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * @var string | ||
| 36 | + * | ||
| 37 | + * @ORM\Column(name="aula", type="string", length=10, nullable=true, options={"comment" = "Indica el aula donde se va a dictar la unidad curricular (EN OBSERVACION, ESTE VALOR PUEDE SER VARIABLE PARA UNA MISMA OFERTA)"}) | ||
| 38 | + */ | ||
| 39 | + private $aula; | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * @var string | ||
| 43 | + * | ||
| 44 | + * @ORM\Column(name="cupo", type="decimal", precision=2, scale=0, nullable=false, options={"comment" = "Indica el numero de cupos para esa oferta"}) | ||
| 45 | + */ | ||
| 46 | + private $cupo; | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idSeccion" , cascade={"all"}) | ||
| 50 | + * */ | ||
| 51 | + protected $hasInscripcion; | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + /** | ||
| 55 | + * @var \AppBundle\Entity\Turno | ||
| 56 | + * | ||
| 57 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Turno") | ||
| 58 | + * @ORM\JoinColumns({ | ||
| 59 | + * @ORM\JoinColumn(name="id_turno", referencedColumnName="id", nullable=false) | ||
| 60 | + * }) | ||
| 61 | + */ | ||
| 62 | + private $idTurno; | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * @var \AppBundle\Entity\RolInstitucion | ||
| 66 | + * | ||
| 67 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion") | ||
| 68 | + * @ORM\JoinColumns({ | ||
| 69 | + * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false) | ||
| 70 | + * }) | ||
| 71 | + */ | ||
| 72 | + private $idRolInstitucion; | ||
| 21 | 73 | ||
| 22 | /** | 74 | /** |
| 23 | * @var integer | 75 | * @var integer |
| @@ -28,8 +80,22 @@ class Seccion | @@ -28,8 +80,22 @@ class Seccion | ||
| 28 | * @ORM\SequenceGenerator(sequenceName="seccion_id_seq", allocationSize=1, initialValue=1) | 80 | * @ORM\SequenceGenerator(sequenceName="seccion_id_seq", allocationSize=1, initialValue=1) |
| 29 | */ | 81 | */ |
| 30 | private $id; | 82 | private $id; |
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * @ORM\ManyToOne(targetEntity="OfertaAcademica", inversedBy="seccion") | ||
| 86 | + * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | ||
| 87 | + */ | ||
| 88 | + private $ofertaAcademica; | ||
| 31 | 89 | ||
| 32 | 90 | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * Constructor | ||
| 94 | + */ | ||
| 95 | + public function __construct() | ||
| 96 | + { | ||
| 97 | + $this->hasInscripcion = new \Doctrine\Common\Collections\ArrayCollection(); | ||
| 98 | + } | ||
| 33 | 99 | ||
| 34 | /** | 100 | /** |
| 35 | * Set nombre | 101 | * Set nombre |
| @@ -55,6 +121,52 @@ class Seccion | @@ -55,6 +121,52 @@ class Seccion | ||
| 55 | } | 121 | } |
| 56 | 122 | ||
| 57 | /** | 123 | /** |
| 124 | + * Set aula | ||
| 125 | + * | ||
| 126 | + * @param string $aula | ||
| 127 | + * @return Seccion | ||
| 128 | + */ | ||
| 129 | + public function setAula($aula) | ||
| 130 | + { | ||
| 131 | + $this->aula = $aula; | ||
| 132 | + | ||
| 133 | + return $this; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * Get aula | ||
| 138 | + * | ||
| 139 | + * @return string | ||
| 140 | + */ | ||
| 141 | + public function getAula() | ||
| 142 | + { | ||
| 143 | + return $this->aula; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + /** | ||
| 147 | + * Set cupo | ||
| 148 | + * | ||
| 149 | + * @param string $cupo | ||
| 150 | + * @return Seccion | ||
| 151 | + */ | ||
| 152 | + public function setCupo($cupo) | ||
| 153 | + { | ||
| 154 | + $this->cupo = $cupo; | ||
| 155 | + | ||
| 156 | + return $this; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + /** | ||
| 160 | + * Get cupo | ||
| 161 | + * | ||
| 162 | + * @return string | ||
| 163 | + */ | ||
| 164 | + public function getCupo() | ||
| 165 | + { | ||
| 166 | + return $this->cupo; | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + /** | ||
| 58 | * Get id | 170 | * Get id |
| 59 | * | 171 | * |
| 60 | * @return integer | 172 | * @return integer |
| @@ -63,13 +175,116 @@ class Seccion | @@ -63,13 +175,116 @@ class Seccion | ||
| 63 | { | 175 | { |
| 64 | return $this->id; | 176 | return $this->id; |
| 65 | } | 177 | } |
| 178 | + | ||
| 179 | + /** | ||
| 180 | + * Add hasInscripcion | ||
| 181 | + * | ||
| 182 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | ||
| 183 | + * @return Seccion | ||
| 184 | + */ | ||
| 185 | + public function addHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | ||
| 186 | + { | ||
| 187 | + $this->hasInscripcion[] = $hasInscripcion; | ||
| 188 | + | ||
| 189 | + return $this; | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + /** | ||
| 193 | + * Remove hasInscripcion | ||
| 194 | + * | ||
| 195 | + * @param \AppBundle\Entity\Inscripcion $hasInscripcion | ||
| 196 | + */ | ||
| 197 | + public function removeHasInscripcion(\AppBundle\Entity\Inscripcion $hasInscripcion) | ||
| 198 | + { | ||
| 199 | + $this->hasInscripcion->removeElement($hasInscripcion); | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + /** | ||
| 203 | + * Get hasInscripcion | ||
| 204 | + * | ||
| 205 | + * @return \Doctrine\Common\Collections\Collection | ||
| 206 | + */ | ||
| 207 | + public function getHasInscripcion() | ||
| 208 | + { | ||
| 209 | + return $this->hasInscripcion; | ||
| 210 | + } | ||
| 211 | + | ||
| 212 | + /** | ||
| 213 | + * Set idTurno | ||
| 214 | + * | ||
| 215 | + * @param \AppBundle\Entity\Turno $idTurno | ||
| 216 | + * @return Seccion | ||
| 217 | + */ | ||
| 218 | + public function setIdTurno(\AppBundle\Entity\Turno $idTurno) | ||
| 219 | + { | ||
| 220 | + $this->idTurno = $idTurno; | ||
| 221 | + | ||
| 222 | + return $this; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + /** | ||
| 226 | + * Get idTurno | ||
| 227 | + * | ||
| 228 | + * @return \AppBundle\Entity\Turno | ||
| 229 | + */ | ||
| 230 | + public function getIdTurno() | ||
| 231 | + { | ||
| 232 | + return $this->idTurno; | ||
| 233 | + } | ||
| 234 | + | ||
| 235 | + /** | ||
| 236 | + * Set idRolInstitucion | ||
| 237 | + * | ||
| 238 | + * @param \AppBundle\Entity\RolInstitucion $idRolInstitucion | ||
| 239 | + * @return Seccion | ||
| 240 | + */ | ||
| 241 | + public function setIdRolInstitucion(\AppBundle\Entity\RolInstitucion $idRolInstitucion) | ||
| 242 | + { | ||
| 243 | + $this->idRolInstitucion = $idRolInstitucion; | ||
| 244 | + | ||
| 245 | + return $this; | ||
| 246 | + } | ||
| 247 | + | ||
| 248 | + /** | ||
| 249 | + * Get idRolInstitucion | ||
| 250 | + * | ||
| 251 | + * @return \AppBundle\Entity\RolInstitucion | ||
| 252 | + */ | ||
| 253 | + public function getIdRolInstitucion() | ||
| 254 | + { | ||
| 255 | + return $this->idRolInstitucion; | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + /** | ||
| 259 | + * Set ofertaAcademica | ||
| 260 | + * | ||
| 261 | + * @param \AppBundle\Entity\OfertaAcademica $ofertaAcademica | ||
| 262 | + * @return Seccion | ||
| 263 | + */ | ||
| 264 | + public function setOfertaAcademica(\AppBundle\Entity\OfertaAcademica $ofertaAcademica = null) | ||
| 265 | + { | ||
| 266 | + $this->ofertaAcademica = $ofertaAcademica; | ||
| 267 | + | ||
| 268 | + return $this; | ||
| 269 | + } | ||
| 270 | + | ||
| 271 | + /** | ||
| 272 | + * Get ofertaAcademica | ||
| 273 | + * | ||
| 274 | + * @return \AppBundle\Entity\OfertaAcademica | ||
| 275 | + */ | ||
| 276 | + public function getOfertaAcademica() | ||
| 277 | + { | ||
| 278 | + return $this->ofertaAcademica; | ||
| 279 | + } | ||
| 66 | 280 | ||
| 67 | /** | 281 | /** |
| 68 | * | 282 | * |
| 69 | * @return string | 283 | * @return string |
| 70 | */ | 284 | */ |
| 71 | 285 | ||
| 72 | - public function __toString() { | 286 | + public function __toString() |
| 287 | + { | ||
| 73 | return $this->getNombre(); | 288 | return $this->getNombre(); |
| 74 | } | 289 | } |
| 75 | -} | ||
| 76 | \ No newline at end of file | 290 | \ No newline at end of file |
| 291 | +} |
src/AppBundle/Entity/Seccion.php~
| @@ -0,0 +1,90 @@ | @@ -0,0 +1,90 @@ | ||
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace AppBundle\Entity; | ||
| 4 | + | ||
| 5 | +use Doctrine\ORM\Mapping as ORM; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Seccion | ||
| 9 | + * | ||
| 10 | + * @ORM\Table(name="seccion", uniqueConstraints={@ORM\UniqueConstraint(name="uq_seccion", columns={"nombre"})}) | ||
| 11 | + * @ORM\Entity | ||
| 12 | + */ | ||
| 13 | +class Seccion | ||
| 14 | +{ | ||
| 15 | + /** | ||
| 16 | + * @var string | ||
| 17 | + * | ||
| 18 | + * @ORM\Column(name="nombre", type="string", length=20, nullable=false, options={"comment" = "nombre de la seccion"}) | ||
| 19 | + */ | ||
| 20 | + private $nombre; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * @var string | ||
| 24 | + * | ||
| 25 | + * @ORM\Column(name="aula", type="string", length=10, nullable=true, options={"comment" = "Indica el aula donde se va a dictar la unidad curricular (EN OBSERVACION, ESTE VALOR PUEDE SER VARIABLE PARA UNA MISMA OFERTA)"}) | ||
| 26 | + */ | ||
| 27 | + private $aula; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * @var string | ||
| 31 | + * | ||
| 32 | + * @ORM\Column(name="cupo", type="decimal", precision=2, scale=0, nullable=false, options={"comment" = "Indica el numero de cupos para esa oferta"}) | ||
| 33 | + */ | ||
| 34 | + private $cupo; | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * @ORM\OneToMany(targetEntity="AppBundle\Entity\Inscripcion" , mappedBy="idOfertaAcademica" , cascade={"all"}) | ||
| 38 | + * */ | ||
| 39 | + protected $hasInscripcion; | ||
| 40 | + | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * @var \AppBundle\Entity\Turno | ||
| 44 | + * | ||
| 45 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Turno") | ||
| 46 | + * @ORM\JoinColumns({ | ||
| 47 | + * @ORM\JoinColumn(name="id_turno", referencedColumnName="id", nullable=false) | ||
| 48 | + * }) | ||
| 49 | + */ | ||
| 50 | + private $idTurno; | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * @var \AppBundle\Entity\RolInstitucion | ||
| 54 | + * | ||
| 55 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion") | ||
| 56 | + * @ORM\JoinColumns({ | ||
| 57 | + * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false) | ||
| 58 | + * }) | ||
| 59 | + */ | ||
| 60 | + private $idRolInstitucion; | ||
| 61 | + | ||
| 62 | + /** | ||
| 63 | + * @var integer | ||
| 64 | + * | ||
| 65 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador de las seccion"}) | ||
| 66 | + * @ORM\Id | ||
| 67 | + * @ORM\GeneratedValue(strategy="IDENTITY") | ||
| 68 | + * @ORM\SequenceGenerator(sequenceName="seccion_id_seq", allocationSize=1, initialValue=1) | ||
| 69 | + */ | ||
| 70 | + private $id; | ||
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * @ORM\ManyToOne(targetEntity="OfertaAcademica", inversedBy="seccion") | ||
| 74 | + * @ORM\JoinColumn(name="oferta_academica_id", referencedColumnName="id") | ||
| 75 | + */ | ||
| 76 | + private $ofertaAcademica; | ||
| 77 | + | ||
| 78 | + | ||
| 79 | + | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + /** | ||
| 83 | + * | ||
| 84 | + * @return string | ||
| 85 | + */ | ||
| 86 | + | ||
| 87 | + public function __toString() { | ||
| 88 | + return $this->getNombre(); | ||
| 89 | + } | ||
| 90 | +} | ||
| 0 | \ No newline at end of file | 91 | \ No newline at end of file |
src/AppBundle/Entity/UnidadCurricular.php
| @@ -161,7 +161,8 @@ class UnidadCurricular | @@ -161,7 +161,8 @@ class UnidadCurricular | ||
| 161 | * @return string | 161 | * @return string |
| 162 | */ | 162 | */ |
| 163 | 163 | ||
| 164 | - public function __toString() { | 164 | + public function __toString() |
| 165 | + { | ||
| 165 | return $this->getNombre(); | 166 | return $this->getNombre(); |
| 166 | } | 167 | } |
| 167 | } | 168 | } |
src/AppBundle/Entity/UnidadCurricularVolumen.php
| @@ -101,4 +101,8 @@ class UnidadCurricularVolumen | @@ -101,4 +101,8 @@ class UnidadCurricularVolumen | ||
| 101 | { | 101 | { |
| 102 | return $this->idUnidadCurricular; | 102 | return $this->idUnidadCurricular; |
| 103 | } | 103 | } |
| 104 | + | ||
| 105 | + public function __toString() { | ||
| 106 | + return $this->getIdUnidadCurricular(); | ||
| 107 | + } | ||
| 104 | } | 108 | } |
src/AppBundle/Form/InscripcionEditType.php
| @@ -16,7 +16,7 @@ class InscripcionEditType extends AbstractType | @@ -16,7 +16,7 @@ class InscripcionEditType extends AbstractType | ||
| 16 | public function buildForm(FormBuilderInterface $builder, array $options) | 16 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 17 | { | 17 | { |
| 18 | $builder | 18 | $builder |
| 19 | - ->add('idOfertaAcademica') | 19 | + ->add('idSeccion') |
| 20 | ->add('idEstatus') | 20 | ->add('idEstatus') |
| 21 | 21 | ||
| 22 | ; | 22 | ; |
src/AppBundle/Form/InscripcionType.php
| @@ -26,10 +26,10 @@ class InscripcionType extends AbstractType | @@ -26,10 +26,10 @@ class InscripcionType extends AbstractType | ||
| 26 | /*->add('idRolInstitucion') | 26 | /*->add('idRolInstitucion') |
| 27 | ->add('idOfertaAcademica') | 27 | ->add('idOfertaAcademica') |
| 28 | ->add('idEstatus')*/ | 28 | ->add('idEstatus')*/ |
| 29 | - ->add('idOfertaAcademica', EntityType::class, array( | 29 | + ->add('idSeccion', EntityType::class, array( |
| 30 | 'class' => 'AppBundle:OfertaAcademica', | 30 | 'class' => 'AppBundle:OfertaAcademica', |
| 31 | 'expanded' => true, | 31 | 'expanded' => true, |
| 32 | - 'multiple' => true, | 32 | + 'multiple' => true, |
| 33 | 'query_builder' => function (EntityRepository $er) { | 33 | 'query_builder' => function (EntityRepository $er) { |
| 34 | return $er->createQueryBuilder('u') | 34 | return $er->createQueryBuilder('u') |
| 35 | ->orderBy('u.idMallaCurricularUc', 'ASC') | 35 | ->orderBy('u.idMallaCurricularUc', 'ASC') |
| @@ -40,7 +40,7 @@ class InscripcionType extends AbstractType | @@ -40,7 +40,7 @@ class InscripcionType extends AbstractType | ||
| 40 | 2 => 1, | 40 | 2 => 1, |
| 41 | )); | 41 | )); |
| 42 | ;}, | 42 | ;}, |
| 43 | - 'group_by' => 'idSeccion' | 43 | + |
| 44 | )) | 44 | )) |
| 45 | 45 | ||
| 46 | ; | 46 | ; |
src/AppBundle/Form/OfertaAcademicaType.php
| @@ -5,7 +5,6 @@ namespace AppBundle\Form; | @@ -5,7 +5,6 @@ namespace AppBundle\Form; | ||
| 5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
| 6 | use Symfony\Component\Form\FormBuilderInterface; | 6 | use Symfony\Component\Form\FormBuilderInterface; |
| 7 | use Symfony\Component\OptionsResolver\OptionsResolver; | 7 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 8 | -use Symfony\Bridge\Doctrine\Form\Type\EntityType; | ||
| 9 | 8 | ||
| 10 | class OfertaAcademicaType extends AbstractType | 9 | class OfertaAcademicaType extends AbstractType |
| 11 | { | 10 | { |
| @@ -15,31 +14,8 @@ class OfertaAcademicaType extends AbstractType | @@ -15,31 +14,8 @@ class OfertaAcademicaType extends AbstractType | ||
| 15 | */ | 14 | */ |
| 16 | public function buildForm(FormBuilderInterface $builder, array $options) | 15 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 17 | { | 16 | { |
| 18 | - $builder | ||
| 19 | - ->add('idMallaCurricularUc', EntityType::class, array( | ||
| 20 | - 'label' => false, | ||
| 21 | - 'placeholder' => 'Seleccione Unidad Curricular', | ||
| 22 | - 'class' => 'AppBundle:MallaCurricularUc', | ||
| 23 | - 'choice_label' => 'idUnidadCurricularVolumen.idUnidadCurricular', | ||
| 24 | - 'group_by' => function($val, $key, $index) { | ||
| 25 | - | ||
| 26 | - return "Trayecto: " . $val->getIdTrayectoTramoModalidadTipoUc()->getIdTrayecto() | ||
| 27 | - . " Tramo: " . $val->getIdTrayectoTramoModalidadTipoUc()->getIdTramo() . ". " | ||
| 28 | - . $val->getIdTrayectoTramoModalidadTipoUc()->getIdModalidad() | ||
| 29 | - . "( " . $val->getIdTrayectoTramoModalidadTipoUc()->getIdTipoUc() . " )" | ||
| 30 | - ; | ||
| 31 | - }, | ||
| 32 | - | ||
| 33 | - )) | ||
| 34 | - ->add('idTurno') | ||
| 35 | - ->add('idSeccion') | ||
| 36 | - ->add('aula') | ||
| 37 | - ->add('cupo') | ||
| 38 | - ->add('idRolInstitucion', EntityType::class, array( | ||
| 39 | - 'class' => 'AppBundle:RolInstitucion', | ||
| 40 | - 'placeholder' => 'Seleccione Docente a Dictar UC', | ||
| 41 | - 'label' => false | ||
| 42 | - )) | 17 | + $builder |
| 18 | + ->add('idMallaCurricularUc') | ||
| 43 | ->add('idOfertaMallaCurricular') | 19 | ->add('idOfertaMallaCurricular') |
| 44 | ; | 20 | ; |
| 45 | } | 21 | } |
src/AppBundle/Form/SeccionType.php
| @@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
| 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 | + | ||
| 9 | +class SeccionType extends AbstractType | ||
| 10 | +{ | ||
| 11 | + /** | ||
| 12 | + * @param FormBuilderInterface $builder | ||
| 13 | + * @param array $options | ||
| 14 | + */ | ||
| 15 | + public function buildForm(FormBuilderInterface $builder, array $options) | ||
| 16 | + { | ||
| 17 | + $builder | ||
| 18 | + ->add('nombre') | ||
| 19 | + ->add('aula') | ||
| 20 | + ->add('cupo') | ||
| 21 | + ->add('idTurno') | ||
| 22 | + ->add('idRolInstitucion') | ||
| 23 | + ->add('ofertaAcademica') | ||
| 24 | + ; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * @param OptionsResolver $resolver | ||
| 29 | + */ | ||
| 30 | + public function configureOptions(OptionsResolver $resolver) | ||
| 31 | + { | ||
| 32 | + $resolver->setDefaults(array( | ||
| 33 | + 'data_class' => 'AppBundle\Entity\Seccion' | ||
| 34 | + )); | ||
| 35 | + } | ||
| 36 | +} |
src/AppBundle/Tests/Controller/SeccionControllerTest.php
| @@ -0,0 +1,55 @@ | @@ -0,0 +1,55 @@ | ||
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +namespace AppBundle\Tests\Controller; | ||
| 4 | + | ||
| 5 | +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
| 6 | + | ||
| 7 | +class SeccionControllerTest 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/gestion/oferta_academica/seccion/'); | ||
| 17 | + $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /ceapp/gestion/oferta_academica/seccion/"); | ||
| 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_seccion[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_seccion[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 | +} |