Commit a805aeb27dbc38b87bb70283dc4f9fc6e7e38b3a
1 parent
c6c02b91d4
Exists in
master
corregidos errores menores por el renombramiento de la entidad TrayectoTramoModa…
…lidadTipo y creada la interfaz CRUD de Oferta Academica a groso modo
Showing
7 changed files
with
252 additions
and
31 deletions
Show diff stats
app/Resources/views/ofertaacademica/index.html.twig
| 1 | -{% extends 'base.html.twig' %} | |
| 1 | +{% extends 'base_app.html.twig' %} | |
| 2 | 2 | |
| 3 | 3 | {% block body %} |
| 4 | - <h1>OfertaAcademica list</h1> | |
| 5 | - | |
| 6 | - <table> | |
| 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"> | |
| 7 | 13 | <thead> |
| 8 | 14 | <tr> |
| 15 | + <th>Malla</th> | |
| 16 | + <th>Codigo UC</th> | |
| 17 | + <th>Unidad Curricular</th> | |
| 18 | + <th>Modalidad</th> | |
| 19 | + <th>Tipo</th> | |
| 9 | 20 | <th>Aula</th> |
| 10 | - <th>Cupo</th> | |
| 11 | - <th>Id</th> | |
| 21 | + <th>Cupo</th> | |
| 12 | 22 | <th>Actions</th> |
| 13 | 23 | </tr> |
| 14 | 24 | </thead> |
| 15 | 25 | <tbody> |
| 16 | 26 | {% for ofertaAcademica in ofertaAcademicas %} |
| 17 | 27 | <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> | |
| 18 | 33 | <td><a href="{{ path('ceapp_gestion_oferta_academica_show', { 'id': ofertaAcademica.id }) }}">{{ ofertaAcademica.aula }}</a></td> |
| 19 | - <td>{{ ofertaAcademica.cupo }}</td> | |
| 20 | - <td>{{ ofertaAcademica.id }}</td> | |
| 34 | + <td>{{ ofertaAcademica.cupo }}</td> | |
| 21 | 35 | <td> |
| 22 | 36 | <ul> |
| 23 | 37 | <li> |
| ... | ... | @@ -38,4 +52,9 @@ |
| 38 | 52 | <a href="{{ path('ceapp_gestion_oferta_academica_new') }}">Create a new entry</a> |
| 39 | 53 | </li> |
| 40 | 54 | </ul> |
| 55 | + </div> | |
| 56 | + | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + | |
| 41 | 60 | {% endblock %} | ... | ... |
app/Resources/views/ofertaacademica/new.html.twig
| 1 | -{% extends 'base.html.twig' %} | |
| 1 | +{% extends 'base_app.html.twig' %} | |
| 2 | 2 | |
| 3 | 3 | {% block body %} |
| 4 | - <h1>OfertaAcademica creation</h1> | |
| 5 | - | |
| 4 | + <div class="container"> | |
| 5 | + <h1>Creacion de Oferta Academica</h1> | |
| 6 | +{% form_theme form 'bootstrap_3_horizontal_layout.html.twig' %} | |
| 6 | 7 | {{ form_start(form) }} |
| 7 | 8 | {{ form_widget(form) }} |
| 8 | 9 | <input type="submit" value="Create" /> |
| ... | ... | @@ -13,4 +14,5 @@ |
| 13 | 14 | <a href="{{ path('ceapp_gestion_oferta_academica_index') }}">Back to the list</a> |
| 14 | 15 | </li> |
| 15 | 16 | </ul> |
| 17 | + </div> | |
| 16 | 18 | {% endblock %} | ... | ... |
src/AppBundle/Entity/MallaCurricularUc.php
| ... | ... | @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; |
| 7 | 7 | /** |
| 8 | 8 | * MallaCurricularUc |
| 9 | 9 | * |
| 10 | - * @ORM\Table(name="malla_curricular_uc", uniqueConstraints={@ORM\UniqueConstraint(name="i_malla_curricular", columns={"id_malla_curricular", "id_unidad_curricular_volumen"})}, indexes={@ORM\Index(name="fki_malla_curricular_malla_curricular_uc", columns={"id_malla_curricular"}), @ORM\Index(name="fki_trayecto_tramo_modalidad_malla_curricular_uc", columns={"id_trayecto_tramo_mod"}), @ORM\Index(name="fki_unidad_curricular_volumen_malla_curricular", columns={"id_unidad_curricular_volumen"})}) | |
| 10 | + * @ORM\Table(name="malla_curricular_uc", uniqueConstraints={@ORM\UniqueConstraint(name="i_malla_curricular", columns={"id_malla_curricular", "id_unidad_curricular_volumen"})}, indexes={@ORM\Index(name="fki_malla_curricular_malla_curricular_uc", columns={"id_malla_curricular"}), @ORM\Index(name="fki_trayecto_tramo_modalidad_malla_curricular_tipo_uc", columns={"id_trayecto_tramo_modalidad_tipo_uc"}), @ORM\Index(name="fki_unidad_curricular_volumen_malla_curricular", columns={"id_unidad_curricular_volumen"})}) | |
| 11 | 11 | * @ORM\Entity |
| 12 | 12 | */ |
| 13 | 13 | class MallaCurricularUc |
| ... | ... | @@ -44,10 +44,10 @@ class MallaCurricularUc |
| 44 | 44 | * |
| 45 | 45 | * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TrayectoTramoModalidadTipo") |
| 46 | 46 | * @ORM\JoinColumns({ |
| 47 | - * @ORM\JoinColumn(name="id_trayecto_tramo_mod", referencedColumnName="id", nullable=false) | |
| 47 | + * @ORM\JoinColumn(name="id_trayecto_tramo_modalidad_tipo_uc", referencedColumnName="id", nullable=false) | |
| 48 | 48 | * }) |
| 49 | 49 | */ |
| 50 | - private $idTrayectoTramoMod; | |
| 50 | + private $idTrayectoTramoModalidadTipoUc; | |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * @var \AppBundle\Entity\MallaCurricular |
| ... | ... | @@ -117,26 +117,26 @@ class MallaCurricularUc |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
| 120 | - * Set idTrayectoTramoMod | |
| 120 | + * Set idTrayectoTramoModalidadTipoUc | |
| 121 | 121 | * |
| 122 | - * @param \AppBundle\Entity\TrayectoTramoModalidadTipo $idTrayectoTramoMod | |
| 122 | + * @param \AppBundle\Entity\TrayectoTramoModalidadTipo $idTrayectoTramoModalidadTipoUc | |
| 123 | 123 | * @return MallaCurricularUc |
| 124 | 124 | */ |
| 125 | - public function setIdTrayectoTramoMod(\AppBundle\Entity\TrayectoTramoModalidadTipo $idTrayectoTramoMod) | |
| 125 | + public function setIdTrayectoTramoModalidadTipoUc(\AppBundle\Entity\TrayectoTramoModalidadTipo $idTrayectoTramoModalidadTipoUc) | |
| 126 | 126 | { |
| 127 | - $this->idTrayectoTramoMod = $idTrayectoTramoMod; | |
| 127 | + $this->idTrayectoTramoModalidadTipoUc = $idTrayectoTramoModalidadTipoUc; | |
| 128 | 128 | |
| 129 | 129 | return $this; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
| 133 | - * Get idTrayectoTramoMod | |
| 133 | + * Get idTrayectoTramoModalidadTipoUc | |
| 134 | 134 | * |
| 135 | 135 | * @return \AppBundle\Entity\TrayectoTramoModalidadTipo |
| 136 | 136 | */ |
| 137 | - public function getIdTrayectoTramoMod() | |
| 137 | + public function getIdTrayectoTramoModalidadTipoUc() | |
| 138 | 138 | { |
| 139 | - return $this->idTrayectoTramoMod; | |
| 139 | + return $this->idTrayectoTramoModalidadTipoUc; | |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
| ... | ... | @@ -161,4 +161,6 @@ class MallaCurricularUc |
| 161 | 161 | { |
| 162 | 162 | return $this->idMallaCurricular; |
| 163 | 163 | } |
| 164 | + | |
| 165 | + | |
| 164 | 166 | } | ... | ... |
src/AppBundle/Entity/MallaCurricularUc.php~
| ... | ... | @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; |
| 7 | 7 | /** |
| 8 | 8 | * MallaCurricularUc |
| 9 | 9 | * |
| 10 | - * @ORM\Table(name="malla_curricular_uc", uniqueConstraints={@ORM\UniqueConstraint(name="i_malla_curricular", columns={"id_malla_curricular", "id_unidad_curricular_volumen"})}, indexes={@ORM\Index(name="fki_malla_curricular_malla_curricular_uc", columns={"id_malla_curricular"}), @ORM\Index(name="fki_trayecto_tramo_modalidad_malla_curricular_uc", columns={"id_trayecto_tramo_mod"}), @ORM\Index(name="fki_unidad_curricular_volumen_malla_curricular", columns={"id_unidad_curricular_volumen"})}) | |
| 10 | + * @ORM\Table(name="malla_curricular_uc", uniqueConstraints={@ORM\UniqueConstraint(name="i_malla_curricular", columns={"id_malla_curricular", "id_unidad_curricular_volumen"})}, indexes={@ORM\Index(name="fki_malla_curricular_malla_curricular_uc", columns={"id_malla_curricular"}), @ORM\Index(name="fki_trayecto_tramo_modalidad_malla_curricular_tipo_uc", columns={"id_trayecto_tramo_modalidad_tipo_uc"}), @ORM\Index(name="fki_unidad_curricular_volumen_malla_curricular", columns={"id_unidad_curricular_volumen"})}) | |
| 11 | 11 | * @ORM\Entity |
| 12 | 12 | */ |
| 13 | 13 | class MallaCurricularUc |
| ... | ... | @@ -40,14 +40,14 @@ class MallaCurricularUc |
| 40 | 40 | private $idUnidadCurricularVolumen; |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * @var \AppBundle\Entity\TrayectoTramoModalidad | |
| 43 | + * @var \AppBundle\Entity\TrayectoTramoModalidadTipo | |
| 44 | 44 | * |
| 45 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TrayectoTramoModalidad") | |
| 45 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TrayectoTramoModalidadTipo") | |
| 46 | 46 | * @ORM\JoinColumns({ |
| 47 | - * @ORM\JoinColumn(name="id_trayecto_tramo_mod", referencedColumnName="id", nullable=false) | |
| 47 | + * @ORM\JoinColumn(name="id_trayecto_tramo_modalidad_tipo_uc", referencedColumnName="id", nullable=false) | |
| 48 | 48 | * }) |
| 49 | 49 | */ |
| 50 | - private $idTrayectoTramoMod; | |
| 50 | + private $idTrayectoTramoModalidadTipoUc; | |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * @var \AppBundle\Entity\MallaCurricular |
| ... | ... | @@ -59,4 +59,6 @@ class MallaCurricularUc |
| 59 | 59 | */ |
| 60 | 60 | private $idMallaCurricular; |
| 61 | 61 | |
| 62 | + | |
| 63 | + | |
| 62 | 64 | } | ... | ... |
src/AppBundle/Entity/TrayectoTramoModalidadTipo.php~
| ... | ... | @@ -0,0 +1,168 @@ |
| 1 | +<?php | |
| 2 | + | |
| 3 | +namespace AppBundle\Entity; | |
| 4 | + | |
| 5 | +use Doctrine\ORM\Mapping as ORM; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * TrayectoTramoModalidadTipo | |
| 9 | + * | |
| 10 | + * @ORM\Table(name="trayecto_tramo_modalidad_tipo_uc", uniqueConstraints={@ORM\UniqueConstraint(name="i_trayecto_tramo_modalidad_tipo_uc", columns={"id_trayecto", "id_tramo", "id_modalidad", "id_tipo_uc"})}, indexes={@ORM\Index(name="fki_modalidad", columns={"id_modalidad"}), @ORM\Index(name="fki_tramo_trayecto_tramo_modalidad", columns={"id_tramo"}), @ORM\Index(name="IDX_AE063967814981A6", columns={"id_trayecto"}), @ORM\Index(name="IDX_TIPO_UC", columns={"id_tipo_uc"})}) | |
| 11 | + * @ORM\Entity | |
| 12 | + */ | |
| 13 | +class TrayectoTramoModalidadTipo | |
| 14 | +{ | |
| 15 | + /** | |
| 16 | + * @var integer | |
| 17 | + * | |
| 18 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "identificador del trayecto_tramo_modalidad"}) | |
| 19 | + * @ORM\Id | |
| 20 | + * @ORM\GeneratedValue(strategy="IDENTITY") | |
| 21 | + * @ORM\SequenceGenerator(sequenceName="trayecto_tramo_modalidad_id_seq", allocationSize=1, initialValue=1) | |
| 22 | + */ | |
| 23 | + private $id; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * @var \AppBundle\Entity\Trayecto | |
| 27 | + * | |
| 28 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Trayecto") | |
| 29 | + * @ORM\JoinColumns({ | |
| 30 | + * @ORM\JoinColumn(name="id_trayecto", referencedColumnName="id", nullable=false) | |
| 31 | + * }) | |
| 32 | + */ | |
| 33 | + private $idTrayecto; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * @var \AppBundle\Entity\Tramo | |
| 37 | + * | |
| 38 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Tramo") | |
| 39 | + * @ORM\JoinColumns({ | |
| 40 | + * @ORM\JoinColumn(name="id_tramo", referencedColumnName="id", nullable=false) | |
| 41 | + * }) | |
| 42 | + */ | |
| 43 | + private $idTramo; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * @var \AppBundle\Entity\Modalidad | |
| 47 | + * | |
| 48 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Modalidad") | |
| 49 | + * @ORM\JoinColumns({ | |
| 50 | + * @ORM\JoinColumn(name="id_modalidad", referencedColumnName="id", nullable=false) | |
| 51 | + * }) | |
| 52 | + */ | |
| 53 | + private $idModalidad; | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * @var \AppBundle\Entity\TipoUc | |
| 57 | + * | |
| 58 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TipoUc") | |
| 59 | + * @ORM\JoinColumns({ | |
| 60 | + * @ORM\JoinColumn(name="id_tipo_uc", referencedColumnName="id", nullable=false) | |
| 61 | + * }) | |
| 62 | + */ | |
| 63 | + private $idTipoUc; | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * Get id | |
| 69 | + * | |
| 70 | + * @return integer | |
| 71 | + */ | |
| 72 | + public function getId() | |
| 73 | + { | |
| 74 | + return $this->id; | |
| 75 | + } | |
| 76 | + | |
| 77 | + /** | |
| 78 | + * Set idTrayecto | |
| 79 | + * | |
| 80 | + * @param \AppBundle\Entity\Trayecto $idTrayecto | |
| 81 | + * @return TrayectoTramoModalidadTipo | |
| 82 | + */ | |
| 83 | + public function setIdTrayecto(\AppBundle\Entity\Trayecto $idTrayecto) | |
| 84 | + { | |
| 85 | + $this->idTrayecto = $idTrayecto; | |
| 86 | + | |
| 87 | + return $this; | |
| 88 | + } | |
| 89 | + | |
| 90 | + /** | |
| 91 | + * Get idTrayecto | |
| 92 | + * | |
| 93 | + * @return \AppBundle\Entity\Trayecto | |
| 94 | + */ | |
| 95 | + public function getIdTrayecto() | |
| 96 | + { | |
| 97 | + return $this->idTrayecto; | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * Set idTramo | |
| 102 | + * | |
| 103 | + * @param \AppBundle\Entity\Tramo $idTramo | |
| 104 | + * @return TrayectoTramoModalidadTipo | |
| 105 | + */ | |
| 106 | + public function setIdTramo(\AppBundle\Entity\Tramo $idTramo) | |
| 107 | + { | |
| 108 | + $this->idTramo = $idTramo; | |
| 109 | + | |
| 110 | + return $this; | |
| 111 | + } | |
| 112 | + | |
| 113 | + /** | |
| 114 | + * Get idTramo | |
| 115 | + * | |
| 116 | + * @return \AppBundle\Entity\Tramo | |
| 117 | + */ | |
| 118 | + public function getIdTramo() | |
| 119 | + { | |
| 120 | + return $this->idTramo; | |
| 121 | + } | |
| 122 | + | |
| 123 | + /** | |
| 124 | + * Set idModalidad | |
| 125 | + * | |
| 126 | + * @param \AppBundle\Entity\Modalidad $idModalidad | |
| 127 | + * @return TrayectoTramoModalidadTipo | |
| 128 | + */ | |
| 129 | + public function setIdModalidad(\AppBundle\Entity\Modalidad $idModalidad) | |
| 130 | + { | |
| 131 | + $this->idModalidad = $idModalidad; | |
| 132 | + | |
| 133 | + return $this; | |
| 134 | + } | |
| 135 | + | |
| 136 | + /** | |
| 137 | + * Get idModalidad | |
| 138 | + * | |
| 139 | + * @return \AppBundle\Entity\Modalidad | |
| 140 | + */ | |
| 141 | + public function getIdModalidad() | |
| 142 | + { | |
| 143 | + return $this->idModalidad; | |
| 144 | + } | |
| 145 | + | |
| 146 | + /** | |
| 147 | + * Set idTipoUc | |
| 148 | + * | |
| 149 | + * @param \AppBundle\Entity\TipoUc $idTipoUc | |
| 150 | + * @return TrayectoTramoModalidadTipo | |
| 151 | + */ | |
| 152 | + public function setIdTipoUc(\AppBundle\Entity\TipoUc $idTipoUc) | |
| 153 | + { | |
| 154 | + $this->idTipoUc = $idTipoUc; | |
| 155 | + | |
| 156 | + return $this; | |
| 157 | + } | |
| 158 | + | |
| 159 | + /** | |
| 160 | + * Get idTipoUc | |
| 161 | + * | |
| 162 | + * @return \AppBundle\Entity\TipoUc | |
| 163 | + */ | |
| 164 | + public function getIdTipoUc() | |
| 165 | + { | |
| 166 | + return $this->idTipoUc; | |
| 167 | + } | |
| 168 | +} | ... | ... |
src/AppBundle/Entity/Turno.php
src/AppBundle/Form/OfertaAcademicaType.php
| ... | ... | @@ -5,6 +5,7 @@ namespace AppBundle\Form; |
| 5 | 5 | use Symfony\Component\Form\AbstractType; |
| 6 | 6 | use Symfony\Component\Form\FormBuilderInterface; |
| 7 | 7 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 8 | +use Symfony\Bridge\Doctrine\Form\Type\EntityType; | |
| 8 | 9 | |
| 9 | 10 | class OfertaAcademicaType extends AbstractType |
| 10 | 11 | { |
| ... | ... | @@ -14,13 +15,31 @@ class OfertaAcademicaType extends AbstractType |
| 14 | 15 | */ |
| 15 | 16 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 16 | 17 | { |
| 17 | - $builder | |
| 18 | - ->add('aula') | |
| 19 | - ->add('cupo') | |
| 20 | - ->add('idMallaCurricularUc') | |
| 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 | + )) | |
| 21 | 34 | ->add('idTurno') |
| 22 | 35 | ->add('idSeccion') |
| 23 | - ->add('idRolInstitucion') | |
| 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 | + )) | |
| 24 | 43 | ->add('idOfertaMallaCurricular') |
| 25 | 44 | ; |
| 26 | 45 | } | ... | ... |