From a334fa1e7213c87920676a9c59918dd2115dd71f Mon Sep 17 00:00:00 2001 From: Wilmer Ramones Date: Thu, 6 Oct 2016 11:45:27 -0400 Subject: [PATCH] =?UTF-8?q?creada=20la=20propiedad=20de=20hasCalificacion?= =?UTF-8?q?=20dentro=20de=20la=20planificacion=20de=20la=20secci=C3=B3n=20?= =?UTF-8?q?para=20verficiar=20si=20esa=20planificaci=C3=B3n=20tiene=20nota?= =?UTF-8?q?s=20registradas.=20=20Luego=20se=20procede=20a=20chequear=20par?= =?UTF-8?q?a=20permitir=20cargar=20o=20no=20las=20notas=20y=20si=20ya=20es?= =?UTF-8?q?tan=20cargadas,=20mostrar=20la=20nota=20registrada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/planificacioncalificacion/new.html.twig | 23 ++++- .../PlanificacionCalificacionController.php | 3 +- src/AppBundle/Entity/PlanificacionCalificacion.php | 2 +- .../Entity/PlanificacionCalificacion.php~ | 106 ++++++++++++++++++++- src/AppBundle/Entity/PlanificacionSeccion.php | 39 ++++++++ src/AppBundle/Entity/PlanificacionSeccion.php~ | 49 +++++++++- 6 files changed, 211 insertions(+), 11 deletions(-) diff --git a/app/Resources/views/planificacioncalificacion/new.html.twig b/app/Resources/views/planificacioncalificacion/new.html.twig index b9d3c83..75d607a 100644 --- a/app/Resources/views/planificacioncalificacion/new.html.twig +++ b/app/Resources/views/planificacioncalificacion/new.html.twig @@ -3,23 +3,38 @@ {% block body %}

Registro Calificacion Planificacion

{{planificacion.idtemaUc}}

+ +
    {% for o in planificacion.seccion.hasInscripcion %} - + {% if planificacion.hasCalificacion | length < 1 %}
  • {{o}} -
  • + + {% else %} +
  • + {% for p in planificacion.hasCalificacion %} + {{o}} + + + {% endfor %} +
  • + + + {% endif %} {% endfor %}
- - + {% if planificacion.hasCalificacion | length < 1 %} + + + {% endif %}
{% endblock %} diff --git a/src/AppBundle/Controller/PlanificacionCalificacionController.php b/src/AppBundle/Controller/PlanificacionCalificacionController.php index fd5fb1a..e066621 100644 --- a/src/AppBundle/Controller/PlanificacionCalificacionController.php +++ b/src/AppBundle/Controller/PlanificacionCalificacionController.php @@ -43,9 +43,10 @@ class PlanificacionCalificacionController extends Controller */ public function newAction(Request $request, PlanificacionSeccion $planificacion) { - $planificacionCalificacion = new PlanificacionCalificacion(); + if ($request->isMethod("POST")) { + $planificacionCalificacion = new PlanificacionCalificacion(); $em = $this->getDoctrine()->getManager(); //var_dump($request->request->get('planificacion_calificacion')); exit; foreach ($request->request->get('planificacion_calificacion')['idInscripcion'] as $key => $value ){ diff --git a/src/AppBundle/Entity/PlanificacionCalificacion.php b/src/AppBundle/Entity/PlanificacionCalificacion.php index d629918..c66bc9a 100644 --- a/src/AppBundle/Entity/PlanificacionCalificacion.php +++ b/src/AppBundle/Entity/PlanificacionCalificacion.php @@ -26,7 +26,7 @@ class PlanificacionCalificacion /** * @var \AppBundle\Entity\PlanificacionSeccion * - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion") + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion", inversedBy="hasCalificacion") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_planificacion_seccion", referencedColumnName="id", nullable=false) * }) diff --git a/src/AppBundle/Entity/PlanificacionCalificacion.php~ b/src/AppBundle/Entity/PlanificacionCalificacion.php~ index 25100f5..c66bc9a 100644 --- a/src/AppBundle/Entity/PlanificacionCalificacion.php~ +++ b/src/AppBundle/Entity/PlanificacionCalificacion.php~ @@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM; /** * PlanificacionCalificacion * - * @ORM\Table(name="planificacion_calificacion", uniqueConstraints={@ORM\UniqueConstraint(name="i_registro_nota", columns={"id_inscripcion", "id_calificacion"})}, indexes={@ORM\Index(name="fki_id_inscripcion", columns={"id_inscripcion"}), @ORM\Index(name="fki_id_calificacion", columns={"id_calificacion"}), @ORM\Index(name="fki_id_estatus_nota", columns={"id_estatus_nota"}), @ORM\Index(name="fki_id_planificacion_seccion", columns={"id_planificacion_seccion"})}) + * @ORM\Table(name="planificacion_calificacion", uniqueConstraints={@ORM\UniqueConstraint(name="i_registro_nota_planificacion", columns={"id_inscripcion", "id_calificacion", "id_planificacion_seccion"})}, indexes={@ORM\Index(name="fki_id_inscripcion_planificacion", columns={"id_inscripcion"}), @ORM\Index(name="fki_id_calificacion_planificacion", columns={"id_calificacion"}), @ORM\Index(name="fki_id_estatus_nota_planificacion", columns={"id_estatus_nota"}), @ORM\Index(name="fki_id_planificacion_seccion", columns={"id_planificacion_seccion"})}) * @ORM\Entity */ class PlanificacionCalificacion @@ -26,7 +26,7 @@ class PlanificacionCalificacion /** * @var \AppBundle\Entity\PlanificacionSeccion * - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion") + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PlanificacionSeccion", inversedBy="hasCalificacion") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="id_planificacion_seccion", referencedColumnName="id", nullable=false) * }) @@ -67,4 +67,106 @@ class PlanificacionCalificacion + + /** + * Get id + * + * @return integer + */ + public function getId() + { + return $this->id; + } + + /** + * Set idPlanificacionSeccion + * + * @param \AppBundle\Entity\PlanificacionSeccion $idPlanificacionSeccion + * @return PlanificacionCalificacion + */ + public function setIdPlanificacionSeccion(\AppBundle\Entity\PlanificacionSeccion $idPlanificacionSeccion) + { + $this->idPlanificacionSeccion = $idPlanificacionSeccion; + + return $this; + } + + /** + * Get idPlanificacionSeccion + * + * @return \AppBundle\Entity\PlanificacionSeccion + */ + public function getIdPlanificacionSeccion() + { + return $this->idPlanificacionSeccion; + } + + /** + * Set idInscripcion + * + * @param \AppBundle\Entity\Inscripcion $idInscripcion + * @return PlanificacionCalificacion + */ + public function setIdInscripcion(\AppBundle\Entity\Inscripcion $idInscripcion) + { + $this->idInscripcion = $idInscripcion; + + return $this; + } + + /** + * Get idInscripcion + * + * @return \AppBundle\Entity\Inscripcion + */ + public function getIdInscripcion() + { + return $this->idInscripcion; + } + + /** + * Set idCalificacion + * + * @param \AppBundle\Entity\Calificacion $idCalificacion + * @return PlanificacionCalificacion + */ + public function setIdCalificacion(\AppBundle\Entity\Calificacion $idCalificacion) + { + $this->idCalificacion = $idCalificacion; + + return $this; + } + + /** + * Get idCalificacion + * + * @return \AppBundle\Entity\Calificacion + */ + public function getIdCalificacion() + { + return $this->idCalificacion; + } + + /** + * Set idEstatusNota + * + * @param \AppBundle\Entity\EstatusNota $idEstatusNota + * @return PlanificacionCalificacion + */ + public function setIdEstatusNota(\AppBundle\Entity\EstatusNota $idEstatusNota) + { + $this->idEstatusNota = $idEstatusNota; + + return $this; + } + + /** + * Get idEstatusNota + * + * @return \AppBundle\Entity\EstatusNota + */ + public function getIdEstatusNota() + { + return $this->idEstatusNota; + } } diff --git a/src/AppBundle/Entity/PlanificacionSeccion.php b/src/AppBundle/Entity/PlanificacionSeccion.php index b6aca0e..7b29a72 100644 --- a/src/AppBundle/Entity/PlanificacionSeccion.php +++ b/src/AppBundle/Entity/PlanificacionSeccion.php @@ -99,6 +99,11 @@ class PlanificacionSeccion */ private $seccion; + /** + * @ORM\OneToMany(targetEntity="AppBundle\Entity\PlanificacionCalificacion", mappedBy="idPlanificacionSeccion", cascade={"all"}) + * */ + protected $hasCalificacion; + /** @@ -110,6 +115,7 @@ class PlanificacionSeccion $this->contenido = new \Doctrine\Common\Collections\ArrayCollection(); $this->estrategia = new \Doctrine\Common\Collections\ArrayCollection(); $this->evaluacion = new \Doctrine\Common\Collections\ArrayCollection(); + $this->hasCalificacion = new \Doctrine\Common\Collections\ArrayCollection(); } @@ -397,4 +403,37 @@ class PlanificacionSeccion public function __toString() { return $this->getSeccion()->getNombre(); } + + /** + * Add hasCalificacion + * + * @param \AppBundle\Entity\PlanificacionCalificacion $hasCalificacion + * @return PlanificacionSeccion + */ + public function addHasCalificacion(\AppBundle\Entity\PlanificacionCalificacion $hasCalificacion) + { + $this->hasCalificacion[] = $hasCalificacion; + + return $this; + } + + /** + * Remove hasCalificacion + * + * @param \AppBundle\Entity\PlanificacionCalificacion $hasCalificacion + */ + public function removeHasCalificacion(\AppBundle\Entity\PlanificacionCalificacion $hasCalificacion) + { + $this->hasCalificacion->removeElement($hasCalificacion); + } + + /** + * Get hasCalificacion + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getHasCalificacion() + { + return $this->hasCalificacion; + } } diff --git a/src/AppBundle/Entity/PlanificacionSeccion.php~ b/src/AppBundle/Entity/PlanificacionSeccion.php~ index 721f083..3e924ad 100644 --- a/src/AppBundle/Entity/PlanificacionSeccion.php~ +++ b/src/AppBundle/Entity/PlanificacionSeccion.php~ @@ -35,7 +35,7 @@ class PlanificacionSeccion /** - * @ORM\OneToMany(targetEntity="PlanificacionSeccionEspecifico", mappedBy="planificacionSeccionId") + * @ORM\OneToMany(targetEntity="PlanificacionSeccionEspecifico", mappedBy="planificacionSeccionId",cascade={"all"}) * @var \Doctrine\Common\Collections\ArrayCollection */ private $objetivoEspecifico; @@ -49,13 +49,13 @@ class PlanificacionSeccion /** - * @ORM\OneToMany(targetEntity="PlanificacionSeccionEstrategia", mappedBy="idPlanificacionEstrategia") + * @ORM\OneToMany(targetEntity="PlanificacionSeccionEstrategia", mappedBy="planificacionSeccionId", cascade={"all"}) */ private $estrategia; /** - * @ORM\OneToMany(targetEntity="PlanificacionSeccionEvaluacion", mappedBy="idPlanificacionEvaluacion") + * @ORM\OneToMany(targetEntity="PlanificacionSeccionEvaluacion", mappedBy="planificacionSeccionId", cascade={"all"}) */ private $evaluacion; @@ -99,6 +99,11 @@ class PlanificacionSeccion */ private $seccion; + /** + * @ORM\OneToMany(targetEntity="AppBundle\Entity\PlanificacionCalificacion", mappedBy="idPlanificacionSeccion", cascade={"all"}) + * */ + protected $hasCalificacion; + /** @@ -110,6 +115,7 @@ class PlanificacionSeccion $this->contenido = new \Doctrine\Common\Collections\ArrayCollection(); $this->estrategia = new \Doctrine\Common\Collections\ArrayCollection(); $this->evaluacion = new \Doctrine\Common\Collections\ArrayCollection(); + $this->hasCalificacion = new \Doctrine\Common\Collections\ArrayCollection(); } @@ -360,4 +366,41 @@ class PlanificacionSeccion { return $this->fechaUltimaActualizacion; } + + /** + * Add objetivoEspecifico + * + * @param \AppBundle\Entity\PlanificacionSeccionEspecifico $objetivoEspecifico + * @return PlanificacionSeccion + */ + public function addObjetivoEspecifico(\AppBundle\Entity\PlanificacionSeccionEspecifico $objetivoEspecifico) + { + $this->objetivoEspecifico[] = $objetivoEspecifico; + + return $this; + } + + /** + * Remove objetivoEspecifico + * + * @param \AppBundle\Entity\PlanificacionSeccionEspecifico $objetivoEspecifico + */ + public function removeObjetivoEspecifico(\AppBundle\Entity\PlanificacionSeccionEspecifico $objetivoEspecifico) + { + $this->objetivoEspecifico->removeElement($objetivoEspecifico); + } + + /** + * Get objetivoEspecifico + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getObjetivoEspecifico() + { + return $this->objetivoEspecifico; + } + + public function __toString() { + return $this->getSeccion()->getNombre(); + } } -- 2.0.0