public function ingresarInfoCaractAction()
 {
     $opciones = $this->getRequest()->getSession()->get('opciones');
     $user = new User();
     $empleado = new Empleado();
     $user = $this->get('security.context')->getToken()->getUser();
     $empleado = $user->getEmpleado();
     $idUnidad = $empleado->getUnidadOrganizativa()->getIdUnidadOrg();
     $unidaDao = new UnidadOrganizativaDao($this->getDoctrine());
     $unidad = new UnidadOrganizativa();
     $infoGeneral = new InformacionGeneral();
     $unidad = $unidaDao->getUnidadOrg($idUnidad);
     $nombreUnidad = $unidad->getNombreUnidad();
     $nombreUnidadPadre = $unidad->getParent()->getNombreUnidad();
     $infoGeneral = $unidad->getInformacionGeneral();
     $caractOrg = $unidad->getCaractOrg();
     $form = $this->createForm(new InfoCaractOrgType(), $infoGeneral);
     $formCaract = $this->createForm(new CaractOrgType(), $caractOrg);
     return $this->render('ISRISidPlaUnidadOrgBundle:InforCaractOrg:ingresoInfoCaractOrg.html.twig', array('form' => $form->createView(), 'formOrg' => $formCaract->createView(), 'opciones' => $opciones, 'unidadOrg' => $nombreUnidad, 'unidadPadre' => $nombreUnidadPadre, 'idCaractOrg' => $caractOrg->getIdCaractOrg()));
 }
Пример #2
0
 public function editEmpleado($dui, $primerNombre, $segundoNombre, $primerApellido, $segundoApellido, $id, $unidadAsignada)
 {
     $empleado = new Empleado();
     $empleado = $this->repositorio->find($id);
     if (!$empleado) {
         throw $this->createNotFoundException('No se encontro empleado con ese id ' . $id);
     }
     $empleado->setDui($dui);
     $empleado->setPrimerNombre($primerNombre);
     $empleado->setSegundoNombre($segundoNombre);
     $empleado->setPrimerApellido($primerApellido);
     $empleado->setSegundoApellido($segundoApellido);
     $unidadDao = new UnidadOrganizativaDao($this->doctrine);
     $unidad = $unidadDao->getUnidadOrg($unidadAsignada);
     $empleado->setUnidadOrganizativa($unidad);
     $this->em->flush();
     $matrizMensajes = array('El proceso de almacenar termino con exito', 'Rol ' . $rol->getIdRol());
     return $matrizMensajes;
 }
 public function ingresarUnidadOrgAction()
 {
     $opciones = $this->getRequest()->getSession()->get('opciones');
     $request = $this->getRequest();
     $nombreUnidad = $request->get('nombreUnidad');
     $direccion = $request->get('direccion');
     $responsable = $request->get('responsable');
     $telefono = $request->get('telefono');
     $fax = $request->get('fax');
     $tipoUnidad = $request->get('tipoUnidad');
     $unidadPadre = $request->get('unidadPadre');
     $departameto = $request->get('departamento');
     $municipio = $request->get('municipio');
     $descripcion = $request->get('descripcion');
     $unidadOrgDao = new UnidadOrganizativaDao($this->getDoctrine());
     $unidadOrgDao->ingresarUnidadOrg($nombreUnidad, $direccion, $responsable, $telefono, $fax, $tipoUnidad, $unidadPadre, $departameto, $municipio, $descripcion);
     $departamDao = new DepartametoPaisDao($this->getDoctrine());
     $departamentos = $departamDao->getDepartametos();
     return $this->render('ISRISidPlaAdminBundle:UnidadOrganizativa:manttUnidadesOrganizativas.html.twig', array('opciones' => $opciones));
 }