Last active
October 24, 2017 18:16
-
-
Save cricri92/56005e63a9eecea8bb137b03edcaa9f9 to your computer and use it in GitHub Desktop.
Esta ruta carga todos los datos del trámite para que el personal de AP pueda visualizarlo y trabajar con el.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param Transicion $transicion | |
* @return array | |
*/ | |
public function getEstadosPosiblesSegunTransicion(Transicion $transicion) { | |
$em = $this->getDoctrine()->getManager(); | |
$estados = $em->getRepository('TramiteBundle:Estado')->findAll(); | |
$new_estados = []; | |
switch ($transicion->getEstado()->getId()) { | |
// Si está pendiente | |
case 1: | |
$new_estados[] = $estados[4]; | |
break; | |
// Si está negado o aprobado | |
case 2: | |
case 3: | |
$new_estados[] = $estados[5]; | |
break; | |
// Si está en proceso | |
case 5: | |
$new_estados[] = $estados[6]; | |
$new_estados[] = $estados[13]; | |
break; | |
// Si está en reproceso | |
case 7: | |
$new_estados[] = $estados[3]; | |
break; | |
// Si esta enviado a CF | |
case 14: | |
$new_estados[] = $estados[14]; | |
$new_estados[] = $estados[1]; | |
break; | |
// Si está enviado a CU | |
case 15: | |
$new_estados[] = $estados[1]; | |
$new_estados[] = $estados[2]; | |
} | |
return $new_estados; | |
} | |
/** | |
* @Route("/reincorporacion-docente/ver-detalle-solicitud", name="ver-detalle-solicitud") | |
* @param $request Request | |
* @Method("GET") | |
* @RequiresPermission("Detalle solicitud reincorporacion") | |
* @return Response | |
*/ | |
public function mostrarDetalleSolicitudDocente(Request $request) | |
{ | |
$tramite_data = $this->getTramiteDetalleById($request->get('id')); | |
$user = $tramite_data['tramite']->getUsuarioId(); | |
$registros = $this->getRegistrosUsuario($user->getId()); | |
$cargos = $this->getRegistrosTipoCargosUsuario($user->getId()); | |
$revistas = $this->getRegistrosPublicacionesImpresas($user->getId()); | |
$recaudos = $this->getListaRecaudosByTramite($tramite_data['tramite']); | |
$trns = $tramite_data['transiciones']; | |
$estados_posibles = $this->getEstadosPosiblesSegunTransicion($trns[sizeof($trns) - 1]); | |
return $this->render('ReincorporacionBundle::detalle-solicitud-reincorporacion.html.twig', array( | |
'tramite_data' => $tramite_data, | |
'user' => $user, | |
'registros' => $registros, | |
'cargos' => $cargos, | |
'revistas' => $revistas, | |
'recaudos' => $recaudos, | |
'estados' => $estados_posibles | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment