diff --git a/src/AppBundle/Controller/InscripcionController.php b/src/AppBundle/Controller/InscripcionController.php index 4c98c44..29d0ca0 100644 --- a/src/AppBundle/Controller/InscripcionController.php +++ b/src/AppBundle/Controller/InscripcionController.php @@ -105,7 +105,9 @@ class InscripcionController extends Controller $em = $this->getDoctrine()->getManager(); $deleteForm = $this->createDeleteForm($inscripcion); $estado_academico = $em->getRepository('AppBundle:EstadoAcademico')->findOneByIdRolInstitucion($this->getUser()->getIdRolInstitucion()); - $editForm = $this->createForm('AppBundle\Form\InscripcionEditType', $inscripcion, array('oferta' => $inscripcion->getIdSeccion()->getOfertaAcademica()->getId())); + + $editForm = $this->createForm(new \AppBundle\Form\InscripcionEditType($this->get('security.context') + ->isGranted('ROLE_COORDINADOR_REGIONAL')), $inscripcion, array('oferta' => $inscripcion->getIdSeccion()->getOfertaAcademica()->getId())); $editForm->handleRequest($request); if ($editForm->isSubmitted() && $editForm->isValid()) { diff --git a/src/AppBundle/Form/InscripcionEditType.php b/src/AppBundle/Form/InscripcionEditType.php index e95e10a..62b0f0a 100644 --- a/src/AppBundle/Form/InscripcionEditType.php +++ b/src/AppBundle/Form/InscripcionEditType.php @@ -10,6 +10,17 @@ use Doctrine\ORM\EntityRepository; class InscripcionEditType extends AbstractType { + + private $isGranted; + + public function __construct($roleFlag) + { + $this->isGranted = $roleFlag; + //var_dump($this->isGranted); exit; + } + + + /** * @param FormBuilderInterface $builder * @param array $options @@ -28,10 +39,15 @@ class InscripcionEditType extends AbstractType )); }, - )) - ->add('idEstatus') + )); + + if($this->isGranted){ + $builder->add('idEstatus'); + } - ; + + + } /**