Commit c8399c4cc13b649b2bba69f420407c14f7b6eac4
1 parent
264818550f
Exists in
master
creada la entidad pidaEstatus y enlazada al formulario y la vista
Showing
5 changed files
with
241 additions
and
67 deletions
Show diff stats
app/Resources/views/solicitudes/pida.html.twig
| ... | ... | @@ -35,6 +35,12 @@ |
| 35 | 35 | {% form_theme form 'bootstrap_3_layout.html.twig' %} |
| 36 | 36 | {{ form_start(form) }} |
| 37 | 37 | {{ form_widget(form) }} |
| 38 | + | |
| 39 | + <ul class="actividad" data-prototype="{{ form_widget(form.contenido.vars.prototype)|e('html_attr') }}"> | |
| 40 | + | |
| 41 | + </ul> | |
| 42 | + | |
| 43 | + | |
| 38 | 44 | {{ form_end(form) }} |
| 39 | 45 | </div> |
| 40 | 46 | ... | ... |
src/AppBundle/Entity/AdscripcionPida.php
| ... | ... | @@ -68,20 +68,20 @@ class AdscripcionPida |
| 68 | 68 | * }) |
| 69 | 69 | */ |
| 70 | 70 | protected $idActividadDocente; |
| 71 | + | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * @var \AppBundle\Entity\PidaPlazo | |
| 75 | + * | |
| 76 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PidaPlazo") | |
| 77 | + * @ORM\JoinColumns({ | |
| 78 | + * @ORM\JoinColumn(name="id_pida_plazo", referencedColumnName="id", nullable=true) | |
| 79 | + * }) | |
| 80 | + */ | |
| 81 | + protected $idPidaPlazo; | |
| 71 | 82 | |
| 72 | 83 | |
| 73 | - /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de inicio de la activdad PIDA"}) | |
| 74 | - | |
| 75 | - */ | |
| 76 | - | |
| 77 | - private $fecha_inicio; | |
| 78 | - | |
| 79 | - | |
| 80 | - /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de fin de la actividad"}) | |
| 81 | - | |
| 82 | - */ | |
| 83 | - | |
| 84 | - private $fecha_final; | |
| 84 | + | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de creación de la solicitud"}) |
| ... | ... | @@ -96,6 +96,19 @@ class AdscripcionPida |
| 96 | 96 | */ |
| 97 | 97 | |
| 98 | 98 | private $fecha_ultima_actualizacion; |
| 99 | + | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * @var \AppBundle\Entity\PidaEstatus | |
| 103 | + * | |
| 104 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PidaEstatus") | |
| 105 | + * @ORM\JoinColumns({ | |
| 106 | + * @ORM\JoinColumn(name="id_pida_estatus", referencedColumnName="id", nullable=true) | |
| 107 | + * }) | |
| 108 | + */ | |
| 109 | + protected $idPidaEstatus; | |
| 110 | + | |
| 111 | + | |
| 99 | 112 | |
| 100 | 113 | /** |
| 101 | 114 | * @var \AppBundle\Entity\Estatus |
| ... | ... | @@ -252,72 +265,74 @@ class AdscripcionPida |
| 252 | 265 | return $this->idActividadDocente; |
| 253 | 266 | } |
| 254 | 267 | |
| 268 | + | |
| 269 | + | |
| 255 | 270 | /** |
| 256 | - * Set fecha_inicio | |
| 271 | + * Set objetivoEspecifico | |
| 257 | 272 | * |
| 258 | - * @param \DateTime $fechaInicio | |
| 273 | + * @param string $objetivoEspecifico | |
| 259 | 274 | * @return AdscripcionPida |
| 260 | 275 | */ |
| 261 | - public function setFechaInicio($fechaInicio) | |
| 276 | + public function setObjetivoEspecifico($objetivoEspecifico) | |
| 262 | 277 | { |
| 263 | - $this->fecha_inicio = $fechaInicio; | |
| 278 | + $this->objetivoEspecifico = $objetivoEspecifico; | |
| 264 | 279 | |
| 265 | 280 | return $this; |
| 266 | 281 | } |
| 267 | 282 | |
| 268 | 283 | /** |
| 269 | - * Get fecha_inicio | |
| 284 | + * Get objetivoEspecifico | |
| 270 | 285 | * |
| 271 | - * @return \DateTime | |
| 286 | + * @return string | |
| 272 | 287 | */ |
| 273 | - public function getFechaInicio() | |
| 288 | + public function getObjetivoEspecifico() | |
| 274 | 289 | { |
| 275 | - return $this->fecha_inicio; | |
| 290 | + return $this->objetivoEspecifico; | |
| 276 | 291 | } |
| 277 | 292 | |
| 278 | 293 | /** |
| 279 | - * Set fecha_final | |
| 294 | + * Set idPidaPlazo | |
| 280 | 295 | * |
| 281 | - * @param \DateTime $fechaFinal | |
| 296 | + * @param \AppBundle\Entity\PidaPlazo $idPidaPlazo | |
| 282 | 297 | * @return AdscripcionPida |
| 283 | 298 | */ |
| 284 | - public function setFechaFinal($fechaFinal) | |
| 299 | + public function setIdPidaPlazo(\AppBundle\Entity\PidaPlazo $idPidaPlazo = null) | |
| 285 | 300 | { |
| 286 | - $this->fecha_final = $fechaFinal; | |
| 301 | + $this->idPidaPlazo = $idPidaPlazo; | |
| 287 | 302 | |
| 288 | 303 | return $this; |
| 289 | 304 | } |
| 290 | 305 | |
| 291 | 306 | /** |
| 292 | - * Get fecha_final | |
| 307 | + * Get idPidaPlazo | |
| 293 | 308 | * |
| 294 | - * @return \DateTime | |
| 309 | + * @return \AppBundle\Entity\PidaPlazo | |
| 295 | 310 | */ |
| 296 | - public function getFechaFinal() | |
| 311 | + public function getIdPidaPlazo() | |
| 297 | 312 | { |
| 298 | - return $this->fecha_final; | |
| 313 | + return $this->idPidaPlazo; | |
| 299 | 314 | } |
| 300 | 315 | |
| 301 | 316 | /** |
| 302 | - * Set objetivoEspecifico | |
| 317 | + * Set idPidaEstatus | |
| 303 | 318 | * |
| 304 | - * @param string $objetivoEspecifico | |
| 319 | + * @param \AppBundle\Entity\PidaEstatus $idPidaEstatus | |
| 305 | 320 | * @return AdscripcionPida |
| 306 | 321 | */ |
| 307 | - public function setObjetivoEspecifico($objetivoEspecifico) | |
| 322 | + public function setIdPidaEstatus(\AppBundle\Entity\PidaEstatus $idPidaEstatus) | |
| 308 | 323 | { |
| 309 | - $this->objetivoEspecifico = $objetivoEspecifico; | |
| 324 | + $this->idPidaEstatus = $idPidaEstatus; | |
| 310 | 325 | |
| 311 | 326 | return $this; |
| 312 | 327 | } |
| 313 | 328 | |
| 314 | 329 | /** |
| 315 | - * Get objetivoEspecifico | |
| 330 | + * Get idPidaEstatus | |
| 316 | 331 | * |
| 317 | - * @return string | |
| 332 | + * @return \AppBundle\Entity\PidaEstatus | |
| 318 | 333 | */ |
| 319 | - public function getObjetivoEspecifico() | |
| 334 | + public function getIdPidaEstatus() | |
| 320 | 335 | { |
| 321 | - return $this->objetivoEspecifico; | |
| 336 | + return $this->idPidaEstatus; | |
| 322 | 337 | } |
| 323 | 338 | } | ... | ... |
src/AppBundle/Entity/AdscripcionPida.php~
| ... | ... | @@ -39,7 +39,7 @@ class AdscripcionPida |
| 39 | 39 | /** |
| 40 | 40 | * @var \AppBundle\Entity\RolInstitucion |
| 41 | 41 | * |
| 42 | - * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion") | |
| 42 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\RolInstitucion", inversedBy="pida") | |
| 43 | 43 | * @ORM\JoinColumns({ |
| 44 | 44 | * @ORM\JoinColumn(name="id_rol_institucion", referencedColumnName="id", nullable=false) |
| 45 | 45 | * }) |
| ... | ... | @@ -68,20 +68,20 @@ class AdscripcionPida |
| 68 | 68 | * }) |
| 69 | 69 | */ |
| 70 | 70 | protected $idActividadDocente; |
| 71 | + | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * @var \AppBundle\Entity\PidaPlazo | |
| 75 | + * | |
| 76 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PidaPlazo") | |
| 77 | + * @ORM\JoinColumns({ | |
| 78 | + * @ORM\JoinColumn(name="id_pida_plazo", referencedColumnName="id", nullable=true) | |
| 79 | + * }) | |
| 80 | + */ | |
| 81 | + protected $idPidaPlazo; | |
| 71 | 82 | |
| 72 | 83 | |
| 73 | - /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de inicio de la activdad PIDA"}) | |
| 74 | - | |
| 75 | - */ | |
| 76 | - | |
| 77 | - private $fecha_inicio; | |
| 78 | - | |
| 79 | - | |
| 80 | - /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de fin de la actividad"}) | |
| 81 | - | |
| 82 | - */ | |
| 83 | - | |
| 84 | - private $fecha_final; | |
| 84 | + | |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | /** @ORM\Column(type="datetime", nullable=false, options={"comment" = "Fecha de creación de la solicitud"}) |
| ... | ... | @@ -96,6 +96,19 @@ class AdscripcionPida |
| 96 | 96 | */ |
| 97 | 97 | |
| 98 | 98 | private $fecha_ultima_actualizacion; |
| 99 | + | |
| 100 | + | |
| 101 | + /** | |
| 102 | + * @var \AppBundle\Entity\PidaEstatus | |
| 103 | + * | |
| 104 | + * @ORM\ManyToOne(targetEntity="AppBundle\Entity\PidaEstatus") | |
| 105 | + * @ORM\JoinColumns({ | |
| 106 | + * @ORM\JoinColumn(name="id_pida_estatus", referencedColumnName="id", nullable=false) | |
| 107 | + * }) | |
| 108 | + */ | |
| 109 | + protected $idPidaEstatus; | |
| 110 | + | |
| 111 | + | |
| 99 | 112 | |
| 100 | 113 | /** |
| 101 | 114 | * @var \AppBundle\Entity\Estatus |
| ... | ... | @@ -252,49 +265,51 @@ class AdscripcionPida |
| 252 | 265 | return $this->idActividadDocente; |
| 253 | 266 | } |
| 254 | 267 | |
| 268 | + | |
| 269 | + | |
| 255 | 270 | /** |
| 256 | - * Set fecha_inicio | |
| 271 | + * Set objetivoEspecifico | |
| 257 | 272 | * |
| 258 | - * @param \DateTime $fechaInicio | |
| 273 | + * @param string $objetivoEspecifico | |
| 259 | 274 | * @return AdscripcionPida |
| 260 | 275 | */ |
| 261 | - public function setFechaInicio($fechaInicio) | |
| 276 | + public function setObjetivoEspecifico($objetivoEspecifico) | |
| 262 | 277 | { |
| 263 | - $this->fecha_inicio = $fechaInicio; | |
| 278 | + $this->objetivoEspecifico = $objetivoEspecifico; | |
| 264 | 279 | |
| 265 | 280 | return $this; |
| 266 | 281 | } |
| 267 | 282 | |
| 268 | 283 | /** |
| 269 | - * Get fecha_inicio | |
| 284 | + * Get objetivoEspecifico | |
| 270 | 285 | * |
| 271 | - * @return \DateTime | |
| 286 | + * @return string | |
| 272 | 287 | */ |
| 273 | - public function getFechaInicio() | |
| 288 | + public function getObjetivoEspecifico() | |
| 274 | 289 | { |
| 275 | - return $this->fecha_inicio; | |
| 290 | + return $this->objetivoEspecifico; | |
| 276 | 291 | } |
| 277 | 292 | |
| 278 | 293 | /** |
| 279 | - * Set fecha_final | |
| 294 | + * Set idPidaPlazo | |
| 280 | 295 | * |
| 281 | - * @param \DateTime $fechaFinal | |
| 296 | + * @param \AppBundle\Entity\PidaPlazo $idPidaPlazo | |
| 282 | 297 | * @return AdscripcionPida |
| 283 | 298 | */ |
| 284 | - public function setFechaFinal($fechaFinal) | |
| 299 | + public function setIdPidaPlazo(\AppBundle\Entity\PidaPlazo $idPidaPlazo = null) | |
| 285 | 300 | { |
| 286 | - $this->fecha_final = $fechaFinal; | |
| 301 | + $this->idPidaPlazo = $idPidaPlazo; | |
| 287 | 302 | |
| 288 | 303 | return $this; |
| 289 | 304 | } |
| 290 | 305 | |
| 291 | 306 | /** |
| 292 | - * Get fecha_final | |
| 307 | + * Get idPidaPlazo | |
| 293 | 308 | * |
| 294 | - * @return \DateTime | |
| 309 | + * @return \AppBundle\Entity\PidaPlazo | |
| 295 | 310 | */ |
| 296 | - public function getFechaFinal() | |
| 311 | + public function getIdPidaPlazo() | |
| 297 | 312 | { |
| 298 | - return $this->fecha_final; | |
| 313 | + return $this->idPidaPlazo; | |
| 299 | 314 | } |
| 300 | 315 | } | ... | ... |
src/AppBundle/Entity/PidaEstatus.php
| ... | ... | @@ -0,0 +1,107 @@ |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Created by PhpStorm. | |
| 4 | + * User: ubv-cipee | |
| 5 | + * Date: 29/06/16 | |
| 6 | + * Time: 08:12 AM | |
| 7 | + */ | |
| 8 | + | |
| 9 | + | |
| 10 | +namespace AppBundle\Entity; | |
| 11 | + | |
| 12 | +use Doctrine\ORM\Mapping as ORM; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * PidaEstatus | |
| 16 | + * | |
| 17 | + * @ORM\Table(name="pida_estatus", uniqueConstraints={@ORM\UniqueConstraint(name="uq_pida_estatus", columns={"nombre"})}) | |
| 18 | + * @ORM\Entity | |
| 19 | + */ | |
| 20 | +class PidaEstatus | |
| 21 | +{ | |
| 22 | + /** | |
| 23 | + * @var string | |
| 24 | + * | |
| 25 | + * @ORM\Column(name="nombre", type="string", length=20, nullable=false, options={"comment" = "Nombre del estatus"}) | |
| 26 | + */ | |
| 27 | + private $nombre; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * @var string | |
| 31 | + * | |
| 32 | + * @ORM\Column(name="descripcion", type="string", length=50, nullable=false, options={"comment" = "Descripcion o significado del estatus"}) | |
| 33 | + */ | |
| 34 | + private $descripcion; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * @var integer | |
| 38 | + * | |
| 39 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"comment" = "Identificador del estatus"}) | |
| 40 | + * @ORM\Id | |
| 41 | + * @ORM\GeneratedValue(strategy="IDENTITY") | |
| 42 | + * @ORM\SequenceGenerator(sequenceName="estatus_id_seq", allocationSize=1, initialValue=1) | |
| 43 | + */ | |
| 44 | + private $id; | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Set nombre | |
| 50 | + * | |
| 51 | + * @param string $nombre | |
| 52 | + * @return Estatus | |
| 53 | + */ | |
| 54 | + public function setNombre($nombre) | |
| 55 | + { | |
| 56 | + $this->nombre = $nombre; | |
| 57 | + | |
| 58 | + return $this; | |
| 59 | + } | |
| 60 | + | |
| 61 | + /** | |
| 62 | + * Get nombre | |
| 63 | + * | |
| 64 | + * @return string | |
| 65 | + */ | |
| 66 | + public function getNombre() | |
| 67 | + { | |
| 68 | + return $this->nombre; | |
| 69 | + } | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * Set descripcion | |
| 73 | + * | |
| 74 | + * @param string $descripcion | |
| 75 | + * @return Estatus | |
| 76 | + */ | |
| 77 | + public function setDescripcion($descripcion) | |
| 78 | + { | |
| 79 | + $this->descripcion = $descripcion; | |
| 80 | + | |
| 81 | + return $this; | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Get descripcion | |
| 86 | + * | |
| 87 | + * @return string | |
| 88 | + */ | |
| 89 | + public function getDescripcion() | |
| 90 | + { | |
| 91 | + return $this->descripcion; | |
| 92 | + } | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * Get id | |
| 96 | + * | |
| 97 | + * @return integer | |
| 98 | + */ | |
| 99 | + public function getId() | |
| 100 | + { | |
| 101 | + return $this->id; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public function __toString() { | |
| 105 | + return $this->getNombre(); | |
| 106 | + } | |
| 107 | +} | |
| 0 | 108 | \ No newline at end of file | ... | ... |
src/AppBundle/Form/PidaType.php
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | |
| 10 | 10 | namespace AppBundle\Form; |
| 11 | 11 | |
| 12 | +use Doctrine\ORM\EntityRepository; | |
| 12 | 13 | use Symfony\Component\Form\AbstractType; |
| 13 | 14 | use Symfony\Component\Form\FormBuilderInterface; |
| 14 | 15 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| ... | ... | @@ -52,9 +53,39 @@ class PidaType extends AbstractType |
| 52 | 53 | 'label' => 'Tarea' |
| 53 | 54 | )) |
| 54 | 55 | |
| 55 | - ->add('fecha_inicio') | |
| 56 | + ->add('idPidaPlazo', EntityType::class, array( | |
| 57 | + 'class' => 'AppBundle:PidaPlazo', | |
| 58 | + 'label' => 'Plazos de la Actividad: ', | |
| 59 | + 'label_attr' => array('class' => 'radio-inline'), | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + 'choice_label' => 'nombre', | |
| 64 | + | |
| 65 | + // used to render a select box, check boxes or radios | |
| 66 | + // 'multiple' => true, | |
| 67 | + 'expanded' => true, | |
| 68 | + )) | |
| 69 | + | |
| 70 | + | |
| 71 | + ->add('idPidaEstatus', EntityType::class, array( | |
| 72 | + 'class' => 'AppBundle:PidaEstatus', | |
| 73 | + 'label' => false, | |
| 74 | + 'label_attr' => array('class' => 'radio-inline'), | |
| 75 | + 'query_builder' => function (EntityRepository $er) { | |
| 76 | + return $er->createQueryBuilder('u') | |
| 77 | + ->orderBy('u.id', 'ASC'); | |
| 78 | + }, | |
| 79 | + | |
| 80 | + // use the User.username property as the visible option string | |
| 81 | + 'choice_label' => 'nombre', | |
| 82 | + | |
| 83 | + // used to render a select box, check boxes or radios | |
| 84 | + // 'multiple' => true, | |
| 85 | + 'expanded' => true, | |
| 86 | + )) | |
| 56 | 87 | |
| 57 | - ->add('fecha_final') | |
| 88 | + | |
| 58 | 89 | |
| 59 | 90 | |
| 60 | 91 | ; | ... | ... |