Commit 1f6a3ce07e171917dd8802ef092432a5c15247bf
1 parent
677ac06c7c
Exists in
master
Excelente, es increible pero cierto.... acabo de terminar de crear la planificac…
…ión docente... si esto está listo... agarrate mundo... voy con todo.
Showing
9 changed files
with
436 additions
and
104 deletions
Show diff stats
app/Resources/views/planificacionseccion/new.html.twig
@@ -20,6 +20,10 @@ | @@ -20,6 +20,10 @@ | ||
20 | 20 | ||
21 | </ul> | 21 | </ul> |
22 | 22 | ||
23 | + <ul class="evaluacion" data-prototype="{{ form_widget(form.evaluacion.vars.prototype)|e('html_attr') }}"> | ||
24 | + | ||
25 | + </ul> | ||
26 | + | ||
23 | <input type="submit" value="Create" /> | 27 | <input type="submit" value="Create" /> |
24 | {{ form_end(form) }} | 28 | {{ form_end(form) }} |
25 | 29 | ||
@@ -40,11 +44,13 @@ | @@ -40,11 +44,13 @@ | ||
40 | var $addEspecificoLink = $('<a href="#" class="add_especifico_link">Añadir Objetivos Especificos</a>'); | 44 | var $addEspecificoLink = $('<a href="#" class="add_especifico_link">Añadir Objetivos Especificos</a>'); |
41 | var $addContenidoLink = $('<a href="#" class="add_contenido_link">Añadir conceptos</a>'); | 45 | var $addContenidoLink = $('<a href="#" class="add_contenido_link">Añadir conceptos</a>'); |
42 | var $addEstrategiaLink = $('<a href="#" class="add_estrategia_link">Añadir estrategias</a>'); | 46 | var $addEstrategiaLink = $('<a href="#" class="add_estrategia_link">Añadir estrategias</a>'); |
47 | + var $addEvaluacionLink = $('<a href="#" class="add_evaluacion_link">Añadir Evaluaciones</a>'); | ||
43 | var $RemoveContenidoLink = $('<a href="#" class="remove_contenido_link">Quitar Conceptos</a>'); | 48 | var $RemoveContenidoLink = $('<a href="#" class="remove_contenido_link">Quitar Conceptos</a>'); |
44 | 49 | ||
45 | var $newLinkLiContenido = $('<li></li>').append($addContenidoLink); | 50 | var $newLinkLiContenido = $('<li></li>').append($addContenidoLink); |
46 | var $newLinkLiEspecifico = $('<li></li>').append($addEspecificoLink); | 51 | var $newLinkLiEspecifico = $('<li></li>').append($addEspecificoLink); |
47 | var $newLinkLiEstrategia = $('<li></li>').append($addEstrategiaLink); | 52 | var $newLinkLiEstrategia = $('<li></li>').append($addEstrategiaLink); |
53 | + var $newLinkLiEvaluacion = $('<li></li>').append($addEvaluacionLink); | ||
48 | 54 | ||
49 | 55 | ||
50 | jQuery(document).ready(function() { | 56 | jQuery(document).ready(function() { |
@@ -52,16 +58,19 @@ | @@ -52,16 +58,19 @@ | ||
52 | $contenidoHolder = $('ul.contenido'); | 58 | $contenidoHolder = $('ul.contenido'); |
53 | $especificoHolder = $('ul.objetivoEspecifico'); | 59 | $especificoHolder = $('ul.objetivoEspecifico'); |
54 | $estrategiaHolder = $('ul.estrategia'); | 60 | $estrategiaHolder = $('ul.estrategia'); |
61 | + $evaluacionHolder = $('ul.evaluacion'); | ||
55 | // add the "add a tag" anchor and li to the tags ul | 62 | // add the "add a tag" anchor and li to the tags ul |
56 | $contenidoHolder.append($newLinkLiContenido); | 63 | $contenidoHolder.append($newLinkLiContenido); |
57 | $especificoHolder.append($newLinkLiEspecifico); | 64 | $especificoHolder.append($newLinkLiEspecifico); |
58 | $estrategiaHolder.append($newLinkLiEstrategia); | 65 | $estrategiaHolder.append($newLinkLiEstrategia); |
66 | + $evaluacionHolder.append($newLinkLiEvaluacion); | ||
59 | 67 | ||
60 | // count the current form inputs we have (e.g. 2), use that as the new | 68 | // count the current form inputs we have (e.g. 2), use that as the new |
61 | // index when inserting a new item (e.g. 2) | 69 | // index when inserting a new item (e.g. 2) |
62 | $contenidoHolder.data('index', $contenidoHolder.find(':input').length); | 70 | $contenidoHolder.data('index', $contenidoHolder.find(':input').length); |
63 | $especificoHolder.data('index', $especificoHolder.find(':input').length); | 71 | $especificoHolder.data('index', $especificoHolder.find(':input').length); |
64 | $estrategiaHolder.data('index', $estrategiaHolder.find(':input').length); | 72 | $estrategiaHolder.data('index', $estrategiaHolder.find(':input').length); |
73 | + $evaluacionHolder.data('index', $evaluacionHolder.find(':input').length); | ||
65 | 74 | ||
66 | $addContenidoLink.on('click', function(e) { | 75 | $addContenidoLink.on('click', function(e) { |
67 | // prevent the link from creating a "#" on the URL | 76 | // prevent the link from creating a "#" on the URL |
@@ -88,6 +97,14 @@ | @@ -88,6 +97,14 @@ | ||
88 | addEstrategiaForm($estrategiaHolder, $newLinkLiEstrategia); | 97 | addEstrategiaForm($estrategiaHolder, $newLinkLiEstrategia); |
89 | }); | 98 | }); |
90 | 99 | ||
100 | + $addEvaluacionLink.on('click', function(e) { | ||
101 | + // prevent the link from creating a "#" on the URL | ||
102 | + e.preventDefault(); | ||
103 | + | ||
104 | + // add a new tag form (see next code block) | ||
105 | + addEvaluacionForm($evaluacionHolder, $newLinkLiEvaluacion); | ||
106 | + }); | ||
107 | + | ||
91 | 108 | ||
92 | 109 | ||
93 | function addContenidoForm($contenidoHolder, $newLinkLiContenido) { | 110 | function addContenidoForm($contenidoHolder, $newLinkLiContenido) { |
@@ -196,6 +213,42 @@ | @@ -196,6 +213,42 @@ | ||
196 | 213 | ||
197 | 214 | ||
198 | 215 | ||
216 | + function addEvaluacionForm($evaluacionHolder, $newLinkLiEvaluacion) { | ||
217 | + // Get the data-prototype explained earlier | ||
218 | + var prototype = $evaluacionHolder.data('prototype'); | ||
219 | + | ||
220 | + // get the new index | ||
221 | + var index = $evaluacionHolder.data('index'); | ||
222 | + | ||
223 | + // Replace '$$name$$' in the prototype's HTML to | ||
224 | + // instead be a number based on how many items we have | ||
225 | + var newFormEvaluacion = prototype.replace(/__name__/g, index); | ||
226 | + | ||
227 | + // increase the index with one for the next item | ||
228 | + $evaluacionHolder.data('index', index + 1); | ||
229 | + | ||
230 | + // Display the form in the page in an li, before the "Add a tag" link li | ||
231 | + var $newFormLiEvaluacion = $('<li></li>').append(newFormEvaluacion); | ||
232 | + | ||
233 | + // also add a remove button, just for this example | ||
234 | + $newFormLiEvaluacion.append('<a href="#" class="remove-tag">x</a>'); | ||
235 | + | ||
236 | + $newLinkLiEvaluacion.before($newFormLiEvaluacion); | ||
237 | + | ||
238 | + // handle the removal, just for this example | ||
239 | + $('.remove-tag').click(function(e) { | ||
240 | + e.preventDefault(); | ||
241 | + | ||
242 | + $(this).parent().remove(); | ||
243 | + | ||
244 | + return false; | ||
245 | + }); | ||
246 | + | ||
247 | + | ||
248 | + } | ||
249 | + | ||
250 | + | ||
251 | + | ||
199 | }); | 252 | }); |
200 | 253 | ||
201 | 254 |
src/AppBundle/Controller/PlanificacionSeccionController.php
@@ -56,38 +56,26 @@ class PlanificacionSeccionController extends Controller | @@ -56,38 +56,26 @@ class PlanificacionSeccionController extends Controller | ||
56 | 56 | ||
57 | if ($form->isSubmitted() && $form->isValid()) { | 57 | if ($form->isSubmitted() && $form->isValid()) { |
58 | 58 | ||
59 | - //var_dump($p->getId()); exit; | ||
60 | 59 | ||
61 | - // ciclo a traves de las relaciones para cada contenido | 60 | + $seccion->addPlanificacion($planificacionSeccion); |
61 | + | ||
62 | + // ciclo a traves de las relaciones para cada contenido añadirle la planificacion | ||
62 | foreach($planificacionSeccion->getContenido() as $contenido){ | 63 | foreach($planificacionSeccion->getContenido() as $contenido){ |
63 | - $contenido->setPlanificacionSeccionId($planificacionSeccion); | ||
64 | - $seccion->addPlanificacion($planificacionSeccion); | 64 | + $contenido->setPlanificacionSeccionId($planificacionSeccion); |
65 | } | 65 | } |
66 | 66 | ||
67 | foreach($planificacionSeccion->getObjetivoEspecifico() as $especifico){ | 67 | foreach($planificacionSeccion->getObjetivoEspecifico() as $especifico){ |
68 | - $especifico->setPlanificacionSeccionId($planificacionSeccion); | ||
69 | - | 68 | + $especifico->setPlanificacionSeccionId($planificacionSeccion); |
70 | } | 69 | } |
71 | 70 | ||
72 | - foreach ($planificacionSeccion->getEstrategia() as $estrategias){ | ||
73 | - $estrategias->setPlanificacionSeccionId($planificacionSeccion); | ||
74 | - | ||
75 | - | 71 | + foreach ($planificacionSeccion->getEstrategia() as $estrategias){ |
72 | + $estrategias->setPlanificacionSeccionId($planificacionSeccion); | ||
76 | } | 73 | } |
77 | 74 | ||
78 | - /*foreach($planificacionSeccion->getEstrategia() as $estrategias){ | ||
79 | - $estrategias->setPlanificacionSeccionId($planificacionSeccion); | ||
80 | - foreach($estrategias->getTecnicasPlanificacion() as $t){ | ||
81 | - $estrategias->addTecnicasPlanificacion($t); | ||
82 | - } | ||
83 | - foreach($estrategias->getRecursosPlanificacion() as $r){ | ||
84 | - $estrategias->addRecursosPlanificacion($r); | ||
85 | - } | ||
86 | - | ||
87 | - }*/ | ||
88 | - | ||
89 | - | ||
90 | - | 75 | + foreach ($planificacionSeccion->getEvaluacion() as $evaluaciones){ |
76 | + $evaluaciones->setPlanificacionSeccionId($planificacionSeccion); | ||
77 | + } | ||
78 | + | ||
91 | //var_dump($seccion->getPlanificacion()->count()); exit; | 79 | //var_dump($seccion->getPlanificacion()->count()); exit; |
92 | $em = $this->getDoctrine()->getManager(); | 80 | $em = $this->getDoctrine()->getManager(); |
93 | $em->persist($planificacionSeccion); | 81 | $em->persist($planificacionSeccion); |
src/AppBundle/Entity/PlanificacionSeccion.php
@@ -55,7 +55,7 @@ class PlanificacionSeccion | @@ -55,7 +55,7 @@ class PlanificacionSeccion | ||
55 | 55 | ||
56 | 56 | ||
57 | /** | 57 | /** |
58 | - * @ORM\OneToMany(targetEntity="PlanificacionSeccionEvaluacion", mappedBy="idPlanificacionEvaluacion") | 58 | + * @ORM\OneToMany(targetEntity="PlanificacionSeccionEvaluacion", mappedBy="planificacionSeccionId", cascade={"all"}) |
59 | */ | 59 | */ |
60 | private $evaluacion; | 60 | private $evaluacion; |
61 | 61 |
src/AppBundle/Entity/PlanificacionSeccionEvaluacion.php
@@ -8,31 +8,13 @@ use Symfony\Component\Validator\Constraints as Assert; | @@ -8,31 +8,13 @@ use Symfony\Component\Validator\Constraints as Assert; | ||
8 | /** | 8 | /** |
9 | * PlanificacionSeccionEvaluacion | 9 | * PlanificacionSeccionEvaluacion |
10 | * | 10 | * |
11 | - * @ORM\Table(name="planificacion_seccion_evaluacion", | ||
12 | - * uniqueConstraints= | ||
13 | - * {@ORM\UniqueConstraint(name="uq_planificacion_seccion", | ||
14 | - * columns={"id_planificacion_seccion"}) | ||
15 | - * }, | ||
16 | - * indexes={ | ||
17 | - * @ORM\Index(name="fki_id_planificacion_evaluacion", | ||
18 | - * columns={"id_planificacion_seccion"}) | ||
19 | - * } | ||
20 | - * ) | 11 | + * @ORM\Table(name="planificacion_seccion_evaluacion") |
21 | * @ORM\Entity | 12 | * @ORM\Entity |
22 | */ | 13 | */ |
23 | class PlanificacionSeccionEvaluacion | 14 | class PlanificacionSeccionEvaluacion |
24 | { | 15 | { |
25 | 16 | ||
26 | - /** | ||
27 | - * @var \AppBundle\Entity\PlanificacionSeccion | ||
28 | - * | ||
29 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion") | ||
30 | - * @ORM\JoinColumns({ | ||
31 | - * @ORM\JoinColumn(name="id_planificacion_seccion", referencedColumnName="id", nullable=false) | ||
32 | - * }) | ||
33 | - */ | ||
34 | - private $idPlanificacionSeccion; | ||
35 | - | 17 | + |
36 | /** | 18 | /** |
37 | * @var integer | 19 | * @var integer |
38 | * | 20 | * |
@@ -54,12 +36,20 @@ class PlanificacionSeccionEvaluacion | @@ -54,12 +36,20 @@ class PlanificacionSeccionEvaluacion | ||
54 | private $idTipoEvaluacion; | 36 | private $idTipoEvaluacion; |
55 | 37 | ||
56 | 38 | ||
57 | - /** | ||
58 | - * @var text | 39 | + /** |
40 | + * @var \Doctrine\Common\Collections\Collection | ||
59 | * | 41 | * |
60 | - * @ORM\Column(name="tipo_instrumento_evaluacion", type="text", nullable=false, options={"comment" = "Instrumentos para la evaluacion"}) | 42 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\TipoInstrumentoEvaluacion", inversedBy="evaluacion") |
43 | + * @ORM\JoinTable(name="evaluacion_instrumento", | ||
44 | + * joinColumns={ | ||
45 | + * @ORM\JoinColumn(name="evaluacion_id", referencedColumnName="id", nullable=false) | ||
46 | + * }, | ||
47 | + * inverseJoinColumns={ | ||
48 | + * @ORM\JoinColumn(name="instrumento_id", referencedColumnName="id", nullable=false) | ||
49 | + * } | ||
50 | + * ) | ||
61 | */ | 51 | */ |
62 | - private $tipoInstrumentoEvaluacion; | 52 | + protected $instrumentos; |
63 | 53 | ||
64 | 54 | ||
65 | /** | 55 | /** |
@@ -98,13 +88,9 @@ class PlanificacionSeccionEvaluacion | @@ -98,13 +88,9 @@ class PlanificacionSeccionEvaluacion | ||
98 | 88 | ||
99 | /** | 89 | /** |
100 | * @ORM\ManyToOne(targetEntity="PlanificacionSeccion", inversedBy="evaluacion") | 90 | * @ORM\ManyToOne(targetEntity="PlanificacionSeccion", inversedBy="evaluacion") |
101 | - * @ORM\JoinColumn(name="id_planificacion_evaluacion", referencedColumnName="id") | 91 | + * @ORM\JoinColumn(name="planificacion_seccion_id", referencedColumnName="id") |
102 | */ | 92 | */ |
103 | - private $idPlanificacionEvaluacion; | ||
104 | - | ||
105 | - | ||
106 | - | ||
107 | - | 93 | + private $planificacionSeccionId; |
108 | 94 | ||
109 | 95 | ||
110 | 96 | ||
@@ -187,28 +173,7 @@ class PlanificacionSeccionEvaluacion | @@ -187,28 +173,7 @@ class PlanificacionSeccionEvaluacion | ||
187 | return $this->fechaEvaluacion; | 173 | return $this->fechaEvaluacion; |
188 | } | 174 | } |
189 | 175 | ||
190 | - /** | ||
191 | - * Set idPlanificacionSeccion | ||
192 | - * | ||
193 | - * @param \AppBundle\Entity\PlanificacionSeccion $idPlanificacionSeccion | ||
194 | - * @return PlanificacionSeccionEvaluacion | ||
195 | - */ | ||
196 | - public function setIdPlanificacionSeccion(\AppBundle\Entity\PlanificacionSeccion $idPlanificacionSeccion) | ||
197 | - { | ||
198 | - $this->idPlanificacionSeccion = $idPlanificacionSeccion; | ||
199 | - | ||
200 | - return $this; | ||
201 | - } | ||
202 | - | ||
203 | - /** | ||
204 | - * Get idPlanificacionSeccion | ||
205 | - * | ||
206 | - * @return \AppBundle\Entity\PlanificacionSeccion | ||
207 | - */ | ||
208 | - public function getIdPlanificacionSeccion() | ||
209 | - { | ||
210 | - return $this->idPlanificacionSeccion; | ||
211 | - } | 176 | + |
212 | 177 | ||
213 | /** | 178 | /** |
214 | * Set idTipoEvaluacion | 179 | * Set idTipoEvaluacion |
@@ -278,4 +243,67 @@ class PlanificacionSeccionEvaluacion | @@ -278,4 +243,67 @@ class PlanificacionSeccionEvaluacion | ||
278 | { | 243 | { |
279 | return $this->idPlanificacionEvaluacion; | 244 | return $this->idPlanificacionEvaluacion; |
280 | } | 245 | } |
246 | + | ||
247 | + /** | ||
248 | + * Set planificacionSeccionId | ||
249 | + * | ||
250 | + * @param \AppBundle\Entity\PlanificacionSeccion $planificacionSeccionId | ||
251 | + * @return PlanificacionSeccionEvaluacion | ||
252 | + */ | ||
253 | + public function setPlanificacionSeccionId(\AppBundle\Entity\PlanificacionSeccion $planificacionSeccionId = null) | ||
254 | + { | ||
255 | + $this->planificacionSeccionId = $planificacionSeccionId; | ||
256 | + | ||
257 | + return $this; | ||
258 | + } | ||
259 | + | ||
260 | + /** | ||
261 | + * Get planificacionSeccionId | ||
262 | + * | ||
263 | + * @return \AppBundle\Entity\PlanificacionSeccion | ||
264 | + */ | ||
265 | + public function getPlanificacionSeccionId() | ||
266 | + { | ||
267 | + return $this->planificacionSeccionId; | ||
268 | + } | ||
269 | + /** | ||
270 | + * Constructor | ||
271 | + */ | ||
272 | + public function __construct() | ||
273 | + { | ||
274 | + $this->instrumentos = new \Doctrine\Common\Collections\ArrayCollection(); | ||
275 | + } | ||
276 | + | ||
277 | + /** | ||
278 | + * Add instrumentos | ||
279 | + * | ||
280 | + * @param \AppBundle\Entity\TipoInstrumentoEvaluacion $instrumentos | ||
281 | + * @return PlanificacionSeccionEvaluacion | ||
282 | + */ | ||
283 | + public function addInstrumento(\AppBundle\Entity\TipoInstrumentoEvaluacion $instrumentos) | ||
284 | + { | ||
285 | + $this->instrumentos[] = $instrumentos; | ||
286 | + | ||
287 | + return $this; | ||
288 | + } | ||
289 | + | ||
290 | + /** | ||
291 | + * Remove instrumentos | ||
292 | + * | ||
293 | + * @param \AppBundle\Entity\TipoInstrumentoEvaluacion $instrumentos | ||
294 | + */ | ||
295 | + public function removeInstrumento(\AppBundle\Entity\TipoInstrumentoEvaluacion $instrumentos) | ||
296 | + { | ||
297 | + $this->instrumentos->removeElement($instrumentos); | ||
298 | + } | ||
299 | + | ||
300 | + /** | ||
301 | + * Get instrumentos | ||
302 | + * | ||
303 | + * @return \Doctrine\Common\Collections\Collection | ||
304 | + */ | ||
305 | + public function getInstrumentos() | ||
306 | + { | ||
307 | + return $this->instrumentos; | ||
308 | + } | ||
281 | } | 309 | } |
src/AppBundle/Entity/PlanificacionSeccionEvaluacion.php~
@@ -8,31 +8,13 @@ use Symfony\Component\Validator\Constraints as Assert; | @@ -8,31 +8,13 @@ use Symfony\Component\Validator\Constraints as Assert; | ||
8 | /** | 8 | /** |
9 | * PlanificacionSeccionEvaluacion | 9 | * PlanificacionSeccionEvaluacion |
10 | * | 10 | * |
11 | - * @ORM\Table(name="planificacion_seccion_evaluacion", | ||
12 | - * uniqueConstraints= | ||
13 | - * {@ORM\UniqueConstraint(name="uq_planificacion_seccion", | ||
14 | - * columns={"id_planificacion_seccion"}) | ||
15 | - * }, | ||
16 | - * indexes={ | ||
17 | - * @ORM\Index(name="fki_id_planificacion_evaluacion", | ||
18 | - * columns={"id_planificacion_seccion"}) | ||
19 | - * } | ||
20 | - * ) | 11 | + * @ORM\Table(name="planificacion_seccion_evaluacion") |
21 | * @ORM\Entity | 12 | * @ORM\Entity |
22 | */ | 13 | */ |
23 | class PlanificacionSeccionEvaluacion | 14 | class PlanificacionSeccionEvaluacion |
24 | { | 15 | { |
25 | 16 | ||
26 | - /** | ||
27 | - * @var \AppBundle\Entity\PlanificacionSeccion | ||
28 | - * | ||
29 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion") | ||
30 | - * @ORM\JoinColumns({ | ||
31 | - * @ORM\JoinColumn(name="id_planificacion_seccion", referencedColumnName="id", nullable=false) | ||
32 | - * }) | ||
33 | - */ | ||
34 | - private $idPlanificacionSeccion; | ||
35 | - | 17 | + |
36 | /** | 18 | /** |
37 | * @var integer | 19 | * @var integer |
38 | * | 20 | * |
@@ -54,12 +36,20 @@ class PlanificacionSeccionEvaluacion | @@ -54,12 +36,20 @@ class PlanificacionSeccionEvaluacion | ||
54 | private $idTipoEvaluacion; | 36 | private $idTipoEvaluacion; |
55 | 37 | ||
56 | 38 | ||
57 | - /** | ||
58 | - * @var text | 39 | + /** |
40 | + * @var \Doctrine\Common\Collections\Collection | ||
59 | * | 41 | * |
60 | - * @ORM\Column(name="tipo_instrumento_evaluacion", type="text", nullable=false, options={"comment" = "Instrumentos para la evaluacion"}) | 42 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\TipoInstrumentoEvaluacion", inversedBy="evaluacion") |
43 | + * @ORM\JoinTable(name="evaluacion_instrumento", | ||
44 | + * joinColumns={ | ||
45 | + * @ORM\JoinColumn(name="evaluacion_id", referencedColumnName="id", nullable=false) | ||
46 | + * }, | ||
47 | + * inverseJoinColumns={ | ||
48 | + * @ORM\JoinColumn(name="instrumento_id", referencedColumnName="id", nullable=false) | ||
49 | + * } | ||
50 | + * ) | ||
61 | */ | 51 | */ |
62 | - private $tipoInstrumentoEvaluacion; | 52 | + protected $instrumentos; |
63 | 53 | ||
64 | 54 | ||
65 | /** | 55 | /** |
@@ -98,13 +88,182 @@ class PlanificacionSeccionEvaluacion | @@ -98,13 +88,182 @@ class PlanificacionSeccionEvaluacion | ||
98 | 88 | ||
99 | /** | 89 | /** |
100 | * @ORM\ManyToOne(targetEntity="PlanificacionSeccion", inversedBy="evaluacion") | 90 | * @ORM\ManyToOne(targetEntity="PlanificacionSeccion", inversedBy="evaluacion") |
101 | - * @ORM\JoinColumn(name="id_planificacion_evaluacion", referencedColumnName="id") | 91 | + * @ORM\JoinColumn(name="planificacion_seccion_id", referencedColumnName="id") |
102 | */ | 92 | */ |
103 | - private $idPlanificacionEvaluacion; | 93 | + private $planificacionSeccionId; |
104 | 94 | ||
105 | 95 | ||
106 | 96 | ||
107 | - | 97 | + /** |
98 | + * Get id | ||
99 | + * | ||
100 | + * @return integer | ||
101 | + */ | ||
102 | + public function getId() | ||
103 | + { | ||
104 | + return $this->id; | ||
105 | + } | ||
106 | + | ||
107 | + /** | ||
108 | + * Set tipoInstrumentoEvaluacion | ||
109 | + * | ||
110 | + * @param string $tipoInstrumentoEvaluacion | ||
111 | + * @return PlanificacionSeccionEvaluacion | ||
112 | + */ | ||
113 | + public function setTipoInstrumentoEvaluacion($tipoInstrumentoEvaluacion) | ||
114 | + { | ||
115 | + $this->tipoInstrumentoEvaluacion = $tipoInstrumentoEvaluacion; | ||
116 | + | ||
117 | + return $this; | ||
118 | + } | ||
119 | + | ||
120 | + /** | ||
121 | + * Get tipoInstrumentoEvaluacion | ||
122 | + * | ||
123 | + * @return string | ||
124 | + */ | ||
125 | + public function getTipoInstrumentoEvaluacion() | ||
126 | + { | ||
127 | + return $this->tipoInstrumentoEvaluacion; | ||
128 | + } | ||
129 | + | ||
130 | + /** | ||
131 | + * Set ponderacion | ||
132 | + * | ||
133 | + * @param integer $ponderacion | ||
134 | + * @return PlanificacionSeccionEvaluacion | ||
135 | + */ | ||
136 | + public function setPonderacion($ponderacion) | ||
137 | + { | ||
138 | + $this->ponderacion = $ponderacion; | ||
139 | + | ||
140 | + return $this; | ||
141 | + } | ||
142 | + | ||
143 | + /** | ||
144 | + * Get ponderacion | ||
145 | + * | ||
146 | + * @return integer | ||
147 | + */ | ||
148 | + public function getPonderacion() | ||
149 | + { | ||
150 | + return $this->ponderacion; | ||
151 | + } | ||
152 | + | ||
153 | + /** | ||
154 | + * Set fechaEvaluacion | ||
155 | + * | ||
156 | + * @param \DateTime $fechaEvaluacion | ||
157 | + * @return PlanificacionSeccionEvaluacion | ||
158 | + */ | ||
159 | + public function setFechaEvaluacion($fechaEvaluacion) | ||
160 | + { | ||
161 | + $this->fechaEvaluacion = $fechaEvaluacion; | ||
162 | + | ||
163 | + return $this; | ||
164 | + } | ||
165 | + | ||
166 | + /** | ||
167 | + * Get fechaEvaluacion | ||
168 | + * | ||
169 | + * @return \DateTime | ||
170 | + */ | ||
171 | + public function getFechaEvaluacion() | ||
172 | + { | ||
173 | + return $this->fechaEvaluacion; | ||
174 | + } | ||
108 | 175 | ||
109 | 176 | ||
177 | + | ||
178 | + /** | ||
179 | + * Set idTipoEvaluacion | ||
180 | + * | ||
181 | + * @param \AppBundle\Entity\TipoEvaluacion $idTipoEvaluacion | ||
182 | + * @return PlanificacionSeccionEvaluacion | ||
183 | + */ | ||
184 | + public function setIdTipoEvaluacion(\AppBundle\Entity\TipoEvaluacion $idTipoEvaluacion) | ||
185 | + { | ||
186 | + $this->idTipoEvaluacion = $idTipoEvaluacion; | ||
187 | + | ||
188 | + return $this; | ||
189 | + } | ||
190 | + | ||
191 | + /** | ||
192 | + * Get idTipoEvaluacion | ||
193 | + * | ||
194 | + * @return \AppBundle\Entity\TipoEvaluacion | ||
195 | + */ | ||
196 | + public function getIdTipoEvaluacion() | ||
197 | + { | ||
198 | + return $this->idTipoEvaluacion; | ||
199 | + } | ||
200 | + | ||
201 | + /** | ||
202 | + * Set idEstatus | ||
203 | + * | ||
204 | + * @param \AppBundle\Entity\Estatus $idEstatus | ||
205 | + * @return PlanificacionSeccionEvaluacion | ||
206 | + */ | ||
207 | + public function setIdEstatus(\AppBundle\Entity\Estatus $idEstatus) | ||
208 | + { | ||
209 | + $this->idEstatus = $idEstatus; | ||
210 | + | ||
211 | + return $this; | ||
212 | + } | ||
213 | + | ||
214 | + /** | ||
215 | + * Get idEstatus | ||
216 | + * | ||
217 | + * @return \AppBundle\Entity\Estatus | ||
218 | + */ | ||
219 | + public function getIdEstatus() | ||
220 | + { | ||
221 | + return $this->idEstatus; | ||
222 | + } | ||
223 | + | ||
224 | + /** | ||
225 | + * Set idPlanificacionEvaluacion | ||
226 | + * | ||
227 | + * @param \AppBundle\Entity\PlanificacionSeccion $idPlanificacionEvaluacion | ||
228 | + * @return PlanificacionSeccionEvaluacion | ||
229 | + */ | ||
230 | + public function setIdPlanificacionEvaluacion(\AppBundle\Entity\PlanificacionSeccion $idPlanificacionEvaluacion = null) | ||
231 | + { | ||
232 | + $this->idPlanificacionEvaluacion = $idPlanificacionEvaluacion; | ||
233 | + | ||
234 | + return $this; | ||
235 | + } | ||
236 | + | ||
237 | + /** | ||
238 | + * Get idPlanificacionEvaluacion | ||
239 | + * | ||
240 | + * @return \AppBundle\Entity\PlanificacionSeccion | ||
241 | + */ | ||
242 | + public function getIdPlanificacionEvaluacion() | ||
243 | + { | ||
244 | + return $this->idPlanificacionEvaluacion; | ||
245 | + } | ||
246 | + | ||
247 | + /** | ||
248 | + * Set planificacionSeccionId | ||
249 | + * | ||
250 | + * @param \AppBundle\Entity\PlanificacionSeccion $planificacionSeccionId | ||
251 | + * @return PlanificacionSeccionEvaluacion | ||
252 | + */ | ||
253 | + public function setPlanificacionSeccionId(\AppBundle\Entity\PlanificacionSeccion $planificacionSeccionId = null) | ||
254 | + { | ||
255 | + $this->planificacionSeccionId = $planificacionSeccionId; | ||
256 | + | ||
257 | + return $this; | ||
258 | + } | ||
259 | + | ||
260 | + /** | ||
261 | + * Get planificacionSeccionId | ||
262 | + * | ||
263 | + * @return \AppBundle\Entity\PlanificacionSeccion | ||
264 | + */ | ||
265 | + public function getPlanificacionSeccionId() | ||
266 | + { | ||
267 | + return $this->planificacionSeccionId; | ||
268 | + } | ||
110 | } | 269 | } |
src/AppBundle/Entity/TipoInstrumentoEvaluacion.php
@@ -29,6 +29,13 @@ class TipoInstrumentoEvaluacion | @@ -29,6 +29,13 @@ class TipoInstrumentoEvaluacion | ||
29 | * @ORM\SequenceGenerator(sequenceName="estado_id_seq", allocationSize=1, initialValue=1) | 29 | * @ORM\SequenceGenerator(sequenceName="estado_id_seq", allocationSize=1, initialValue=1) |
30 | */ | 30 | */ |
31 | private $id; | 31 | private $id; |
32 | + | ||
33 | + /** | ||
34 | + * @var \Doctrine\Common\Collections\Collection | ||
35 | + * | ||
36 | + * @ORM\ManyToMany(targetEntity="AppBundle\Entity\PlanificacionSeccionEvaluacion", mappedBy="instrumentos", cascade={"all"}) | ||
37 | + */ | ||
38 | + protected $evaluacion; | ||
32 | 39 | ||
33 | 40 | ||
34 | 41 | ||
@@ -46,6 +53,15 @@ class TipoInstrumentoEvaluacion | @@ -46,6 +53,15 @@ class TipoInstrumentoEvaluacion | ||
46 | 53 | ||
47 | 54 | ||
48 | 55 | ||
56 | + | ||
57 | + /** | ||
58 | + * Constructor | ||
59 | + */ | ||
60 | + public function __construct() | ||
61 | + { | ||
62 | + $this->evaluacion = new \Doctrine\Common\Collections\ArrayCollection(); | ||
63 | + } | ||
64 | + | ||
49 | /** | 65 | /** |
50 | * Set nombre | 66 | * Set nombre |
51 | * | 67 | * |
@@ -78,4 +94,37 @@ class TipoInstrumentoEvaluacion | @@ -78,4 +94,37 @@ class TipoInstrumentoEvaluacion | ||
78 | { | 94 | { |
79 | return $this->id; | 95 | return $this->id; |
80 | } | 96 | } |
97 | + | ||
98 | + /** | ||
99 | + * Add evaluacion | ||
100 | + * | ||
101 | + * @param \AppBundle\Entity\PlanificacionSeccionEvaluacion $evaluacion | ||
102 | + * @return TipoInstrumentoEvaluacion | ||
103 | + */ | ||
104 | + public function addEvaluacion(\AppBundle\Entity\PlanificacionSeccionEvaluacion $evaluacion) | ||
105 | + { | ||
106 | + $this->evaluacion[] = $evaluacion; | ||
107 | + | ||
108 | + return $this; | ||
109 | + } | ||
110 | + | ||
111 | + /** | ||
112 | + * Remove evaluacion | ||
113 | + * | ||
114 | + * @param \AppBundle\Entity\PlanificacionSeccionEvaluacion $evaluacion | ||
115 | + */ | ||
116 | + public function removeEvaluacion(\AppBundle\Entity\PlanificacionSeccionEvaluacion $evaluacion) | ||
117 | + { | ||
118 | + $this->evaluacion->removeElement($evaluacion); | ||
119 | + } | ||
120 | + | ||
121 | + /** | ||
122 | + * Get evaluacion | ||
123 | + * | ||
124 | + * @return \Doctrine\Common\Collections\Collection | ||
125 | + */ | ||
126 | + public function getEvaluacion() | ||
127 | + { | ||
128 | + return $this->evaluacion; | ||
129 | + } | ||
81 | } | 130 | } |
src/AppBundle/Entity/TipoInstrumentoEvaluacion.php~
@@ -29,6 +29,11 @@ class TipoInstrumentoEvaluacion | @@ -29,6 +29,11 @@ class TipoInstrumentoEvaluacion | ||
29 | * @ORM\SequenceGenerator(sequenceName="estado_id_seq", allocationSize=1, initialValue=1) | 29 | * @ORM\SequenceGenerator(sequenceName="estado_id_seq", allocationSize=1, initialValue=1) |
30 | */ | 30 | */ |
31 | private $id; | 31 | private $id; |
32 | + | ||
33 | + /** | ||
34 | + * @ORM\OneToMany(targetEntity="PlanificacionSeccionEvaluacion", mappedBy="instrumentos", cascade={"all"}) | ||
35 | + */ | ||
36 | + private $evaluacion; | ||
32 | 37 | ||
33 | 38 | ||
34 | 39 | ||
@@ -45,4 +50,6 @@ class TipoInstrumentoEvaluacion | @@ -45,4 +50,6 @@ class TipoInstrumentoEvaluacion | ||
45 | } | 50 | } |
46 | 51 | ||
47 | 52 | ||
48 | -} | ||
49 | \ No newline at end of file | 53 | \ No newline at end of file |
54 | + | ||
55 | + | ||
56 | +} |
src/AppBundle/Form/PlanificacionSeccionEvaluacionType.php
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
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 PlanificacionSeccionEvaluacionType 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('instrumentos', EntityType::class, array( | ||
20 | + 'class' => 'AppBundle:TipoInstrumentoEvaluacion', | ||
21 | + 'multiple' => TRUE, | ||
22 | + 'expanded' => TRUE, | ||
23 | + )) | ||
24 | + ->add('ponderacion') | ||
25 | + ->add('fechaEvaluacion') | ||
26 | + ->add('idTipoEvaluacion') | ||
27 | + ->add('idEstatus') | ||
28 | + ; | ||
29 | + } | ||
30 | + | ||
31 | + /** | ||
32 | + * @param OptionsResolver $resolver | ||
33 | + */ | ||
34 | + public function configureOptions(OptionsResolver $resolver) | ||
35 | + { | ||
36 | + $resolver->setDefaults(array( | ||
37 | + 'data_class' => 'AppBundle\Entity\PlanificacionSeccionEvaluacion' | ||
38 | + )); | ||
39 | + } | ||
40 | +} |
src/AppBundle/Form/PlanificacionSeccionType.php
@@ -73,6 +73,14 @@ class PlanificacionSeccionType extends AbstractType | @@ -73,6 +73,14 @@ class PlanificacionSeccionType extends AbstractType | ||
73 | 'allow_add' => true, | 73 | 'allow_add' => true, |
74 | 'label' => false | 74 | 'label' => false |
75 | )) | 75 | )) |
76 | + | ||
77 | + ->add('evaluacion', CollectionType::class, array( | ||
78 | + 'entry_type' => PlanificacionSeccionEvaluacionType::class, | ||
79 | + 'allow_add' => true, | ||
80 | + 'label' => false | ||
81 | + )) | ||
82 | + | ||
83 | + | ||
76 | ; | 84 | ; |
77 | } | 85 | } |
78 | 86 |